Skip to content

Commit 44f0c2a

Browse files
committed
Correct applyCommonMappings methods
1 parent 7779a3b commit 44f0c2a

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

utbot-usvm/src/main/kotlin/org/utbot/usvm/converter/JcToUtExecutionConverter.kt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -359,17 +359,22 @@ class JcToUtExecutionConverter(
359359
constructConstArrayModelMapper(),
360360
)
361361
private fun UtExecution.applyCommonMappings(): UtExecution {
362-
commonMappers.forEach { mapper -> this.mapModels(mapper) }
363-
return this
362+
var mappedExecution = this
363+
commonMappers.forEach { mapper -> mappedExecution = mappedExecution.mapModels(mapper) }
364+
return mappedExecution
364365
}
365366

366367
private fun EnvironmentModels.applyCommonMappings(): EnvironmentModels {
367-
commonMappers.forEach { this.mapModels(it) }
368-
return this
368+
var mappedEnvironmentalModels = this
369+
commonMappers.forEach { mapper -> mappedEnvironmentalModels = mappedEnvironmentalModels.mapModels(mapper) }
370+
return mappedEnvironmentalModels
369371
}
370372

371373
private fun List<UtInstrumentation>.applyCommonMappings(): List<UtInstrumentation> {
372-
commonMappers.forEach { mapper -> this.map { instr -> instr.mapModels(mapper) } }
373-
return this
374+
var mappedInstrumentation = this
375+
commonMappers.forEach {
376+
mapper -> mappedInstrumentation = mappedInstrumentation.map { instr -> instr.mapModels(mapper) }
377+
}
378+
return mappedInstrumentation
374379
}
375380
}

0 commit comments

Comments
 (0)