void (@NotNull PsiElement element, @NotNull final Editor editor, final @NotNull Pass<? super PsiElement> renameCallback) { final PsiMethod psiMethod = (PsiMethod)element; if (psiMethod.isConstructor()) { final PsiClass containingClass = psiMethod.getContainingClass(); if (containingClass == null) return; if (!Comparing.strEqual(psiMethod.getName(), containingClass.getName())) { renameCallback.accept(psiMethod); return; } super.substituteElementToRename(element, editor, renameCallback); } else { PsiRecordComponent recordComponent = JavaPsiRecordUtil.getRecordComponentForAccessor(psiMethod); if (recordComponent != null) { renameCallback.accept(recordComponent); return; } SuperMethodWarningUtil.checkSuperMethod(psiMethod, new PsiElementProcessor<>() { @Override public boolean execute(@NotNull PsiMethod method) { if (!PsiElementRenameHandler.canRename(method.getProject(), editor, method)) return false; renameCallback.accept(method); return false; } }, editor); } }