--- old/src/share/classes/javax/annotation/processing/Processor.java 2013-03-26 16:16:37.000000000 -0700 +++ new/src/share/classes/javax/annotation/processing/Processor.java 2013-03-26 16:16:37.000000000 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ package javax.annotation.processing; import java.util.Set; +import javax.lang.model.util.Elements; import javax.lang.model.element.*; import javax.lang.model.SourceVersion; @@ -106,6 +107,23 @@ * processing {@code "*"} can claim the (empty) set of annotation * types. * + *

An annotation type is considered present if there is an + * annotation of that type on a declaration enclosed within the root + * elements of a round. For this purpose, a type parameter is + * considered to be enclosed by its {@linkplain + * TypeParameter#getGenericElement generic element}. Annotations on + * {@linkplain ElementType#TYPE_USE type uses} are not + * considered as part of the computation. To be present, an annotation + * must be returnable by {@link Elements#getAllAnnotationMirrors()}, + * that is, the annotation must be present on the declaration of the + * element or present via inheritance. An annotation is not + * considered present by virtue of being wrapped by a container + * annotation. Therefore, to properly process {@linkplain + * java.lang.annotation.Repeatable repeatable annotation types}, + * processors are advised to include both the annotation and its + * container in the set of {@linkplain #getSupportedAnnotationTypes() + * supported annotation types}. + * *

Note that if a processor supports {@code "*"} and returns {@code * true}, all annotations are claimed. Therefore, a universal * processor being used to, for example, implement additional validity