Removed accessors for const properties

This commit is contained in:
Michael Bogdanov
2015-12-24 15:53:05 +03:00
parent b4db23a7b3
commit f870e365fa
12 changed files with 56 additions and 48 deletions
@@ -42,6 +42,7 @@ public class JavaToKotlinClassMap implements PlatformToKotlinClassMap {
private final Map<ClassDescriptor, ClassDescriptor> mutableToReadOnly = new HashMap<ClassDescriptor, ClassDescriptor>();
private final Map<ClassDescriptor, ClassDescriptor> readOnlyToMutable = new HashMap<ClassDescriptor, ClassDescriptor>();
private final CompanionObjectMapping companionObjectMapping;
private JavaToKotlinClassMap() {
KotlinBuiltIns builtIns = JvmBuiltIns.getInstance();
@@ -69,7 +70,7 @@ public class JavaToKotlinClassMap implements PlatformToKotlinClassMap {
add(ClassId.topLevel(jvmType.getWrapperFqName()), builtIns.getPrimitiveClassDescriptor(jvmType.getPrimitiveType()));
}
CompanionObjectMapping companionObjectMapping = new CompanionObjectMapping(builtIns);
companionObjectMapping = new CompanionObjectMapping(builtIns);
for (ClassDescriptor descriptor : companionObjectMapping.allClassesWithIntrinsicCompanions()) {
ClassDescriptor companion = descriptor.getCompanionObjectDescriptor();
assert companion != null : "No companion object found for " + descriptor;
@@ -118,6 +119,10 @@ public class JavaToKotlinClassMap implements PlatformToKotlinClassMap {
return kotlinToJava.get(kotlinFqName);
}
public boolean isMappedCompanion(@NotNull ClassDescriptor descriptor) {
return companionObjectMapping.hasMappingToObject(descriptor);
}
private void add(
@NotNull Class<?> javaClass,
@NotNull ClassDescriptor kotlinDescriptor,