hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas FRIOL (JIRA)" <j...@apache.org>
Subject [jira] Created: (HADOOP-501) toString(resources, sb) in Configuration.java throws a ClassCastException since resources can be loaded from an URL
Date Fri, 01 Sep 2006 15:02:22 GMT
toString(resources, sb) in Configuration.java throws a ClassCastException since resources can
be loaded from an URL
-------------------------------------------------------------------------------------------------------------------

                 Key: HADOOP-501
                 URL: http://issues.apache.org/jira/browse/HADOOP-501
             Project: Hadoop
          Issue Type: Bug
    Affects Versions: 0.5.0
            Reporter: Thomas FRIOL
            Priority: Minor
         Attachments: Configuration.java.patch

Object obj = i.next();
if (obj instanceof Path) {
        sb.append((Path)obj);
} else {
        sb.append((String)obj);
}

If obj is an URL -> ClassCastException.

Moreover, I think the test before appending the resource to the StringBuffer is not really
necessary since the method take an Object as argument. Why not simply have :

Object obj = i.next();
sb.append(obj);

I have attached a patch to fix this.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message