| Summary: | JAXB Externalized Metadata: potential null pointer in finalize properties method in annotations processor | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | David McCann <david.mccann> | ||||
| Component: | Eclipselink | Assignee: | David McCann <david.mccann> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | ||||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 317962 | ||||||
| Attachments: |
|
||||||
Created attachment 181660 [details]
Proposed fix
Reviewed by: rick.barkhouse@oracle.com Tests: all unit tests pass as expected revision: 8406 The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink |
When validating xml-join-nodes in the finalizeProperties method we first try to match the referenced-xml-path of the xml-join-node to an xml-id on the target class; if there's no match we try xml-key properties. The following code causes a null pointer exception if there are no xml-key properties: for (Property xmlkeyProperty : targetInfo.getXmlKeyProperties()) { Here is the exception: ---------------------------------------------------------- Caused by: java.lang.NullPointerException at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.finalizeProperties(AnnotationsProcessor.java:713) at org.eclipse.persistence.jaxb.compiler.XMLProcessor.processXML(XMLProcessor.java:339) at org.eclipse.persistence.jaxb.compiler.Generator.<init>(Generator.java:145) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:244) ... 23 more ----------------------------------------------------------- We need to check for non-null xmlKeyProperties on the target property before doing the for loop.