void () { final PsiElement[] children = myClass.getChildren(); for (PsiElement child : children) { if (child instanceof PsiMember && !myMovedMembers.contains(child)) { child.accept(new UsedMovedMembersConflictsCollector(child)); } } final PsiAnnotation annotation = AnnotationUtil.findAnnotation(myClass, CommonClassNames.JAVA_LANG_FUNCTIONAL_INTERFACE); if (annotation != null && myMovedMembers.contains(LambdaUtil.getFunctionalInterfaceMethod(myClass))) { myConflicts.putValue(annotation, JavaRefactoringBundle.message("functional.interface.broken")); } boolean isAbstract = myClass.hasModifierProperty(PsiModifier.ABSTRACT); for (PsiMember member : myMovedMembers) { if (!member.hasModifierProperty(PsiModifier.STATIC)) { member.accept(new JavaRecursiveElementWalkingVisitor() { @Override public void visitMethodCallExpression(@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); if (expression.getMethodExpression().getQualifierExpression() instanceof PsiSuperExpression) { final PsiMethod resolvedMethod = expression.resolveMethod(); if (resolvedMethod != null) { final PsiClass resolvedClass = resolvedMethod.getContainingClass(); if (resolvedClass != null && myClass.isInheritor(resolvedClass, true)) { final PsiMethod methodBySignature = myClass.findMethodBySignature(resolvedMethod, false); if (methodBySignature != null && !myMovedMembers.contains(methodBySignature)) { myConflicts.putValue(expression, JavaBundle.message("push.down.super.method.call.changed.conflict")); } } } } } }); } if (!member.hasModifierProperty(PsiModifier.STATIC) && member instanceof PsiMethod && !myAbstractMembers.contains(member)) { Set<PsiClass> unrelatedDefaults = new LinkedHashSet<>(); for (PsiMethod superMethod : ((PsiMethod)member).findSuperMethods()) { if (!isAbstract && superMethod.hasModifierProperty(PsiModifier.ABSTRACT)) { myConflicts.putValue(member, JavaBundle .message("push.down.missed.implementation.conflict", RefactoringUIUtil.getDescription(myClass, false), RefactoringUIUtil.getDescription(superMethod, false))); break; } if (superMethod.hasModifierProperty(PsiModifier.DEFAULT)) { unrelatedDefaults.add(superMethod.getContainingClass()); if (unrelatedDefaults.size() > 1) { List<PsiClass> supers = new ArrayList<>(unrelatedDefaults); supers.sort(Comparator.comparing(PsiClass::getName)); PsiClass lastClass = supers.remove(supers.size() - 1); myConflicts.putValue(member, StringUtil .capitalize(JavaRefactoringBundle .message("push.down.unrelated.defaults.conflict", RefactoringUIUtil.getDescription(myClass, false), StringUtil.join(supers, aClass -> RefactoringUIUtil.getDescription(aClass, false), ", "), RefactoringUIUtil.getDescription(lastClass, false)))); break; } } } } } }