From a5faad040608feaf9f80c9e8649c00e622a4cbdd Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Sat, 21 Jan 2017 15:11:47 +0300 Subject: [PATCH] New test runners: ReflectionUtil delegation property bug fixed --- python/src/com/jetbrains/reflection/ReflectionUtils.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/src/com/jetbrains/reflection/ReflectionUtils.kt b/python/src/com/jetbrains/reflection/ReflectionUtils.kt index 4ef38fef1247..2500de401c24 100644 --- a/python/src/com/jetbrains/reflection/ReflectionUtils.kt +++ b/python/src/com/jetbrains/reflection/ReflectionUtils.kt @@ -118,11 +118,11 @@ fun getProperties(instance: Any, annotationToFilterByClass: Class<*>? = null, us val klass = instance.javaClass.kotlin val allKotlinProperties = LinkedHashSet(klass.memberProperties.filterIsInstance(KProperty::class.java)) - var delegatedProperties = listOf() // See DelegationProperty doc + val delegatedProperties = ArrayList() // See DelegationProperty doc allKotlinProperties.filter { it.isAnnotated(DelegationProperty::class) }.forEach { val delegatedInstance = it.getter.call(instance) if (delegatedInstance != null) { - delegatedProperties = getProperties(delegatedInstance, annotationToFilterBy?.java, false).properties + delegatedProperties.addAll(getProperties(delegatedInstance, annotationToFilterBy?.java, false).properties) allKotlinProperties.remove(it) } }