From 88a71b9ef211ef5ea148c25ee3b2c1f032e1aad0 Mon Sep 17 00:00:00 2001 From: Maxim Shafirov Date: Wed, 25 Jan 2012 15:02:58 +0400 Subject: [PATCH] Make sure we won't compile same modules in subsequent script runs in same VM instance --- .../src/org/jetbrains/jet/compiler/CompileEnvironment.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java index 8d44302eb30..92a05e64133 100644 --- a/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java +++ b/compiler/cli/src/org/jetbrains/jet/compiler/CompileEnvironment.java @@ -22,6 +22,7 @@ import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; +import java.util.ArrayList; import java.util.List; import java.util.jar.*; @@ -165,7 +166,9 @@ public class CompileEnvironment { method.setAccessible(true); method.invoke(null); - return AllModules.modules; + ArrayList answer = new ArrayList(AllModules.modules); + AllModules.modules.clear(); + return answer; } catch (Exception e) { throw new ModuleExecutionException(e); }