void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { PsiLiteralExpression literal = ObjectUtils.tryCast(element, PsiLiteralExpression.class); if (literal == null) return; String text = literal.getText(); if (myRange.getEndOffset() >= text.length()) return; String existing = myRange.substring(text); if (!existing.equals(myToken.toString())) return; text = text.substring(0, myRange.getStartOffset()) + myToken.fixed() + text.substring(myRange.getEndOffset()); PsiExpression replacement = JavaPsiFacade.getElementFactory(project).createExpressionFromText(text, literal); literal.replace(replacement); }