Skip to content

Commit

Permalink
Reflow a comment that didn't appreciate being formatted in unknown co…
Browse files Browse the repository at this point in the history
…mmit

PiperOrigin-RevId: 595108607
  • Loading branch information
graememorgan authored and Error Prone Team committed Jan 2, 2024
1 parent 63cf192 commit fd21bc9
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,16 @@ public Description matchMethodInvocation(MethodInvocationTree t, VisitorState st
}

/**
* Assuming the argument in the varargs position is a single one of type int[], here is the truth
* table: Param type Should return Why int... false Exact type match int[]... false Exact type
* match for the array element type T... true Will cause boxing Object... true Will cause boxing
* Assuming the argument in the varargs position is a single one of type {@code int[]}, here is
* the truth table:
*
* <pre>
* Param type Should return Why
* int... false Exact type match
* int[]... false Exact type match for the array element type
* T... true Will cause boxing
* Object... true Will cause boxing
* </pre>
*/
private static boolean isVarargs(MethodInvocationTree tree, VisitorState state) {
MethodSymbol symbol = ASTHelpers.getSymbol(tree);
Expand All @@ -62,7 +69,7 @@ private static boolean isVarargs(MethodInvocationTree tree, VisitorState state)
return false;
}

// Last param must be varags
// Last param must be varargs
List<VarSymbol> params = symbol.getParameters();
int varargsPosition = params.size() - 1;
ArrayType varargsParamType = (ArrayType) getLast(params).type;
Expand Down

0 comments on commit fd21bc9

Please sign in to comment.