View | Details | Raw Unified | Return to bug 167217 | Differences between
and this patch

Collapse All | Expand All

(-)compiler/org/eclipse/jdt/internal/compiler/ast/MemberValuePair.java (+13 lines)
Lines 199-204 Link Here
199
			if (leafType.isAnnotationType()) {
199
			if (leafType.isAnnotationType()) {
200
				if (!valueType.leafComponentType().isAnnotationType()) { // check annotation type and also reject null literal
200
				if (!valueType.leafComponentType().isAnnotationType()) { // check annotation type and also reject null literal
201
					scope.problemReporter().annotationValueMustBeAnnotation(this.binding.declaringClass, this.name, this.value, leafType);
201
					scope.problemReporter().annotationValueMustBeAnnotation(this.binding.declaringClass, this.name, this.value, leafType);
202
				} else if (this.value instanceof ArrayInitializer) {
203
					ArrayInitializer initializer = (ArrayInitializer) this.value;
204
					final Expression[] expressions = initializer.expressions;
205
					if (expressions != null) {
206
						for (int i =0, max = expressions.length; i < max; i++) {
207
							Expression currentExpression = expressions[i];
208
							if (currentExpression instanceof NullLiteral || !(currentExpression instanceof Annotation)) {
209
								scope.problemReporter().annotationValueMustBeAnnotation(this.binding.declaringClass, this.name, currentExpression, leafType);
210
							}
211
						}
212
					}
213
				} else if (!(this.value instanceof Annotation)) {
214
					scope.problemReporter().annotationValueMustBeAnnotation(this.binding.declaringClass, this.name, this.value, leafType);
202
				}
215
				}
203
				break checkAnnotationMethodType;
216
				break checkAnnotationMethodType;
204
			}
217
			}

Return to bug 167217