Index: MethodDeclaration.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/ast/MethodDeclaration.java,v retrieving revision 1.48 diff -u -r1.48 MethodDeclaration.java --- MethodDeclaration.java 30 May 2005 15:53:25 -0000 1.48 +++ MethodDeclaration.java 21 Jun 2005 08:26:42 -0000 @@ -135,16 +135,17 @@ } // check @Override annotation - if (this.binding != null) { + checkOverride: { + if (this.binding == null) break checkOverride; + if (scope.compilerOptions().sourceLevel < JDK1_5) break checkOverride; int bindingModifiers = this.binding.modifiers; - if ((this.binding.tagBits & TagBits.AnnotationOverride) != 0 - && (bindingModifiers & AccOverriding) == 0) { - // claims to override, and doesn't actually do so - scope.problemReporter().methodMustOverride(this); - } else if ((this.binding.tagBits & TagBits.AnnotationOverride) == 0 - && (this.binding.declaringClass.modifiers & AccInterface) == 0 - && (bindingModifiers & (AccStatic|AccOverriding)) == AccOverriding - && scope.compilerOptions().sourceLevel >= JDK1_5) { + boolean hasOverrideAnnotation = (this.binding.tagBits & TagBits.AnnotationOverride) != 0; + boolean isInterfaceMethod = this.binding.declaringClass.isInterface(); + if (hasOverrideAnnotation) { + if ((bindingModifiers & AccOverriding) == 0 || isInterfaceMethod) + // claims to override, and doesn't actually do so + scope.problemReporter().methodMustOverride(this); + } else if (!isInterfaceMethod && (bindingModifiers & (AccStatic|AccOverriding)) == AccOverriding) { // actually overrides, but did not claim to do so scope.problemReporter().missingOverrideAnnotation(this); }