Kapt: Simplify wrapper tests
(cherry picked from commit 1677984)
This commit is contained in:
committed by
Yan Zhulanow
parent
e04f834a0e
commit
238340a143
@@ -0,0 +1,17 @@
|
||||
// FQNAME: EnumClass
|
||||
|
||||
// FILE: EnumClass.java
|
||||
enum EnumClass {
|
||||
RED, GREEN, BLUE;
|
||||
|
||||
void someMethod() {
|
||||
System.out.println("Hello, world!")
|
||||
}
|
||||
|
||||
String getStringRepresentation() {
|
||||
return this.toString();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Anno.kt
|
||||
annotation class Anno
|
||||
@@ -0,0 +1,11 @@
|
||||
final enum EnumClass {
|
||||
public static final EnumClass RED
|
||||
|
||||
public static final EnumClass GREEN
|
||||
|
||||
public static final EnumClass BLUE
|
||||
|
||||
void someMethod()
|
||||
|
||||
java.lang.String getStringRepresentation()
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// FQNAME: MetaAnnotation
|
||||
|
||||
// FILE: MetaAnnotation.java
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Deprecated
|
||||
@Target({ ElementType.CONSTRUCTOR, ElementType.FIELD })
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface MetaAnnotation {
|
||||
String strValue();
|
||||
}
|
||||
|
||||
// FILE: Anno.kt
|
||||
annotation class Anno
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
@java.lang.Deprecated
|
||||
@java.lang.annotation.Target(value = { CONSTRUCTOR, FIELD })
|
||||
@java.lang.annotation.Retention(value = RUNTIME)
|
||||
public abstract @interface MetaAnnotation {
|
||||
public abstract java.lang.String strValue()
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
// FQNAME: Simple
|
||||
|
||||
// FILE: Simple.java
|
||||
@interface Anno {
|
||||
String[] numbers();
|
||||
}
|
||||
|
||||
@interface AnnoValue {
|
||||
String[] value();
|
||||
}
|
||||
|
||||
@KotlinAnnotation(a = "A", b = 5)
|
||||
@Anno(numbers = { "five", "six" })
|
||||
@AnnoValue({ "five", "six" })
|
||||
public abstract class Simple {
|
||||
@Anno(numbers = "seven")
|
||||
@AnnoValue("seven")
|
||||
final String field = "A";
|
||||
|
||||
abstract void voidMethod();
|
||||
|
||||
static {
|
||||
System.out.println("A");
|
||||
}
|
||||
|
||||
{
|
||||
System.out.println("b");
|
||||
}
|
||||
|
||||
protected String strMethod(int param) {
|
||||
return "A";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: KotlinAnnotation.kt
|
||||
annotation class KotlinAnnotation(val a: String, val b: Int)
|
||||
@@ -0,0 +1,18 @@
|
||||
@KotlinAnnotation(a = "A", b = 5)
|
||||
@Anno(numbers = { "five", "six" })
|
||||
@AnnoValue(value = { "five", "six" })
|
||||
public abstract class Simple {
|
||||
static {}
|
||||
|
||||
{}
|
||||
|
||||
@Anno(numbers = { "seven" })
|
||||
@AnnoValue(value = { "seven" })
|
||||
final java.lang.String field
|
||||
|
||||
abstract void voidMethod()
|
||||
|
||||
protected java.lang.String strMethod(int param)
|
||||
|
||||
public void <init>()
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// FQNAME: WithNested
|
||||
|
||||
// FILE: WithNested.java
|
||||
class WithNested {
|
||||
void myClassFun() {}
|
||||
|
||||
static class NestedClass {
|
||||
void nestedClassFun() {}
|
||||
}
|
||||
|
||||
class InnerClass {
|
||||
void innerClassFun() {}
|
||||
|
||||
class InnerInnerClass {
|
||||
void innerInnerClassFun() {}
|
||||
}
|
||||
}
|
||||
|
||||
interface NestedInterface {
|
||||
void nestedInterfaceFun() {}
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: Anno.kt
|
||||
annotation class Anno
|
||||
@@ -0,0 +1,27 @@
|
||||
class WithNested {
|
||||
void myClassFun()
|
||||
|
||||
static class NestedClass {
|
||||
void nestedClassFun()
|
||||
|
||||
void <init>()
|
||||
}
|
||||
|
||||
class InnerClass {
|
||||
void innerClassFun()
|
||||
|
||||
class InnerInnerClass {
|
||||
void innerInnerClassFun()
|
||||
|
||||
void <init>(WithNested.InnerClass $instance)
|
||||
}
|
||||
|
||||
void <init>(WithNested $instance)
|
||||
}
|
||||
|
||||
static abstract interface NestedInterface {
|
||||
public abstract void nestedInterfaceFun()
|
||||
}
|
||||
|
||||
void <init>()
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// FQNAME: test.Main
|
||||
|
||||
package test
|
||||
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
@MainAnno("A", 5)
|
||||
class Main {
|
||||
@field:XAnno(color = Color.GREEN)
|
||||
val x: String = ""
|
||||
|
||||
@get:YAnno(arrayOf<String>("Mary", "Tom"), intArrayOf(1, 3, 5), arrayOf<Color>(Color.GREEN, Color.RED))
|
||||
val y: String = ""
|
||||
|
||||
@set:ZAnno(String::class, arrayOf(String::class, Long::class, Main::class))
|
||||
var z: String = ""
|
||||
|
||||
// Property annotations are lost here (we don't create Elements (javac API) for the synthetic propertyName$annotations() methods)
|
||||
@MainAnno("B", 6)
|
||||
val zz: String = ""
|
||||
}
|
||||
|
||||
enum class Color {
|
||||
RED, GREEN, BLUE
|
||||
}
|
||||
|
||||
annotation class MainAnno(val a: String, val b: Int)
|
||||
|
||||
annotation class XAnno(val color: Color)
|
||||
|
||||
annotation class YAnno(val names: Array<String>, val ints: IntArray, val colors: Array<Color>)
|
||||
|
||||
annotation class ZAnno(val clazz: KClass<*>, val classes: Array<KClass<*>>)
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
@test.MainAnno(a = "A", b = 5)
|
||||
public final class Main {
|
||||
@test.XAnno(color = GREEN)
|
||||
@org.jetbrains.annotations.NotNull
|
||||
private final java.lang.String x
|
||||
|
||||
@org.jetbrains.annotations.NotNull
|
||||
private final java.lang.String y
|
||||
|
||||
@org.jetbrains.annotations.NotNull
|
||||
private java.lang.String z
|
||||
|
||||
@org.jetbrains.annotations.NotNull
|
||||
private final java.lang.String zz
|
||||
|
||||
@org.jetbrains.annotations.NotNull
|
||||
public final java.lang.String getX()
|
||||
|
||||
@test.YAnno(names = { "Mary", "Tom" }, ints = { 1, 3, 5 }, colors = { GREEN, RED })
|
||||
@org.jetbrains.annotations.NotNull
|
||||
public final java.lang.String getY()
|
||||
|
||||
@org.jetbrains.annotations.NotNull
|
||||
public final java.lang.String getZ()
|
||||
|
||||
@test.ZAnno(clazz = java.lang.String.class, classes = { java.lang.String.class, long.class, test.Main.class })
|
||||
public final void setZ(java.lang.String p)
|
||||
|
||||
@org.jetbrains.annotations.NotNull
|
||||
public final java.lang.String getZz()
|
||||
|
||||
public void <init>()
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
// FQNAME: EnumClass
|
||||
|
||||
enum class EnumClass {
|
||||
RED, GREEN, BLUE;
|
||||
|
||||
fun someFun() {
|
||||
System.out.println("Hello, world!")
|
||||
}
|
||||
|
||||
fun stringRepresentation() = this.toString()
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
public enum EnumClass {
|
||||
public static final EnumClass RED
|
||||
|
||||
public static final EnumClass GREEN
|
||||
|
||||
public static final EnumClass BLUE
|
||||
|
||||
public final void someFun()
|
||||
|
||||
@org.jetbrains.annotations.NotNull
|
||||
public final java.lang.String stringRepresentation()
|
||||
|
||||
protected void <init>()
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// FQNAME: Test
|
||||
|
||||
class Test {
|
||||
@kotlin.jvm.Transient
|
||||
val f: String = ""
|
||||
|
||||
// explicitly
|
||||
@org.jetbrains.annotations.NotNull
|
||||
fun a() {}
|
||||
|
||||
@kotlin.jvm.Synchronized
|
||||
fun b() {}
|
||||
|
||||
@kotlin.jvm.JvmOverloads
|
||||
fun c(a: Int = 3, b: String = "") {}
|
||||
|
||||
@java.lang.Deprecated
|
||||
fun d() {}
|
||||
|
||||
@kotlin.Deprecated("")
|
||||
fun e() {}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
public final class Test {
|
||||
@kotlin.jvm.Transient
|
||||
@org.jetbrains.annotations.NotNull
|
||||
private final transient java.lang.String f
|
||||
|
||||
@org.jetbrains.annotations.NotNull
|
||||
public final java.lang.String getF()
|
||||
|
||||
@org.jetbrains.annotations.NotNull
|
||||
public final void a()
|
||||
|
||||
@kotlin.jvm.Synchronized
|
||||
public final synchronized void b()
|
||||
|
||||
@kotlin.jvm.JvmOverloads
|
||||
public final void c(int a, java.lang.String b)
|
||||
|
||||
@kotlin.jvm.JvmOverloads
|
||||
public void c(int a)
|
||||
|
||||
@kotlin.jvm.JvmOverloads
|
||||
public void c()
|
||||
|
||||
@java.lang.Deprecated
|
||||
public final void d()
|
||||
|
||||
@kotlin.Deprecated(message = "")
|
||||
public final void e()
|
||||
|
||||
public void <init>()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// FQNAME: Anno
|
||||
|
||||
@Repeatable
|
||||
@Deprecated("")
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
@Target(AnnotationTarget.CLASS, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.EXPRESSION)
|
||||
annotation class Anno
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
@kotlin.annotation.Repeatable
|
||||
@kotlin.Deprecated(message = "")
|
||||
@kotlin.annotation.Retention(value = RUNTIME)
|
||||
@kotlin.annotation.Target(allowedTargets = { CLASS, CONSTRUCTOR, EXPRESSION })
|
||||
@java.lang.annotation.Retention(value = RUNTIME)
|
||||
@java.lang.annotation.Target(value = { TYPE, CONSTRUCTOR })
|
||||
public abstract @interface Anno {
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
// FQNAME: MyClass
|
||||
|
||||
class MyClass {
|
||||
companion object {
|
||||
val CONST = 2
|
||||
}
|
||||
|
||||
fun myClassFun() {}
|
||||
|
||||
class NestedClass {
|
||||
companion object A {
|
||||
val CONSTA = 3
|
||||
}
|
||||
|
||||
fun nestedClassFun() {}
|
||||
|
||||
class NestedNestedClass {
|
||||
fun nestedNestedClassFun() {}
|
||||
}
|
||||
}
|
||||
|
||||
inner class InnerClass {
|
||||
fun innerClassFun() {}
|
||||
}
|
||||
|
||||
interface InnerInterface {
|
||||
fun innerInterfaceFun()
|
||||
fun innerInterfaceFunWithImpl() = 5
|
||||
}
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
public final class MyClass {
|
||||
private static final int CONST
|
||||
|
||||
public static final MyClass.Companion Companion
|
||||
|
||||
public final void myClassFun()
|
||||
|
||||
public void <init>()
|
||||
|
||||
public static final class Companion {
|
||||
public final int getCONST()
|
||||
|
||||
private void <init>()
|
||||
}
|
||||
|
||||
public static final class NestedClass {
|
||||
private static final int CONSTA
|
||||
|
||||
public static final MyClass.NestedClass.A A
|
||||
|
||||
public final void nestedClassFun()
|
||||
|
||||
public void <init>()
|
||||
|
||||
public static final class A {
|
||||
public final int getCONSTA()
|
||||
|
||||
private void <init>()
|
||||
}
|
||||
|
||||
public static final class NestedNestedClass {
|
||||
public final void nestedNestedClassFun()
|
||||
|
||||
public void <init>()
|
||||
}
|
||||
}
|
||||
|
||||
public final class InnerClass {
|
||||
public final void innerClassFun()
|
||||
|
||||
public void <init>()
|
||||
}
|
||||
|
||||
public static abstract interface InnerInterface {
|
||||
public abstract void innerInterfaceFun()
|
||||
|
||||
public abstract int innerInterfaceFunWithImpl()
|
||||
|
||||
public static final class DefaultImpls {
|
||||
public static int innerInterfaceFunWithImpl(MyClass.InnerInterface $this)
|
||||
|
||||
public void <init>()
|
||||
}
|
||||
}
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// FQNAME: MyClass
|
||||
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class Anno(val name: String)
|
||||
|
||||
@Anno("Mary")
|
||||
@Anno("Tom")
|
||||
class MyClass
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
@Anno(name = "Mary")
|
||||
@Anno(name = "Tom")
|
||||
public final class MyClass {
|
||||
public void <init>()
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// FQNAME: test.Simple
|
||||
|
||||
package test
|
||||
|
||||
abstract class Simple(private val prop: String) {
|
||||
protected val anotherProp: Int = 5
|
||||
|
||||
abstract fun strFun(x: Long): String
|
||||
fun voidFun() {}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
public abstract class Simple {
|
||||
private final int anotherProp
|
||||
|
||||
private final java.lang.String prop
|
||||
|
||||
protected final int getAnotherProp()
|
||||
|
||||
@org.jetbrains.annotations.NotNull
|
||||
public abstract java.lang.String strFun(long x)
|
||||
|
||||
public final void voidFun()
|
||||
|
||||
public void <init>(java.lang.String prop)
|
||||
}
|
||||
Reference in New Issue
Block a user