LAB-62 get rid of static *Bundle usages: more fields with better name

GitOrigin-RevId: 47473f9bd3c2a454188464dbabb69a8329ddeea7
This commit is contained in:
Dmitry.Krasilschikov
2020-01-02 14:32:02 +00:00
committed by intellij-monorepo-bot
parent ae5bde9d70
commit 5e39996220
2 changed files with 8 additions and 8 deletions
@@ -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");
}
}
@@ -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");
}
}