File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
utbot-framework/src/main/kotlin/org/utbot/engine Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -2345,14 +2345,12 @@ class Traverser(
23452345 // better than engine.
23462346 val types = instanceOfConstraint?.typeStorage?.possibleConcreteTypes ? : instance.possibleConcreteTypes
23472347
2348- val allConcreteInvocationTargets = findMethodInvocationTargets(types, methodSubSignature)
2349- val libraryTargets = findLibraryTargets(instance.type, methodSubSignature)
2350-
2351- // to choose only "good" targets take only library targets in case they present in all targets,
2352- // otherwise take all targets
2353- val methodInvocationTargets = libraryTargets?.takeIf {
2354- allConcreteInvocationTargets.containsAll(it)
2355- } ? : allConcreteInvocationTargets
2348+ val allPossibleConcreteTypes = typeRegistry.findInheritorsIncludingTypes(instance.type) { setOf (instance.type) }
2349+
2350+ val methodInvocationTargets = findLibraryTargets(instance.type, methodSubSignature)?.takeIf {
2351+ // we have no specified types, so we can take only library targets (if present) for optimization purposes
2352+ types.size == allPossibleConcreteTypes.size
2353+ } ? : findMethodInvocationTargets(types, methodSubSignature)
23562354
23572355 return methodInvocationTargets
23582356 .map { (method, implementationClass, possibleTypes) ->
You can’t perform that action at this time.
0 commit comments