Skip to content

Commit 124384f

Browse files
authored
Make SpringTypeReplacer actually call its delegate (#2465)
1 parent c21a916 commit 124384f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

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

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@ class SpringTypeReplacer(
1313
private val springApplicationContext: SpringApplicationContext
1414
) : TypeReplacer {
1515
override val typeReplacementMode: TypeReplacementMode =
16-
// TODO add ` || delegateTypeReplacer.typeReplacementMode == TypeReplacementMode.KnownImplementor`
17-
// (TODO is added as a part of only equivalent transformations refactoring PR and should be completed in the follow up PR)
18-
if (springApplicationContext.beanDefinitions.isNotEmpty()) TypeReplacementMode.KnownImplementor
19-
else TypeReplacementMode.NoImplementors
16+
if (springApplicationContext.beanDefinitions.isNotEmpty() ||
17+
delegateTypeReplacer.typeReplacementMode == TypeReplacementMode.KnownImplementor)
18+
TypeReplacementMode.KnownImplementor
19+
else
20+
TypeReplacementMode.NoImplementors
2021

2122
override fun replaceTypeIfNeeded(type: RefType): ClassId? =
22-
// TODO add `delegateTypeReplacer.replaceTypeIfNeeded(type) ?: `
23-
// (TODO is added as a part of only equivalent transformations refactoring PR and should be completed in the follow up PR)
2423
if (type.isAbstractType) springApplicationContext.injectedTypes.singleOrNull { it.isSubtypeOf(type.id) }
25-
else null
24+
else delegateTypeReplacer.replaceTypeIfNeeded(type)
2625
}

0 commit comments

Comments
 (0)