@@ -50,7 +50,6 @@ import org.utbot.framework.plugin.api.ClassId
50
50
import org.utbot.framework.plugin.api.ExecutableId
51
51
import org.utbot.framework.plugin.api.UtModel
52
52
import org.utbot.framework.plugin.api.util.executable
53
- import org.utbot.framework.plugin.api.util.id
54
53
import org.utbot.framework.plugin.api.util.isArray
55
54
import org.utbot.framework.plugin.api.util.isNotSubtypeOf
56
55
import org.utbot.framework.plugin.api.util.isSubtypeOf
@@ -67,7 +66,10 @@ import org.utbot.framework.plugin.api.ConstructorId
67
66
import org.utbot.framework.plugin.api.FieldId
68
67
import org.utbot.framework.plugin.api.MethodId
69
68
import org.utbot.framework.plugin.api.util.classClassId
69
+ import org.utbot.framework.plugin.api.util.constructorClassId
70
+ import org.utbot.framework.plugin.api.util.fieldClassId
70
71
import org.utbot.framework.plugin.api.util.isPrimitive
72
+ import org.utbot.framework.plugin.api.util.methodClassId
71
73
import java.lang.reflect.Constructor
72
74
import java.lang.reflect.Method
73
75
import kotlin.reflect.KFunction
@@ -306,15 +308,15 @@ internal class CgStatementConstructorImpl(context: CgContext) :
306
308
}
307
309
308
310
override fun createFieldVariable (fieldId : FieldId ): CgVariable {
309
- val declaringClass = newVar(Class :: class .id ) { Class :: class .id [forName](fieldId.declaringClass.name) }
311
+ val declaringClass = newVar(classClassId ) { classClassId [forName](fieldId.declaringClass.name) }
310
312
val name = fieldId.name + " Field"
311
- return newVar(java.lang.reflect. Field :: class .id , name) {
313
+ return newVar(fieldClassId , name) {
312
314
declaringClass[getDeclaredField](fieldId.name)
313
315
}
314
316
}
315
317
316
318
override fun createExecutableVariable (executableId : ExecutableId , arguments : List <CgExpression >): CgVariable {
317
- val declaringClass = newVar(Class :: class .id ) { Class :: class .id [forName](executableId.classId.name) }
319
+ val declaringClass = newVar(classClassId ) { classClassId [forName](executableId.classId.name) }
318
320
val argTypes = (arguments zip executableId.parameters).map { (argument, parameterType) ->
319
321
val baseName = when (argument) {
320
322
is CgVariable -> " ${argument.name} Type"
@@ -324,21 +326,21 @@ internal class CgStatementConstructorImpl(context: CgContext) :
324
326
if (parameterType.isPrimitive) {
325
327
CgGetJavaClass (parameterType)
326
328
} else {
327
- Class :: class .id [forName](parameterType.name)
329
+ classClassId [forName](parameterType.name)
328
330
}
329
331
}
330
332
}
331
333
332
334
return when (executableId) {
333
335
is MethodId -> {
334
336
val name = executableId.name + " Method"
335
- newVar(java.lang.reflect. Method :: class .id , name) {
337
+ newVar(methodClassId , name) {
336
338
declaringClass[getDeclaredMethod](executableId.name, * argTypes.toTypedArray())
337
339
}
338
340
}
339
341
is ConstructorId -> {
340
342
val name = executableId.classId.prettifiedName.decapitalize() + " Constructor"
341
- newVar(java.lang.reflect. Constructor :: class .id , name) {
343
+ newVar(constructorClassId , name) {
342
344
declaringClass[getDeclaredConstructor](* argTypes.toTypedArray())
343
345
}
344
346
}
@@ -467,9 +469,9 @@ internal class CgStatementConstructorImpl(context: CgContext) :
467
469
// utils
468
470
469
471
private fun classRefOrNull (type : ClassId , expr : CgExpression ): ClassId ? {
470
- if (type == Class :: class .id && expr is CgGetClass ) return expr.classId
472
+ if (type == classClassId && expr is CgGetClass ) return expr.classId
471
473
472
- if (type == Class :: class .id && expr is CgExecutableCall && expr.executableId == forName) {
474
+ if (type == classClassId && expr is CgExecutableCall && expr.executableId == forName) {
473
475
val name = (expr.arguments.getOrNull(0 ) as ? CgLiteral )?.value as ? String
474
476
475
477
if (name != null ) {
@@ -487,7 +489,7 @@ internal class CgStatementConstructorImpl(context: CgContext) :
487
489
ExpressionWithType (enumClass, access)
488
490
} else {
489
491
val enumClassVariable = newVar(classCgClassId) {
490
- Class :: class .id [forName](enumClass.name)
492
+ classClassId [forName](enumClass.name)
491
493
}
492
494
493
495
ExpressionWithType (objectClassId, utilsClassId[getEnumConstantByName](enumClassVariable, constant))
0 commit comments