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

Bug 357099

Summary: javax.persistence.Parameter.getParameterType() does not throw java.lang.IllegalStateException
Product: z_Archived Reporter: Stephen DiMilla <stephen.dimilla>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED INVALID QA Contact:
Severity: blocker    
Priority: P2 CC: lance.andersen, stephen.dimilla, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard: jpa21
Attachments:
Description Flags
test code
none
entity class none

Description Stephen DiMilla CLA 2011-09-08 10:37:50 EDT
Build Identifier: eclipselink-2.3.0.v20110604-r9504

When calling javax.persistence.Parameter.getParameterType() on a parameter from a JPQL TypedQuery, IllegalStateException is not being thrown. Currently the parameter type is being returned. Gordon Yorke indicated that IllegalStateException should be thrown therefore I am filing this bug.

Reproducible: Always

Steps to Reproduce:
Run the attached test code with the attached entity class.
Comment 1 Stephen DiMilla CLA 2011-09-08 10:38:38 EDT
Created attachment 203000 [details]
test code
Comment 2 Stephen DiMilla CLA 2011-09-08 10:39:00 EDT
Created attachment 203001 [details]
entity class
Comment 3 Tom Ware CLA 2012-04-05 11:01:12 EDT
Updating target milestone.
Comment 4 Tom Ware CLA 2013-02-04 14:43:38 EST
I discussed this with Gordon and we agreed the functionality should be as follows:

If we can determine the type, we may return it.

If we cannot, we should throw IllegalStateException

In the test above, we can determine the type, and hence are allowed to return it.
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:22:40 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink