[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.jdt] Question on Marker use (APT vs. JavaModel)

I have some custom annotations I've created, and in my AnnotationProcessor I may flag errors on the annotations using EclipseMessager.printFixableError(...).

This works fine in the context of the Annotation Processor and Quick fix processors. However, now i have a need to have these errors be visible outside of annotation processing (specifically, I want to enable/disable particular actions based on whether there are annotation errors).

I tried to retrieve the error markers by using ICompilationUnit.getUnderlyingResource().findMarkers(), but even when returning all marker types, the markers created by EclipseMessager.printFixableError() are not being seen.

Question 1: Is there a way to retrieve the markers created by EclipseMessager.printFixableError starting from an ICompilationUnit?

I tried to work around this by creating a new marker type that extends the JavaModel problem marker -- but within my annotation processor, if I try to create a marker of this type on the file, it appears to re-trigger annotation processing, resulting in infinite recursion.

So if the answer to Question 1 is no, Question 2 is how can I create problem markers on a file from within an annotation processor without triggering this recursive behavior?

Thanks,
Mike