Generate nullability annotations as non-runtime-retained
org.jetbrains.annotations.NotNull/Nullable have retention CLASS, therefore they should appear in RuntimeInvisibleAnnotations #KT-22201 Fixed
This commit is contained in:
committed by
Nicolay Mitropolsky
parent
2e4f3ced9b
commit
628833af65
@@ -537,7 +537,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
|||||||
public void generateEqualsMethod(@NotNull FunctionDescriptor function, @NotNull List<? extends PropertyDescriptor> properties) {
|
public void generateEqualsMethod(@NotNull FunctionDescriptor function, @NotNull List<? extends PropertyDescriptor> properties) {
|
||||||
MethodContext context = ImplementationBodyCodegen.this.context.intoFunction(function);
|
MethodContext context = ImplementationBodyCodegen.this.context.intoFunction(function);
|
||||||
MethodVisitor mv = v.newMethod(JvmDeclarationOriginKt.OtherOrigin(function), ACC_PUBLIC, "equals", "(Ljava/lang/Object;)Z", null, null);
|
MethodVisitor mv = v.newMethod(JvmDeclarationOriginKt.OtherOrigin(function), ACC_PUBLIC, "equals", "(Ljava/lang/Object;)Z", null, null);
|
||||||
mv.visitParameterAnnotation(0, Type.getDescriptor(Nullable.class), true);
|
mv.visitParameterAnnotation(0, Type.getDescriptor(Nullable.class), false);
|
||||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||||
|
|
||||||
mv.visitCode();
|
mv.visitCode();
|
||||||
@@ -645,7 +645,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
|||||||
public void generateToStringMethod(@NotNull FunctionDescriptor function, @NotNull List<? extends PropertyDescriptor> properties) {
|
public void generateToStringMethod(@NotNull FunctionDescriptor function, @NotNull List<? extends PropertyDescriptor> properties) {
|
||||||
MethodContext context = ImplementationBodyCodegen.this.context.intoFunction(function);
|
MethodContext context = ImplementationBodyCodegen.this.context.intoFunction(function);
|
||||||
MethodVisitor mv = v.newMethod(JvmDeclarationOriginKt.OtherOrigin(function), ACC_PUBLIC, "toString", "()Ljava/lang/String;", null, null);
|
MethodVisitor mv = v.newMethod(JvmDeclarationOriginKt.OtherOrigin(function), ACC_PUBLIC, "toString", "()Ljava/lang/String;", null, null);
|
||||||
mv.visitAnnotation(Type.getDescriptor(NotNull.class), true);
|
mv.visitAnnotation(Type.getDescriptor(NotNull.class), false);
|
||||||
InstructionAdapter iv = new InstructionAdapter(mv);
|
InstructionAdapter iv = new InstructionAdapter(mv);
|
||||||
|
|
||||||
mv.visitCode();
|
mv.visitCode();
|
||||||
|
|||||||
Reference in New Issue
Block a user