diff --git a/idea/build.gradle b/idea/build.gradle index a3baf46..0930930 100644 --- a/idea/build.gradle +++ b/idea/build.gradle @@ -2,7 +2,7 @@ plugins { id("org.jetbrains.intellij").version("latest.integration") } -version("0.2.1") +version("0.2.2") javaVersion(11) sourceSets { diff --git a/idea/source/net/auoeke/uncheck/intellij/HighlightFilter.java b/idea/source/net/auoeke/uncheck/intellij/HighlightFilter.java index 3daec32..643c210 100644 --- a/idea/source/net/auoeke/uncheck/intellij/HighlightFilter.java +++ b/idea/source/net/auoeke/uncheck/intellij/HighlightFilter.java @@ -89,6 +89,9 @@ private static boolean initialized(PsiMethod constructor, PsiField field) { || Stream.of(constructor.getBody().getChildren()) .filter(PsiExpressionStatement.class::isInstance) .map(statement -> ((PsiExpressionStatement) statement).getExpression()) - .anyMatch(expression -> expression instanceof PsiMethodCallExpression && initialized(((PsiMethodCallExpression) expression).resolveMethod(), field)); + .filter(PsiMethodCallExpression.class::isInstance) + .map(call -> ((PsiMethodCallExpression) call).resolveMethod()) + .filter(c -> c != constructor) + .anyMatch(c -> initialized(c, field)); } }