boolean (@NotNull PsiLocalVariable localVariable1, @NotNull PsiLocalVariable localVariable2) { PsiModifierList firstModifierList = localVariable1.getModifierList(); PsiModifierList secondModifierList = localVariable2.getModifierList(); if (firstModifierList != null || secondModifierList != null) { if (firstModifierList == null || secondModifierList == null) { return false; } String firstModifierListText = firstModifierList.getText(); String secondModifierListText = secondModifierList.getText(); if (firstModifierListText != null && !firstModifierListText.equals(secondModifierListText)) { return false; } } PsiType firstType = localVariable1.getType(); if (!firstType.equals(localVariable2.getType())) return false; String firstName = localVariable1.getName(); String secondName = localVariable2.getName(); if (!firstName.equals(secondName)) { mySubstitutionTable.put(localVariable2, firstName); } return true; }