test/tools/javac/annotations/repeatingAnnotations/combo/TargetAnnoCombo.java

changeset 2250
66570bfdbdd7
parent 1641
195b71850b56
child 2525
2eb010b6cb22
equal deleted inserted replaced
2249:aec87f856502 2250:66570bfdbdd7
1 /* 1 /*
2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
21 * questions. 21 * questions.
22 */ 22 */
23 23
24 /* 24 /*
25 * @test 25 * @test
26 * @bug 7151010 8006547 8007766 26 * @bug 7151010 8006547 8007766 8029017
27 * @summary Default test cases for running combinations for Target values 27 * @summary Default test cases for running combinations for Target values
28 * @build Helper 28 * @build Helper
29 * @run main TargetAnnoCombo 29 * @run main TargetAnnoCombo
30 */ 30 */
31 31
143 containerAnnotations.contains(TYPE_PARAMETER)); 143 containerAnnotations.contains(TYPE_PARAMETER));
144 } 144 }
145 145
146 Set<ElementType> tempBaseSet = EnumSet.noneOf(ElementType.class); 146 Set<ElementType> tempBaseSet = EnumSet.noneOf(ElementType.class);
147 tempBaseSet.addAll(baseAnnotations); 147 tempBaseSet.addAll(baseAnnotations);
148
148 // If BaseAnno has TYPE, then ANNOTATION_TYPE is allowed by default. 149 // If BaseAnno has TYPE, then ANNOTATION_TYPE is allowed by default.
149 if (baseAnnotations.contains(TYPE)) { 150 if (baseAnnotations.contains(TYPE)) {
150 tempBaseSet.add(ANNOTATION_TYPE); 151 tempBaseSet.add(ANNOTATION_TYPE);
152 }
153
154 // If BaseAnno has TYPE_USE, then add the extra allowed types
155 if (baseAnnotations.contains(TYPE_USE)) {
156 tempBaseSet.add(ANNOTATION_TYPE);
157 tempBaseSet.add(TYPE);
158 tempBaseSet.add(TYPE_PARAMETER);
151 } 159 }
152 160
153 // If containerAnno has no @Target, only valid case if baseAnnoTarget has 161 // If containerAnno has no @Target, only valid case if baseAnnoTarget has
154 // all targets defined else invalid set. 162 // all targets defined else invalid set.
155 if (containerAnnotations == null) { 163 if (containerAnnotations == null) {

mercurial