diff --git a/java/java-impl/src/com/intellij/codeInspection/reference/RefMethodImpl.java b/java/java-impl/src/com/intellij/codeInspection/reference/RefMethodImpl.java index 1ab4f888c691..f5aa2c90b0a7 100644 --- a/java/java-impl/src/com/intellij/codeInspection/reference/RefMethodImpl.java +++ b/java/java-impl/src/com/intellij/codeInspection/reference/RefMethodImpl.java @@ -179,6 +179,9 @@ public class RefMethodImpl extends RefJavaElementImpl implements RefMethod { @NotNull public Collection getSuperMethods() { if (mySuperMethods == null) return EMPTY_METHOD_LIST; + if (mySuperMethods.size() > 10) { + LOG.info("method: " + getName() + " owner:" + getOwnerClass().getQualifiedName()); + } return mySuperMethods; } @@ -216,7 +219,7 @@ public class RefMethodImpl extends RefJavaElementImpl implements RefMethod { } public void addSuperMethod(RefMethodImpl refSuperMethod) { - if (!getSuperMethods().contains(refSuperMethod)) { + if (!getSuperMethods().contains(refSuperMethod) && !refSuperMethod.getSuperMethods().contains(this)) { if (mySuperMethods == null){ mySuperMethods = new ArrayList(1); } @@ -225,7 +228,7 @@ public class RefMethodImpl extends RefJavaElementImpl implements RefMethod { } public void markExtended(RefMethodImpl method) { - if (!getDerivedMethods().contains(method)) { + if (!getDerivedMethods().contains(method) && !method.getDerivedMethods().contains(this)) { if (myDerivedMethods == null) { myDerivedMethods = new ArrayList(1); }