mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
update inspection and quickfix
This commit is contained in:
@@ -65,7 +65,7 @@ public class UseCoupleInspection extends InternalInspection {
|
||||
if (psiClass != null && PAIR_FQN.equals(psiClass.getQualifiedName())) {
|
||||
final PsiType[] types = expression.getArgumentList().getExpressionTypes();
|
||||
if (types.length == 2 && types[0].equals(types[1])) {
|
||||
final String name = "Change to Couple.newOne";
|
||||
final String name = "Change to Couple.of";
|
||||
holder.registerProblem(expression, name, ProblemHighlightType.GENERIC_ERROR_OR_WARNING, new UseCoupleQuickFix(name));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class UseCoupleQuickFix extends LocalQuickFixBase {
|
||||
final PsiTypeElement newType = factory.createTypeElementFromText(COUPLE_FQN + "<" + type + ">", element.getContext());
|
||||
newElement = element.replace(newType);
|
||||
} else {
|
||||
final String text = COUPLE_FQN + ".newOne" + element.getText().substring("Pair.create".length());
|
||||
final String text = COUPLE_FQN + ".of" + element.getText().substring("Pair.create".length());
|
||||
final PsiExpression expression = factory.createExpressionFromText(text, element.getContext());
|
||||
newElement = element.replace(expression);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user