void (PsiJavaCodeReferenceElement reference) { final PsiElement resolved = reference.resolve(); if (resolved != null && !reported.contains(resolved) && !CommonRefactoringUtil.isAncestor(resolved, scopes) && !(resolved instanceof LightElement) && resolved.isPhysical() && !haveElementInScope(resolved)) { if (resolved instanceof PsiMethod) { for (PsiMethod superMethod : ((PsiMethod)resolved).findDeepestSuperMethods()) { if (haveElementInScope(superMethod)) return; } } final String scopeDescription = RefactoringUIUtil.getDescription(ConflictsUtil.getContainer(reference), true); final String message = RefactoringBundle.message("0.referenced.in.1.will.not.be.accessible.in.module.2", RefactoringUIUtil.getDescription(resolved, true), scopeDescription, CommonRefactoringUtil.htmlEmphasize(targetModule.getName())); conflicts.putValue(reference, StringUtil.capitalize(message)); reported.add(resolved); } }