Skip to content

Commit 1ba7d74

Browse files
committed
Improve adding of ReplacedFuzzedTypeFlag
1 parent 775db7b commit 1ba7d74

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

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

0 commit comments

Comments
 (0)