Community
Participate
Working Groups
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.
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