Skip to content

Commit 3f338fa

Browse files
Fix the search of SootConstructor by ConstructorId (#360)
Fix the search of SootConstructor by ConstructorId
1 parent 8f1d85c commit 3f338fa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

utbot-framework/src/main/kotlin/org/utbot/framework/modifications/ConstructorAnalyzer.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import org.utbot.framework.plugin.api.ClassId
44
import org.utbot.framework.plugin.api.ConstructorId
55
import org.utbot.framework.plugin.api.FieldId
66
import org.utbot.framework.plugin.api.id
7+
import org.utbot.framework.plugin.api.util.isArray
78
import org.utbot.framework.plugin.api.util.isRefType
9+
import org.utbot.framework.plugin.api.util.jClass
810
import soot.Scene
911
import soot.SootMethod
1012
import soot.Type
@@ -248,7 +250,11 @@ class ConstructorAnalyzer {
248250
*/
249251
private fun getParameterType(type: ClassId): Type? =
250252
try {
251-
if (type.isRefType) scene.getRefType(type.name) else scene.getType(type.name)
253+
when {
254+
type.isRefType -> scene.getRefType(type.name)
255+
type.isArray -> scene.getType(type.jClass.canonicalName)
256+
else -> scene.getType(type.name)
257+
}
252258
} catch (e: Exception) {
253259
null
254260
}

0 commit comments

Comments
 (0)