void (@NotNull PsiReference reference, @NotNull PsiMember member, @Nullable PsiModifierList modifierListCopy, @Nullable PsiClass targetClass, @NotNull Set<? extends PsiMember> membersToMove, @NotNull MultiMap<PsiElement, @DialogMessage String> conflicts) { JavaPsiFacade manager = JavaPsiFacade.getInstance(member.getProject()); PsiElement ref = reference.getElement(); if (!RefactoringHierarchyUtil.willBeInTargetClass(ref, membersToMove, targetClass, false)) { // check for target class accessibility if (targetClass != null && !manager.getResolveHelper().isAccessible(targetClass, targetClass.getModifierList(), ref, null, null)) { String message = JavaRefactoringBundle.message("0.is.1.and.will.not.be.accessible.from.2.in.the.target.class", RefactoringUIUtil.getDescription(targetClass, true), VisibilityUtil.getVisibilityStringToDisplay(targetClass), RefactoringUIUtil.getDescription(ConflictsUtil.getContainer(ref), true)); message = StringUtil.capitalize(message); conflicts.putValue(targetClass, message); } // check for member accessibility else if (!manager.getResolveHelper().isAccessible(member, modifierListCopy, ref, targetClass, null)) { String message = JavaRefactoringBundle.message("0.is.1.and.will.not.be.accessible.from.2.in.the.target.class", RefactoringUIUtil.getDescription(member, true), VisibilityUtil.toPresentableText( VisibilityUtil.getVisibilityModifier(modifierListCopy)), RefactoringUIUtil.getDescription(ConflictsUtil.getContainer(ref), true)); message = StringUtil.capitalize(message); conflicts.putValue(member, message); } } }