DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20429>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20429 DOM3: Invalid Boolean Object test in DOMConfigurationImpl.setParameter Summary: DOM3: Invalid Boolean Object test in DOMConfigurationImpl.setParameter Product: Xerces2-J Version: 2.4.0 Platform: All OS/Version: All Status: NEW Severity: Blocker Priority: Other Component: DOM AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Regarding the DOM3 Level experimental implementation in Xerces2-J: There is a coding error in org.apache.xerces.dom.DOMConfigurationImpl.setParameter(String name, Object value). The error is in the first two lines: if (value == Boolean.TRUE || value == Boolean.FALSE) { boolean state = (value == Boolean.TRUE) ? true : false; . . . Since the value argument is a Boolean _Object_ and not a primitive, the == operator compares identity of objects, not equivalence of Boolean values. Since I pass a Boolean Object that is freshly allocated (actually, I don't but the Jython runtime does), the == is not satisfied and the code drops through to the default, FEATURE_NOT_FOUND. The check should be done the same way the name check is done, viz. if (value.equals(Boolean.TRUE) || value.equals(Boolean.FALSE) { boolean state = (value.equals(Boolean.TRUE) ? true : false; . . . or, more succinctly, if (value instanceof Boolean) { boolean state = value.booleanValue() --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
