File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ import org.utbot.framework.isFromTrustedLibrary
6161import org.utbot.framework.plugin.api.TypeReplacementMode.*
6262import org.utbot.framework.plugin.api.util.SpringModelUtils
6363import org.utbot.framework.plugin.api.util.allDeclaredFieldIds
64+ import org.utbot.framework.plugin.api.util.allSuperTypes
6465import org.utbot.framework.plugin.api.util.fieldId
6566import org.utbot.framework.plugin.api.util.isSubtypeOf
6667import org.utbot.framework.plugin.api.util.utContext
@@ -1492,6 +1493,10 @@ class SpringApplicationContext(
14921493 return springInjectedClassesStorage
14931494 }
14941495
1496+ private val allInjectedTypes: Set <ClassId > by lazy {
1497+ springInjectedClasses.flatMap { it.allSuperTypes() }.toSet()
1498+ }
1499+
14951500 // This is a service field to model the lazy behavior of [springInjectedClasses].
14961501 // Do not call it outside the getter.
14971502 //
@@ -1525,7 +1530,7 @@ class SpringApplicationContext(
15251530 override fun speculativelyCannotProduceNullPointerException (
15261531 field : SootField ,
15271532 classUnderTest : ClassId ,
1528- ): Boolean = field.fieldId in classUnderTest.allDeclaredFieldIds && field.declaringClass.id !in springInjectedClasses
1533+ ): Boolean = field.fieldId in classUnderTest.allDeclaredFieldIds && field.type.classId !in allInjectedTypes
15291534
15301535 override fun preventsFurtherTestGeneration (): Boolean =
15311536 super .preventsFurtherTestGeneration() || springContextLoadingResult?.contextLoaded == false
You can’t perform that action at this time.
0 commit comments