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
@@ -0,0 +1,78 @@
|
||||
// FILE: JavaClass.java
|
||||
public class JavaClass {
|
||||
public class Foo {
|
||||
public class Bar {}
|
||||
}
|
||||
}
|
||||
|
||||
//FILE: J$B.java
|
||||
public class J$B {
|
||||
public class C {}
|
||||
|
||||
public class D$E {
|
||||
class F {}
|
||||
class F$G {}
|
||||
}
|
||||
|
||||
public class D$$E {}
|
||||
public class D$$$E {}
|
||||
}
|
||||
|
||||
// FILE: a.kt
|
||||
interface IFoo {
|
||||
interface IBar {
|
||||
annotation class Anno(vararg val value: kotlin.reflect.KClass<*>)
|
||||
|
||||
@Anno(IZoo::class)
|
||||
interface IZoo
|
||||
}
|
||||
}
|
||||
|
||||
class Experiment {
|
||||
annotation class Type
|
||||
|
||||
@Type
|
||||
data class Group(s: String)
|
||||
}
|
||||
|
||||
class Foo {
|
||||
open class Bar {
|
||||
object Zoo
|
||||
}
|
||||
}
|
||||
|
||||
class `A$B` {
|
||||
class C
|
||||
|
||||
@JvmField lateinit var c: C
|
||||
@JvmField lateinit var de: `D$E`
|
||||
|
||||
@JvmField lateinit var jc: `J$B`.C
|
||||
@JvmField lateinit var jde: `J$B`.`D$E`
|
||||
|
||||
class `D$E` {
|
||||
class F
|
||||
class `F$G`
|
||||
|
||||
@JvmField lateinit var f: F
|
||||
@JvmField lateinit var fg: `F$G`
|
||||
|
||||
@JvmField lateinit var jf: `J$B`.`D$E`.F
|
||||
@JvmField lateinit var jfg: `J$B`.`D$E`.`F$G`
|
||||
}
|
||||
|
||||
class `D$$E`
|
||||
class `D$$$E`
|
||||
|
||||
@JvmField lateinit var dee: `D$$E`
|
||||
@JvmField lateinit var deee: `D$$$E`
|
||||
|
||||
@JvmField lateinit var jdee: `J$B`.`D$$E`
|
||||
@JvmField lateinit var jdeee: `J$B`.`D$$$E`
|
||||
}
|
||||
|
||||
@IFoo.IBar.Anno(IFoo.IBar.IZoo::class, Foo.Bar::class)
|
||||
class Test1(val zoo: Foo.Bar.Zoo) : Foo.Bar(), IFoo.IBar, IFoo.IBar.IZoo {
|
||||
fun a(): Thread.State = Thread.State.NEW
|
||||
fun b(foo: JavaClass.Foo, bar: JavaClass.Foo.Bar) {}
|
||||
}
|
||||
+192
@@ -0,0 +1,192 @@
|
||||
@kotlin.Metadata()
|
||||
public final class A$B {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public A$B.C c;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public A$B.D$E de;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public J$B.C jc;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public J$B.D$E jde;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public A$B.D$$E dee;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public A$B.D$$$E deee;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public J$B.D$$E jdee;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public J$B.D$$$E jdeee;
|
||||
|
||||
public A$B() {
|
||||
super();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class C {
|
||||
|
||||
public C() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class D$E {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public A$B.D$E.F f;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public A$B.D$E.F$G fg;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public J$B.D$E.F jf;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public J$B.D$E.F$G jfg;
|
||||
|
||||
public D$E() {
|
||||
super();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class F {
|
||||
|
||||
public F() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class F$G {
|
||||
|
||||
public F$G() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class D$$E {
|
||||
|
||||
public D$$E() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class D$$$E {
|
||||
|
||||
public D$$$E() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Experiment {
|
||||
|
||||
public Experiment() {
|
||||
super();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||
public static abstract @interface Type {
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
@Experiment.Type()
|
||||
public static final class Group {
|
||||
|
||||
public Group(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String s) {
|
||||
super();
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final Experiment.Group copy(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String s) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Foo {
|
||||
|
||||
public Foo() {
|
||||
super();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static class Bar {
|
||||
|
||||
public Bar() {
|
||||
super();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class Zoo {
|
||||
public static final Foo.Bar.Zoo INSTANCE = null;
|
||||
|
||||
private Zoo() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
|
||||
@kotlin.Metadata()
|
||||
public abstract interface IFoo {
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static abstract interface IBar {
|
||||
|
||||
@kotlin.Metadata()
|
||||
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||
public static abstract @interface Anno {
|
||||
|
||||
public abstract java.lang.Class<?>[] value();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
@IFoo.IBar.Anno(value = {IFoo.IBar.IZoo.class})
|
||||
public static abstract interface IZoo {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
|
||||
@kotlin.Metadata()
|
||||
@IFoo.IBar.Anno(value = {IFoo.IBar.IZoo.class, Foo.Bar.class})
|
||||
public final class Test1 extends Foo.Bar implements IFoo.IBar, IFoo.IBar.IZoo {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final Foo.Bar.Zoo zoo = null;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.Thread.State a() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final void b(@org.jetbrains.annotations.NotNull()
|
||||
JavaClass.Foo foo, @org.jetbrains.annotations.NotNull()
|
||||
JavaClass.Foo.Bar bar) {
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final Foo.Bar.Zoo getZoo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Test1(@org.jetbrains.annotations.NotNull()
|
||||
Foo.Bar.Zoo zoo) {
|
||||
super();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
// FILE: test/JavaClass.java
|
||||
package test;
|
||||
|
||||
class JavaClass {
|
||||
class Foo {
|
||||
class Bar {}
|
||||
}
|
||||
}
|
||||
|
||||
//FILE: test/J$B.java
|
||||
package test;
|
||||
|
||||
public class J$B {
|
||||
public class C {}
|
||||
|
||||
public class D$E {
|
||||
class F {}
|
||||
class F$G {}
|
||||
}
|
||||
|
||||
public class D$$E {}
|
||||
public class D$$$E {}
|
||||
}
|
||||
|
||||
// FILE: a.kt
|
||||
package test
|
||||
|
||||
interface IFoo {
|
||||
interface IBar {
|
||||
annotation class Anno(vararg val value: kotlin.reflect.KClass<*>)
|
||||
|
||||
@Anno(IZoo::class)
|
||||
interface IZoo
|
||||
}
|
||||
}
|
||||
|
||||
class Experiment {
|
||||
annotation class Type
|
||||
|
||||
@Type
|
||||
data class Group(s: String)
|
||||
}
|
||||
|
||||
class Foo {
|
||||
open class Bar {
|
||||
object Zoo
|
||||
}
|
||||
}
|
||||
|
||||
class `A$B` {
|
||||
class C
|
||||
|
||||
@JvmField lateinit var c: C
|
||||
@JvmField lateinit var de: `D$E`
|
||||
|
||||
@JvmField lateinit var jc: `J$B`.C
|
||||
@JvmField lateinit var jde: `J$B`.`D$E`
|
||||
|
||||
class `D$E` {
|
||||
class F
|
||||
class `F$G`
|
||||
|
||||
@JvmField lateinit var f: F
|
||||
@JvmField lateinit var fg: `F$G`
|
||||
|
||||
@JvmField lateinit var jf: `J$B`.`D$E`.F
|
||||
@JvmField lateinit var jfg: `J$B`.`D$E`.`F$G`
|
||||
}
|
||||
|
||||
class `D$$E`
|
||||
class `D$$$E`
|
||||
|
||||
@JvmField lateinit var dee: `D$$E`
|
||||
@JvmField lateinit var deee: `D$$$E`
|
||||
|
||||
@JvmField lateinit var jdee: `J$B`.`D$$E`
|
||||
@JvmField lateinit var jdeee: `J$B`.`D$$$E`
|
||||
}
|
||||
|
||||
@IFoo.IBar.Anno(IFoo.IBar.IZoo::class, Foo.Bar::class)
|
||||
class Test1(val zoo: Foo.Bar.Zoo) : Foo.Bar(), IFoo.IBar, IFoo.IBar.IZoo {
|
||||
fun a(): Thread.State = Thread.State.NEW
|
||||
fun b(foo: JavaClass.Foo, bar: JavaClass.Foo.Bar) {}
|
||||
}
|
||||
@@ -0,0 +1,198 @@
|
||||
package test;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class A$B {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public test.A$B.C c;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public test.A$B.D$E de;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public test.J$B.C jc;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public test.J$B.D$E jde;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public test.A$B.D$$E dee;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public test.A$B.D$$$E deee;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public test.J$B.D$$E jdee;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public test.J$B.D$$$E jdeee;
|
||||
|
||||
public A$B() {
|
||||
super();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class C {
|
||||
|
||||
public C() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class D$E {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public test.A$B.D$E.F f;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public test.A$B.D$E.F$G fg;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public test.J$B.D$E.F jf;
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public test.J$B.D$E.F$G jfg;
|
||||
|
||||
public D$E() {
|
||||
super();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class F {
|
||||
|
||||
public F() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class F$G {
|
||||
|
||||
public F$G() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class D$$E {
|
||||
|
||||
public D$$E() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class D$$$E {
|
||||
|
||||
public D$$$E() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
package test;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Experiment {
|
||||
|
||||
public Experiment() {
|
||||
super();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||
public static abstract @interface Type {
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
@test.Experiment.Type()
|
||||
public static final class Group {
|
||||
|
||||
public Group(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String s) {
|
||||
super();
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final test.Experiment.Group copy(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String s) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
package test;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class Foo {
|
||||
|
||||
public Foo() {
|
||||
super();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static class Bar {
|
||||
|
||||
public Bar() {
|
||||
super();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static final class Zoo {
|
||||
public static final test.Foo.Bar.Zoo INSTANCE = null;
|
||||
|
||||
private Zoo() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
package test;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public abstract interface IFoo {
|
||||
|
||||
@kotlin.Metadata()
|
||||
public static abstract interface IBar {
|
||||
|
||||
@kotlin.Metadata()
|
||||
@java.lang.annotation.Retention(value = java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||
public static abstract @interface Anno {
|
||||
|
||||
public abstract java.lang.Class<?>[] value();
|
||||
}
|
||||
|
||||
@kotlin.Metadata()
|
||||
@test.IFoo.IBar.Anno(value = {test.IFoo.IBar.IZoo.class})
|
||||
public static abstract interface IZoo {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
package test;
|
||||
|
||||
@kotlin.Metadata()
|
||||
@test.IFoo.IBar.Anno(value = {test.IFoo.IBar.IZoo.class, test.Foo.Bar.class})
|
||||
public final class Test1 extends test.Foo.Bar implements test.IFoo.IBar, test.IFoo.IBar.IZoo {
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
private final test.Foo.Bar.Zoo zoo = null;
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final java.lang.Thread.State a() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final void b(@org.jetbrains.annotations.NotNull()
|
||||
test.JavaClass.Foo foo, @org.jetbrains.annotations.NotNull()
|
||||
test.JavaClass.Foo.Bar bar) {
|
||||
}
|
||||
|
||||
@org.jetbrains.annotations.NotNull()
|
||||
public final test.Foo.Bar.Zoo getZoo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Test1(@org.jetbrains.annotations.NotNull()
|
||||
test.Foo.Bar.Zoo zoo) {
|
||||
super();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user