Light Classes: Replace accessor with property name when renaming KtProperty/KtParameter through its light methods

#KT-11880 Fixed
This commit is contained in:
Alexey Sedunov
2016-04-15 15:36:09 +03:00
parent c21dff66aa
commit 754e7cac52
24 changed files with 259 additions and 1 deletions
@@ -0,0 +1,9 @@
package a;
public class J {
static void test() {
KotlinSpringBean bean = new KotlinSpringBean(1);
bean.isFooNew();
bean.setFooNew(true);
}
}
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="a.KotlinSpringBean" name="xmlKotlinBean">
<constructor-arg name="value" value="1"/>
</bean>
<bean class="a.KotlinSpringBean" name="xmlKotlinBean2">
<constructor-arg name="value" value="2"/>
<property name="fooNew" value="#{xmlKotlinBean.fooNew}" />
</bean>
</beans>
@@ -0,0 +1,11 @@
package a
class KotlinSpringBean(value: Int) {
var isFooNew: Boolean = false
}
fun test() {
val bean = KotlinSpringBean(1)
bean.isFooNew
bean.isFooNew = true
}
@@ -0,0 +1,9 @@
package a;
public class J {
static void test() {
KotlinSpringBean bean = new KotlinSpringBean(1);
bean.isFoo();
bean.setFoo(true);
}
}
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="a.KotlinSpringBean" name="xmlKotlinBean">
<constructor-arg name="value" value="1"/>
</bean>
<bean class="a.KotlinSpringBean" name="xmlKotlinBean2">
<constructor-arg name="value" value="2"/>
<property name="foo" value="#{xmlKotlinBean./*rename*/foo}" />
</bean>
</beans>
@@ -0,0 +1,11 @@
package a
class KotlinSpringBean(value: Int) {
var isFoo: Boolean = false
}
fun test() {
val bean = KotlinSpringBean(1)
bean.isFoo
bean.isFoo = true
}
@@ -0,0 +1,10 @@
{
"fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"],
"type": "MARKED_ELEMENT",
"mainFile": "a/spring-config.xml",
"springFileSet": ["a/spring-config.xml"],
"newName": "isFooNew",
"byRef": "true",
"injected": "true",
"withRuntime": "true"
}
@@ -0,0 +1,9 @@
package a;
public class J {
static void test() {
KotlinSpringBean bean = new KotlinSpringBean(1);
bean.getFooNew();
bean.setFooNew(2);
}
}
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="a.KotlinSpringBean" name="xmlKotlinBean">
<constructor-arg name="fooNew" value="1"/>
</bean>
<bean class="a.KotlinSpringBean" name="xmlKotlinBean2">
<constructor-arg name="fooNew" value="2"/>
<property name="fooNew" value="#{xmlKotlinBean.fooNew}" />
</bean>
</beans>
@@ -0,0 +1,9 @@
package a
class KotlinSpringBean(var fooNew: Int)
fun test() {
val bean = KotlinSpringBean(1)
bean.fooNew
bean.fooNew = 2
}
@@ -0,0 +1,9 @@
package a;
public class J {
static void test() {
KotlinSpringBean bean = new KotlinSpringBean(1);
bean.getFoo();
bean.setFoo(2);
}
}
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="a.KotlinSpringBean" name="xmlKotlinBean">
<constructor-arg name="foo" value="1"/>
</bean>
<bean class="a.KotlinSpringBean" name="xmlKotlinBean2">
<constructor-arg name="foo" value="2"/>
<property name="foo" value="#{xmlKotlinBean./*rename*/foo}" />
</bean>
</beans>
@@ -0,0 +1,9 @@
package a
class KotlinSpringBean(var foo: Int)
fun test() {
val bean = KotlinSpringBean(1)
bean.foo
bean.foo = 2
}
@@ -0,0 +1,10 @@
{
"fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"],
"type": "MARKED_ELEMENT",
"mainFile": "a/spring-config.xml",
"springFileSet": ["a/spring-config.xml"],
"newName": "fooNew",
"byRef": "true",
"injected": "true",
"withRuntime": "true"
}
@@ -0,0 +1,9 @@
package a;
public class J {
static void test() {
KotlinSpringBean bean = new KotlinSpringBean(1);
bean.getFooNew();
bean.setFooNew(2);
}
}
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="a.KotlinSpringBean" name="xmlKotlinBean">
<constructor-arg name="value" value="1"/>
</bean>
<bean class="a.KotlinSpringBean" name="xmlKotlinBean2">
<constructor-arg name="value" value="2"/>
<property name="fooNew" value="#{xmlKotlinBean.fooNew}" />
</bean>
</beans>
@@ -0,0 +1,11 @@
package a
class KotlinSpringBean(value: Int) {
var fooNew: Int = 0
}
fun test() {
val bean = KotlinSpringBean(1)
bean.fooNew
bean.fooNew = 2
}
@@ -0,0 +1,9 @@
package a;
public class J {
static void test() {
KotlinSpringBean bean = new KotlinSpringBean(1);
bean.getFoo();
bean.setFoo(2);
}
}
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<bean class="a.KotlinSpringBean" name="xmlKotlinBean">
<constructor-arg name="value" value="1"/>
</bean>
<bean class="a.KotlinSpringBean" name="xmlKotlinBean2">
<constructor-arg name="value" value="2"/>
<property name="foo" value="#{xmlKotlinBean./*rename*/foo}" />
</bean>
</beans>
@@ -0,0 +1,11 @@
package a
class KotlinSpringBean(value: Int) {
var foo: Int = 0
}
fun test() {
val bean = KotlinSpringBean(1)
bean.foo
bean.foo = 2
}
@@ -0,0 +1,10 @@
{
"fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"],
"type": "MARKED_ELEMENT",
"mainFile": "a/spring-config.xml",
"springFileSet": ["a/spring-config.xml"],
"newName": "fooNew",
"byRef": "true",
"injected": "true",
"withRuntime": "true"
}