|Annotation Processing sometimes misses annotated class [message #900419]
||Mon, 06 August 2012 20:53
We have a project that effectively produces a set of text files based on |
annotated class. All in all we have 22 annotated classes out of
thousands and sometimes eclipse will find all the annotated classes.
The problem is that sometimes it won't. All the class are properly
compiled, just from debugging into the following method we see that the
RoundEnvironment rarely through multiple rounds will it return all 22
classes. Instead we get a consistent 15 that are returned.
Any idea where to debug in eclipse to figure out why it can compile the
classes all the time but only sometimes return the annotated classes?
public boolean preProcess( final Set<? extends TypeElement>
for( TypeElement annotation : annotations )
List<Tuple<Element, AnnotationMirror>> elements = new
Set<? extends Element> annotatedElements =
roundEnv.getElementsAnnotatedWith( annotation );
for( Element element : annotatedElements)
for( AnnotationMirror annotationMirror :
.toString() ) )
elements.add( new Tuple<>( element,
annotationMirror ) );
if( elements.size() > 0 )
roundMap.put( annotation, elements );