Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] Fix for bug 273491 - {JAXB TCK} ArrayIndexOutOfBoundsException when unmarshalling empty byte[] element

Fix submitted for the following bug:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=273491

Description:
When attempting to unmarshall the following XML document:

<?xml version="1.0"?><employee id="123">
        <photo></photo>
</employee>

Where <photo> is a XMLBinaryDataMapping, the following exception will be thrown:

java.lang.ArrayIndexOutOfBoundsException: -1
        at org.eclipse.persistence.internal.oxm.conversion.Base64.base64Decode(Base64.java:110)
        at org.eclipse.persistence.internal.oxm.XMLConversionManager.convertSchemaBase64ToByteArray(XMLConversionManager.java:1632)
        at org.eclipse.persistence.internal.oxm.XMLInlineBinaryHandler.endElement(XMLInlineBinaryHandler.java:79)
        ...

Test Cases:
org.eclipse.persistence.testing.oxm.mappings.binarydata.BinaryDataEmptyElementTestCases

Patch attached to bug, reviewed by Matt MacIvor.

--
Oracle
Rick Barkhouse | Software Developer, TopLink | 613.288.4613
Oracle Development
45 O'Connor Street, Suite 400 | Ottawa, Ontario K1P 1A4

Back to the top