Kapt: Do not use awkward ('$' -> '/') logic for KAPT3 class builder mode
So (for the most often reproduction case) #KT-19433 Fixed Before this commit, internal names for nested classes were written as test/Foo/Bar (comparing to test/Foo$Bar in the normal mode), as getting qualified names from such internal names was trivial. But, because of IC, we needed to write class files to the disk, so our decompiler could find such "broken" classes and read it in a wrong way.
This commit is contained in:
committed by
Mikhail Glukhikh
parent
e5e5b56af0
commit
57d209f599
@@ -99,20 +99,6 @@ public class KotlinTypeMapper {
|
||||
private final boolean isJvm8TargetWithDefaults;
|
||||
|
||||
private final TypeMappingConfiguration<Type> typeMappingConfiguration = new TypeMappingConfiguration<Type>() {
|
||||
private final Function2<String, String, String> defaultClassNameFactory
|
||||
= TypeMappingConfiguration.Companion.getDEFAULT_INNER_CLASS_NAME_FACTORY();
|
||||
|
||||
private final Function2<String, String, String> innerClassNameFactory = new Function2<String, String, String>() {
|
||||
@Override
|
||||
public String invoke(String outer, String inner) {
|
||||
if (classBuilderMode == ClassBuilderMode.KAPT3) {
|
||||
return outer + '/' + inner;
|
||||
}
|
||||
|
||||
return defaultClassNameFactory.invoke(outer, inner);
|
||||
}
|
||||
};
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public KotlinType commonSupertype(@NotNull Collection<KotlinType> types) {
|
||||
@@ -122,7 +108,7 @@ public class KotlinTypeMapper {
|
||||
@NotNull
|
||||
@Override
|
||||
public Function2<String, String, String> getInnerClassNameFactory() {
|
||||
return innerClassNameFactory;
|
||||
return TypeMappingConfiguration.DefaultImpls.getInnerClassNameFactory(this);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
Reference in New Issue
Block a user