void (@NotNull MoveMembersProcessor.MoveMembersUsageInfo usageInfo, @Nullable PsiModifierList modifierListCopy, @NotNull PsiClass targetClass, @NotNull Set<PsiMember> membersToMove, @NotNull MoveMembersOptions moveMembersOptions, @NotNull MultiMap<PsiElement, @DialogMessage String> conflicts) { final PsiElement element = usageInfo.getElement(); if (element == null) return; final PsiMember member = usageInfo.member; if (element instanceof PsiReferenceExpression) { PsiExpression qualifier = ((PsiReferenceExpression)element).getQualifierExpression(); PsiClass accessObjectClass = null; if (qualifier != null) { accessObjectClass = (PsiClass)PsiUtil.getAccessObjectClass(qualifier).getElement(); } if (!JavaResolveUtil.isAccessible(member, targetClass, modifierListCopy, element, accessObjectClass, null)) { String newVisibility = moveMembersOptions.getExplicitMemberVisibility(); String visibility = newVisibility != null ? newVisibility : VisibilityUtil.getVisibilityStringToDisplay(member); String message = RefactoringBundle.message("0.with.1.visibility.is.not.accessible.from.2", RefactoringUIUtil.getDescription(member, false), visibility, RefactoringUIUtil.getDescription(ConflictsUtil.getContainer(element), true)); conflicts.putValue(member, StringUtil.capitalize(message)); } } if (member instanceof PsiField && targetClass.isInterface()) { ReadWriteAccessDetector accessDetector = ReadWriteAccessDetector.findDetector(member); if (accessDetector != null) { ReadWriteAccessDetector.Access access = accessDetector.getExpressionAccess(element); if (access != ReadWriteAccessDetector.Access.Read) { String message = JavaRefactoringBundle.message("move.member.write.access.in.interface.conflict", RefactoringUIUtil.getDescription(member, true)); conflicts.putValue(element, StringUtil.capitalize(message)); } } } else if (member instanceof PsiField && usageInfo.reference instanceof PsiExpression && member.hasModifierProperty(PsiModifier.FINAL) && PsiUtil.isAccessedForWriting((PsiExpression)usageInfo.reference) && !RefactoringHierarchyUtil.willBeInTargetClass(usageInfo.reference, membersToMove, targetClass, true)) { conflicts.putValue(usageInfo.member, JavaBundle.message("move.member.final.initializer.conflict", RefactoringUIUtil.getDescription(member, true))); } if (toBeConvertedToEnum(moveMembersOptions, member, targetClass) && !isEnumAcceptable(element, targetClass)) { conflicts.putValue(element, JavaBundle.message("move.member.enum.conflict")); } final PsiReference reference = usageInfo.getReference(); if (reference != null) { RefactoringConflictsUtilImpl .checkAccessibilityConflictsAfterMove(reference, member, modifierListCopy, targetClass, membersToMove, conflicts); } }