Skip to content

Commit

Permalink
Prevent ExplicitEnumOrdering from throwing an NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Jan 27, 2024
1 parent 4849bb5 commit 02b63a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private static ImmutableSet<String> getMissingEnumValues(
List<? extends ExpressionTree> expressions) {
return expressions.stream()
.map(ASTHelpers::getSymbol)
.filter(Symbol::isEnum)
.filter(s -> s != null && s.isEnum())
.collect(
collectingAndThen(
toImmutableSetMultimap(Symbol::asType, Symbol::toString),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ void identification() {
" Ordering.explicit(IsoEra.BCE, SOURCE, RetentionPolicy.CLASS);",
" // BUG: Diagnostic contains: RetentionPolicy.SOURCE, IsoEra.BCE",
" Ordering.explicit(CLASS, RUNTIME, CE);",
"",
" Ordering.explicit(BCE, null, CE);",
" }",
"}")
.doTest();
Expand Down

0 comments on commit 02b63a4

Please sign in to comment.