void (MultiMap<PsiElement, @NlsContexts.DialogMessage String> conflicts) { super.checkMethodConflicts(conflicts); final VariableData[] parameters = getChosenParameters(); final Map<String, PsiLocalVariable> vars = new HashMap<>(); for (PsiElement element : myElements) { element.accept(new JavaRecursiveElementWalkingVisitor() { @Override public void visitLocalVariable(@NotNull PsiLocalVariable variable) { super.visitLocalVariable(variable); vars.put(variable.getName(), variable); } @Override public void visitClass(@NotNull PsiClass aClass) {} }); } for (VariableData parameter : parameters) { final String paramName = parameter.name; final PsiLocalVariable variable = vars.get(paramName); if (variable != null) { conflicts.putValue(variable, JavaRefactoringBundle.message("extract.method.conflict.variable", paramName)); } } }