Description
Given a test scenario [1], conduct it on RI and HY.
RI works well while HY fails.
This test case illuminates that RI doesn't parse the content of given InputStream in XMLDecoder's constructions, which should be handled in its readObject method.
I think that we should follow RI's behaviors on this.
[1]
public void test_setExceptionListener() throws Exception {
class MockExceptionListener implements ExceptionListener {
private boolean isCalled;
public void exceptionThrown(Exception e)
public boolean isCalled()
{ return isCalled; }}
XMLDecoder xmlDecoder = new XMLDecoder(new ByteArrayInputStream(
"<java><string/>".getBytes("UTF-8")));
MockExceptionListener mockListener = new MockExceptionListener();
xmlDecoder.setExceptionListener(mockListener);
assertNotNull(xmlDecoder.readObject());
assertTrue(mockListener.isCalled());
}