You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2017/02/20 16:58:52 UTC
[02/12] ant git commit: New magic name org.apache.ant.scriptcache
New magic name org.apache.ant.scriptcache
Project: http://git-wip-us.apache.org/repos/asf/ant/repo
Commit: http://git-wip-us.apache.org/repos/asf/ant/commit/fd0fb26c
Tree: http://git-wip-us.apache.org/repos/asf/ant/tree/fd0fb26c
Diff: http://git-wip-us.apache.org/repos/asf/ant/diff/fd0fb26c
Branch: refs/heads/master
Commit: fd0fb26cc5f834595ffbd397550e1555691c299a
Parents: ea70917
Author: pyxide <op...@gmail.com>
Authored: Mon Feb 20 13:26:27 2017 +0100
Committer: Stefan Bodewig <bo...@apache.org>
Committed: Mon Feb 20 17:41:37 2017 +0100
----------------------------------------------------------------------
src/main/org/apache/tools/ant/MagicNames.java | 6 ++++++
.../org/apache/tools/ant/util/optional/JavaxScriptRunner.java | 6 +++++-
2 files changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ant/blob/fd0fb26c/src/main/org/apache/tools/ant/MagicNames.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/MagicNames.java b/src/main/org/apache/tools/ant/MagicNames.java
index bc39a25..336c3bc 100644
--- a/src/main/org/apache/tools/ant/MagicNames.java
+++ b/src/main/org/apache/tools/ant/MagicNames.java
@@ -56,6 +56,12 @@ public final class MagicNames {
public static final String SCRIPT_REPOSITORY = "org.apache.ant.scriptrepo";
/**
+ * The name of the script cache used by the script runner.
+ * Value {@value}
+ */
+ public static final String SCRIPT_CACHE = "org.apache.ant.scriptcache";
+
+ /**
* The name of the reference to the System Class Loader.
* Value {@value}
**/
http://git-wip-us.apache.org/repos/asf/ant/blob/fd0fb26c/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java
----------------------------------------------------------------------
diff --git a/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java b/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java
index 63ab4d9..997af7a 100644
--- a/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java
+++ b/src/main/org/apache/tools/ant/util/optional/JavaxScriptRunner.java
@@ -21,6 +21,7 @@ package org.apache.tools.ant.util.optional;
import java.util.Iterator;
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.MagicNames;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.util.ReflectWrapper;
import org.apache.tools.ant.util.ScriptRunnerBase;
@@ -84,7 +85,10 @@ public class JavaxScriptRunner extends ScriptRunnerBase {
if (getCompiled()) {
- final String compiledScriptRefName = execName + ".compiled." + getScript().hashCode() + "." + getProject().hashCode();
+ final String compiledScriptRefName = MagicNames.SCRIPT_CACHE + "." + getLanguage() +
+ "." + getScript().hashCode() + "." +
+ (null == getClass().getClassLoader() ? 0 : getClass().getClassLoader().hashCode());
+
if (null == compiledScript) {
compiledScript = getProject().getReference(compiledScriptRefName);
}