Community
Participate
Working Groups
Xml Direct/DirectCollection and Composite/CompositeCollection mappings each create a NullPolicy instance in their constructors to act as a default in the event that one is not explicitly set. We should add two static NullPolicy instances to NullPolicy - two are required as direct performs setNullRepresentedByEmptyNode(true) but composites do not. We will add a getNullPolicyInternal() method that detects if a NullPolicy has been explicitly set, if so it will be returned - if not the default will be returned. This new method is required to avoid the static default being changed by the user. The getNullPolicy method will now lazy load a NullPolicy instance. We will need to change internal calls to getNullPolicy (that do not modify the policy, but just check settings) to use getNullPolicyInternal. This will me done in node value classes, mappings, etc.
Created attachment 188785 [details] Proposed fix.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink