Annotation Processing sometimes misses annotated class [message #900419] |
Tue, 07 August 2012 00:53 |
Eclipse User |
|
|
|
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>
annotations )
{
for( TypeElement annotation : annotations )
{
List<Tuple<Element, AnnotationMirror>> elements = new
ArrayList<>();
Set<? extends Element> annotatedElements =
roundEnv.getElementsAnnotatedWith( annotation );
for( Element element : annotatedElements)
{
for( AnnotationMirror annotationMirror :
element.getAnnotationMirrors() )
{
if(
annotation.getQualifiedName().toString().equals(
annotationMirror.getAnnotationType()
.toString() ) )
{
elements.add( new Tuple<>( element,
annotationMirror ) );
}
}
}
if( elements.size() > 0 )
{
roundMap.put( annotation, elements );
}
}
return ensureAllSupportedAnnotations();
}
Wb
|
|
|
Powered by
FUDForum. Page generated in 0.02993 seconds