langtools/src/java.compiler/share/classes/javax/annotation/processing/RoundEnvironment.java
author jlahoda
Tue, 13 Dec 2016 10:49:28 +0100
changeset 42815 050370edaade
parent 38919 88f6e6f58798
child 43567 d0d89c3da7be
permissions -rw-r--r--
8072988: Update javax.annotation.processing for modules Summary: Support for generating files in multi-module mode. Reviewed-by: darcy, jjg Contributed-by: joe.darcy@oracle.com, jan.lahoda@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
38919
88f6e6f58798 8159378: Correct wording of RoundEnvironment.getElementsAnnotatedWithAny
darcy
parents: 38606
diff changeset
     2
 * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 10
diff changeset
    23
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
06bc494ca11e Initial load
duke
parents:
diff changeset
    26
package javax.annotation.processing;
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
import javax.lang.model.element.Element;
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
import javax.lang.model.element.TypeElement;
38606
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
    30
import java.util.LinkedHashSet;
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
    31
import java.util.Collections;
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
import java.util.Set;
06bc494ca11e Initial load
duke
parents:
diff changeset
    33
import java.lang.annotation.Annotation;
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
/**
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 * An annotation processing tool framework will {@linkplain
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 * Processor#process provide an annotation processor with an object
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
 * implementing this interface} so that the processor can query for
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
 * information about a round of annotation processing.
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    41
 * @author Joseph D. Darcy
06bc494ca11e Initial load
duke
parents:
diff changeset
    42
 * @author Scott Seligman
06bc494ca11e Initial load
duke
parents:
diff changeset
    43
 * @author Peter von der Ahé
06bc494ca11e Initial load
duke
parents:
diff changeset
    44
 * @since 1.6
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    46
public interface RoundEnvironment {
06bc494ca11e Initial load
duke
parents:
diff changeset
    47
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    48
     * Returns {@code true} if types generated by this round will not
06bc494ca11e Initial load
duke
parents:
diff changeset
    49
     * be subject to a subsequent round of annotation processing;
06bc494ca11e Initial load
duke
parents:
diff changeset
    50
     * returns {@code false} otherwise.
06bc494ca11e Initial load
duke
parents:
diff changeset
    51
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    52
     * @return {@code true} if types generated by this round will not
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
     * be subject to a subsequent round of annotation processing;
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
     * returns {@code false} otherwise
06bc494ca11e Initial load
duke
parents:
diff changeset
    55
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    56
    boolean processingOver();
06bc494ca11e Initial load
duke
parents:
diff changeset
    57
06bc494ca11e Initial load
duke
parents:
diff changeset
    58
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
     * Returns {@code true} if an error was raised in the prior round
06bc494ca11e Initial load
duke
parents:
diff changeset
    60
     * of processing; returns {@code false} otherwise.
06bc494ca11e Initial load
duke
parents:
diff changeset
    61
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    62
     * @return {@code true} if an error was raised in the prior round
06bc494ca11e Initial load
duke
parents:
diff changeset
    63
     * of processing; returns {@code false} otherwise
06bc494ca11e Initial load
duke
parents:
diff changeset
    64
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    65
    boolean errorRaised();
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
06bc494ca11e Initial load
duke
parents:
diff changeset
    67
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    68
     * Returns the root elements for annotation processing generated
06bc494ca11e Initial load
duke
parents:
diff changeset
    69
     * by the prior round.
06bc494ca11e Initial load
duke
parents:
diff changeset
    70
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    71
     * @return the root elements for annotation processing generated
06bc494ca11e Initial load
duke
parents:
diff changeset
    72
     * by the prior round, or an empty set if there were none
06bc494ca11e Initial load
duke
parents:
diff changeset
    73
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    74
    Set<? extends Element> getRootElements();
06bc494ca11e Initial load
duke
parents:
diff changeset
    75
06bc494ca11e Initial load
duke
parents:
diff changeset
    76
    /**
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
     * Returns the elements annotated with the given annotation type.
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
     * The annotation may appear directly or be inherited.  Only
42815
050370edaade 8072988: Update javax.annotation.processing for modules
jlahoda
parents: 38919
diff changeset
    79
     * package elements, module elements, and type elements <i>included</i> in this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    80
     * round of annotation processing, or declarations of members,
06bc494ca11e Initial load
duke
parents:
diff changeset
    81
     * constructors, parameters, or type parameters declared within
06bc494ca11e Initial load
duke
parents:
diff changeset
    82
     * those, are returned.  Included type elements are {@linkplain
06bc494ca11e Initial load
duke
parents:
diff changeset
    83
     * #getRootElements root types} and any member types nested within
42815
050370edaade 8072988: Update javax.annotation.processing for modules
jlahoda
parents: 38919
diff changeset
    84
     * them.  Elements of a package are not considered included simply
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    85
     * because a {@code package-info} file for that package was
06bc494ca11e Initial load
duke
parents:
diff changeset
    86
     * created.
42815
050370edaade 8072988: Update javax.annotation.processing for modules
jlahoda
parents: 38919
diff changeset
    87
     * Likewise, elements of a module are not considered included
050370edaade 8072988: Update javax.annotation.processing for modules
jlahoda
parents: 38919
diff changeset
    88
     * simply because a {@code module-info} file for that module was
050370edaade 8072988: Update javax.annotation.processing for modules
jlahoda
parents: 38919
diff changeset
    89
     * created
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    90
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
    91
     * @param a  annotation type being requested
06bc494ca11e Initial load
duke
parents:
diff changeset
    92
     * @return the elements annotated with the given annotation type,
06bc494ca11e Initial load
duke
parents:
diff changeset
    93
     * or an empty set if there are none
06bc494ca11e Initial load
duke
parents:
diff changeset
    94
     * @throws IllegalArgumentException if the argument does not
06bc494ca11e Initial load
duke
parents:
diff changeset
    95
     * represent an annotation type
06bc494ca11e Initial load
duke
parents:
diff changeset
    96
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
    97
    Set<? extends Element> getElementsAnnotatedWith(TypeElement a);
06bc494ca11e Initial load
duke
parents:
diff changeset
    98
06bc494ca11e Initial load
duke
parents:
diff changeset
    99
    /**
38606
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   100
     * Returns the elements annotated with one or more of the given
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   101
     * annotation types.
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   102
     *
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   103
     * @apiNote This method may be useful when processing repeating
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   104
     * annotations by looking for an annotation type and its
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   105
     * containing annotation type at the same time.
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   106
     *
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   107
     * @implSpec The default implementation of this method creates an
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   108
     * empty result set, iterates over the annotations in the argument
38919
88f6e6f58798 8159378: Correct wording of RoundEnvironment.getElementsAnnotatedWithAny
darcy
parents: 38606
diff changeset
   109
     * array calling {@link #getElementsAnnotatedWith(TypeElement)} on
38606
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   110
     * each annotation and adding those results to the result
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   111
     * set. Finally, the contents of the result set are returned as an
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   112
     * unmodifiable set.
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   113
     *
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   114
     * @param annotations  annotation types being requested
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   115
     * @return the elements annotated with one or more of the given
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   116
     * annotation types, or an empty set if there are none
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   117
     * @throws IllegalArgumentException if the any elements of the
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   118
     * argument set do not represent an annotation type
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   119
     * @jls 9.6.3 Repeatable Annotation Types
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   120
     * @since 9
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   121
     */
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   122
    default Set<? extends Element> getElementsAnnotatedWithAny(TypeElement... annotations){
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   123
        // Use LinkedHashSet rather than HashSet for predictability
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   124
        Set<Element> result = new LinkedHashSet<>();
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   125
        for (TypeElement annotation : annotations) {
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   126
            result.addAll(getElementsAnnotatedWith(annotation));
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   127
        }
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   128
        return Collections.unmodifiableSet(result);
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   129
    }
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   130
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   131
    /**
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   132
     * Returns the elements annotated with the given annotation type.
06bc494ca11e Initial load
duke
parents:
diff changeset
   133
     * The annotation may appear directly or be inherited.  Only
42815
050370edaade 8072988: Update javax.annotation.processing for modules
jlahoda
parents: 38919
diff changeset
   134
     * package elements, module elements, and type elements <i>included</i> in this
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   135
     * round of annotation processing, or declarations of members,
06bc494ca11e Initial load
duke
parents:
diff changeset
   136
     * constructors, parameters, or type parameters declared within
06bc494ca11e Initial load
duke
parents:
diff changeset
   137
     * those, are returned.  Included type elements are {@linkplain
06bc494ca11e Initial load
duke
parents:
diff changeset
   138
     * #getRootElements root types} and any member types nested within
06bc494ca11e Initial load
duke
parents:
diff changeset
   139
     * them.  Elements in a package are not considered included simply
06bc494ca11e Initial load
duke
parents:
diff changeset
   140
     * because a {@code package-info} file for that package was
06bc494ca11e Initial load
duke
parents:
diff changeset
   141
     * created.
42815
050370edaade 8072988: Update javax.annotation.processing for modules
jlahoda
parents: 38919
diff changeset
   142
     * Likewise, elements of a module are not considered included
050370edaade 8072988: Update javax.annotation.processing for modules
jlahoda
parents: 38919
diff changeset
   143
     * simply because a {@code module-info} file for that module was
050370edaade 8072988: Update javax.annotation.processing for modules
jlahoda
parents: 38919
diff changeset
   144
     * created
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   145
     *
06bc494ca11e Initial load
duke
parents:
diff changeset
   146
     * @param a  annotation type being requested
06bc494ca11e Initial load
duke
parents:
diff changeset
   147
     * @return the elements annotated with the given annotation type,
06bc494ca11e Initial load
duke
parents:
diff changeset
   148
     * or an empty set if there are none
06bc494ca11e Initial load
duke
parents:
diff changeset
   149
     * @throws IllegalArgumentException if the argument does not
06bc494ca11e Initial load
duke
parents:
diff changeset
   150
     * represent an annotation type
06bc494ca11e Initial load
duke
parents:
diff changeset
   151
     */
