You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iceberg.apache.org by bl...@apache.org on 2020/11/20 23:21:34 UTC

[iceberg] branch master updated: AWS: Fix errorprone warnings in S3URI (#1787)

This is an automated email from the ASF dual-hosted git repository.

blue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iceberg.git


The following commit(s) were added to refs/heads/master by this push:
     new 9bccb4e  AWS: Fix errorprone warnings in S3URI (#1787)
9bccb4e is described below

commit 9bccb4ec3936a1f2abe0fd3e9cd8fef49ffc32a0
Author: Jack Ye <yz...@amazon.com>
AuthorDate: Fri Nov 20 15:21:23 2020 -0800

    AWS: Fix errorprone warnings in S3URI (#1787)
---
 aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java b/aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
index b7c9368..04cf168 100644
--- a/aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
+++ b/aws/src/main/java/org/apache/iceberg/aws/s3/S3URI.java
@@ -57,7 +57,7 @@ class S3URI {
     Preconditions.checkNotNull(location, "Location cannot be null.");
 
     this.location = location;
-    String [] schemeSplit = location.split(SCHEME_DELIM);
+    String [] schemeSplit = location.split(SCHEME_DELIM, -1);
     ValidationException.check(schemeSplit.length == 2, "Invalid S3 URI: %s", location);
 
     String scheme = schemeSplit[0];
@@ -70,27 +70,27 @@ class S3URI {
 
     // Strip query and fragment if they exist
     String path = authoritySplit[1];
-    path = path.split(QUERY_DELIM)[0];
-    path = path.split(FRAGMENT_DELIM)[0];
+    path = path.split(QUERY_DELIM, -1)[0];
+    path = path.split(FRAGMENT_DELIM, -1)[0];
     this.key = path;
   }
 
   /**
-   * @return S3 bucket
+   * Returns S3 bucket name.
    */
   public String bucket() {
     return bucket;
   }
 
   /**
-   * @return S3 key
+   * Returns S3 object key name.
    */
   public String key() {
     return key;
   }
 
-  /*
-   * @return original, unmodified location
+  /**
+   * Returns original, unmodified S3 URI location.
    */
   public String location() {
     return location;