Skip to content

Commit

Permalink
Fix a crash on a test-only redefinition of ThreadPoolExecutor that do…
Browse files Browse the repository at this point in the history
…esn't have any parameters

PiperOrigin-RevId: 464805116
  • Loading branch information
cushon authored and Error Prone Team committed Aug 2, 2022
1 parent 9449d38 commit cb1fac8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ public Description matchNewClass(NewClassTree tree, VisitorState state) {
return Description.NO_MATCH;
}
List<? extends ExpressionTree> arguments = tree.getArguments();
if (arguments.size() < 2) {
return Description.NO_MATCH;
}
Integer corePoolSize = ASTHelpers.constValue(arguments.get(0), Integer.class);
Integer maximumPoolSize = ASTHelpers.constValue(arguments.get(1), Integer.class);
if (corePoolSize == null || maximumPoolSize == null || corePoolSize.equals(maximumPoolSize)) {
Expand Down

0 comments on commit cb1fac8

Please sign in to comment.