Lines 587-615
Link Here
|
587 |
case Binding.FIELD : |
587 |
case Binding.FIELD : |
588 |
FieldBinding field = (FieldBinding) recipient; |
588 |
FieldBinding field = (FieldBinding) recipient; |
589 |
field.tagBits = ((FieldBinding) annotationRecipient).tagBits; |
589 |
field.tagBits = ((FieldBinding) annotationRecipient).tagBits; |
|
|
590 |
if (annotations != null) { |
591 |
// need to fill the instances array |
592 |
for (int j = 0; j < length; j++) { |
593 |
Annotation annot = sourceAnnotations[j]; |
594 |
annotations[j] = annot.getCompilerAnnotation(); |
595 |
} |
596 |
} |
590 |
break; |
597 |
break; |
591 |
case Binding.LOCAL : |
598 |
case Binding.LOCAL : |
592 |
LocalVariableBinding local = (LocalVariableBinding) recipient; |
599 |
LocalVariableBinding local = (LocalVariableBinding) recipient; |
593 |
long otherLocalTagBits = ((LocalVariableBinding) annotationRecipient).tagBits; |
600 |
long otherLocalTagBits = ((LocalVariableBinding) annotationRecipient).tagBits; |
594 |
local.tagBits = otherLocalTagBits; |
601 |
local.tagBits = otherLocalTagBits; |
595 |
/* |
602 |
if ((otherLocalTagBits & TagBits.AnnotationSuppressWarnings) == 0) { |
596 |
* Annotations are shared between two locals, but we still need to record |
603 |
// None of the annotations is a SuppressWarnings annotation |
597 |
* the suppress annotation range for the second local |
604 |
// need to fill the instances array |
598 |
*/ |
605 |
if (annotations != null) { |
599 |
if ((otherLocalTagBits & TagBits.AnnotationSuppressWarnings) != 0) { |
606 |
for (int j = 0; j < length; j++) { |
|
|
607 |
Annotation annot = sourceAnnotations[j]; |
608 |
annotations[j] = annot.getCompilerAnnotation(); |
609 |
} |
610 |
} |
611 |
} else if (annotations != null) { |
612 |
// One of the annotations at least is a SuppressWarnings annotation |
600 |
LocalDeclaration localDeclaration = local.declaration; |
613 |
LocalDeclaration localDeclaration = local.declaration; |
601 |
annotation.recordSuppressWarnings(scope, localDeclaration.declarationSourceStart, localDeclaration.declarationSourceEnd, scope.compilerOptions().suppressWarnings); |
614 |
int declarationSourceEnd = localDeclaration.declarationSourceEnd; |
|
|
615 |
int declarationSourceStart = localDeclaration.declarationSourceStart; |
616 |
for (int j = 0; j < length; j++) { |
617 |
Annotation annot = sourceAnnotations[j]; |
618 |
/* |
619 |
* Annotations are shared between two locals, but we still need to record |
620 |
* the suppress annotation range for the second local |
621 |
*/ |
622 |
AnnotationBinding annotationBinding = annot.getCompilerAnnotation(); |
623 |
annotations[j] = annotationBinding; |
624 |
if (annotationBinding != null) { |
625 |
final ReferenceBinding annotationType = annotationBinding.getAnnotationType(); |
626 |
if (annotationType != null && annotationType.id == TypeIds.T_JavaLangSuppressWarnings) { |
627 |
annot.recordSuppressWarnings(scope, declarationSourceStart, declarationSourceEnd, scope.compilerOptions().suppressWarnings); |
628 |
} |
629 |
} |
630 |
} |
602 |
} |
631 |
} |
603 |
break; |
632 |
break; |
604 |
} |
633 |
} |
605 |
if (annotations != null) { |
|
|
606 |
// need to fill the instances array |
607 |
annotations[0] = annotation.getCompilerAnnotation(); |
608 |
for (int j = 1; j < length; j++) { |
609 |
Annotation annot = sourceAnnotations[j]; |
610 |
annotations[j] = annot.getCompilerAnnotation(); |
611 |
} |
612 |
} |
613 |
return; |
634 |
return; |
614 |
} else { |
635 |
} else { |
615 |
annotation.recipient = recipient; |
636 |
annotation.recipient = recipient; |