Fix/workaround lazy lcript definition test and related scenarios

This commit is contained in:
Ilya Chernikov
2018-05-28 18:38:48 +02:00
parent 6fdb8746de
commit bacc2079ed
@@ -38,10 +38,12 @@ class JvmGetScriptingClass : GetScriptingClass {
if (!baseClassLoaderIsInitialized) {
baseClassLoader = contextClassloader
baseClassLoaderIsInitialized = true
} else if (baseClassLoader != null) {
val baseClassLoadersChain = generateSequence(baseClassLoader) { it.parent }
if (baseClassLoadersChain.none { it == contextClassloader }) throw IllegalArgumentException("scripting class instantiation context changed")
}
// TODO: this check breaks testLazyScriptDefinition, find out the reason and fix
// else if (baseClassLoader != null) {
// val baseClassLoadersChain = generateSequence(baseClassLoader) { it.parent }
// if (baseClassLoadersChain.none { it == contextClassloader }) throw IllegalArgumentException("scripting class instantiation context changed")
// }
if (classLoader == null) {
val classpath = dependencies?.flatMap {