hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cutt...@apache.org
Subject svn commit: r376492 - /lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobConf.java
Date Thu, 09 Feb 2006 23:49:41 GMT
Author: cutting
Date: Thu Feb  9 15:49:39 2006
New Revision: 376492

URL: http://svn.apache.org/viewcvs?rev=376492&view=rev
Log:
Further improvements from Bryan A. Pendleton.

Modified:
    lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobConf.java

Modified: lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobConf.java
URL: http://svn.apache.org/viewcvs/lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobConf.java?rev=376492&r1=376491&r2=376492&view=diff
==============================================================================
--- lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobConf.java (original)
+++ lucene/hadoop/trunk/src/java/org/apache/hadoop/mapred/JobConf.java Thu Feb  9 15:49:39
2006
@@ -69,7 +69,10 @@
    */
   public JobConf(Configuration conf, Class aClass) {
     this(conf);
-    setJar(findContainingJar(aClass));
+    String jar = findContainingJar(aClass);
+    if (jar != null) {
+      setJar(jar);
+    }
   }
 
 
@@ -302,7 +305,11 @@
           itr.hasMoreElements();) {
         URL url = (URL) itr.nextElement();
         if ("jar".equals(url.getProtocol())) {
-          return url.getPath().replaceFirst("file:", "").replaceAll("!.*$", "");
+          String toReturn = url.getPath();
+          if (toReturn.startsWith("file:")) {
+            toReturn = toReturn.substring("file:".length());
+          }
+          return toReturn.replaceAll("!.*$", "");
         }
       }
     } catch (IOException e) {



Mime
View raw message