Skip to content

Commit ebe8669

Browse files
committed
Construct objects with full privileges
1 parent d456378 commit ebe8669

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

utbot-framework/src/main/kotlin/org/utbot/framework/concrete/UtModelConstructor.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ import org.utbot.framework.plugin.api.util.objectClassId
3030
import org.utbot.framework.plugin.api.util.shortClassId
3131
import org.utbot.framework.util.valueToClassId
3232
import java.lang.reflect.Modifier
33+
import java.security.AccessController
34+
import java.security.PrivilegedAction
3335
import java.util.IdentityHashMap
3436

3537
/**
@@ -81,7 +83,7 @@ internal class UtModelConstructor(
8183
*
8284
* Handles cache on stateBefore values.
8385
*/
84-
override fun construct(value: Any?, classId: ClassId): UtModel =
86+
override fun construct(value: Any?, classId: ClassId): UtModel = AccessController.doPrivileged(PrivilegedAction {
8587
when (value) {
8688
null -> UtNullModel(classId)
8789
is Unit -> UtVoidModel
@@ -106,6 +108,7 @@ internal class UtModelConstructor(
106108
is Class<*> -> constructFromClass(value)
107109
else -> constructFromAny(value)
108110
}
111+
})
109112

110113
// Q: Is there a way to get rid of duplicated code?
111114

0 commit comments

Comments
 (0)