jackye1995 commented on a change in pull request #2703:
URL: https://github.com/apache/iceberg/pull/2703#discussion_r653836208



##########
File path: api/src/main/java/org/apache/iceberg/catalog/TableIdentifier.java
##########
@@ -36,6 +36,7 @@
   private final String name;
 
   public static TableIdentifier of(String... names) {
+    Preconditions.checkArgument(names != null, "Cannot create table identifier 
from null array");

Review comment:
       I don't think null check is needed for java varargs. The names will be 
empty array if no input is given. I verified it locally:
   
   ```
   private void met(String... strs) {
       System.out.println(Arrays.toString(strs));
     }
   
   met();
   ```
   
   The result is `[]`

##########
File path: api/src/main/java/org/apache/iceberg/catalog/TableIdentifier.java
##########
@@ -36,6 +36,7 @@
   private final String name;
 
   public static TableIdentifier of(String... names) {
+    Preconditions.checkArgument(names != null, "Cannot create table identifier 
from null array");

Review comment:
       Ah I see, never thought about this use case, thanks!




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to