dramaticlly commented on code in PR #17751:
URL: https://github.com/apache/iceberg/pull/17751#discussion_r3832060627
##########
core/src/main/java/org/apache/iceberg/rest/responses/FetchPlanningResultResponse.java:
##########
@@ -99,8 +99,11 @@ public Builder withErrorResponse(ErrorResponse response) {
return this;
}
- public Builder withCredentials(List<Credential> credentialsToAdd) {
- credentials.addAll(credentialsToAdd);
+ public Builder withCredentials(List<Credential> newCredentials) {
+ Preconditions.checkArgument(null != newCredentials, "Invalid credentials
list: null");
+ Preconditions.checkArgument(!newCredentials.contains(null), "Invalid
credential: null");
Review Comment:
I think `ImmutableList.copyOf(credentialsToAdd)` will throw NPE instead of
IllegalArgumentException instead, from AGENTS.md seem to favor
"Preconditions.checkArgument over NPE"
and I saw we have some precedence in
https://github.com/apache/iceberg/blob/7f879b11366e17a676a03f15247a821751415529/core/src/main/java/org/apache/iceberg/rest/responses/ListTablesResponse.java#L84
and
https://github.com/apache/iceberg/blob/7f879b11366e17a676a03f15247a821751415529/core/src/main/java/org/apache/iceberg/rest/responses/ListNamespacesResponse.java#L83
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]