| Summary: | exception processing object factory methods | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Karen Butzke <karenfbutzke> | ||||
| Component: | Eclipselink | Assignee: | Blaise Doughan <blaise.doughan> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | eclipselink.oxm-inbox | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Created attachment 185076 [details]
MOXy - Fix
Fix checked into trunk at rev: 8706 MINOR CHANGE: Guard against there being no type parameter on the JAXBElement by returning Object.class. Code reviewed by Matt MacIvor The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
Given this example MOXy hits the following exception processing the annotations. It is because of the return type of JAXBElement not having any type arguments. class Pea { @XmlElementRefs({ @XmlElementRef(name="foo",type=JAXBElement.class) @XmlElementRef(name="bar",type=JAXBElement.class) }) List<JAXBElement<String>> fooOrBar; } @XmlRegistry class ObjectFactory { @XmlElementDecl(scope=Pea.class,name="foo") JAXBElement createPeaFoo(String s); @XmlElementDecl(scope=Pea.class,name="bar") JAXBElement createPeaBar(String s); @XmlElementDecl(name="foo") JAXBElement createFoo(Integer i); } Caused by: java.lang.ArrayIndexOutOfBoundsException: 0 at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processObjectFactory(AnnotationsProcessor.java:2878) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processClass(AnnotationsProcessor.java:941) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processAdditionalClasses(AnnotationsProcessor.java:919) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.postBuildTypeInfo(AnnotationsProcessor.java:543) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processClassesAndProperties(AnnotationsProcessor.java:215) at org.eclipse.persistence.jaxb.compiler.Generator.<init>(Generator.java:147) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:265) ... 7 more