Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 342624 - ASTTools.findTypeInHierarchy() does not handle parameterized type reference
Summary: ASTTools.findTypeInHierarchy() does not handle parameterized type reference
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: Framework (show other bugs)
Version: 3.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.0.1   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard: fix_ready
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-12 14:31 EDT by Pascal Filion CLA
Modified: 2011-08-19 16:39 EDT (History)
3 users (show)

See Also:
neil.hauge: review+


Attachments
proposed patch against head (979 bytes, patch)
2011-06-10 13:18 EDT, Karen Butzke CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pascal Filion CLA 2011-04-12 14:31:51 EDT
If the ITypeBinding is for a generic type, i.e. java.util.Collection<E> than ITypeBinding.getQualifiedName() returns the fully qualified class name with the generic type.

1. Create a new JPA project with EclipseLink as the platform.
2. Create a persistence.xml
3. Create a new JPA entity and add it to the persistence.xml
4. Create an interface:
   import org.eclipse.persistence.config.DescriptorCustomizer;
   public interface MyInterface<T> extends DescriptorCustomizer {
   }
5. Create a new class that implements the interface:
   import org.eclipse.persistence.descriptors.ClassDescriptor;
   public class MyClass implements MyInterface<Object> {
      public void customize(ClassDescriptor descriptor) throws Exception {
      }
   }
6. Set the Customer Class on the entity to be the newly created class.

During validation, ASTTool.findTypeInHierarchy() is called and ITypeBinding.getQualifiedName() will return MyInterface<java.lang.Object> instead of MyInterface.
Comment 1 Pascal Filion CLA 2011-04-12 14:34:38 EDT
Refer to bug 342475 for more information.
Comment 2 Karen Butzke CLA 2011-06-10 13:18:26 EDT
Created attachment 197803 [details]
proposed patch against head
Comment 3 Karen Butzke CLA 2011-06-24 07:58:39 EDT
checked in to HEAD for 3.0.1
Comment 4 Jolene Moffitt CLA 2011-08-19 16:39:40 EDT
Verified in Build I-3.4.0-20110812160550 

Verified if you add the New Class to the Entity and Save no errors appear.  See the link to view test steps for verification.  http://wiki.eclipse.org/Dali_3.0.1