Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Annotation Processing sometimes misses annotated class
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
Previous Topic:Installing Eclipse for Java
Next Topic:Source code from folder in "subst" unit, not found
Goto Forum:
  


Current Time: Tue Oct 21 02:25:16 GMT 2014

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

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