Spring Support: Fix renaming of Spring bean declarations via SpEL references

#KT-11720 Fixed
 #KT-11725 Fixed
This commit is contained in:
Alexey Sedunov
2016-04-04 21:20:59 +03:00
parent 5203f62655
commit afecb09b6f
66 changed files with 715 additions and 11 deletions
@@ -0,0 +1,11 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Bean public JavaSpringBean buildBeanJNew() { return new JavaSpringBean(3); }
@Value("#{buildBeanJNew.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,9 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
@Configuration
open class KotlinAnnotated {
@Value("#{buildBeanJNew.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,11 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Bean public JavaSpringBean buildBeanJ() { return new JavaSpringBean(3); }
@Value("#{/*rename*/buildBeanJ.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,9 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
@Configuration
open class KotlinAnnotated {
@Value("#{buildBeanJ.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,10 @@
{
"fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"],
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaAnnotated.java",
"springFileSet": ["test/JavaAnnotated.java", "test/KotlinAnnotated.kt"],
"injected": "true",
"byRef": "true",
"newName": "buildBeanJNew",
"withRuntime": "true"
}
@@ -0,0 +1,11 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Bean(name = {"annJavaBean2"}) public JavaSpringBean buildBeanJ() { return new JavaSpringBean(3); }
@Value("#{annJavaBean2.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,9 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
@Configuration
open class KotlinAnnotated {
@Value("#{annJavaBean2.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,11 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Bean(name = { "annJavaBean" }) public JavaSpringBean buildBeanJ() { return new JavaSpringBean(3); }
@Value("#{/*rename*/annJavaBean.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,9 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
@Configuration
open class KotlinAnnotated {
@Value("#{annJavaBean.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,10 @@
{
"fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"],
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaAnnotated.java",
"springFileSet": ["test/JavaAnnotated.java", "test/KotlinAnnotated.kt"],
"injected": "true",
"byRef": "true",
"newName": "annJavaBean2",
"withRuntime": "true"
}
@@ -0,0 +1,10 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Value("#{buildBeanJNew.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,13 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Bean
@Configuration
open class KotlinAnnotated {
@Bean
fun buildBeanJNew() = JavaSpringBean(3)
@Value("#{buildBeanJNew.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,10 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Value("#{/*rename*/buildBeanJ.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,13 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Bean
@Configuration
open class KotlinAnnotated {
@Bean
fun buildBeanJ() = JavaSpringBean(3)
@Value("#{buildBeanJ.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,10 @@
{
"fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"],
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaAnnotated.java",
"springFileSet": ["test/JavaAnnotated.java", "test/KotlinAnnotated.kt"],
"injected": "true",
"byRef": "true",
"newName": "buildBeanJNew",
"withRuntime": "true"
}
@@ -0,0 +1,10 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Value("#{annJavaBean2.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,13 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Bean
@Configuration
open class KotlinAnnotated {
@Bean(name = arrayOf("annJavaBean2"))
fun buildBeanJ() = JavaSpringBean(3)
@Value("#{annJavaBean2.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,10 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Value("#{/*rename*/annJavaBean.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,13 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Bean
@Configuration
open class KotlinAnnotated {
@Bean(name = arrayOf("annJavaBean"))
fun buildBeanJ() = JavaSpringBean(3)
@Value("#{annJavaBean.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,10 @@
{
"fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"],
"type": "MARKED_ELEMENT",
"mainFile": "test/JavaAnnotated.java",
"springFileSet": ["test/JavaAnnotated.java", "test/KotlinAnnotated.kt"],
"injected": "true",
"byRef": "true",
"newName": "annJavaBean2",
"withRuntime": "true"
}
@@ -0,0 +1,11 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Bean public JavaSpringBean buildBeanJNew() { return new JavaSpringBean(3); }
@Value("#{buildBeanJNew.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,9 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
@Configuration
open class KotlinAnnotated {
@Value("#{buildBeanJNew.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,11 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Bean public JavaSpringBean buildBeanJ() { return new JavaSpringBean(3); }
@Value("#{buildBeanJ.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,9 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
@Configuration
open class KotlinAnnotated {
@Value("#{/*rename*/buildBeanJ.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,10 @@
{
"fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"],
"type": "MARKED_ELEMENT",
"mainFile": "test/KotlinAnnotated.kt",
"springFileSet": ["test/JavaAnnotated.java", "test/KotlinAnnotated.kt"],
"injected": "true",
"byRef": "true",
"newName": "buildBeanJNew",
"withRuntime": "true"
}
@@ -0,0 +1,11 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Bean(name = {"annJavaBean2"}) public JavaSpringBean buildBeanJ() { return new JavaSpringBean(3); }
@Value("#{annJavaBean2.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,9 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
@Configuration
open class KotlinAnnotated {
@Value("#{annJavaBean2.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,11 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Bean(name = { "annJavaBean" }) public JavaSpringBean buildBeanJ() { return new JavaSpringBean(3); }
@Value("#{annJavaBean.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,9 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
@Configuration
open class KotlinAnnotated {
@Value("#{/*rename*/annJavaBean.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,10 @@
{
"fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"],
"type": "MARKED_ELEMENT",
"mainFile": "test/KotlinAnnotated.kt",
"springFileSet": ["test/JavaAnnotated.java", "test/KotlinAnnotated.kt"],
"injected": "true",
"byRef": "true",
"newName": "annJavaBean2",
"withRuntime": "true"
}
@@ -0,0 +1,10 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Value("#{buildBeanJNew.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,13 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Bean
@Configuration
open class KotlinAnnotated {
@Bean
fun buildBeanJNew() = JavaSpringBean(3)
@Value("#{buildBeanJNew.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,10 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Value("#{buildBeanJ.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,13 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Bean
@Configuration
open class KotlinAnnotated {
@Bean
fun buildBeanJ() = JavaSpringBean(3)
@Value("#{/*rename*/buildBeanJ.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,10 @@
{
"fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"],
"type": "MARKED_ELEMENT",
"mainFile": "test/KotlinAnnotated.kt",
"springFileSet": ["test/JavaAnnotated.java", "test/KotlinAnnotated.kt"],
"injected": "true",
"byRef": "true",
"newName": "buildBeanJNew",
"withRuntime": "true"
}
@@ -0,0 +1,10 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Value("#{annJavaBean2.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,13 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Bean
@Configuration
open class KotlinAnnotated {
@Bean(name = arrayOf("annJavaBean2"))
fun buildBeanJ() = JavaSpringBean(3)
@Value("#{annJavaBean2.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,10 @@
package test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class JavaAnnotated {
@Value("#{annJavaBean.value + 1}") private int newValue;
}
@@ -0,0 +1,6 @@
package test;
public class JavaSpringBean {
public final int value;
public JavaSpringBean(int p) { value = p; }
}
@@ -0,0 +1,13 @@
package test
import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Bean
@Configuration
open class KotlinAnnotated {
@Bean(name = arrayOf("annJavaBean"))
fun buildBeanJ() = JavaSpringBean(3)
@Value("#{/*rename*/annJavaBean.value + 1}") private var newValue: Int = 0
}
@@ -0,0 +1,10 @@
{
"fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"],
"type": "MARKED_ELEMENT",
"mainFile": "test/KotlinAnnotated.kt",
"springFileSet": ["test/JavaAnnotated.java", "test/KotlinAnnotated.kt"],
"injected": "true",
"byRef": "true",
"newName": "annJavaBean2",
"withRuntime": "true"
}