| Summary: | Class with switch statement on enum causes error when creating JAXB Context | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Blaise Doughan <blaise.doughan> | ||||||
| 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 200031 [details]
MOXy - Test Cases
Created attachment 200032 [details]
MOXy - Fix
Fix checked into 2.3.1 at rev: 9769 Fix checked into trunk at rev: 9770 Code reviewed by: Rick Barkhouse Fix Description: If the class does not have a raw name, then assume it is not a domain class. The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
The following error is thrown: javax.xml.bind.JAXBException - with linked exception: [java.lang.NullPointerException] at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:827) at org.eclipse.persistence.jaxb.JAXBContext.<init>(JAXBContext.java:138) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:142) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:129) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:93) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:83) at org.eclipse.persistence.testing.jaxb.xmlenum.EnumSwitchTestCases.testCreateContext(EnumSwitchTestCases.java:28) Caused by: java.lang.NullPointerException at org.eclipse.persistence.jaxb.javamodel.Helper.isBuiltInJavaType(Helper.java:261) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.shouldGenerateTypeInfo(AnnotationsProcessor.java:1546) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processClass(AnnotationsProcessor.java:1045) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processAdditionalClasses(AnnotationsProcessor.java:1010) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.postBuildTypeInfo(AnnotationsProcessor.java:592) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processClassesAndProperties(AnnotationsProcessor.java:233) at org.eclipse.persistence.jaxb.compiler.Generator.<init>(Generator.java:147) at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:824) When creating a JAXBContext on a class that contains a switch statment on an enum such as: public class EnumSwitchRoot { private Department department; private Department foo() { switch(department) { case SALES: { return Department.SALES; } case SUPPORT: { return Department.SUPPORT; } } return null; } }