hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cnaur...@apache.org
Subject [06/50] [abbrv] hadoop git commit: HADOOP-13410. RunJar adds the content of the jar twice to the classpath (Yuanbo Liu via sjlee)
Date Thu, 18 Aug 2016 20:27:08 GMT
HADOOP-13410. RunJar adds the content of the jar twice to the classpath (Yuanbo Liu via sjlee)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/4d3ea92f
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/4d3ea92f
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/4d3ea92f

Branch: refs/heads/HADOOP-13345
Commit: 4d3ea92f4fe4be2a0ee9849c65cb1c91b0c5711b
Parents: 874577a
Author: Sangjin Lee <sjlee@apache.org>
Authored: Thu Aug 11 19:56:58 2016 -0700
Committer: Sangjin Lee <sjlee@apache.org>
Committed: Thu Aug 11 19:56:58 2016 -0700

----------------------------------------------------------------------
 .../src/main/java/org/apache/hadoop/util/RunJar.java           | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/4d3ea92f/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/RunJar.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/RunJar.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/RunJar.java
index 19b51ad..d91a78b 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/RunJar.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/util/RunJar.java
@@ -226,7 +226,7 @@ public class RunJar {
 
     unJar(file, workDir);
 
-    ClassLoader loader = createClassLoader(file, workDir);
+    ClassLoader loader = createClassLoader(workDir);
 
     Thread.currentThread().setContextClassLoader(loader);
     Class<?> mainClass = Class.forName(mainClassName, true, loader);
@@ -250,14 +250,13 @@ public class RunJar {
    * the user jar as well as the HADOOP_CLASSPATH. Otherwise, it creates a
    * classloader that simply adds the user jar to the classpath.
    */
-  private ClassLoader createClassLoader(File file, final File workDir)
+  private ClassLoader createClassLoader(final File workDir)
       throws MalformedURLException {
     ClassLoader loader;
     // see if the client classloader is enabled
     if (useClientClassLoader()) {
       StringBuilder sb = new StringBuilder();
       sb.append(workDir).append("/").
-          append(File.pathSeparator).append(file).
           append(File.pathSeparator).append(workDir).append("/classes/").
           append(File.pathSeparator).append(workDir).append("/lib/*");
       // HADOOP_CLASSPATH is added to the client classpath
@@ -277,7 +276,6 @@ public class RunJar {
     } else {
       List<URL> classPath = new ArrayList<>();
       classPath.add(new File(workDir + "/").toURI().toURL());
-      classPath.add(file.toURI().toURL());
       classPath.add(new File(workDir, "classes/").toURI().toURL());
       File[] libs = new File(workDir, "lib").listFiles();
       if (libs != null) {


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message