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

Bug 330660

Summary: Canonical model generator throws ClassCastException when using package-info.java
Product: z_Archived Reporter: Guy Pelletier <guy.pelletier>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipselink.orm-inbox, lahoda, Sergey.Petrov
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed changes none

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