@@ -9,8 +9,8 @@ import org.utbot.framework.codegen.domain.builtin.getMethodId
9
9
import org.utbot.framework.codegen.domain.builtin.getTargetException
10
10
import org.utbot.framework.codegen.domain.builtin.invoke
11
11
import org.utbot.framework.codegen.domain.builtin.newInstance
12
+ import org.utbot.framework.codegen.domain.builtin.genericObjectClassId
12
13
import org.utbot.framework.codegen.domain.builtin.setAccessible
13
- import org.utbot.framework.codegen.domain.builtin.stubberClassId
14
14
import org.utbot.framework.codegen.domain.context.CgContext
15
15
import org.utbot.framework.codegen.domain.context.CgContextOwner
16
16
import org.utbot.framework.codegen.domain.models.CgAllocateArray
@@ -191,24 +191,24 @@ internal class CgCallableAccessManagerImpl(val context: CgContext) : CgCallableA
191
191
192
192
private infix fun CgExpression.canBeReceiverOf (executable : MethodId ): Boolean =
193
193
when {
194
- // method of the current test class can be called on its 'this' instance
194
+ // this executable can be called on its 'this' instance
195
195
currentTestClass == executable.classId && this isThisInstanceOf currentTestClass -> true
196
196
197
- // method of the current test class can be called on an object of this class or any of its subtypes
197
+ // this executable can be called on an object of this class or any of its subtypes
198
198
this .type isSubtypeOf executable.classId -> true
199
199
200
- // method of the current test class can be called on builtin type
201
- this .type in builtinCallersWithoutReflection -> true
200
+ // this executable can be called on builtin type
201
+ this .type is BuiltinClassId && this .type in builtinCallersWithoutReflection -> true
202
202
203
203
else -> false
204
204
}
205
205
206
- // Fore some builtin types do not having [ClassId] we need to clarify
207
- // that it is allowed to call their methods without reflection.
206
+ // For some builtin types we need to clarify
207
+ // that it is allowed to call an executable without reflection.
208
208
//
209
209
// This approach is used, for example, to render the constructions with stubs
210
210
// like `doNothing().when(entityManagerMock).persist(any())`.
211
- private val builtinCallersWithoutReflection = setOf< ClassId >(stubberClassId )
211
+ private val builtinCallersWithoutReflection = setOf (genericObjectClassId )
212
212
213
213
/* *
214
214
* For Kotlin extension functions, real caller is one of the arguments in JVM method (and declaration class is omitted),
0 commit comments