Community
Participate
Working Groups
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.
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.
At the very minimum they Kind.MANDATORY_WARNING's should be shown in the problem view.
Will consider this for 4.5, but no promise yet.
No progress on this. Will look at it during 4.6.
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.
No progress yet and unlikely to get time during 4.6. Moving out.
Hi What happened to this issue? //mikael
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.