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
61
61
import org.utbot.framework.plugin.api.TypeReplacementMode.*
62
62
import org.utbot.framework.plugin.api.util.SpringModelUtils
63
63
import org.utbot.framework.plugin.api.util.allDeclaredFieldIds
64
+ import org.utbot.framework.plugin.api.util.allSuperTypes
64
65
import org.utbot.framework.plugin.api.util.fieldId
65
66
import org.utbot.framework.plugin.api.util.isSubtypeOf
66
67
import org.utbot.framework.plugin.api.util.utContext
@@ -1492,6 +1493,10 @@ class SpringApplicationContext(
1492
1493
return springInjectedClassesStorage
1493
1494
}
1494
1495
1496
+ private val allInjectedTypes: Set <ClassId > by lazy {
1497
+ springInjectedClasses.flatMap { it.allSuperTypes() }.toSet()
1498
+ }
1499
+
1495
1500
// This is a service field to model the lazy behavior of [springInjectedClasses].
1496
1501
// Do not call it outside the getter.
1497
1502
//
@@ -1525,7 +1530,7 @@ class SpringApplicationContext(
1525
1530
override fun speculativelyCannotProduceNullPointerException (
1526
1531
field : SootField ,
1527
1532
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
1529
1534
1530
1535
override fun preventsFurtherTestGeneration (): Boolean =
1531
1536
super .preventsFurtherTestGeneration() || springContextLoadingResult?.contextLoaded == false
You can’t perform that action at this time.
0 commit comments