Pull Java<->Kotlin primitive type mapping up to JavaToKotlinClassMapBuilder
This commit is contained in:
-10
@@ -25,7 +25,6 @@ import org.jetbrains.kotlin.name.ClassId;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
import org.jetbrains.kotlin.name.FqNameUnsafe;
|
||||
import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
@@ -37,15 +36,6 @@ public class JavaToKotlinClassMap extends JavaToKotlinClassMapBuilder implements
|
||||
|
||||
private JavaToKotlinClassMap() {
|
||||
init();
|
||||
initPrimitives();
|
||||
}
|
||||
|
||||
private void initPrimitives() {
|
||||
KotlinBuiltIns builtIns = KotlinBuiltIns.getInstance();
|
||||
|
||||
for (JvmPrimitiveType jvmType : JvmPrimitiveType.values()) {
|
||||
register(ClassId.topLevel(jvmType.getWrapperFqName()), builtIns.getPrimitiveClassDescriptor(jvmType.getPrimitiveType()));
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
+9
@@ -22,6 +22,7 @@ import org.jetbrains.kotlin.descriptors.ClassDescriptor;
|
||||
import org.jetbrains.kotlin.name.ClassId;
|
||||
import org.jetbrains.kotlin.name.FqName;
|
||||
import org.jetbrains.kotlin.name.Name;
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmPrimitiveType;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.util.*;
|
||||
@@ -56,6 +57,14 @@ public abstract class JavaToKotlinClassMapBuilder {
|
||||
register(Map.Entry.class, kotlinBuiltIns.getMapEntry(), kotlinBuiltIns.getMutableMapEntry());
|
||||
register(ListIterator.class, kotlinBuiltIns.getListIterator(), kotlinBuiltIns.getMutableListIterator());
|
||||
|
||||
for (JvmPrimitiveType jvmType : JvmPrimitiveType.values()) {
|
||||
register(
|
||||
ClassId.topLevel(jvmType.getWrapperFqName()),
|
||||
kotlinBuiltIns.getPrimitiveClassDescriptor(jvmType.getPrimitiveType()),
|
||||
Direction.BOTH
|
||||
);
|
||||
}
|
||||
|
||||
register(classId(Deprecated.class), kotlinBuiltIns.getDeprecatedAnnotation(), Direction.JAVA_TO_KOTLIN);
|
||||
|
||||
register(classId(Void.class), kotlinBuiltIns.getNothing(), Direction.KOTLIN_TO_JAVA);
|
||||
|
||||
Reference in New Issue
Block a user