Skip to content

Commit beef34f

Browse files
committed
Improve adding of ReplacedFuzzedTypeFlag
1 parent cce1616 commit beef34f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

utbot-spring-framework/src/main/kotlin/org/utbot/framework/context/spring/SpringApplicationContextImpl.kt

+5-3
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,12 @@ class SpringApplicationContextImpl(
8989
.withFallback(origValueProvider)
9090
.replaceTypes { description, type ->
9191
typeReplacer.replaceTypeIfNeeded(type.classId)
92-
?.takeIf { it != type.classId }
93-
?.let { replacement ->
92+
?.let { replacementClassId ->
9493
// TODO infer generic type of replacement
95-
toFuzzerType(replacement.jClass, description.typeCache).addProperties(
94+
val replacement =
95+
if (type.classId == replacementClassId) type
96+
else toFuzzerType(replacementClassId.jClass, description.typeCache)
97+
replacement.addProperties(
9698
dynamicPropertiesOf(ReplacedFuzzedTypeFlag.withValue(Unit))
9799
)
98100
} ?: type

0 commit comments

Comments
 (0)