boolean (@NotNull Ref<UsageInfo[]> refUsages) { UsageInfo[] usagesIn = refUsages.get(); MultiMap<PsiElement, @DialogMessage String> conflicts = new MultiMap<>(); final Set<PsiMember> methods = Collections.singleton(myMethod); //check that method to call would be still accessible from the call places RefactoringConflictsUtil.getInstance().analyzeAccessibilityConflictsAfterMemberMove(myTargetClass, myNewVisibility, methods, conflicts); //additionally check that body of method contains only accessible in the inheritors references if (myTargetClass.isInterface() && !PsiUtil.isLanguageLevel8OrHigher(myTargetClass)) { for (final UsageInfo usage : usagesIn) { if (usage instanceof ImplementingClassUsageInfo) { PsiClass targetClass = ((ImplementingClassUsageInfo)usage).getPsiClass(); RefactoringConflictsUtilImpl.analyzeUsedElementsAfterMove(myMethod, myMethod, methods, null, targetClass, targetClass, conflicts); } } } for (final UsageInfo usageInfo : usagesIn) { PsiElement place = null; if (usageInfo instanceof MethodCallUsageInfo) { place = ((MethodCallUsageInfo)usageInfo).getMethodCall(); if (myTargetParameter != null) { final PsiExpression[] expressions = ((PsiMethodCallExpression)place).getArgumentList().getExpressions(); final int index = myMethod.getParameterList().getParameterIndex(myTargetParameter); if (index < expressions.length) { PsiExpression instanceValue = expressions[index]; instanceValue = RefactoringUtil.unparenthesizeExpression(instanceValue); if (instanceValue instanceof PsiLiteralExpression && ((PsiLiteralExpression)instanceValue).getValue() == null) { String message = JavaRefactoringBundle.message("0.contains.call.with.null.argument.for.parameter.1", RefactoringUIUtil.getDescription(ConflictsUtil.getContainer(place), true), CommonRefactoringUtil.htmlEmphasize(myTargetParameter.getName())); conflicts.putValue(place, message); } } } } else if (usageInfo instanceof MethodReferenceUsageInfo) { place = ((MethodReferenceUsageInfo)usageInfo).getExpression(); if (!((MethodReferenceUsageInfo)usageInfo).isApplicableBySecondSearch()) { conflicts.putValue(place, JavaRefactoringBundle.message("expand.method.reference.warning")); } } if (myTargetParameter == null && place != null && myTargetClass.hasTypeParameters() && !thisAccessExpressionApplicable(place)) { conflicts.putValue(place, JavaRefactoringBundle.message("infer.class.type.args.warning", myTargetClass.getName())); } } return showConflicts(conflicts, usagesIn); }