mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java] don't show implicit classes as "anonymous" in batch inspection results (IDEA-334425)
GitOrigin-RevId: 1c636b01743409c25ef084faca47f34b0127ff4d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
dd15510bf3
commit
ab2af3d314
@@ -288,6 +288,8 @@ inspection.redundant.type.no.generics.problem.descriptor=Type arguments are redu
|
||||
inspection.redundant.type.problem.descriptor=Explicit type arguments can be inferred
|
||||
inspection.redundant.type.remove.quickfix=Remove type arguments
|
||||
inspection.reference.anonymous.name=anonymous ({0})
|
||||
inspection.reference.anonymous.class=anonymous class
|
||||
inspection.reference.implicit.class=implicit class
|
||||
inspection.reference.implicit.constructor.name=implicit constructor of {0}
|
||||
inspection.reference.lambda.name=lambda ({0})
|
||||
inspection.reference.default.lambda.name=lambda
|
||||
|
||||
+7
-4
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.codeInspection.reference;
|
||||
|
||||
import com.intellij.analysis.AnalysisBundle;
|
||||
@@ -80,15 +80,18 @@ public abstract class RefJavaElementImpl extends RefElementImpl implements RefJa
|
||||
@NotNull
|
||||
private static String getName(@NotNull UElement declaration) {
|
||||
PsiElement element = declaration.getJavaPsi();
|
||||
if (element instanceof PsiAnonymousClass psiAnonymousClass) {
|
||||
PsiClass psiBaseClass = psiAnonymousClass.getBaseClassType().resolve();
|
||||
if (element instanceof PsiAnonymousClass anonymousClass) {
|
||||
PsiClass psiBaseClass = anonymousClass.getBaseClassType().resolve();
|
||||
if (psiBaseClass == null) {
|
||||
return "anonymous class";
|
||||
return JavaAnalysisBundle.message("inspection.reference.anonymous.class");
|
||||
}
|
||||
else {
|
||||
return JavaAnalysisBundle.message("inspection.reference.anonymous.name", psiBaseClass.getName());
|
||||
}
|
||||
}
|
||||
if (element instanceof PsiImplicitClass) {
|
||||
return JavaAnalysisBundle.message("inspection.reference.implicit.class");
|
||||
}
|
||||
|
||||
if (element instanceof PsiSyntheticClass jspClass) {
|
||||
final PsiFile jspxFile = jspClass.getContainingFile();
|
||||
|
||||
Reference in New Issue
Block a user