Skip to content

Commit

Permalink
fix stack overflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nnym committed Feb 12, 2022
1 parent 02b0587 commit 63a8e0a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion idea/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id("org.jetbrains.intellij").version("latest.integration")
}

version("0.2.1")
version("0.2.2")
javaVersion(11)

sourceSets {
Expand Down
5 changes: 4 additions & 1 deletion idea/source/net/auoeke/uncheck/intellij/HighlightFilter.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

0 comments on commit 63a8e0a

Please sign in to comment.