[java][highlight] IDEA-274531 errors shown incorrectly when a method name is the...
authorNikita Eshkeev <nikita.eshkeev@jetbrains.com>
Thu, 29 Jul 2021 13:17:06 +0000 (16:17 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Thu, 29 Jul 2021 18:01:56 +0000 (18:01 +0000)
Fix the caption of the error highlighting when it looks like a call to a static field or method with redundant `new`

GitOrigin-RevId: b15739b54ef0b195f9bb05f12775ab5e6c5b3b0b

java/java-analysis-impl/src/com/intellij/codeInsight/daemon/impl/analysis/HighlightUtil.java
java/java-psi-impl/src/messages/JavaErrorBundle.properties

index ee48b19f6709a3de5771c59964870a6b5a42bcd0..52566d477373729be99d1fda13ce853c07722f2e 100644 (file)
@@ -2959,7 +2959,7 @@ public final class HighlightUtil {
     PsiElement refParent = ref.getParent();
 
     if (!(resolved instanceof PsiClass) && isCallToStaticMember(refParent)) {
-      final String text = JavaErrorBundle.message("cannot.resolve.symbol", refName.getText());
+      final String text = JavaErrorBundle.message("redundant.new.keyword", refName.getText());
       final HighlightInfo info = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(ref).descriptionAndTooltip(text).create();
       QuickFixAction.registerQuickFixAction(info, new RemoveNewKeywordFix(refParent));
       return info;
index 1ca581c5baeda73e2ca75462e55f9234eaf550b1..e179537657273b74a714a2a1c1c79d9d0d639c18 100644 (file)
@@ -283,6 +283,7 @@ deprecated.symbol=''{0}'' is deprecated
 marked.for.removal.symbol=''{0}'' is deprecated and marked for removal
 qualifier.must.be.expression=Qualifier must be an expression
 cannot.resolve.symbol=Cannot resolve symbol ''{0}''
+redundant.new.keyword=Redundant 'new'
 class.is.already.defined.in.single.static.import=Class ''{0}'' is already defined in a single static import
 class.is.ambiguous.in.single.static.import=Class ''{0}'' is ambiguous in a single static import
 field.is.already.defined.in.single.static.import=Field ''{0}'' is already defined in a single static import