Fix for KT-15027 J2K: Annotations are set on functions, but not on property accessors
#KT-15027 fixed
This commit is contained in:
committed by
Simon Ogorodnik
parent
5071baf970
commit
73ea0e8460
+16
@@ -0,0 +1,16 @@
|
||||
@interface A {
|
||||
|
||||
}
|
||||
|
||||
@interface B {
|
||||
|
||||
}
|
||||
|
||||
public class U {
|
||||
@B
|
||||
public int i;
|
||||
|
||||
public U(@A int i) {
|
||||
this.i = i;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
internal annotation class A
|
||||
|
||||
internal annotation class B
|
||||
|
||||
class U(@param:A @B
|
||||
var i: Int)
|
||||
@@ -0,0 +1,18 @@
|
||||
@interface An {
|
||||
String value();
|
||||
}
|
||||
|
||||
|
||||
public class Test {
|
||||
private int id;
|
||||
|
||||
@An(value = "get")
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@An(value = "set")
|
||||
public void setId(int id) {
|
||||
this.id = id
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
internal annotation class An(val value: String)
|
||||
|
||||
|
||||
class Test {
|
||||
@get:An(value = "get")
|
||||
@set:An(value = "set")
|
||||
var id: Int = 0
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
public class WithModifiersOnAccessors {
|
||||
private synchronized void methSync() {}
|
||||
protected strictfp void methStrict() {}
|
||||
|
||||
private int sync = 0;
|
||||
public synchronized int getSync() { return sync; }
|
||||
public synchronized void setSync(int sync) { this.sync = sync; }
|
||||
|
||||
public double strict = 0.0;
|
||||
public strictfp double getStrict() { return strict; }
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class WithModifiersOnAccessors {
|
||||
@Synchronized private fun methSync() {
|
||||
}
|
||||
|
||||
@Strictfp protected fun methStrict() {
|
||||
}
|
||||
|
||||
@get:Synchronized @set:Synchronized var sync = 0
|
||||
|
||||
@get:Strictfp var strict = 0.0
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
import javaApi.Anon5
|
||||
|
||||
internal class A
|
||||
@Anon5(10)
|
||||
internal class A @Anon5(10)
|
||||
constructor(private val a: Int, private val b: Int) {
|
||||
|
||||
@Deprecated("") // this constructor will not be replaced by default parameter value in primary because of this annotation
|
||||
|
||||
Reference in New Issue
Block a user