@@ -0,0 +1,2723 @@
+/*%0A * Copyright 2005 Bas Leijdekkers%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.siyeh.ig.classlayout;%0A%0Aimport com.intellij.codeInsight.daemon.GroupNames;%0Aimport com.intellij.psi.PsiCodeBlock;%0Aimport com.intellij.psi.PsiElement;%0Aimport com.intellij.psi.PsiMethod;%0Aimport com.intellij.psi.PsiModifierList;%0Aimport com.siyeh.ig.BaseInspectionVisitor;%0Aimport com.siyeh.ig.MethodInspection;%0Aimport com.siyeh.ig.psiutils.EquivalenceChecker;%0Aimport org.jetbrains.annotations.Nullable;%0A%0Apublic class RedundantMethodOverrideInspection extends MethodInspection %7B%0A%0A    public String getGroupDisplayName() %7B%0A        return GroupNames.INHERITANCE_GROUP_NAME;%0A    %7D%0A%0A    public String getDisplayName() %7B%0A        return %22Method is identical to super method%22;%0A    %7D%0A%0A    @Nullable%0A    protected String buildErrorString(PsiElement location) %7B%0A        return %22Method '#ref()' is identical to super method%22;%0A    %7D%0A%0A    public BaseInspectionVisitor buildVisitor() %7B%0A        return new RedundantMethodOverrideVisitor();%0A    %7D%0A%0A    private static class RedundantMethodOverrideVisitor%0A            extends BaseInspectionVisitor %7B%0A%0A        public void visitMethod(PsiMethod method) %7B%0A            super.visitMethod(method);%0A            final PsiCodeBlock body = method.getBody();%0A            if (body == null) %7B%0A                return;%0A            %7D%0A            final PsiMethod%5B%5D superMethods = method.findSuperMethods(false);%0A            if (superMethods.length == 0) %7B%0A                return;%0A            %7D%0A            final PsiMethod superMethod = superMethods%5B0%5D;%0A            final PsiCodeBlock superBody = superMethod.getBody();%0A            if (superBody == null) %7B%0A                return;%0A            %7D%0A            final PsiModifierList superModifierList =%0A                    superMethod.getModifierList();%0A            final PsiModifierList modifierList = method.getModifierList();%0A            if (!EquivalenceChecker.modifierListsAreEquivalent(%0A                    modifierList, superModifierList)) %7B%0A                return;%0A            %7D%0A            if (!EquivalenceChecker.codeBlocksAreEquivalent(body, superBody)) %7B%0A                return;%0A            %7D%0A            registerMethodError(method);%0A        %7D%0A    %7D%0A%7D

fix for IDEADEV-2368