Spring Support: Fixed rename of custom-named beans specified with Kotlin annotation
#KT-12096 Fixed
This commit is contained in:
+4
@@ -0,0 +1,4 @@
|
||||
package bean;
|
||||
|
||||
public class BeanA {
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package bean;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
public class JavaRef {
|
||||
@Value("#{ nameJ }") private BeanA valueA;
|
||||
@Value("#{ nameK2 }") private BeanA valueK;
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package bean
|
||||
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
@Configuration open class KotlinConfig {
|
||||
@Bean(name = arrayOf("nameK2")) open fun createBeanK() = BeanA()
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
<?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="bean.JavaRef" name="refJ">
|
||||
<property name="p1" ref="nameJ"/>
|
||||
<property name="p2" ref="nameK2"/>
|
||||
</bean>
|
||||
</beans>
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"fixtureClasses": ["org.jetbrains.kotlin.idea.spring.tests.SpringTestFixtureExtension"],
|
||||
"type": "MARKED_ELEMENT",
|
||||
"mainFile": "bean/spring-config.xml",
|
||||
"springFileSet": ["bean/spring-config.xml", "bean/KotlinConfig.kt"],
|
||||
"newName": "nameK2",
|
||||
"byRef": "true",
|
||||
"withRuntime": "true",
|
||||
"searchInComments": "false",
|
||||
"searchInTextOccurrences": "false"
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
package bean;
|
||||
|
||||
public class BeanA {
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package bean;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
public class JavaRef {
|
||||
@Value("#{ nameJ }") private BeanA valueA;
|
||||
@Value("#{ nameK }") private BeanA valueK;
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
package bean
|
||||
|
||||
import org.springframework.context.annotation.Bean
|
||||
import org.springframework.context.annotation.Configuration
|
||||
|
||||
@Configuration open class KotlinConfig {
|
||||
@Bean(name = arrayOf("nameK")) open fun createBeanK() = BeanA()
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
<?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="bean.JavaRef" name="refJ">
|
||||
<property name="p1" ref="nameJ"/>
|
||||
<property name="p2" ref="/*rename*/nameK"/>
|
||||
</bean>
|
||||
</beans>
|
||||
Reference in New Issue
Block a user