Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354305

Summary: NPE in ListContainerPolicy valueFromPKList
Product: z_Archived Reporter: David Minsky <david.minsky>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed patch and testcase
none
Updated patch
none
Updated patch none

Description David Minsky CLA 2011-08-09 17:28:10 EDT
When an Order Column is specified for a collection mapping, under certain circumstances a NullPointerException can occur when the mapping's valueFromPKList(Object[], AbstractSession) method is invoked.

This issue is occurring because the code in ContainerPolicy that initializes the list order field replaces an already initialized ContainerPolicy with a new
OrderedListContainerPolicy. This new policy is not initialized, and thus the
policy's elementDescriptor field is null, leading to a later NPE when valueFromPKList is called.
Comment 1 David Minsky CLA 2011-08-09 17:33:02 EDT
Created attachment 201191 [details]
Proposed patch and testcase
Comment 2 David Minsky CLA 2011-08-10 18:07:02 EDT
Created attachment 201284 [details]
Updated patch

Correcting testcase and moving @OrderColumn, due to issues in testing
Comment 3 David Minsky CLA 2011-08-12 12:09:56 EDT
Created attachment 201411 [details]
Updated patch

Patch now utilizes its own model classes.
Comment 4 David Minsky CLA 2011-08-12 14:33:45 EDT
Fixed in EclipseLink trunk (2.4) r9882
Comment 5 David Minsky CLA 2011-08-12 16:33:06 EDT
Checked into 2.3 branch (2.3.1) at r9885
Comment 6 David Minsky CLA 2011-08-12 17:48:18 EDT
Checked into 2.2 trunk at r9887
Comment 7 David Minsky CLA 2011-08-15 13:13:11 EDT
Checked into 2.1 trunk at r9891
Comment 8 Eclipse Webmaster CLA 2022-06-09 10:28:17 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink