Bug 428357 - Annotation Processor Warnings not shown in Editor
Summary: Annotation Processor Warnings not shown in Editor
Status: NEW
Alias: None
Product: JDT
Classification: Eclipse Project
Component: APT (show other bugs)
Version: 4.3.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jay Arthanareeswaran CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-17 09:28 EST by Markus Vieghofer CLA
Modified: 2022-07-15 15:59 EDT (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Vieghofer CLA 2014-02-17 09:28:10 EST
I use annotation processing to process various files. One step of this process is to validate them, if they are correct. When there are semantical problems in the file I print warnings or errors depending on how critical the problem is. For doing this I use the 

processingEnvironment.getMessager().printMessage(Kind.ERROR, "msg", element);

method (when it's not an error but a warnnig I use Kind.WARNING of course). The problem is that if a file only contains warnings, no matter if they are Kind.WARNING or Kind.MANDATORY_WARNING, they are not displayed in the editor or the "Problems" tab. I can only see them in the "Error Log".

When the file also has errors, I can see the errors and the warnings in the editor and the "Prblems" view.
Comment 1 Doug Simon CLA 2014-08-27 07:02:54 EDT
I see something similar. Strictly speaking, I believe this is spec compliant in that the 'element' parameter to Messager.printMessage is only a hint and further more there's no guarantee as to where the messages will be printed.

What's weird is that the Eclipse batch compiler will always print an error message at the source location of the hint element. Eclipse itself however seems to send the message to the Error Log if the hint element is not part of the source type (or project?) currently being processed by the annotation processor. This is unfortunate as one now needs to determine where the message may be going and if there's a chance it won't be printed on the hint element, the message needs to be augmented with the fully qualified name of the hint element.
Comment 2 Morten Christensen CLA 2014-10-27 12:36:00 EDT
At the very minimum they Kind.MANDATORY_WARNING's should be shown in the problem view.
Comment 3 Jay Arthanareeswaran CLA 2014-10-28 01:57:31 EDT
Will consider this for 4.5, but no promise yet.
Comment 4 Jay Arthanareeswaran CLA 2015-05-12 04:44:28 EDT
No progress on this. Will look at it during 4.6.
Comment 5 Walter Harley CLA 2015-05-15 02:27:57 EDT
FWIW, we definitely weren't doing it out of spec compliance.  My recollection is that at the time the error is created (in the incremental version anyhow) we just don't always have access to the location information, and without location information we don't have a way to create a Problem.

But as for why warnings would only show up if there are also errors - that just seems very strange.  I don't think it used to be that way and I wonder if this has somehow regressed; maybe the behavior of the Problems window changed in a way that exposes a bug that didn't use to matter, or something.
Comment 6 Jay Arthanareeswaran CLA 2016-04-05 04:34:09 EDT
No progress yet and unlikely to get time during 4.6. Moving out.
Comment 7 Mikael Petterson CLA 2017-08-15 07:45:03 EDT
Hi

What happened to this issue?

//mikael
Comment 8 Eclipse Genie CLA 2020-07-06 08:36:22 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 9 Eclipse Genie CLA 2022-07-15 15:59:29 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.