harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kevin Zhou (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6213) [classlib][beans] XMLDecoder.readObject() should not invoke org.xml.sax.SAXParseException
Date Wed, 27 May 2009 06:14:45 GMT
[classlib][beans] XMLDecoder.readObject() should not invoke org.xml.sax.SAXParseException
-----------------------------------------------------------------------------------------

                 Key: HARMONY-6213
                 URL: https://issues.apache.org/jira/browse/HARMONY-6213
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
    Affects Versions: 5.0M9
            Reporter: Kevin Zhou


Given a test case [1], RI passes it while HARMONY fails. 
For HARMONY, it throws the following exceptions:

org.xml.sax.SAXParseException: Premature end of file.
Continue...
org.xml.sax.SAXParseException: Premature end of file.
Continue...
org.xml.sax.SAXParseException: Premature end of file.
Continue...
org.xml.sax.SAXParseException: Premature end of file.
Continue...

[1] Test Case:
public void test_readObject() throws Exception {
        final Vector<Exception> exceptionList = new Vector<Exception>();

        final ExceptionListener exceptionListener = new ExceptionListener() {
            public void exceptionThrown(Exception e) {
                exceptionList.addElement(e);
                System.err.println(e + "\nContinue...");
            }
        };

        String content = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><java version=\"1.6.0_13\"
class=\"java.beans.XMLDecoder\"><int>1</int><int>2</int><int>3</int></java>";
        XMLDecoder xmlDecoder = new XMLDecoder(new ByteArrayInputStream(content
                .getBytes("UTF-8")));
        xmlDecoder.setExceptionListener(exceptionListener);
        assertEquals(new Integer(1), xmlDecoder.readObject());
        assertEquals(new Integer(2), xmlDecoder.readObject());
        assertEquals(new Integer(3), xmlDecoder.readObject());
        xmlDecoder.close();
        assertEquals(0, exceptionList.size());
    } 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message