Rename: Fixed rename of Kotlin enum constants/@JvmField properties through Java references

#KT-11817 Fixed
This commit is contained in:
Alexey Sedunov
2016-04-19 20:39:19 +03:00
parent 070923f03a
commit b35834dd18
13 changed files with 72 additions and 2 deletions
@@ -0,0 +1,5 @@
public class EnumJavaRef {
public void use(EnumTarget p) {
System.out.println(p == EnumTarget.YELLOW);
}
}
@@ -0,0 +1 @@
enum class EnumTarget { YELLOW, GREEN, BLUE }
@@ -0,0 +1,5 @@
public class EnumJavaRef {
public void use(EnumTarget p) {
System.out.println(p == EnumTarget./*rename*/RED);
}
}
@@ -0,0 +1 @@
enum class EnumTarget { RED, GREEN, BLUE }
@@ -0,0 +1,6 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "EnumJavaRef.java",
"newName": "YELLOW",
"byRef": "true"
}
@@ -0,0 +1,5 @@
package testing.rename
public open class C {
@JvmStatic var <caret> second = 1
}
@@ -0,0 +1,10 @@
package testing;
import testing.rename.C;
class JavaClient {
public void foo(C c) {
int n = c.second;
c.second = 2;
}
}
@@ -0,0 +1,5 @@
package testing.rename
public open class C {
@JvmStatic var <caret>first = 1
}
@@ -0,0 +1,10 @@
package testing;
import testing.rename.C;
class JavaClient {
public void foo(C c) {
int n = c.first;
c.first = 2;
}
}
@@ -0,0 +1,7 @@
{
"type": "KOTLIN_PROPERTY",
"classId": "testing/rename/C",
"oldName": "first",
"newName": "second",
"withRuntime": "true"
}