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. |
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) { |