Bug 248160 - APT processor errors don't show up in Eclipse IDE
Summary: APT processor errors don't show up in Eclipse IDE
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: APT (show other bugs)
Version: 3.4   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Generic inbox for the JDT-APT component CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-22 12:08 EDT by Walter Harley CLA
Modified: 2022-12-12 03:46 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Walter Harley CLA 2008-09-22 12:08:57 EDT
+++ This bug was initially created as a clone of Bug #248156 +++

Build ID: I20080617-2000

Steps To Reproduce:
1. Using http://wiki.netbeans.org/FaqApt ...
2. Create a project with ann/Handlable.java, proc/HandlableProcessor.java, and META-INF/services/javax.annotation.processing.Processor
3. Compile project and export as Jar file
4. Create another project which uses the produced Jar as its annotation processor and add demo/Main.java
5. Note that Main.java does not compile.

More information:
Notes...  It would be nice to be able to use the first project directly (as the source for annotation processing) rather than indirectly via a Jar file.  Meanwhile, the example doesn't compile because the Eclipse compiler seems incomplete.

To see this, you need to start Eclipse with "-consolelog -debug".  I'm digressing again, but it would be nice not to have to do this -- it would be preferable to have the errors show up in Eclipse itself rather than in the terminal that launched it.

The first error you get is:
java.lang.UnsupportedOperationException: Not yet implemented
	at org.eclipse.jdt.internal.apt.pluggable.core.filer.IdeOutputJavaFileObject.toUri(IdeOutputJavaFileObject.java:104)
	at proc.HandlableProcessor.process(HandlableProcessor.java:36)

This corresponds to "f.toUri()" in the printMessage call.  Commenting that out gives:
java.lang.NullPointerException
	at org.eclipse.jdt.internal.compiler.apt.model.Factory.newTypeMirror(Factory.java:384)
	at org.eclipse.jdt.internal.compiler.apt.model.Factory.newTypeMirror(Factory.java:389)
	at org.eclipse.jdt.internal.compiler.apt.model.ElementImpl.asType(ElementImpl.java:50)
	at proc.HandlableProcessor.process(HandlableProcessor.java:43)

which corresponds to "e.asType()".
Comment 1 Walter Harley CLA 2008-09-22 12:18:15 EDT
Brian, it should be possible to see the output by looking in the Errors view, without needing any special command-line flags.  Is it not showing up there for you?

Please note that what's happening here is not a problem with the project, it's an exception being thrown by the compiler's code (representing a bug either in Eclipse or in the annotation processor, but functionally speaking both of those are considered part of the compiler).  So it's not clear the exception itself should be showing up in the project's Problems view.

That said, I was under the impression that when processors throw exceptions we create a problem marker indicating that a processor was not able to run, so I'll investigate that.
Comment 2 Brian Ericson CLA 2008-09-22 12:41:59 EDT
(In reply to comment #1)
> Brian, it should be possible to see the output by looking in the Errors view,
> without needing any special command-line flags.  Is it not showing up there for
> you?
> 

Sorry -- hadn't thought to look at that.  Yes, the errors show up there.
Comment 3 Eclipse Genie CLA 2020-07-03 00:23:14 EDT
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.

If you have further information on the current state of the bug, please add it. 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.
Comment 4 Eclipse Genie CLA 2022-12-12 03:46:25 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.

If you have further information on the current state of the bug, please add it. 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.