Skip to content

Commit d390c58

Browse files
Fix: review comments
1 parent e414253 commit d390c58

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

utbot-framework-test/src/main/java/org/utbot/examples/strings/StringConcat.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
public class StringConcat {
7-
static class Test {
7+
public static class Test {
88
public int x;
99

1010
@Override

utbot-framework/src/main/kotlin/org/utbot/engine/ConstructedSootMethods.kt

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -223,17 +223,15 @@ fun makeSootConcat(declaringClass: SootClass, recipe: String, paramTypes: List<T
223223
var constantPointer = 0 // pointer to constant list
224224
var delayedString = "" // string which is build of sequent values from [constants]
225225

226+
val appendStringSootMethod = sbSootClass.getMethod("append", listOf(STRING_TYPE), sbSootClass.type)
227+
226228
// helper function for appending constants to delayedString
227229
fun appendDelayedStringIfNotEmpty() {
228230
if (delayedString.isEmpty()) {
229231
return
230232
}
231233

232-
val type = STRING_TYPE
233-
234-
val appendSootMethod = sbSootClass.getMethod("append", listOf(type), sbSootClass.type)
235-
236-
val invokeStringBuilderAppendStmt = appendSootMethod.toVirtualInvokeExpr(sb, StringConstant.v(delayedString))
234+
val invokeStringBuilderAppendStmt = appendStringSootMethod.toVirtualInvokeExpr(sb, StringConstant.v(delayedString))
237235
units += invokeStringBuilderAppendStmt.toInvokeStmt()
238236

239237
delayedString = ""
@@ -258,11 +256,8 @@ fun makeSootConcat(declaringClass: SootClass, recipe: String, paramTypes: List<T
258256
appendDelayedStringIfNotEmpty()
259257

260258
val const = constants[constantPointer++]
261-
val type = STRING_TYPE
262-
263-
val appendSootMethod = sbSootClass.getMethod("append", listOf(type), sbSootClass.type)
264259

265-
val stringBuilderAppendExpr = appendSootMethod.toVirtualInvokeExpr(sb, StringConstant.v(const))
260+
val stringBuilderAppendExpr = appendStringSootMethod.toVirtualInvokeExpr(sb, StringConstant.v(const))
266261
units += stringBuilderAppendExpr.toInvokeStmt()
267262
}
268263
else -> {

utbot-framework/src/main/kotlin/org/utbot/engine/DynamicInvokeResolver.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ object StringMakeConcatResolver : DynamicInvokeResolver {
100100
)
101101

102102
val invocationTarget = InvocationTarget(
103-
null,
103+
instance = null,
104104
sootMethod
105105
)
106106

107107
return Invocation(
108-
null,
108+
instance = null,
109109
sootMethod,
110110
parameters,
111111
invocationTarget

utbot-framework/src/main/kotlin/org/utbot/engine/JimpleCreation.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fun createSootMethod(
7474
declaringClass: SootClass,
7575
graphBody: JimpleBody,
7676
isStatic: Boolean = true
77-
) = SootMethod(name, argsTypes, returnType, (if (isStatic) Modifier.STATIC else 0))
77+
) = SootMethod(name, argsTypes, returnType, if (isStatic) Modifier.STATIC else 0)
7878
.also {
7979
declaringClass.addMethod(it)
8080
it.activeBody = graphBody

0 commit comments

Comments
 (0)