Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330660 - Canonical model generator throws ClassCastException when using package-info.java
Summary: Canonical model generator throws ClassCastException when using package-info.java
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-19 08:19 EST by Guy Pelletier CLA
Modified: 2022-06-09 10:31 EDT (History)
3 users (show)

See Also:


Attachments
Proposed changes (27.73 KB, patch)
2010-11-23 12:02 EST, Guy Pelletier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guy Pelletier CLA 2010-11-19 08:19:45 EST
An annotation processor threw an uncaught exception.
Consult the following stack trace for details.
java.lang.RuntimeException: java.lang.ClassCastException: com.sun.tools.javac.code.Symbol$PackageSymbol cannot be cast to javax.lang.model.element.TypeElement
         at org.eclipse.persistence.internal.jpa.modelgen.CanonicalModelProcessor.process(CanonicalModelProcessor.java:400)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:625)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:554)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:699)

Processor needs to gracefully handle package-info.java as they are not TypeElements rather a PackageSymbol.
Comment 1 Guy Pelletier CLA 2010-11-23 12:02:25 EST
Created attachment 183683 [details]
Proposed changes
Comment 2 Guy Pelletier CLA 2010-11-23 13:46:06 EST
Changes have been submitted.

Reviewed by: Tom Ware

Tested manually through Eclipse and our build scripts.
Comment 3 Eclipse Webmaster CLA 2022-06-09 10:31:55 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink