Do not always generate synthetic "$annotations" as private
Since annotations are a part of the declaration, they must have the same visibility as the declaration in the bytecode. Otherwise obfuscators like Proguard might strip the "$annotations" method and no annotations would be found via Kotlin reflection #KT-15993 Fixed
This commit is contained in:
@@ -31,6 +31,7 @@ import org.jetbrains.kotlin.codegen.serialization.JvmSerializerExtension;
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState;
|
||||
import org.jetbrains.kotlin.codegen.state.KotlinTypeMapper;
|
||||
import org.jetbrains.kotlin.descriptors.*;
|
||||
import org.jetbrains.kotlin.descriptors.annotations.AnnotationUseSiteTarget;
|
||||
import org.jetbrains.kotlin.descriptors.annotations.Annotations;
|
||||
import org.jetbrains.kotlin.descriptors.impl.SimpleFunctionDescriptorImpl;
|
||||
import org.jetbrains.kotlin.fileClasses.FileClasses;
|
||||
@@ -237,14 +238,20 @@ public abstract class MemberCodegen<T extends KtPureElement/* TODO: & KtDeclarat
|
||||
Annotations annotations = typeAliasDescriptor.getAnnotations();
|
||||
if (!isAnnotationsMethodOwner || annotations.getAllAnnotations().isEmpty()) return;
|
||||
|
||||
int flags = ACC_DEPRECATED | ACC_PRIVATE | ACC_STATIC | ACC_SYNTHETIC;
|
||||
String name = JvmAbi.getSyntheticMethodNameForAnnotatedTypeAlias(typeAliasDescriptor.getName());
|
||||
String desc = "()V";
|
||||
Method syntheticMethod = new Method(name, desc);
|
||||
generateSyntheticAnnotationsMethod(typeAliasDescriptor, new Method(name, "()V"), annotations, null);
|
||||
}
|
||||
|
||||
MethodVisitor mv = v.newMethod(JvmDeclarationOriginKt.OtherOrigin(typeAliasDescriptor), flags, syntheticMethod.getName(),
|
||||
protected void generateSyntheticAnnotationsMethod(
|
||||
@NotNull MemberDescriptor descriptor,
|
||||
@NotNull Method syntheticMethod,
|
||||
@NotNull Annotations annotations,
|
||||
@Nullable AnnotationUseSiteTarget allowedTarget
|
||||
) {
|
||||
int flags = ACC_DEPRECATED | ACC_STATIC | ACC_SYNTHETIC | AsmUtil.getVisibilityAccessFlag(descriptor);
|
||||
MethodVisitor mv = v.newMethod(JvmDeclarationOriginKt.OtherOrigin(descriptor), flags, syntheticMethod.getName(),
|
||||
syntheticMethod.getDescriptor(), null, null);
|
||||
AnnotationCodegen.forMethod(mv, this, typeMapper).genAnnotations(new AnnotatedSimple(annotations), Type.VOID_TYPE, null);
|
||||
AnnotationCodegen.forMethod(mv, this, typeMapper).genAnnotations(new AnnotatedSimple(annotations), Type.VOID_TYPE, allowedTarget);
|
||||
mv.visitCode();
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitEnd();
|
||||
|
||||
@@ -20,7 +20,6 @@ import com.intellij.openapi.util.Pair;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.codegen.annotation.AnnotatedSimple;
|
||||
import org.jetbrains.kotlin.codegen.annotation.AnnotatedWithFakeAnnotations;
|
||||
import org.jetbrains.kotlin.codegen.context.*;
|
||||
import org.jetbrains.kotlin.codegen.state.GenerationState;
|
||||
@@ -58,7 +57,8 @@ import java.util.List;
|
||||
|
||||
import static org.jetbrains.kotlin.codegen.AsmUtil.getDeprecatedAccessFlag;
|
||||
import static org.jetbrains.kotlin.codegen.AsmUtil.getVisibilityForBackingField;
|
||||
import static org.jetbrains.kotlin.codegen.JvmCodegenUtil.*;
|
||||
import static org.jetbrains.kotlin.codegen.JvmCodegenUtil.isConstOrHasJvmFieldAnnotation;
|
||||
import static org.jetbrains.kotlin.codegen.JvmCodegenUtil.isJvmInterface;
|
||||
import static org.jetbrains.kotlin.codegen.serialization.JvmSerializationBindings.FIELD_FOR_PROPERTY;
|
||||
import static org.jetbrains.kotlin.codegen.serialization.JvmSerializationBindings.SYNTHETIC_METHOD_FOR_PROPERTY;
|
||||
import static org.jetbrains.kotlin.resolve.DescriptorUtils.isCompanionObject;
|
||||
@@ -270,7 +270,7 @@ public class PropertyCodegen {
|
||||
}
|
||||
|
||||
// Annotations on properties are stored in bytecode on an empty synthetic method. This way they're still
|
||||
// accessible via reflection, and 'deprecated' and 'private' flags prevent this method from being called accidentally
|
||||
// accessible via reflection, and 'deprecated' and 'synthetic' flags prevent this method from being called accidentally
|
||||
private void generateSyntheticMethodIfNeeded(@NotNull PropertyDescriptor descriptor, @NotNull Annotations annotations) {
|
||||
if (annotations.getAllAnnotations().isEmpty()) return;
|
||||
|
||||
@@ -278,15 +278,9 @@ public class PropertyCodegen {
|
||||
if (!isInterface(contextDescriptor) ||
|
||||
(FunctionCodegen.processInterface(contextDescriptor, kind, state) ||
|
||||
(kind == OwnerKind.DEFAULT_IMPLS && state.getGenerateDefaultImplsForJvm8()))) {
|
||||
int flags = ACC_DEPRECATED | ACC_PRIVATE | ACC_STATIC | ACC_SYNTHETIC;
|
||||
Method syntheticMethod = getSyntheticMethodSignature(descriptor);
|
||||
MethodVisitor mv = v.newMethod(JvmDeclarationOriginKt.OtherOrigin(descriptor), flags, syntheticMethod.getName(),
|
||||
syntheticMethod.getDescriptor(), null, null);
|
||||
AnnotationCodegen.forMethod(mv, memberCodegen, typeMapper)
|
||||
.genAnnotations(new AnnotatedSimple(annotations), Type.VOID_TYPE, AnnotationUseSiteTarget.PROPERTY);
|
||||
mv.visitCode();
|
||||
mv.visitInsn(Opcodes.RETURN);
|
||||
mv.visitEnd();
|
||||
memberCodegen.generateSyntheticAnnotationsMethod(
|
||||
descriptor, getSyntheticMethodSignature(descriptor), annotations, AnnotationUseSiteTarget.PROPERTY
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,6 @@ synthetic final class test/Foo__InlineOnlyPropertyMultifileKt {
|
||||
public final static method foo(): void
|
||||
private final static method getExtProp(p0: java.lang.Object): java.lang.String
|
||||
private final static method getProp(): java.lang.String
|
||||
private synthetic deprecated static @kotlin.internal.InlineOnly method prop$annotations(): void
|
||||
public synthetic deprecated static @kotlin.internal.InlineOnly method prop$annotations(): void
|
||||
private final static method setProp(p0: java.lang.String): void
|
||||
}
|
||||
|
||||
@@ -3,10 +3,10 @@ public final class A {
|
||||
private final @AnnField @AnnParameterField @AnnTypeField field a: int
|
||||
private final @AnnField @AnnTypeField field x: int
|
||||
public method <init>(@AnnParameterProperty @AnnParameterField p0: int): void
|
||||
private synthetic deprecated static @AnnProperty @AnnFieldProperty @AnnParameterProperty method a$annotations(): void
|
||||
public synthetic deprecated static @AnnProperty @AnnFieldProperty @AnnParameterProperty method a$annotations(): void
|
||||
public final method getA(): int
|
||||
public final method getX(): int
|
||||
private synthetic deprecated static @AnnProperty @AnnFieldProperty method x$annotations(): void
|
||||
public synthetic deprecated static @AnnProperty @AnnFieldProperty method x$annotations(): void
|
||||
}
|
||||
|
||||
@kotlin.annotation.Target
|
||||
@@ -56,4 +56,4 @@ public final class DefaultTargetsKt {
|
||||
private final static @Anno field p2: int
|
||||
static method <clinit>(): void
|
||||
public final static method getP2(): int
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,11 +11,11 @@ public final class A {
|
||||
public final @org.jetbrains.annotations.NotNull method getS(): java.lang.String
|
||||
public final method getX(): int
|
||||
public final @AnnGetter method getY(): int
|
||||
private synthetic deprecated static @AnnProp @AnnProp2 method p$annotations(): void
|
||||
private synthetic deprecated static @AnnProp @AnnProp2 @AnnDelegate method s$annotations(): void
|
||||
public synthetic deprecated static @AnnProp @AnnProp2 method p$annotations(): void
|
||||
public synthetic deprecated static @AnnProp @AnnProp2 @AnnDelegate method s$annotations(): void
|
||||
public final @AnnSetter method setP(@AnnParam p0: int): void
|
||||
public final @AnnSetter method setY(p0: int): void
|
||||
private synthetic deprecated static @AnnProp2 method x$annotations(): void
|
||||
public synthetic deprecated static @AnnProp2 method x$annotations(): void
|
||||
}
|
||||
|
||||
@java.lang.annotation.Retention
|
||||
@@ -50,4 +50,4 @@ public annotation class AnnSetter
|
||||
public final class CustomDelegate {
|
||||
public method <init>(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getValue(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.NotNull p1: kotlin.reflect.KProperty): java.lang.String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ public final class Foo {
|
||||
private final method getExtProp(p0: java.lang.Object): java.lang.String
|
||||
private final method getProp(): java.lang.String
|
||||
private final @kotlin.internal.InlineOnly method getProp2(): java.lang.String
|
||||
private synthetic deprecated static @kotlin.internal.InlineOnly method prop$annotations(): void
|
||||
public synthetic deprecated static @kotlin.internal.InlineOnly method prop$annotations(): void
|
||||
private final method setProp(p0: java.lang.String): void
|
||||
public final method setProp2(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public final class InlineOnlyPropertyKt {
|
||||
private final static method getExtProp(p0: java.lang.Object): java.lang.String
|
||||
private final static method getProp(): java.lang.String
|
||||
private final static @kotlin.internal.InlineOnly method getProp2(): java.lang.String
|
||||
private synthetic deprecated static @kotlin.internal.InlineOnly method prop$annotations(): void
|
||||
public synthetic deprecated static @kotlin.internal.InlineOnly method prop$annotations(): void
|
||||
private final static method setProp(p0: java.lang.String): void
|
||||
public final static method setProp2(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ public annotation class Ann {
|
||||
|
||||
@kotlin.Metadata
|
||||
public final class AnnotationsOnTypeAliasesKt {
|
||||
private synthetic deprecated static @Ann method TA$annotations(): void
|
||||
public synthetic deprecated static @Ann method TA$annotations(): void
|
||||
public final static method assertHasDeclaredMethodWithAnn(@org.jetbrains.annotations.NotNull p0: java.lang.Class): void
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
}
|
||||
|
||||
Vendored
+3
-3
@@ -21,7 +21,7 @@ public final class Test {
|
||||
public final static @org.jetbrains.annotations.NotNull method getTestK(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.NotNull method getTestO(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.NotNull method getTestOK(): java.lang.String
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method testK$annotations(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method testO$annotations(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method testOK$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method testK$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method testO$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method testOK$annotations(): void
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ public final class A {
|
||||
private final static @org.jetbrains.annotations.NotNull field b: java.lang.String
|
||||
private final static @org.jetbrains.annotations.NotNull field c: java.lang.String
|
||||
private method <init>(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getB(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.NotNull method getC(): java.lang.String
|
||||
public final static @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull method test1(): java.lang.String
|
||||
|
||||
@@ -15,7 +15,7 @@ public final class A {
|
||||
public final static class A/Companion {
|
||||
inner class A/Companion
|
||||
private method <init>(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getB(): java.lang.String
|
||||
public final @org.jetbrains.annotations.NotNull method getC(): java.lang.String
|
||||
public final @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull method test1(): java.lang.String
|
||||
|
||||
@@ -16,7 +16,7 @@ public enum class A {
|
||||
public final static class A/Companion {
|
||||
inner class A/Companion
|
||||
private method <init>(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method bar$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method bar$annotations(): void
|
||||
public final @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull method baz(): java.lang.String
|
||||
public final @org.jetbrains.annotations.NotNull method getBar(): java.lang.String
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ public final class AX {
|
||||
public final @org.jetbrains.annotations.NotNull method aNonStatic(): java.lang.String
|
||||
public final static @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull method aStatic(): java.lang.String
|
||||
public final static @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull method b(): java.lang.String
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void
|
||||
public final static @org.jetbrains.annotations.NotNull method getC(): java.lang.String
|
||||
public final @org.jetbrains.annotations.NotNull method getProperty(): java.lang.String
|
||||
}
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ public final static class C/Companion {
|
||||
private method <init>(): void
|
||||
public final @kotlin.jvm.JvmStatic method f1(): int
|
||||
public final method getP1(): int
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method p1$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method p1$annotations(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
@@ -29,5 +29,5 @@ public final class O {
|
||||
private method <init>(): void
|
||||
public final static @kotlin.jvm.JvmStatic method f(): int
|
||||
public final static method getP(): int
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method p$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method p$annotations(): void
|
||||
}
|
||||
|
||||
@@ -19,6 +19,6 @@ public final class Test {
|
||||
public final static method setSomeProperty(@org.jetbrains.annotations.NotNull p0: java.lang.String, p1: int): void
|
||||
public final static method setSomeProperty(p0: long, p1: long): void
|
||||
public final method setZ(@org.jetbrains.annotations.NotNull p0: java.lang.String): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method someProperty$annotations(p0: java.lang.String): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method someProperty$annotations(p0: long): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method someProperty$annotations(p0: java.lang.String): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method someProperty$annotations(p0: long): void
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ public final class A {
|
||||
private final static @org.jetbrains.annotations.NotNull field b: java.lang.String
|
||||
private final static @org.jetbrains.annotations.NotNull field c: java.lang.String
|
||||
private method <init>(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getB(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.NotNull method getC(): java.lang.String
|
||||
public final static @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull method test1(): java.lang.String
|
||||
|
||||
@@ -5,7 +5,7 @@ public final class A {
|
||||
private static field b: int
|
||||
private static field c: int
|
||||
private method <init>(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method a$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method a$annotations(): void
|
||||
public final static method getA(): int
|
||||
public final static @kotlin.jvm.JvmStatic method getB(): int
|
||||
public final method getC(): int
|
||||
|
||||
@@ -5,7 +5,7 @@ public final class A {
|
||||
private static field b: int
|
||||
private static field c: int
|
||||
private method <init>(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method a$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method a$annotations(): void
|
||||
public final static method getA(): int
|
||||
public final static @kotlin.jvm.JvmStatic method getB(): int
|
||||
public final method getC(): int
|
||||
|
||||
@@ -21,5 +21,5 @@ public final static class TestApp/Companion {
|
||||
public synthetic final static method access$setValue$p(p0: TestApp.Companion, @org.jetbrains.annotations.NotNull p1: java.lang.String): void
|
||||
public final @org.jetbrains.annotations.NotNull method getValue(): java.lang.String
|
||||
private final method setValue(p0: java.lang.String): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method value$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method value$annotations(): void
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ public final class A {
|
||||
private static field b: int
|
||||
private static field c: int
|
||||
private method <init>(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method a$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method a$annotations(): void
|
||||
public final static method getA(): int
|
||||
public final static @kotlin.jvm.JvmStatic method getB(): int
|
||||
public final method getC(): int
|
||||
|
||||
@@ -11,5 +11,5 @@ public final class X {
|
||||
public synthetic static method fn$default(p0: X, p1: java.lang.String, p2: int, p3: java.lang.Object): java.lang.String
|
||||
public final @org.jetbrains.annotations.NotNull method fn(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String
|
||||
public final static @org.jetbrains.annotations.NotNull method getX(): java.lang.String
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method x$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method x$annotations(): void
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ public final class A {
|
||||
private final static @org.jetbrains.annotations.NotNull field b: java.lang.String
|
||||
private final static @org.jetbrains.annotations.NotNull field c: java.lang.String
|
||||
private method <init>(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method c$annotations(): void
|
||||
public final @org.jetbrains.annotations.NotNull method getB(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.NotNull method getC(): java.lang.String
|
||||
public final static @kotlin.jvm.JvmStatic @org.jetbrains.annotations.NotNull method test1(): java.lang.String
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ public annotation class a/A
|
||||
@kotlin.Metadata
|
||||
public final class a/MultifileClass {
|
||||
public final static @org.jetbrains.annotations.NotNull field OK: java.lang.String
|
||||
private synthetic deprecated static @a.A method OK$annotations(): void
|
||||
public synthetic deprecated static @a.A method OK$annotations(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ public annotation class Anno
|
||||
@kotlin.Metadata
|
||||
public final class TwoAnnotatedExtensionPropertiesWithoutBackingFieldsKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
private synthetic deprecated static @Anno method foo$annotations(p0: int): void
|
||||
private synthetic deprecated static @Anno method foo$annotations(p0: java.lang.String): void
|
||||
public synthetic deprecated static @Anno method foo$annotations(p0: int): void
|
||||
public synthetic deprecated static @Anno method foo$annotations(p0: java.lang.String): void
|
||||
public final static method getFoo(@org.jetbrains.annotations.NotNull p0: java.lang.String): int
|
||||
public final static method getFoo(p0: int): int
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -8,5 +8,5 @@ public annotation class Ann {
|
||||
public final class PropertyWithoutBackingFieldKt {
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
public final static @org.jetbrains.annotations.NotNull method getProperty(): java.lang.String
|
||||
private synthetic deprecated static @Ann method property$annotations(): void
|
||||
public synthetic deprecated static @Ann method property$annotations(): void
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,6 +9,6 @@ public annotation class Simple {
|
||||
public final class SimpleValAnnotationKt {
|
||||
private final static field foo: int
|
||||
public final static @org.jetbrains.annotations.NotNull method box(): java.lang.String
|
||||
private synthetic deprecated static @Simple method foo$annotations(): void
|
||||
public synthetic deprecated static @Simple method foo$annotations(): void
|
||||
public final static method getFoo(): int
|
||||
}
|
||||
|
||||
+4
-4
@@ -23,10 +23,10 @@ public final static class Host/Companion {
|
||||
public final method getYy(): int
|
||||
public final method setY(p0: int): void
|
||||
public final method setYy(p0: int): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method x$annotations(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method xx$annotations(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method y$annotations(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method yy$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method x$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method xx$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method y$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method yy$annotations(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
|
||||
Vendored
+4
-4
@@ -10,10 +10,10 @@ public final class Host {
|
||||
public final static method getYy(): int
|
||||
public final static method setY(p0: int): void
|
||||
public final static method setYy(p0: int): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method x$annotations(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method xx$annotations(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method y$annotations(): void
|
||||
private synthetic deprecated static @kotlin.jvm.JvmStatic method yy$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method x$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method xx$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method y$annotations(): void
|
||||
public synthetic deprecated static @kotlin.jvm.JvmStatic method yy$annotations(): void
|
||||
}
|
||||
|
||||
@kotlin.Metadata
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class Foo {
|
||||
annotation class Anno
|
||||
|
||||
@Anno
|
||||
private val prop = 42
|
||||
}
|
||||
|
||||
// TESTED_OBJECT_KIND: function
|
||||
// TESTED_OBJECTS: Foo, prop$annotations
|
||||
// FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PRIVATE
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
open class Foo {
|
||||
annotation class Anno
|
||||
|
||||
@Anno
|
||||
protected val prop = 42
|
||||
}
|
||||
|
||||
// TESTED_OBJECT_KIND: function
|
||||
// TESTED_OBJECTS: Foo, prop$annotations
|
||||
// FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PROTECTED
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
class Foo {
|
||||
annotation class Anno
|
||||
|
||||
@Anno
|
||||
val prop = 42
|
||||
}
|
||||
|
||||
// TESTED_OBJECT_KIND: function
|
||||
// TESTED_OBJECTS: Foo, prop$annotations
|
||||
// FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PUBLIC
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
@Target(AnnotationTarget.TYPEALIAS)
|
||||
annotation class Anno
|
||||
|
||||
@Anno
|
||||
private typealias Foo = String
|
||||
|
||||
// TESTED_OBJECT_KIND: function
|
||||
// TESTED_OBJECTS: PrivateTypealiasKt, Foo$annotations
|
||||
// FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PRIVATE
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
@Target(AnnotationTarget.TYPEALIAS)
|
||||
annotation class Anno
|
||||
|
||||
@Anno
|
||||
typealias Foo = String
|
||||
|
||||
// TESTED_OBJECT_KIND: function
|
||||
// TESTED_OBJECTS: PublicTypealiasKt, Foo$annotations
|
||||
// FLAGS: ACC_DEPRECATED, ACC_STATIC, ACC_SYNTHETIC, ACC_PUBLIC
|
||||
+1
-1
@@ -67,7 +67,7 @@ public class SyntheticMethodForAnnotatedPropertyGenTest extends CodegenTestCase
|
||||
assertTrue(method.isSynthetic());
|
||||
int modifiers = method.getModifiers();
|
||||
assertTrue(Modifier.isStatic(modifiers));
|
||||
assertTrue(Modifier.isPrivate(modifiers));
|
||||
assertTrue(Modifier.isPublic(modifiers));
|
||||
|
||||
Annotation[] annotations = method.getDeclaredAnnotations();
|
||||
assertSize(1, annotations);
|
||||
|
||||
@@ -1022,6 +1022,33 @@ public class WriteFlagsTestGenerated extends AbstractWriteFlagsTest {
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/writeFlags/property/syntheticAnnotationsMethod")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class SyntheticAnnotationsMethod extends AbstractWriteFlagsTest {
|
||||
public void testAllFilesPresentInSyntheticAnnotationsMethod() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/writeFlags/property/syntheticAnnotationsMethod"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("privateProperty.kt")
|
||||
public void testPrivateProperty() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/privateProperty.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("protectedProperty.kt")
|
||||
public void testProtectedProperty() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/protectedProperty.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("publicProperty.kt")
|
||||
public void testPublicProperty() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/property/syntheticAnnotationsMethod/publicProperty.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/writeFlags/property/visibility")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
@@ -1049,4 +1076,34 @@ public class WriteFlagsTestGenerated extends AbstractWriteFlagsTest {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/writeFlags/typealias")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class Typealias extends AbstractWriteFlagsTest {
|
||||
public void testAllFilesPresentInTypealias() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/writeFlags/typealias"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class SyntheticAnnotationsMethod extends AbstractWriteFlagsTest {
|
||||
public void testAllFilesPresentInSyntheticAnnotationsMethod() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("privateTypealias.kt")
|
||||
public void testPrivateTypealias() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod/privateTypealias.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("publicTypealias.kt")
|
||||
public void testPublicTypealias() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/writeFlags/typealias/syntheticAnnotationsMethod/publicTypealias.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user