hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sur...@apache.org
Subject svn commit: r1400931 - in /hadoop/common/branches/branch-1: CHANGES.txt src/core/org/apache/hadoop/util/RunJar.java
Date Mon, 22 Oct 2012 16:05:10 GMT
Author: suresh
Date: Mon Oct 22 16:05:10 2012
New Revision: 1400931

URL: http://svn.apache.org/viewvc?rev=1400931&view=rev
Log:
HADOOP-8951. RunJar to fail with user-comprehensible error message if jar missing. Contributed
by Steve Loughran.

Modified:
    hadoop/common/branches/branch-1/CHANGES.txt
    hadoop/common/branches/branch-1/src/core/org/apache/hadoop/util/RunJar.java

Modified: hadoop/common/branches/branch-1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/CHANGES.txt?rev=1400931&r1=1400930&r2=1400931&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/CHANGES.txt (original)
+++ hadoop/common/branches/branch-1/CHANGES.txt Mon Oct 22 16:05:10 2012
@@ -273,6 +273,9 @@ Release 1.2.0 - unreleased
     HDFS-4072. On file deletion remove corresponding blocks pending
     replications. (Jing Zhao via suresh)
 
+    HADOOP-8951. RunJar to fail with user-comprehensible error 
+    message if jar missing. (stevel via suresh)
+
 Release 1.1.1 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-1/src/core/org/apache/hadoop/util/RunJar.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-1/src/core/org/apache/hadoop/util/RunJar.java?rev=1400931&r1=1400930&r2=1400931&view=diff
==============================================================================
--- hadoop/common/branches/branch-1/src/core/org/apache/hadoop/util/RunJar.java (original)
+++ hadoop/common/branches/branch-1/src/core/org/apache/hadoop/util/RunJar.java Mon Oct 22
16:05:10 2012
@@ -81,6 +81,10 @@ public class RunJar {
     int firstArg = 0;
     String fileName = args[firstArg++];
     File file = new File(fileName);
+    if (!file.exists() || !file.isFile()) {
+      System.err.println("Not a valid JAR: " + file.getCanonicalPath());
+      System.exit(-1);
+    }
     String mainClassName = null;
 
     JarFile jarFile;



Mime
View raw message