hadoop-mapreduce-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amareshw...@apache.org
Subject svn commit: r980704 - in /hadoop/mapreduce/trunk: CHANGES.txt src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamUtil.java
Date Fri, 30 Jul 2010 09:37:47 GMT
Author: amareshwari
Date: Fri Jul 30 09:37:46 2010
New Revision: 980704

URL: http://svn.apache.org/viewvc?rev=980704&view=rev
Log:
MAPREDUCE-1686. Fixes StreamUtil.goodClassOrNull to find classes without package names. Contributed
by Paul Burkhardt

Modified:
    hadoop/mapreduce/trunk/CHANGES.txt
    hadoop/mapreduce/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamUtil.java

Modified: hadoop/mapreduce/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/CHANGES.txt?rev=980704&r1=980703&r2=980704&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/CHANGES.txt (original)
+++ hadoop/mapreduce/trunk/CHANGES.txt Fri Jul 30 09:37:46 2010
@@ -205,6 +205,9 @@ Trunk (unreleased changes)
     MAPREDUCE-1701. Fixes a problem to do with exception handling in 
     delegation-token renewals. (Boris Shkolnik via ddas)
 
+    MAPREDUCE-1686. Fixes StreamUtil.goodClassOrNull to find classes without
+    package names. (Paul Burkhardt via amareshwari)
+
 Release 0.21.0 - Unreleased
 
   INCOMPATIBLE CHANGES

Modified: hadoop/mapreduce/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamUtil.java
URL: http://svn.apache.org/viewvc/hadoop/mapreduce/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamUtil.java?rev=980704&r1=980703&r2=980704&view=diff
==============================================================================
--- hadoop/mapreduce/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamUtil.java
(original)
+++ hadoop/mapreduce/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/StreamUtil.java
Fri Jul 30 09:37:46 2010
@@ -55,14 +55,20 @@ public class StreamUtil {
    * (repeat for -reducer, -combiner) </pre>
    */
   public static Class goodClassOrNull(Configuration conf, String className, String defaultPackage)
{
-    if (className.indexOf('.') == -1 && defaultPackage != null) {
-      className = defaultPackage + "." + className;
-    }
     Class clazz = null;
     try {
       clazz = conf.getClassByName(className);
     } catch (ClassNotFoundException cnf) {
     }
+    if (clazz == null) {
+      if (className.indexOf('.') == -1 && defaultPackage != null) {
+        className = defaultPackage + "." + className;
+        try {
+          clazz = conf.getClassByName(className);
+        } catch (ClassNotFoundException cnf) {
+        }
+      }
+    }
     return clazz;
   }
 



Mime
View raw message