Skip to content

Commit 49b9a34

Browse files
committed
Fix compilation
1 parent 978c5d0 commit 49b9a34

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/services/language/CgLanguageAssistant.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.utbot.framework.codegen.services.language
22

3+
import org.utbot.framework.codegen.domain.ProjectType
34
import org.utbot.framework.codegen.domain.context.TestClassContext
45
import org.utbot.framework.codegen.domain.context.CgContext
56
import org.utbot.framework.codegen.renderer.CgPrinter
@@ -45,8 +46,12 @@ abstract class CgLanguageAssistant {
4546
open fun getCallableAccessManagerBy(context: CgContext): CgCallableAccessManager =
4647
CgCallableAccessManagerImpl(context)
4748
open fun getStatementConstructorBy(context: CgContext): CgStatementConstructor = CgStatementConstructorImpl(context)
48-
open fun getVariableConstructorBy(context: CgContext): CgVariableConstructor =
49-
if (context.isSpringClass) CgSpringVariableConstructor(context) else CgVariableConstructor(context)
49+
50+
open fun getVariableConstructorBy(context: CgContext): CgVariableConstructor = when (context.projectType) {
51+
ProjectType.Spring -> CgSpringVariableConstructor(context)
52+
else -> CgVariableConstructor(context)
53+
}
54+
5055
open fun getMethodConstructorBy(context: CgContext): CgMethodConstructor = CgMethodConstructor(context)
5156
open fun getCgFieldStateManager(context: CgContext): CgFieldStateManager = CgFieldStateManagerImpl(context)
5257

0 commit comments

Comments
 (0)