more renames to get rid of "Jet" in class and method names
This commit is contained in:
+2
-2
@@ -50,7 +50,7 @@ class LazyJavaTypeResolver(
|
||||
return when (javaType) {
|
||||
is JavaPrimitiveType -> {
|
||||
val primitiveType = javaType.getType()
|
||||
if (primitiveType != null) c.module.builtIns.getPrimitiveJetType(primitiveType)
|
||||
if (primitiveType != null) c.module.builtIns.getPrimitiveKotlinType(primitiveType)
|
||||
else c.module.builtIns.getUnitType()
|
||||
}
|
||||
is JavaClassifierType ->
|
||||
@@ -70,7 +70,7 @@ class LazyJavaTypeResolver(
|
||||
val javaComponentType = arrayType.getComponentType()
|
||||
val primitiveType = (javaComponentType as? JavaPrimitiveType)?.getType()
|
||||
if (primitiveType != null) {
|
||||
val jetType = c.module.builtIns.getPrimitiveArrayJetType(primitiveType)
|
||||
val jetType = c.module.builtIns.getPrimitiveArrayKotlinType(primitiveType)
|
||||
return@run if (PLATFORM_TYPES && attr.allowFlexible)
|
||||
FlexibleJavaClassifierTypeCapabilities.create(jetType, TypeUtils.makeNullable(jetType))
|
||||
else TypeUtils.makeNullableAsSpecified(jetType, !attr.isMarkedNotNull)
|
||||
|
||||
@@ -61,9 +61,9 @@ public abstract class KotlinBuiltIns {
|
||||
private final BuiltinsPackageFragment builtinsPackageFragment;
|
||||
private final BuiltinsPackageFragment annotationPackageFragment;
|
||||
|
||||
private final Map<PrimitiveType, KotlinType> primitiveTypeToArrayJetType;
|
||||
private final Map<KotlinType, KotlinType> primitiveJetTypeToJetArrayType;
|
||||
private final Map<KotlinType, KotlinType> jetArrayTypeToPrimitiveJetType;
|
||||
private final Map<PrimitiveType, KotlinType> primitiveTypeToArrayKotlinType;
|
||||
private final Map<KotlinType, KotlinType> primitiveKotlinTypeToKotlinArrayType;
|
||||
private final Map<KotlinType, KotlinType> kotlinArrayTypeToPrimitiveKotlinType;
|
||||
|
||||
public static final FqNames FQ_NAMES = new FqNames();
|
||||
|
||||
@@ -91,9 +91,9 @@ public abstract class KotlinBuiltIns {
|
||||
builtinsPackageFragment = (BuiltinsPackageFragment) single(packageFragmentProvider.getPackageFragments(BUILT_INS_PACKAGE_FQ_NAME));
|
||||
annotationPackageFragment = (BuiltinsPackageFragment) single(packageFragmentProvider.getPackageFragments(ANNOTATION_PACKAGE_FQ_NAME));
|
||||
|
||||
primitiveTypeToArrayJetType = new EnumMap<PrimitiveType, KotlinType>(PrimitiveType.class);
|
||||
primitiveJetTypeToJetArrayType = new HashMap<KotlinType, KotlinType>();
|
||||
jetArrayTypeToPrimitiveJetType = new HashMap<KotlinType, KotlinType>();
|
||||
primitiveTypeToArrayKotlinType = new EnumMap<PrimitiveType, KotlinType>(PrimitiveType.class);
|
||||
primitiveKotlinTypeToKotlinArrayType = new HashMap<KotlinType, KotlinType>();
|
||||
kotlinArrayTypeToPrimitiveKotlinType = new HashMap<KotlinType, KotlinType>();
|
||||
for (PrimitiveType primitive : PrimitiveType.values()) {
|
||||
makePrimitive(primitive);
|
||||
}
|
||||
@@ -108,9 +108,9 @@ public abstract class KotlinBuiltIns {
|
||||
KotlinType type = getBuiltInTypeByClassName(primitiveType.getTypeName().asString());
|
||||
KotlinType arrayType = getBuiltInTypeByClassName(primitiveType.getArrayTypeName().asString());
|
||||
|
||||
primitiveTypeToArrayJetType.put(primitiveType, arrayType);
|
||||
primitiveJetTypeToJetArrayType.put(type, arrayType);
|
||||
jetArrayTypeToPrimitiveJetType.put(arrayType, type);
|
||||
primitiveTypeToArrayKotlinType.put(primitiveType, arrayType);
|
||||
primitiveKotlinTypeToKotlinArrayType.put(type, arrayType);
|
||||
kotlinArrayTypeToPrimitiveKotlinType.put(arrayType, type);
|
||||
}
|
||||
|
||||
public static class FqNames {
|
||||
@@ -569,48 +569,48 @@ public abstract class KotlinBuiltIns {
|
||||
// Primitive
|
||||
|
||||
@NotNull
|
||||
public KotlinType getPrimitiveJetType(@NotNull PrimitiveType type) {
|
||||
public KotlinType getPrimitiveKotlinType(@NotNull PrimitiveType type) {
|
||||
return getPrimitiveClassDescriptor(type).getDefaultType();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public KotlinType getByteType() {
|
||||
return getPrimitiveJetType(BYTE);
|
||||
return getPrimitiveKotlinType(BYTE);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public KotlinType getShortType() {
|
||||
return getPrimitiveJetType(SHORT);
|
||||
return getPrimitiveKotlinType(SHORT);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public KotlinType getIntType() {
|
||||
return getPrimitiveJetType(INT);
|
||||
return getPrimitiveKotlinType(INT);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public KotlinType getLongType() {
|
||||
return getPrimitiveJetType(LONG);
|
||||
return getPrimitiveKotlinType(LONG);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public KotlinType getFloatType() {
|
||||
return getPrimitiveJetType(FLOAT);
|
||||
return getPrimitiveKotlinType(FLOAT);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public KotlinType getDoubleType() {
|
||||
return getPrimitiveJetType(DOUBLE);
|
||||
return getPrimitiveKotlinType(DOUBLE);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public KotlinType getCharType() {
|
||||
return getPrimitiveJetType(CHAR);
|
||||
return getPrimitiveKotlinType(CHAR);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public KotlinType getBooleanType() {
|
||||
return getPrimitiveJetType(BOOLEAN);
|
||||
return getPrimitiveKotlinType(BOOLEAN);
|
||||
}
|
||||
|
||||
// Recognized
|
||||
@@ -633,7 +633,7 @@ public abstract class KotlinBuiltIns {
|
||||
}
|
||||
return arrayType.getArguments().get(0).getType();
|
||||
}
|
||||
KotlinType primitiveType = jetArrayTypeToPrimitiveJetType.get(TypeUtils.makeNotNullable(arrayType));
|
||||
KotlinType primitiveType = kotlinArrayTypeToPrimitiveKotlinType.get(TypeUtils.makeNotNullable(arrayType));
|
||||
if (primitiveType == null) {
|
||||
throw new IllegalStateException("not array: " + arrayType);
|
||||
}
|
||||
@@ -641,16 +641,16 @@ public abstract class KotlinBuiltIns {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public KotlinType getPrimitiveArrayJetType(@NotNull PrimitiveType primitiveType) {
|
||||
return primitiveTypeToArrayJetType.get(primitiveType);
|
||||
public KotlinType getPrimitiveArrayKotlinType(@NotNull PrimitiveType primitiveType) {
|
||||
return primitiveTypeToArrayKotlinType.get(primitiveType);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {@code null} if not primitive
|
||||
*/
|
||||
@Nullable
|
||||
public KotlinType getPrimitiveArrayJetTypeByPrimitiveJetType(@NotNull KotlinType jetType) {
|
||||
return primitiveJetTypeToJetArrayType.get(jetType);
|
||||
public KotlinType getPrimitiveArrayKotlinTypeByPrimitiveKotlinType(@NotNull KotlinType kotlinType) {
|
||||
return primitiveKotlinTypeToKotlinArrayType.get(kotlinType);
|
||||
}
|
||||
|
||||
public static boolean isPrimitiveArray(@NotNull FqNameUnsafe arrayFqName) {
|
||||
|
||||
+1
-1
@@ -100,7 +100,7 @@ public class AnnotationDeserializer(private val module: ModuleDescriptor) {
|
||||
val actualArrayType =
|
||||
if (arrayElements.isNotEmpty()) {
|
||||
val actualElementType = resolveArrayElementType(arrayElements.first(), nameResolver)
|
||||
builtIns.getPrimitiveArrayJetTypeByPrimitiveJetType(actualElementType) ?:
|
||||
builtIns.getPrimitiveArrayKotlinTypeByPrimitiveKotlinType(actualElementType) ?:
|
||||
builtIns.getArrayType(Variance.INVARIANT, actualElementType)
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user