@@ -88,6 +88,7 @@ import org.utbot.engine.symbolic.asUpdate
88
88
import org.utbot.engine.simplificators.MemoryUpdateSimplificator
89
89
import org.utbot.engine.simplificators.simplifySymbolicStateUpdate
90
90
import org.utbot.engine.simplificators.simplifySymbolicValue
91
+ import org.utbot.engine.types.CLASS_REF_SOOT_CLASS
91
92
import org.utbot.engine.types.CLASS_REF_TYPE
92
93
import org.utbot.engine.types.ENUM_ORDINAL
93
94
import org.utbot.engine.types.EQUALS_SIGNATURE
@@ -423,8 +424,11 @@ class Traverser(
423
424
private fun TraversalContext.pushInitGraphAfterNewInstanceReflectionCall (stmt : JAssignStmt ): Boolean {
424
425
// Check whether the previous stmt was a `newInstance` invocation
425
426
val lastStmt = environment.state.path.lastOrNull() as ? JAssignStmt ? : return false
426
- val lastStmtRight = lastStmt.rightOp as ? JVirtualInvokeExpr ? : return false
427
- val lastMethodInvocation = lastStmtRight.retrieveMethod()
427
+ if (! lastStmt.containsInvokeExpr()) {
428
+ return false
429
+ }
430
+
431
+ val lastMethodInvocation = lastStmt.invokeExpr.method
428
432
if (lastMethodInvocation.subSignature != NEW_INSTANCE_SIGNATURE ) {
429
433
return false
430
434
}
@@ -2963,8 +2967,9 @@ class Traverser(
2963
2967
}
2964
2968
}
2965
2969
2966
- // Return an unbounded symbolic variable for any `forName` overloading
2967
- if (instance == null && invocation.method.name == " forName" ) {
2970
+ // Return an unbounded symbolic variable for any overloading of method `forName` of class `java.lang.Class`
2971
+ // NOTE: we cannot match by a subsignature here since `forName` method has a few overloadings
2972
+ if (instance == null && invocation.method.declaringClass == CLASS_REF_SOOT_CLASS && invocation.method.name == " forName" ) {
2968
2973
val forNameResult = unboundedVariable(name = " classForName" , invocation.method)
2969
2974
2970
2975
return OverrideResult (success = true , forNameResult)
0 commit comments