diff --git a/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/CompilerEnvironment.java b/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/CompilerEnvironment.java index a2e19be1a7d..614f7c5eae8 100644 --- a/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/CompilerEnvironment.java +++ b/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/CompilerEnvironment.java @@ -17,7 +17,6 @@ package org.jetbrains.jet.compiler.runner; import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.cli.common.messages.MessageCollector; import org.jetbrains.jet.config.Services; import org.jetbrains.jet.preloading.ClassCondition; @@ -28,34 +27,25 @@ import static org.jetbrains.jet.cli.common.messages.CompilerMessageLocation.NO_L import static org.jetbrains.jet.cli.common.messages.CompilerMessageSeverity.ERROR; public final class CompilerEnvironment { - @NotNull public static CompilerEnvironment getEnvironmentFor( @NotNull KotlinPaths kotlinPaths, - @Nullable ClassLoader parentClassLoader, @NotNull ClassCondition classesToLoadByParent, @NotNull Services compilerServices ) { - return new CompilerEnvironment(kotlinPaths, parentClassLoader, classesToLoadByParent, compilerServices); + return new CompilerEnvironment(kotlinPaths, classesToLoadByParent, compilerServices); } - @NotNull private final KotlinPaths kotlinPaths; - @Nullable - private final ClassLoader parentClassLoader; - @NotNull private final ClassCondition classesToLoadByParent; - @NotNull private final Services services; private CompilerEnvironment( @NotNull KotlinPaths kotlinPaths, - @Nullable ClassLoader parentClassLoader, @NotNull ClassCondition classesToLoadByParent, @NotNull Services services ) { this.kotlinPaths = kotlinPaths; - this.parentClassLoader = parentClassLoader; this.classesToLoadByParent = classesToLoadByParent; this.services = services; } @@ -69,11 +59,6 @@ public final class CompilerEnvironment { return kotlinPaths; } - @Nullable - public ClassLoader getParentClassLoader() { - return parentClassLoader; - } - @NotNull public ClassCondition getClassesToLoadByParent() { return classesToLoadByParent; diff --git a/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/CompilerRunnerUtil.java b/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/CompilerRunnerUtil.java index 6ea40e41bcb..d7f08c0da18 100644 --- a/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/CompilerRunnerUtil.java +++ b/ide-compiler-runner/src/org/jetbrains/jet/compiler/runner/CompilerRunnerUtil.java @@ -53,7 +53,7 @@ public class CompilerRunnerUtil { ) throws IOException { ClassLoader classLoader = ourClassLoaderRef.get(); if (classLoader == null) { - classLoader = createClassLoader(libPath, environment.getParentClassLoader(), environment.getClassesToLoadByParent()); + classLoader = createClassLoader(libPath, CompilerRunnerUtil.class.getClassLoader(), environment.getClassesToLoadByParent()); ourClassLoaderRef = new SoftReference(classLoader); } return classLoader; diff --git a/jps-plugin/src/org/jetbrains/jet/jps/build/KotlinBuilder.kt b/jps-plugin/src/org/jetbrains/jet/jps/build/KotlinBuilder.kt index a2d0fef9845..122c01b7ea0 100644 --- a/jps-plugin/src/org/jetbrains/jet/jps/build/KotlinBuilder.kt +++ b/jps-plugin/src/org/jetbrains/jet/jps/build/KotlinBuilder.kt @@ -169,16 +169,14 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR .register(javaClass(), IncrementalCacheProviderImpl(incrementalCaches)) .build() - val environment = CompilerEnvironment.getEnvironmentFor( + return CompilerEnvironment.getEnvironmentFor( PathUtil.getKotlinPathsForJpsPluginOrJpsTests(), - javaClass.getClassLoader(), { className -> - className!!.startsWith("org.jetbrains.jet.lang.resolve.kotlin.incremental.cache.") + className.startsWith("org.jetbrains.jet.lang.resolve.kotlin.incremental.cache.") || className == "org.jetbrains.jet.config.Services" }, compilerServices ) - return environment } private fun getOutputItemsAndTargets(