|
1 | | -package org.utbot.engine |
| 1 | +package org.utbot.framework.plugin.api.util.constructor |
2 | 2 |
|
3 | 3 | import org.utbot.common.Reflection |
4 | 4 | import org.utbot.common.invokeCatching |
| 5 | +import org.utbot.common.withAccessibility |
5 | 6 | import org.utbot.framework.plugin.api.ClassId |
6 | | -import org.utbot.engine.util.lambda.CapturedArgument |
7 | | -import org.utbot.engine.util.lambda.constructLambda |
8 | | -import org.utbot.engine.util.lambda.constructStaticLambda |
9 | 7 | import org.utbot.framework.plugin.api.ConstructorId |
10 | 8 | import org.utbot.framework.plugin.api.EnvironmentModels |
11 | 9 | import org.utbot.framework.plugin.api.FieldId |
@@ -39,15 +37,16 @@ import org.utbot.framework.plugin.api.UtValueExecution |
39 | 37 | import org.utbot.framework.plugin.api.UtValueExecutionState |
40 | 38 | import org.utbot.framework.plugin.api.UtVoidModel |
41 | 39 | import org.utbot.framework.plugin.api.isMockModel |
| 40 | +import org.utbot.framework.plugin.api.util.CapturedArgument |
| 41 | +import org.utbot.framework.plugin.api.util.anyInstance |
| 42 | +import org.utbot.framework.plugin.api.util.constructLambda |
| 43 | +import org.utbot.framework.plugin.api.util.constructStaticLambda |
42 | 44 | import org.utbot.framework.plugin.api.util.constructor |
43 | 45 | import org.utbot.framework.plugin.api.util.isStatic |
44 | | -import org.utbot.framework.plugin.api.util.jField |
45 | 46 | import org.utbot.framework.plugin.api.util.jClass |
| 47 | +import org.utbot.framework.plugin.api.util.jField |
46 | 48 | import org.utbot.framework.plugin.api.util.method |
47 | 49 | import org.utbot.framework.plugin.api.util.utContext |
48 | | -import org.utbot.framework.util.anyInstance |
49 | | -import org.utbot.instrumentation.process.runSandbox |
50 | | -import java.lang.reflect.Field |
51 | 50 | import java.lang.reflect.Modifier |
52 | 51 | import kotlin.reflect.KClass |
53 | 52 |
|
@@ -435,12 +434,12 @@ class ValueConstructor { |
435 | 434 | private fun value(model: UtModel) = construct(model, null).value |
436 | 435 |
|
437 | 436 | private fun MethodId.call(args: List<Any?>, instance: Any?): Any? = |
438 | | - method.runSandbox { |
439 | | - invokeCatching(obj = instance, args = args).getOrThrow() |
| 437 | + method.withAccessibility { |
| 438 | + method.invokeCatching(obj = instance, args = args).getOrThrow() |
440 | 439 | } |
441 | 440 |
|
442 | 441 | private fun ConstructorId.call(args: List<Any?>): Any? = |
443 | | - constructor.runSandbox { |
| 442 | + constructor.withAccessibility { |
444 | 443 | newInstance(*args.toTypedArray()) |
445 | 444 | } |
446 | 445 |
|
|
0 commit comments