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

Bug 348639

Summary: ClassCastException: SourceField/SourceMethod cannot be cast to JavaResourceAbstractType
Product: [WebTools] Dali JPA Tools Reporter: Paul Fullbright <paul.fullbright>
Component: JAXBAssignee: Karen Butzke <karenfbutzke>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: jolene.moffitt, karenfbutzke, nan.n.li, neil.hauge
Version: unspecified   
Target Milestone: 3.1 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 345031    
Bug Blocks:    

Description Paul Fullbright CLA 2011-06-07 15:54:23 EDT
+++ This bug was initially created as a clone of Bug #345031 +++

(For tracking post 3.0.1 fix)

Build Identifier: I20110428-0848

When trying to apply @XmlType to a field, the following CCE would be thrown:

----------------
java.lang.ClassCastException: org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceField cannot be cast to org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType
	at org.eclipse.jpt.jaxb.core.internal.resource.java.XmlTypeAnnotationDefinition.buildAnnotation(XmlTypeAnnotationDefinition.java:47)
	at org.eclipse.jpt.jaxb.core.internal.GenericAnnotationProvider.buildAnnotation(GenericAnnotationProvider.java:84)
	at org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceAnnotatedElement.buildAnnotation(SourceAnnotatedElement.java:219)
	at org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceAnnotatedElement.addOrSyncAnnotation_(SourceAnnotatedElement.java:286)

<snip>
--------------

Similar exception would be thrown when trying to apply @XmlType to a property complaining org.eclipse.jpt.jaxb.core.internal.resource.java.source.SourceField cannot be cast to org.eclipse.jpt.jaxb.core.resource.java.JavaResourceAbstractType.

Reproducible: Always
Comment 1 Karen Butzke CLA 2011-06-27 12:21:33 EDT
taking this one, my changes to our annotation constructors will fix this bug
Comment 2 Karen Butzke CLA 2011-06-27 12:59:32 EDT
fixed for 3.1 M1
Comment 3 Jolene Moffitt CLA 2011-09-14 13:05:33 EDT
Verified in Build I-3.4.0-20110912100409 

Verified ClassCastException does not appear when you add @XmlType. See the link to view test steps for verification. http://wiki.eclipse.org/Dali_3.1_M1