[ 
https://issues.apache.org/jira/browse/HADOOP-7851?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13155026#comment-13155026
 ] 

Amar Kamat commented on HADOOP-7851:
------------------------------------

I think, the fix should be something like
{noformat}
diff --git 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
 hadoop-common-project/hadoop-common/src
index a3d4de0..2c90493 100644
--- 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
+++ 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
@@ -1145,6 +1145,10 @@ public class Configuration implements 
Iterable<Map.Entry<String,String>>,
    *         or <code>defaultValue</code>. 
    */
   public Class<?>[] getClasses(String name, Class<?> ... defaultValue) {
+    // return the default value if the parameter is missing
+    if (get(name) == null) {
+      return defaultValue;
+    }
     String[] classnames = getTrimmedStrings(name);
     if (classnames == null)
       return defaultValue;
{noformat}
                
> Configuration.getClasses() never returns the default value.
> -----------------------------------------------------------
>
>                 Key: HADOOP-7851
>                 URL: https://issues.apache.org/jira/browse/HADOOP-7851
>             Project: Hadoop Common
>          Issue Type: Bug
>          Components: conf
>    Affects Versions: 0.23.0
>            Reporter: Amar Kamat
>              Labels: configuration
>             Fix For: 0.24.0
>
>
> Configuration.getClasses() never returns the default value.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to