Spring Support: Fixed computation of values in Java annotations referred by Kotlin annotation entries

#KT-11702 Fixed
This commit is contained in:
Alexey Sedunov
2016-04-04 13:06:04 +03:00
parent a818d4714e
commit eeac739f69
11 changed files with 122 additions and 19 deletions
@@ -0,0 +1,24 @@
// NUMBER: 1
// EXIST: { lookupString:"buildBar" }
package a
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.AnnotationConfigApplicationContext
class FooBean
class BarBean
@Configuration
open class KotlinAnnotated {
@Bean(name=arrayOf("annFooBean")) open fun buildFoo(): FooBean = FooBean()
@Bean open fun buildBar(): BarBean = BarBean()
}
class Test {
fun test() {
val context = AnnotationConfigApplicationContext("a");
context.getBean("build<caret>")
}
}
@@ -0,0 +1,25 @@
// NUMBER: 2
// EXIST: { lookupString:"annFooBean" }
// EXIST: { lookupString:"kotlinAnnotated" }
package a
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.AnnotationConfigApplicationContext
class FooBean
class BarBean
@Configuration
open class KotlinAnnotated {
@Bean(name=arrayOf("annFooBean")) open fun buildFoo(): FooBean = FooBean()
@Bean open fun buildBar(): BarBean = BarBean()
}
class Test {
fun test() {
val context = AnnotationConfigApplicationContext("a");
context.getBean("ann<caret>")
}
}
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="fooBean" class="java.lang.String"/>
<bean id="fooBean2" class="java.lang.String"/>
<bean id="barBean" class="java.lang.String"/>
<bean id="scopedBean" class="test.ScopedBean"/>
</beans>