diff --git a/utbot-framework/src/main/kotlin/org/utbot/engine/CollectionWrappers.kt b/utbot-framework/src/main/kotlin/org/utbot/engine/CollectionWrappers.kt index 602051458a..3aa0dff24d 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/engine/CollectionWrappers.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/engine/CollectionWrappers.kt @@ -10,6 +10,7 @@ import org.utbot.engine.overrides.collections.UtHashSet import org.utbot.engine.overrides.collections.UtLinkedList import org.utbot.engine.pc.UtAddrExpression import org.utbot.engine.pc.UtExpression +import org.utbot.engine.pc.UtFalse import org.utbot.engine.pc.select import org.utbot.engine.symbolic.asHardConstraint import org.utbot.engine.z3.intValue @@ -84,10 +85,15 @@ abstract class BaseOverriddenWrapper(protected val overriddenClassName: String) val overriddenMethod = overriddenClass.findMethodOrNull(method.subSignature) - val jimpleBody = overriddenMethod?.jimpleBody() ?: method.jimpleBody() - val graphResult = GraphResult(jimpleBody.graph()) - - return listOf(graphResult) + if (overriddenMethod == null) { + // No overridden method has been found, switch to concrete execution + pathLogger.warn("Method ${overriddenClass.name}::${method.subSignature} not found, executing concretely") + return emptyList() + } else { + val jimpleBody = overriddenMethod.jimpleBody() + val graphResult = GraphResult(jimpleBody.graph()) + return listOf(graphResult) + } } } diff --git a/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt b/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt index 02c793d8f4..3b1ea942dd 100644 --- a/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt +++ b/utbot-framework/src/main/kotlin/org/utbot/engine/UtBotSymbolicEngine.kt @@ -3079,6 +3079,11 @@ class UtBotSymbolicEngine( instanceAsWrapperOrNull?.run { val results = invoke(instance as ObjectValue, invocation.method, invocation.parameters) + if (results.isEmpty()) { + // Drop the branch and switch to concrete execution + statesForConcreteExecution += environment.state + queuedSymbolicStateUpdates += UtFalse.asHardConstraint() + } return OverrideResult(success = true, results) }