[java-inspections] Skip reporting on synthetic elements

Fixes IJPL-934 There is no highlighting for JSP file

GitOrigin-RevId: 95d12b410db7ec3f8a3891c46486e4803200b10a
This commit is contained in:
Tagir Valeev
2024-04-04 14:26:26 +02:00
committed by intellij-monorepo-bot
parent e80a1f2be8
commit 274b476799

View File

@@ -118,6 +118,8 @@ public final class UnusedSymbolLocalInspection extends AbstractBaseJavaLocalInsp
private void registerProblem(@NotNull PsiElement element,
@NotNull @InspectionMessage String message,
@NotNull List<IntentionAction> fixes) {
// Synthetic elements in JSP like JspHolderMethod may arrive here
if (element instanceof SyntheticElement) return;
if (element instanceof PsiNameIdentifierOwner owner) {
PsiElement identifier = owner.getNameIdentifier();
if (identifier != null) {