From 84a566b034fef5bf991517a1aa418b4fa04dd738 Mon Sep 17 00:00:00 2001 From: Valentin Kipyatkov Date: Mon, 16 Jun 2014 14:16:17 +0400 Subject: [PATCH] Converter from Java: minor change --- .../jetbrains/jet/j2k/visitors/TypeVisitor.kt | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/j2k/src/org/jetbrains/jet/j2k/visitors/TypeVisitor.kt b/j2k/src/org/jetbrains/jet/j2k/visitors/TypeVisitor.kt index 22b3258385b..9e1eaa766e9 100644 --- a/j2k/src/org/jetbrains/jet/j2k/visitors/TypeVisitor.kt +++ b/j2k/src/org/jetbrains/jet/j2k/visitors/TypeVisitor.kt @@ -68,24 +68,6 @@ class TypeVisitor(private val converter: TypeConverter, private val classesToImp } } - private val toKotlinTypesMap = mapOf( - CommonClassNames.JAVA_LANG_OBJECT to "kotlin.Any", - CommonClassNames.JAVA_LANG_BYTE to "kotlin.Byte", - CommonClassNames.JAVA_LANG_CHARACTER to "kotlin.Char", - CommonClassNames.JAVA_LANG_DOUBLE to "kotlin.Double", - CommonClassNames.JAVA_LANG_FLOAT to "kotlin.Float", - CommonClassNames.JAVA_LANG_INTEGER to "kotlin.Int", - CommonClassNames.JAVA_LANG_LONG to "kotlin.Long", - CommonClassNames.JAVA_LANG_SHORT to "kotlin.Short", - CommonClassNames.JAVA_LANG_BOOLEAN to "kotlin.Boolean", - CommonClassNames.JAVA_LANG_ITERABLE to "kotlin.Iterable", - CommonClassNames.JAVA_UTIL_ITERATOR to "kotlin.Iterator", - CommonClassNames.JAVA_UTIL_LIST to "kotlin.List", - CommonClassNames.JAVA_UTIL_COLLECTION to "kotlin.Collection", - CommonClassNames.JAVA_UTIL_SET to "kotlin.Set", - CommonClassNames.JAVA_UTIL_MAP to "kotlin.Map" - ) - private fun constructClassTypeIdentifier(classType: PsiClassType): Identifier { val psiClass = classType.resolve() if (psiClass != null) { @@ -155,4 +137,24 @@ class TypeVisitor(private val converter: TypeConverter, private val classesToImp override fun visitEllipsisType(ellipsisType: PsiEllipsisType): Type { return VarArgType(converter.convertType(ellipsisType.getComponentType())) } + + class object { + private val toKotlinTypesMap: Map = mapOf( + CommonClassNames.JAVA_LANG_OBJECT to "kotlin.Any", + CommonClassNames.JAVA_LANG_BYTE to "kotlin.Byte", + CommonClassNames.JAVA_LANG_CHARACTER to "kotlin.Char", + CommonClassNames.JAVA_LANG_DOUBLE to "kotlin.Double", + CommonClassNames.JAVA_LANG_FLOAT to "kotlin.Float", + CommonClassNames.JAVA_LANG_INTEGER to "kotlin.Int", + CommonClassNames.JAVA_LANG_LONG to "kotlin.Long", + CommonClassNames.JAVA_LANG_SHORT to "kotlin.Short", + CommonClassNames.JAVA_LANG_BOOLEAN to "kotlin.Boolean", + CommonClassNames.JAVA_LANG_ITERABLE to "kotlin.Iterable", + CommonClassNames.JAVA_UTIL_ITERATOR to "kotlin.Iterator", + CommonClassNames.JAVA_UTIL_LIST to "kotlin.List", + CommonClassNames.JAVA_UTIL_COLLECTION to "kotlin.Collection", + CommonClassNames.JAVA_UTIL_SET to "kotlin.Set", + CommonClassNames.JAVA_UTIL_MAP to "kotlin.Map" + ) + } }