06bc494ca11e Initial load
duke
parents:
diff changeset
   152
    Set<? extends Element> getElementsAnnotatedWith(Class<? extends Annotation> a);
38606
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   153
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   154
    /**
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   155
     * Returns the elements annotated with one or more of the given
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   156
     * annotation types.
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   157
     *
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   158
     * @apiNote This method may be useful when processing repeating
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   159
     * annotations by looking for an annotation type and its
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   160
     * containing annotation type at the same time.
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   161
     *
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   162
     * @implSpec The default implementation of this method creates an
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   163
     * empty result set, iterates over the annotations in the argument
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   164
     * set calling {@link #getElementsAnnotatedWith(Class)} on
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   165
     * each annotation and adding those results to the result
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   166
     * set. Finally, the contents of the result set are returned as an
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   167
     * unmodifiable set.
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   168
     *
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   169
     * @param annotations  annotation types being requested
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   170
     * @return the elements annotated with one or more of the given
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   171
     * annotation types, or an empty set if there are none
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   172
     * @throws IllegalArgumentException if the any elements of the
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   173
     * argument set do not represent an annotation type
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   174
     * @jls 9.6.3 Repeatable Annotation Types
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   175
     * @since 9
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   176
     */
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   177
    default Set<? extends Element> getElementsAnnotatedWithAny(Set<Class<? extends Annotation>> annotations){
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   178
        // Use LinkedHashSet rather than HashSet for predictability
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   179
        Set<Element> result = new LinkedHashSet<>();
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   180
        for (Class<? extends Annotation> annotation : annotations) {
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   181
            result.addAll(getElementsAnnotatedWith(annotation));
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   182
        }
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   183
        return Collections.unmodifiableSet(result);
6b708cd90241 8032230: Enhance javax.a.p.RoundEnvironment after repeating annotations
darcy
parents: 25874
diff changeset
   184
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   185
}