Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » JDT-APT: Marking an error in another class file
JDT-APT: Marking an error in another class file [message #1727713] Fri, 25 March 2016 16:09
Stefan Beukmann is currently offline Stefan BeukmannFriend
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).
Previous Topic:Moving forward/backward by word
Next Topic:Install Java tools/plugin
Goto Forum:
  


Current Time: Tue Sep 24 14:51:19 GMT 2024

Powered by FUDForum. Page generated in 0.05081 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top