Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341251 - DynamicHelper.addTypes() should throw exception if multiple types having the same Class name and pointing to the same table are added to a the same helper
Summary: DynamicHelper.addTypes() should throw exception if multiple types having the ...
Status: ASSIGNED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard: dynamic
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-29 11:54 EDT by Rohit Banga CLA
Modified: 2022-06-09 10:09 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rohit Banga CLA 2011-03-29 11:54:58 EDT
Build Identifier: 20100617-1415

If we add two types having the same name using the following code:

dynClass1 = dynamicClassLoader.createDynamicClass("typename");
typeBuilder1 = new JPADynamicTypeBuilder(dynClass, null, "tablename");

dynClass2 = dynamicClassLoader.createDynamicClass("typename");
typeBuilder2 = new JPADynamicTypeBuilder(dynClass, null, "tablename");

dynamicHelper.addTypes(false, false, typeBuilder1.getType(), typeBuilder2.getType());



Then the addTypes() method does not throw an exception to report a conflict. However when we try to call executeQuery() later on we get a NullPointerException at that point on the following line:
at org.eclipse.persistence.internal.dynamic.ValuesAccessor.setAttributeValueInObject(ValuesAccessor.java:58)

Instead the addTypes() method should report a configuration problem to ease debugging.

Reproducible: Always

Steps to Reproduce:
1.Create two dynamic types having dynamic classes with the same name and pointing to the same table.
2. Add the two dynamic types to the same dynamicHelper.
3. The addTypes() method does not throw an exception.
Comment 1 Eclipse Webmaster CLA 2022-06-09 10:09:37 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink