commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 30839] New: - ClassCastException in XMLConfiguration
Date Wed, 25 Aug 2004 08:23:41 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30839>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30839

ClassCastException in XMLConfiguration

           Summary: ClassCastException in XMLConfiguration
           Product: Commons
           Version: Nightly Builds
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Configuration
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: hermod.opstvedt@dnb.no


In the XMLConfigurations addXMLProperty, it takes an Object as the value to set:
        Element child = document.createElement(nodes[nodes.length - 1]);
        parent.appendChild(child);
        if (attName == null) {
            CharacterData data = document.createTextNode((String) value);
            child.appendChild(data);
        } else {
            child.setAttribute(attName, (String) value);
        }
This should be changed to :
        Element child = document.createElement(nodes[nodes.length - 1]);
        parent.appendChild(child);
        if (attName == null) {
            CharacterData data = document.createTextNode((String) value);
            child.appendChild(data);
        } else {
            child.setAttribute(attName, value.toString);
        }
Thereby avoiding a potential ClasscastException.
Since I can't get at the CVS, I am submitting the change this way.

Hermod

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message