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 "Michael Glavassevich (JIRA)" <xe...@xml.apache.org> on 2006/02/27 06:04:20 UTC

[jira] Updated: (XERCESJ-1007) AbstractMethodError is not caught in DOMSerializerImpl.writeToString() and ...

     [ http://issues.apache.org/jira/browse/XERCESJ-1007?page=all ]

Michael Glavassevich updated XERCESJ-1007:
------------------------------------------

    Fix Version: 2.8.0
    Description: 
The DOMSerializerImpl uses reflection to check whether "getXmlVersion" method or "getInputEncoding", ... exists in the Document implementation class of some given dom node in the writeToString(), write(), writeToURI() methods.
The problem is that when the DOM node is not a Xerces dom node then the checking line can throw an AbstractMethodError and we only catch Exception.
I think that those "catch (Exception e)" should be changed with "catch (Throwable t)".

current codes are...
        // this should run under JDK 1.1.8...
        try {
            getXmlVersion =
                fDocument.getClass().getMethod("getXmlVersion", new Class[] {});
            if (getXmlVersion != null) {
                ver = (String) getXmlVersion.invoke(fDocument, (Object[]) null);
            }
        } catch (Exception e) { <- I think these are problems.
            // no way to test the version...
            // ignore the exception
        }


  was:
The DOMSerializerImpl uses reflection to check whether "getXmlVersion" method or "getInputEncoding", ... exists in the Document implementation class of some given dom node in the writeToString(), write(), writeToURI() methods.
The problem is that when the DOM node is not a Xerces dom node then the checking line can throw an AbstractMethodError and we only catch Exception.
I think that those "catch (Exception e)" should be changed with "catch (Throwable t)".

current codes are...
        // this should run under JDK 1.1.8...
        try {
            getXmlVersion =
                fDocument.getClass().getMethod("getXmlVersion", new Class[] {});
            if (getXmlVersion != null) {
                ver = (String) getXmlVersion.invoke(fDocument, (Object[]) null);
            }
        } catch (Exception e) { <- I think these are problems.
            // no way to test the version...
            // ignore the exception
        }


    Environment: 
XML-XERCES CVS snapshot as of Sep. 7, 2004
jdk 1.4.2_04
windows 2000 sp4

  was:
XML-XERCES CVS snapshot as of Sep. 7, 2004
jdk 1.4.2_04
windows 2000 sp4


> AbstractMethodError is not caught in DOMSerializerImpl.writeToString() and ...
> ------------------------------------------------------------------------------
>
>          Key: XERCESJ-1007
>          URL: http://issues.apache.org/jira/browse/XERCESJ-1007
>      Project: Xerces2-J
>         Type: Bug
>   Components: Serialization
>     Versions: 2.6.2
>  Environment: XML-XERCES CVS snapshot as of Sep. 7, 2004
> jdk 1.4.2_04
> windows 2000 sp4
>     Reporter: Yoon Kyung Koo
>     Assignee: Michael Glavassevich
>      Fix For: 2.8.0
>  Attachments: DOMSerializerImpl_patch.txt
>
> The DOMSerializerImpl uses reflection to check whether "getXmlVersion" method or "getInputEncoding", ... exists in the Document implementation class of some given dom node in the writeToString(), write(), writeToURI() methods.
> The problem is that when the DOM node is not a Xerces dom node then the checking line can throw an AbstractMethodError and we only catch Exception.
> I think that those "catch (Exception e)" should be changed with "catch (Throwable t)".
> current codes are...
>         // this should run under JDK 1.1.8...
>         try {
>             getXmlVersion =
>                 fDocument.getClass().getMethod("getXmlVersion", new Class[] {});
>             if (getXmlVersion != null) {
>                 ver = (String) getXmlVersion.invoke(fDocument, (Object[]) null);
>             }
>         } catch (Exception e) { <- I think these are problems.
>             // no way to test the version...
>             // ignore the exception
>         }

-- 
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


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