Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 348639 - ClassCastException: SourceField/SourceMethod cannot be cast to JavaResourceAbstractType
Summary: ClassCastException: SourceField/SourceMethod cannot be cast to JavaResourceAb...
Status: VERIFIED FIXED
Alias: None
Product: Dali JPA Tools
Classification: WebTools
Component: JAXB (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 3.1 M1   Edit
Assignee: Karen Butzke CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 345031
Blocks:
  Show dependency tree
 
Reported: 2011-06-07 15:54 EDT by Paul Fullbright CLA
Modified: 2011-09-14 13:05 EDT (History)
4 users (show)

See Also:


Attachments

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