this.typeParameters[i].resolve(this.scope);
}
}
// check @Override annotation
final CompilerOptions compilerOptions = this.scope.compilerOptions();
checkOverride: {
if (this.binding == null) break checkOverride;
long sourceLevel = compilerOptions.sourceLevel;
if (sourceLevel < ClassFileConstants.JDK1_5) break checkOverride;
int bindingModifiers = this.binding.modifiers;
boolean hasOverrideAnnotation = (this.binding.tagBits & TagBits.AnnotationOverride) != 0;
boolean isInterfaceMethod = this.binding.declaringClass.isInterface();
if (hasOverrideAnnotation) {
// no static method is considered overriding
if (!isInterfaceMethod && (bindingModifiers & (ClassFileConstants.AccStatic|ExtraCompilerModifiers.AccOverriding)) == ExtraCompilerModifiers.AccOverriding)
break checkOverride;
// in 1.5, strictly for overriding superclass method
// in 1.6 and above, also tolerate implementing interface method
if (sourceLevel >= ClassFileConstants.JDK1_6
&& ((bindingModifiers & (ClassFileConstants.AccStatic|ExtraCompilerModifiers.AccImplementing)) == ExtraCompilerModifiers.AccImplementing))
break checkOverride;
// claims to override, and doesn't actually do so
this.scope.problemReporter().methodMustOverride(this);
} else if (!isInterfaceMethod
&& (bindingModifiers & (ClassFileConstants.AccStatic|ExtraCompilerModifiers.AccOverriding)) == ExtraCompilerModifiers.AccOverriding) {
// actually overrides, but did not claim to do so
this.scope.problemReporter().missingOverrideAnnotation(this);
}
}
// by grammatical construction, interface methods are always abstract
switch (TypeDeclaration.kind(this.scope.referenceType().modifiers)) {
case TypeDeclaration.ENUM_DECL :
if (this.selector == TypeConstants.VALUES) break;
if (this.selector == TypeConstants.VALUEOF) break;
case TypeDeclaration.CLASS_DECL :
// if a method has an semicolon body and is not declared as abstract==>error
// native methods may have a semicolon body
if ((this.modifiers & ExtraCompilerModifiers.AccSemicolonBody) != 0) {
if ((this.modifiers & ClassFileConstants.AccNative) == 0)
if ((this.modifiers & ClassFileConstants.AccAbstract) == 0)
this.scope.problemReporter().methodNeedBody(this);
} else {
// the method HAS a body --> abstract native modifiers are forbiden
if (((this.modifiers & ClassFileConstants.AccNative) != 0) || ((this.modifiers & ClassFileConstants.AccAbstract) != 0))
this.scope.problemReporter().methodNeedingNoBody(this);
}
}
super.resolveStatements();
// TagBits.OverridingMethodWithSupercall is set during the resolveStatements() call
if (compilerOptions.getSeverity(CompilerOptions.OverridingMethodWithoutSuperInvocation) != ProblemSeverities.Ignore) {
if (this.binding != null) {
int bindingModifiers = this.binding.modifiers;
if ((bindingModifiers & (ExtraCompilerModifiers.AccOverriding|ExtraCompilerModifiers.AccImplementing)) == ExtraCompilerModifiers.AccOverriding
&& (this.bits & ASTNode.OverridingMethodWithSupercall) == 0) {
this.scope.problemReporter().overridesMethodWithoutSuperInvocation(this.binding);