From b07373d168df7ba570ca0cae0846622cdfcd6f2f Mon Sep 17 00:00:00 2001 From: Fred Bricon Date: Mon, 16 Oct 2023 16:29:07 +0200 Subject: [PATCH] fix: Non-public @Observes methods should be implicitly used Signed-off-by: Fred Bricon --- .../lsp4mp4ij/psi/core/JavaEEImplicitUsageProvider.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/core/JavaEEImplicitUsageProvider.java b/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/core/JavaEEImplicitUsageProvider.java index 13da9c734..9ed587a72 100644 --- a/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/core/JavaEEImplicitUsageProvider.java +++ b/src/main/java/com/redhat/devtools/intellij/lsp4mp4ij/psi/core/JavaEEImplicitUsageProvider.java @@ -46,7 +46,7 @@ public boolean isImplicitRead(@NotNull PsiElement element) { private boolean isObserverMethod(@NotNull PsiElement element) { if (element instanceof PsiMethod) { PsiMethod method = (PsiMethod) element; - return isPublicNonAbstract(method) && observesOneParameter(method); + return isNonAbstract(method) && observesOneParameter(method); } return false; } @@ -71,9 +71,8 @@ private boolean observesOneParameter(PsiMethod method) { return observesAnnotationCount == 1; } - private boolean isPublicNonAbstract(@NotNull PsiMethod method) { + private boolean isNonAbstract(@NotNull PsiMethod method) { return !method.isConstructor() && - method.hasModifierProperty(PsiModifier.PUBLIC) && !method.hasModifierProperty(PsiModifier.ABSTRACT); }