Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354305 - NPE in ListContainerPolicy valueFromPKList
Summary: NPE in ListContainerPolicy valueFromPKList
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-09 17:28 EDT by David Minsky CLA
Modified: 2022-06-09 10:28 EDT (History)
0 users

See Also:


Attachments
Proposed patch and testcase (4.05 KB, patch)
2011-08-09 17:33 EDT, David Minsky CLA
no flags Details | Diff
Updated patch (4.99 KB, patch)
2011-08-10 18:07 EDT, David Minsky CLA
no flags Details | Diff
Updated patch (12.57 KB, patch)
2011-08-12 12:09 EDT, David Minsky CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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