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 @@ -2347,14 +2347,12 @@ class Traverser(
2347
2347
// better than engine.
2348
2348
val types = instanceOfConstraint?.typeStorage?.possibleConcreteTypes ? : instance.possibleConcreteTypes
2349
2349
2350
- val allConcreteInvocationTargets = findMethodInvocationTargets(types, methodSubSignature)
2351
- val libraryTargets = findLibraryTargets(instance.type, methodSubSignature)
2352
-
2353
- // to choose only "good" targets take only library targets in case they present in all targets,
2354
- // otherwise take all targets
2355
- val methodInvocationTargets = libraryTargets?.takeIf {
2356
- allConcreteInvocationTargets.containsAll(it)
2357
- } ? : allConcreteInvocationTargets
2350
+ val allPossibleConcreteTypes = typeRegistry.findInheritorsIncludingTypes(instance.type) { setOf (instance.type) }
2351
+
2352
+ val methodInvocationTargets = findLibraryTargets(instance.type, methodSubSignature)?.takeIf {
2353
+ // we have no specified types, so we can take only library targets (if present) for optimization purposes
2354
+ types.size == allPossibleConcreteTypes.size
2355
+ } ? : findMethodInvocationTargets(types, methodSubSignature)
2358
2356
2359
2357
return methodInvocationTargets
2360
2358
.map { (method, implementationClass, possibleTypes) ->
You can’t perform that action at this time.
0 commit comments