void (final PsiClass targetClass, final PsiMember movedMember) { if (movedMember instanceof PsiField) { String name = ((PsiField)movedMember).getName(); final PsiField field = targetClass.findFieldByName(name, false); if (field != null) { String message = JavaRefactoringBundle.message("0.already.contains.field.1", RefactoringUIUtil.getDescription(targetClass, false), CommonRefactoringUtil.htmlEmphasize(name)); myConflicts.putValue(field, StringUtil.capitalize(message)); } } else if (movedMember instanceof PsiMethod) { final PsiModifierList modifierList = movedMember.getModifierList(); assert modifierList != null; if (!modifierList.hasModifierProperty(PsiModifier.ABSTRACT)) { PsiMethod method = (PsiMethod)movedMember; final PsiMethod overrider = MethodSignatureUtil.findMethodBySuperMethod(targetClass, method, false); if (overrider != null && ReferencesSearch.search(method, new LocalSearchScope(overrider)).findAll().size() != 1) { String message = RefactoringBundle.message("0.is.already.overridden.in.1", RefactoringUIUtil.getDescription(method, true), RefactoringUIUtil.getDescription(targetClass, false)); myConflicts.putValue(overrider, StringUtil.capitalize(message)); } } } else if (movedMember instanceof PsiClass aClass) { final String name = aClass.getName(); final PsiClass[] allInnerClasses = targetClass.getAllInnerClasses(); for (PsiClass innerClass : allInnerClasses) { if (innerClass.equals(movedMember)) continue; if (Objects.requireNonNull(name).equals(innerClass.getName())) { String message = JavaRefactoringBundle.message("0.already.contains.inner.class.named.1", RefactoringUIUtil.getDescription(targetClass, false), CommonRefactoringUtil.htmlEmphasize(name)); myConflicts.putValue(innerClass, message); } } } if (movedMember.hasModifierProperty(PsiModifier.STATIC) && !targetClass.hasModifierProperty(PsiModifier.STATIC) && !(targetClass.getParent() instanceof PsiFile) && !HighlightingFeature.INNER_STATICS.isAvailable(targetClass)) { myConflicts.putValue(movedMember, JavaBundle.message("push.down.static.nonstatic.conflict", RefactoringUIUtil.getDescription(movedMember, false), RefactoringUIUtil.getDescription(targetClass, false))); } }