You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by ji...@apache.org on 2004/04/23 19:48:53 UTC

[jira] Closed: (XERCESJ-918) Allow 'error-handler', 'resource-resolver' parameters to be set with null value

Message:

   The following issue has been closed.

   Resolver: Michael Glavassevich
       Date: Fri, 23 Apr 2004 10:47 AM

Closed as per state in Bugzilla.
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCESJ-918

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCESJ-918
    Summary: Allow 'error-handler', 'resource-resolver' parameters to be set with null value
       Type: Bug

     Status: Closed
 Resolution: FIXED

    Project: Xerces2-J
 Components: 
             DOM
   Versions:
             2.6.2

   Assignee: Michael Glavassevich
   Reporter: Naela Nissar

    Created: Wed, 17 Mar 2004 5:23 PM
    Updated: Fri, 23 Apr 2004 10:47 AM
Environment: Operating System: Other
Platform: Other

Description:
TYPE_MISMATCH_ERR should not be thrown when attempting to set domConfiguration 
parameters 'error-handler' or 'resource-resolver' to null in LSParser's 
domConfig object or on DOMConfig objects attached to the document. Spec states 
that setting a parameter to null should unset the parameter.  Currently failing 
DOM L3 Core test cases domconfigerrorhandler1 and 2 as a result.

Patch in DOMConfigurationImpl.setParameter:

--- C:\xml-xerces\java\src\org\apache\xerces\dom\DOMConfigurationImpl.java 2004-
03-17 12:06:07.00 -0500  1.25
+++ C:\xerces-temp\DOMConfigurationImpl.java    2004-03-16 18:00:10.00 -0
500
@@ -605,7 +605,7 @@
         }
         else { // set properties
             if (name.equalsIgnoreCase(Constants.DOM_ERROR_HANDLER)) {
-                if (value instanceof DOMErrorHandler) {
+                if (value instanceof DOMErrorHandler || (value==null)) {
                     fErrorHandlerWrapper.setErrorHandler((DOMErrorHandler)value
);
                     setErrorHandler(fErrorHandlerWrapper);
                 }
@@ -621,7 +621,7 @@
                 }
             }
             else if (name.equalsIgnoreCase(Constants.DOM_RESOURCE_RESOLVER)) {
-                if (value instanceof LSResourceResolver) {
+                if (value instanceof LSResourceResolver || (value==null)) {
                     try {
                         setEntityResolver(new DOMEntityResolverWrapper((LSResou
rceResolver) value));
                     }


Patch in DOMParserImpl.setParameter:

--- C:\xml-xerces\java\src\org\apache\xerces\parsers\DOMParserImpl.java 2004-03-
17 12:07:21.00 -0500  1.19
+++ C:\xerces-temp\DOMParserImpl.java   2004-03-17 12:00:45.00 -0500

@@ -411,8 +407,7 @@
         else { // set properties
             if (name.equalsIgnoreCase (Constants.DOM_ERROR_HANDLER)) {
                 // REVISIT: we should probably allow unsetting error-handler
-                if (value == null) return;
-                if (value instanceof DOMErrorHandler) {
+                if (value instanceof DOMErrorHandler || value==null) {
                     try {
                         fErrorHandler = new DOMErrorHandlerWrapper ((DOMErrorHa
ndler) value);
                         fConfiguration.setProperty (ERROR_HANDLER, fErrorHandle
r);
@@ -431,7 +426,7 @@

             }
             else if (name.equalsIgnoreCase (Constants.DOM_RESOURCE_RESOLVER)) {

-                if (value instanceof LSResourceResolver) {
+                if (value instanceof LSResourceResolver || value==null) {
                     try {
                         fConfiguration.setProperty (ENTITY_RESOLVER, new DOMEnt
ityResolverWrapper ((LSResourceResolver) value));
                     }


---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org