Expression currentExpression = expressions[i];
if (currentExpression instanceof NullLiteral) {
scope.problemReporter().annotationValueMustBeConstant(this.binding.declaringClass, this.name, currentExpression, true);
} else if (currentExpression instanceof NameReference) {
NameReference nameReference = (NameReference) currentExpression;
final Binding nameReferenceBinding = nameReference.binding;
if (nameReferenceBinding.kind() == Binding.FIELD) {
FieldBinding fieldBinding = (FieldBinding) nameReferenceBinding;
if (!fieldBinding.declaringClass.isEnum()) {
scope.problemReporter().annotationValueMustBeConstant(this.binding.declaringClass, this.name, currentExpression, true);
}
}
}
}
}
} else if (this.value instanceof NameReference) {
NameReference nameReference = (NameReference) this.value;
final Binding nameReferenceBinding = nameReference.binding;
if (nameReferenceBinding.kind() == Binding.FIELD) {
FieldBinding fieldBinding = (FieldBinding) nameReferenceBinding;
if (!fieldBinding.declaringClass.isEnum()) {
if (!fieldBinding.type.isArrayType()) {
scope.problemReporter().annotationValueMustBeConstant(this.binding.declaringClass, this.name, this.value, true);
} else {