hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Amar Kamat (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-7851) Configuration.getClasses() never returns the default value.
Date Tue, 22 Nov 2011 11:20:39 GMT

    [ 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

        

Mime
View raw message