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

Bug 313948

Summary: Package declarations unsupported?
Product: [Eclipse Project] JDT Reporter: Greg Gibeling <gdgib>
Component: APTAssignee: Generic inbox for the JDT-APT component <jdt-apt-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3    
Version: 3.5.2   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Greg Gibeling CLA 2010-05-21 13:31:34 EDT
Shown below is a partial stack trace (I removed the trace through my code since that's not useful).  It would appear that org.eclipse.jdt.apt.core.internal.util.Factory.createDeclaration() is missing a case for packages, as shown in http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/util/Factory.java?view=markup.  This makes it difficult/impossible to process annotations in package-info.java files.

Actually while we're at it the "IllegalStateException" is pretty useless, it could at least say "binding type \"package\" is not (yet) supported" or something of the like.  Basically just emphasize that the binding type not be recognized is the problem.


java.lang.IllegalStateException: failed to create declaration from package foo.bar
	at org.eclipse.jdt.apt.core.internal.util.Factory.createDeclaration(Factory.java:112)
	at org.eclipse.jdt.apt.core.internal.env.BaseProcessorEnv.getDeclarations(BaseProcessorEnv.java:374)
	at org.eclipse.jdt.apt.core.internal.env.BaseProcessorEnv.getDeclarationsAnnotatedWith(BaseProcessorEnv.java:305)
	at org.eclipse.jdt.apt.core.internal.env.BaseProcessorEnv.getDeclarationsAnnotatedWith(BaseProcessorEnv.java:279)
Comment 1 Eclipse Genie CLA 2020-02-06 15:10:03 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.