ebyhr commented on code in PR #16886:
URL: https://github.com/apache/iceberg/pull/16886#discussion_r3447682405


##########
dell/src/main/java/org/apache/iceberg/dell/ecs/EcsURI.java:
##########
@@ -35,7 +35,7 @@ class EcsURI {
   private final String name;
 
   EcsURI(String location) {
-    Preconditions.checkNotNull(location == null, "Location %s can not be 
null", location);
+    Preconditions.checkNotNull(location, "Location %s can not be null", 
location);

Review Comment:
   The current message will be `Location null can not be null`. I think just 
`Location can not be null` is sufficient.



##########
dell/src/test/java/org/apache/iceberg/dell/ecs/TestEcsURI.java:
##########
@@ -59,4 +59,11 @@ public void testInvalidLocation() {
         .isInstanceOf(ValidationException.class)
         .hasMessage("Invalid ecs location: http://bucket/a";);
   }
+
+  @Test
+  public void testNullLocation() {
+    assertThatThrownBy(() -> new EcsURI((String) null))

Review Comment:
   `(String) ` is redundant. 



##########
dell/src/test/java/org/apache/iceberg/dell/ecs/TestEcsURI.java:
##########
@@ -59,4 +59,11 @@ public void testInvalidLocation() {
         .isInstanceOf(ValidationException.class)
         .hasMessage("Invalid ecs location: http://bucket/a";);
   }
+
+  @Test
+  public void testNullLocation() {
+    assertThatThrownBy(() -> new EcsURI((String) null))
+        .isInstanceOf(NullPointerException.class)
+        .hasMessageContaining("can not be null");

Review Comment:
   Let's use `hasMessage()` instead.



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

Reply via email to