Skip to content

Commit 6df189c

Browse files
Fix: review comments
1 parent 624756b commit 6df189c

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/model/constructor/tree/CgVariableConstructor.kt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,17 +227,20 @@ internal class CgVariableConstructor(val context: CgContext) :
227227
) {
228228
val executable = executableCall.executable
229229
val params = executableCall.params
230-
val cgCall = createCgExecutableCallFromUtExecutableCall(executableCall)
231230

232231
val type = when (executable) {
233232
is MethodId -> executable.returnType
234233
is ConstructorId -> executable.classId
235234
}
236235
// Don't use redundant constructors for primitives and String
237-
val initExpr = if (isPrimitiveWrapperOrString(type)) cgLiteralForWrapper(params) else cgCall
238-
newVar(type, model, baseName) { initExpr }
239-
.takeIf { executableCall == model.instantiationCall }
240-
?.also { valueByModelId[model.id] = it }
236+
val initExpr = if (isPrimitiveWrapperOrString(type)) {
237+
cgLiteralForWrapper(params)
238+
} else {
239+
createCgExecutableCallFromUtExecutableCall(executableCall)
240+
}
241+
newVar(type, model, baseName) {
242+
initExpr
243+
}.also { valueByModelId[model.id] = it }
241244
}
242245

243246

utbot-fuzzers/src/main/kotlin/org/utbot/fuzzer/objects/AssembleModelUtils.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import org.utbot.fuzzer.hex
1010

1111

1212
fun ModelProvider.assembleModel(id: Int, constructorId: ConstructorId, params: List<FuzzedValue>): FuzzedValue {
13-
mutableListOf<UtStatementModel>()
1413
return UtAssembleModel(
1514
id,
1615
constructorId.classId,

0 commit comments

Comments
 (0)