JDT-APT: Marking an error in another class file [message #1727713] |
Fri, 25 March 2016 16:09 |
Stefan Beukmann Messages: 1 Registered: March 2016 |
Junior Member |
|
|
Hi,
I am trying to writing a processor that checks if several classes are annotated in a consistent way. Therefore I would like to print (fixable) errors via the messager to class files that are referenced from the currently edited file.
E.g. if you have a class A annotated with an JPA-@Entity annotation and you have field-reference to a class B that isn't annotated with @Entity, I would like to print an error to the class declaration of B.
If I print the error (while running the processor on A) with the "ClassDeclaration"-Object of B via the EclipseMessager, the error will show up in A (but with the line number of the class declaration of B), although the SourcePositionImpl cleared references B. The "problems tab" also shows the wrong ressource (A).
Am I doing something wrong or is this a bug?
Interestingly, if I use the JDK 6 API to write the processor the location is fine, but I cannot print a "fixable" error (since EclipseMessager is only available to the JDK 5 API).
|
|
|
Powered by
FUDForum. Page generated in 0.05081 seconds