From 5e399962201f230b3bbb5635e2acb12b6024c188 Mon Sep 17 00:00:00 2001 From: "Dmitry.Krasilschikov" Date: Thu, 2 Jan 2020 15:33:03 +0200 Subject: [PATCH] LAB-62 get rid of static *Bundle usages: more fields with better name GitOrigin-RevId: 47473f9bd3c2a454188464dbabb69a8329ddeea7 --- .../wrapreturnvalue/WrapReturnValueHandler.java | 12 ++++++------ .../daemon/impl/GeneralHighlightingPass.java | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/java/java-impl/src/com/intellij/refactoring/wrapreturnvalue/WrapReturnValueHandler.java b/java/java-impl/src/com/intellij/refactoring/wrapreturnvalue/WrapReturnValueHandler.java index 71302553679c..4277c34624dd 100644 --- a/java/java-impl/src/com/intellij/refactoring/wrapreturnvalue/WrapReturnValueHandler.java +++ b/java/java-impl/src/com/intellij/refactoring/wrapreturnvalue/WrapReturnValueHandler.java @@ -58,14 +58,14 @@ class WrapReturnValueHandler implements RefactoringActionHandler { } if(selectedMethod == null){ CommonRefactoringUtil.showErrorHint(project, editor, RefactorJBundle.message("cannot.perform.the.refactoring") + RefactorJBundle.message( - "the.caret.should.be.positioned.at.the.name.of.the.method.to.be.refactored"), getREFACTORING_NAME(), this.getHelpID()); + "the.caret.should.be.positioned.at.the.name.of.the.method.to.be.refactored"), getRefactoringNameText(), this.getHelpID()); return; } invoke(project, selectedMethod, editor); } protected String getRefactoringName(){ - return getREFACTORING_NAME(); + return getRefactoringNameText(); } protected String getHelpID(){ @@ -91,13 +91,13 @@ class WrapReturnValueHandler implements RefactoringActionHandler { private void invoke(final Project project, PsiMethod method, Editor editor) { if(method.isConstructor()){ CommonRefactoringUtil.showErrorHint(project, editor, RefactorJBundle.message("cannot.perform.the.refactoring") + RefactorJBundle.message("constructor.returns.can.not.be.wrapped"), - getREFACTORING_NAME(), this.getHelpID()); + getRefactoringNameText(), this.getHelpID()); return; } final PsiType returnType = method.getReturnType(); if(PsiType.VOID.equals(returnType)){ CommonRefactoringUtil.showErrorHint(project, editor, RefactorJBundle.message("cannot.perform.the.refactoring") + RefactorJBundle.message("method.selected.returns.void"), - getREFACTORING_NAME(), this.getHelpID()); + getRefactoringNameText(), this.getHelpID()); return; } method = SuperMethodWarningUtil.checkSuperMethod(method, RefactoringBundle.message("to.refactor")); @@ -105,7 +105,7 @@ class WrapReturnValueHandler implements RefactoringActionHandler { if(method instanceof PsiCompiledElement){ CommonRefactoringUtil.showErrorHint(project, editor, RefactorJBundle.message("cannot.perform.the.refactoring") + RefactorJBundle.message( - "the.selected.method.cannot.be.wrapped.because.it.is.defined.in.a.non.project.class"), getREFACTORING_NAME(), this.getHelpID()); + "the.selected.method.cannot.be.wrapped.because.it.is.defined.in.a.non.project.class"), getRefactoringNameText(), this.getHelpID()); return; } @@ -114,7 +114,7 @@ class WrapReturnValueHandler implements RefactoringActionHandler { } - public static String getREFACTORING_NAME() { + public static String getRefactoringNameText() { return RefactorJBundle.message("wrap.return.value"); } } diff --git a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPass.java b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPass.java index d09bb4164ea0..6ec15e6d8873 100644 --- a/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPass.java +++ b/platform/analysis-impl/src/com/intellij/codeInsight/daemon/impl/GeneralHighlightingPass.java @@ -77,7 +77,7 @@ public class GeneralHighlightingPass extends ProgressableTextEditorHighlightingP @NotNull ProperTextRange priorityRange, @Nullable Editor editor, @NotNull HighlightInfoProcessor highlightInfoProcessor) { - super(project, document, getPRESENTABLE_NAME(), file, editor, TextRange.create(startOffset, endOffset), true, highlightInfoProcessor); + super(project, document, getPresentableNameText(), file, editor, TextRange.create(startOffset, endOffset), true, highlightInfoProcessor); myUpdateAll = updateAll; myPriorityRange = priorityRange; @@ -599,7 +599,7 @@ public class GeneralHighlightingPass extends ProgressableTextEditorHighlightingP return super.toString() + " updateAll="+myUpdateAll+" range= "+myRestrictRange; } - private static String getPRESENTABLE_NAME() { + private static String getPresentableNameText() { return DaemonBundle.message("pass.syntax"); } }