|
Re: EclipseLink/Moxy 2.4 - some objects not marshalled after correct unmarshalling of XML [message #895040 is a reply to message #894802] |
Wed, 11 July 2012 09:43   |
Eclipse User |
|
|
|
Hi Markus,
This appears to be a bug. You can use the following link to track our progress on this issue:
- http://bugs.eclipse.org/384834
Workaround
package de.dotquality.examples.jaxb.moxy.inheritance;
import java.util.List;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlSeeAlso;
import org.eclipse.persistence.oxm.annotations.XmlClassExtractor;
@XmlClassExtractor(ContainerClassExtractor.class)
@XmlSeeAlso({Container1.class, Container2.class})
public class Container extends Component {
@XmlElements ({
@XmlElement(name="C", type=Control.class),
@XmlElement(name="C", type=ControlA.class),
@XmlElement(name="C", type=ControlB.class),
@XmlElement(name="CO", type=Container.class),
@XmlElement(name="CO", type=Container1.class),
@XmlElement(name="CO", type=Container2.class)
})
List<Component> subChildren;
}
-Blaise
|
|
|
|
|
|
Re: EclipseLink/Moxy 2.4 - some objects not marshalled after correct unmarshalling of XML [message #895478 is a reply to message #895422] |
Fri, 13 July 2012 04:41  |
Eclipse User |
|
|
|
Yeah, I guess you're right Matt!
the problem lies here:
-----
com.sun.org.apache.xerces.internal.util.XMLAttributesImpl.getIndex(String, String)
-----
public int getIndex(String uri, String localPart) {
for (int i = 0; i < fLength; i++) {
Attribute attribute = fAttributes[i];
if (attribute.name.localpart != null &&
attribute.name.localpart.equals(localPart) &&
((uri==attribute.name.uri) ||
(uri!=null && attribute.name.uri!=null && attribute.name.uri.equals(uri)))) {
return i;
}
}
return -1;
} // getIndex(String,String):int
-----
When entering the method with a working version (of jdk/xml libs) the uri is "null" - in non working versions it is "" - i.e. empty String... the condition fails and "-1" is returned...
Thanks for your help guys!
Best regards,
Markus
|
|
|
Powered by
FUDForum. Page generated in 0.08536 seconds