Skip to content

Commit 6549148

Browse files
author
duke
committed
Added webrev for jdk/8066
1 parent 2ff12ce commit 6549148

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

jdk/8066/16/commits.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[{"commit":{"message":"8057113: Change specification as suggested in review"},"files":[{"filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java"}],"sha":"d8df514191153321ad4175bf803ed3465a4f34e3"},{"commit":{"message":"8057113: Update specification, implementation, and test"},"files":[{"filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java"},{"filename":"test\/jdk\/java\/nio\/file\/Path\/Extensions.java"}],"sha":"8a4a4bc6fc41453d9480a5eba0a8f227dd7ceadc"},{"commit":{"message":"8057113: Correct length 2 case; update test cases"},"files":[{"filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java"},{"filename":"test\/jdk\/java\/nio\/file\/Path\/Extensions.java"}],"sha":"3f510ecc32089589203b1fffb13eedc579aaa8bb"},{"commit":{"message":"8057113: Revert return type back to a nullable-String; update test"},"files":[{"filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java"},{"filename":"test\/jdk\/java\/nio\/file\/Path\/Extensions.java"}],"sha":"23ca3f101fc75b2954640dd8c4099fc986a5fe12"},{"commit":{"message":"Merge"},"files":[],"sha":"0ee79433eb5f071484cc0bb9cfcc56442432639a"},{"commit":{"message":"8057113: Remove extensions() test method; add threthree new test cases"},"files":[{"filename":"test\/jdk\/java\/nio\/file\/Path\/Extensions.java"}],"sha":"ec417a8938a6e50a473c2f3c9242f9a897f189b6"},{"commit":{"message":"8057113: Revert excision of wild cards from imports"},"files":[],"sha":"ec0a341ef8186482c73c1909ffeaf061c26afc36"},{"commit":{"message":"8057113: Add class level apiNote; improve getExtension() specification; remove hasExtension() and replaceExtension()"},"files":[{"filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java"},{"filename":"test\/jdk\/java\/nio\/file\/Path\/Extensions.java"}],"sha":"d11ef42a659fd37321ea3bb4155624e8df6faf9b"},{"commit":{"message":"Merge"},"files":[],"sha":"fd0d4c2ede2aa854dc4b4c7cde468b69331194ac"},{"commit":{"message":"8057113: Change @since annotation to 20"},"files":[{"filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java"}],"sha":"4b5166bafc472f29ff446114f7462a3860c7c5fa"},{"commit":{"message":"Merge"},"files":[],"sha":"242924b4f38f4a6ab034a156f5e364d6c70eb75f"},{"commit":{"message":"8057113: Remove superfluous new Object[] statements from test"},"files":[{"filename":"test\/jdk\/java\/nio\/file\/Path\/Extensions.java"}],"sha":"629d9916e8b6c9bc4762809fc389275e922109b7"},{"commit":{"message":"8057113: Fix getExtension() commcents; improve hasExtension() implementation"},"files":[{"filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java"}],"sha":"3d537a31ad214075214f7fe4035efe08dbe799a7"},{"commit":{"message":"8057113: trailing dot yields empty string extension; add test"},"files":[{"filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java"},{"filename":"test\/jdk\/java\/nio\/file\/Path\/Extensions.java"}],"sha":"e5240f1c10023b447a8eac91fc188dea033c9616"},{"commit":{"message":"Merge"},"files":[],"sha":"9bea0288efc4daf3ec0c2006a1531f7304638aca"},{"commit":{"message":"8057113: String getExtension(String defaultExtension) to Optional<String> getExtension() and other changes"},"files":[{"filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java"}],"sha":"8ed8b1b25efa18a419d9176bff38f12616c9881d"},{"commit":{"message":"8057113: Clean up trailing whitespace"},"files":[{"filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java"}],"sha":"a2573adfbee5ef88f759159bba869178ae2565a5"},{"commit":{"message":"8057113: Implement reviewer suggestions for replaceExtension()"},"files":[{"filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java"}],"sha":"04ccbb646f764259576ed732cb720a268bfb7ead"},{"commit":{"message":"8057113: Add hasExtension() and replaceExtension()"},"files":[{"filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java"}],"sha":"4adf810d060138e50d7ce2266e4299645149dd89"},{"commit":{"message":"8057113: Fix variable name in @return verbiage"},"files":[{"filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java"}],"sha":"d5738c466ab6f91ddb2a22c23e07ab1252fc93f0"},{"commit":{"message":"8057113: (fs) Path should have a method to obtain the filename extension"},"files":[{"filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java"}],"sha":"6e00c504ec61d6aea7849718f502d460ad9a8dbb"}]

jdk/8066/16/comparison.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"files":[{"patch":"@@ -2,1 +2,1 @@\n- * Copyright (c) 2007, 2021, Oracle and\/or its affiliates. All rights reserved.\n+ * Copyright (c) 2007, 2022, Oracle and\/or its affiliates. All rights reserved.\n@@ -34,0 +34,1 @@\n+import java.util.Objects;\n@@ -52,1 +53,1 @@\n- * elements.\n+ * elements, and {@link #getExtension() getExtension} to obtain its extension.\n@@ -96,0 +97,7 @@\n+ * @apiNote\n+ * On some file systems a {@code Path} may have an internal representation\n+ * which cannot be converted to a {@code String} without losing information.\n+ * Otherwise stated, the internal representation might not be recoverable\n+ * from the derived path string. This applies to the {@code Path} as a whole\n+ * as well as to its components.\n+ *\n@@ -251,0 +259,56 @@\n+ \/**\n+ * Returns the file name extension of this path as a {@code String}. The\n+ * extension is the portion of the {@linkplain #getFileName file name}\n+ * string after the last period character ('.', U+002E FULL STOP). Leading\n+ * period characters in the string are ignored. If there is no extension,\n+ * then {@code null} is returned. This will occur if the path has zero\n+ * elements ({@link #getFileName()} returns {@code null}), the file name\n+ * string does not contain a period character, or only the first character\n+ * is a period character. If the last character is a period character but\n+ * some other character is not, then the extension is the\n+ * {@linkplain String#isEmpty() empty} string.\n+ *\n+ * @implSpec\n+ * The default implementation is equivalent for this path to:\n+ * <pre>{@code\n+ * int lastDot = fileName.lastIndexOf('.');\n+ * if (lastDot <= 0)\n+ * return null;\n+ * return lastDot == fileName.length() - 1 ?\n+ * \"\" :\n+ * fileName.substring(lastDot + 1);\n+ * }<\/pre>\n+ *\n+ * @return the file name extension of this path, which might be the\n+ * empty string, or {@code null} if no extension is found\n+ *\n+ * @since 20\n+ *\/\n+ default String getExtension() {\n+ Path fileName = getFileName();\n+ if (fileName == null)\n+ return null;\n+\n+ String fileNameString = fileName.toString();\n+ int length = fileNameString.length();\n+\n+ \/\/ An empty or unity length file name string has a null extension\n+ if (length > 1) {\n+ int lastDotIndex = fileNameString.lastIndexOf('.');\n+\n+ \/\/ Indeterminate if there is no period character or\n+ \/\/ only the first character is a period character\n+ if (lastDotIndex > 0) {\n+ if (lastDotIndex == length - 1) {\n+ \/\/ null if all period characters, otherwise empty\n+ return fileNameString.matches(\"\\\\.{\" + length + \"}\") ?\n+ null : \"\";\n+ } else {\n+ return fileNameString.substring(lastDotIndex + 1);\n+ }\n+ }\n+ }\n+\n+ return null;\n+ }\n+\n","filename":"src\/java.base\/share\/classes\/java\/nio\/file\/Path.java","additions":66,"deletions":2,"binary":false,"changes":68,"status":"modified"},{"patch":"@@ -0,0 +1,84 @@\n+\/*\n+ * Copyright (c) 2022, Oracle and\/or its affiliates. All rights reserved.\n+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n+ *\n+ * This code is free software; you can redistribute it and\/or modify it\n+ * under the terms of the GNU General Public License version 2 only, as\n+ * published by the Free Software Foundation.\n+ *\n+ * This code is distributed in the hope that it will be useful, but WITHOUT\n+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n+ * version 2 for more details (a copy is included in the LICENSE file that\n+ * accompanied this code).\n+ *\n+ * You should have received a copy of the GNU General Public License version\n+ * 2 along with this work; if not, write to the Free Software Foundation,\n+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n+ *\n+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n+ * or visit www.oracle.com if you need additional information or have any\n+ * questions.\n+ *\/\n+\n+import java.nio.file.Path;\n+import java.util.Arrays;\n+\n+import org.testng.Assert;\n+import org.testng.annotations.DataProvider;\n+import org.testng.annotations.Test;\n+\n+\/*\n+ * @test\n+ * @bug 8057113\n+ * @summary Verify extension methods\n+ * @run testng Extensions\n+ *\/\n+public class Extensions {\n+ \/**\n+ * Returns path name string and expected extension pairs.\n+ *\n+ * @return {@code {{\"pathname\", \"extension\"},...}}\n+ *\/\n+ @DataProvider\n+ static Object[][] getProvider() {\n+ Object[][] pairs = {\n+ {\"\", null},\n+ {\".\", null},\n+ {\"..\", null},\n+ {\"...\", null},\n+ {\"....\", null},\n+ {\".....\", null},\n+ {\"aa\", null},\n+ {\"a.\", \"\"},\n+ {\".a\", null},\n+ {\"..a\", \"a\"},\n+ {\"...a\", \"a\"},\n+ {\"....a\", \"a\"},\n+ {\".a.b\", \"b\"},\n+ {\"...a.b\", \"b\"},\n+ {\"...a.b.\", \"\"},\n+ {\"..foo\", \"foo\"},\n+ {\"foo.\", \"\"},\n+ {\"test.\", \"\"},\n+ {\"test..\", \"\"},\n+ {\"test...\", \"\"},\n+ {\"test.rb\", \"rb\"},\n+ {\"a\/b\/d\/test.rb\" , \"rb\"},\n+ {\".a\/b\/d\/test.rb\", \"rb\"},\n+ {\"test\", null},\n+ {\".profile\", null},\n+ {\".profile.sh\", \"sh\"},\n+ {\"foo.tar.gz\", \"gz\"},\n+ {\"foo.bar.\", \"\"},\n+ {\"archive.zip\", \"zip\"},\n+ {\"compress.gzip\", \"gzip\"},\n+ };\n+ return pairs;\n+ }\n+\n+ @Test(dataProvider = \"getProvider\")\n+ public static void get(String pathname, String extension) {\n+ Assert.assertEquals(Path.of(pathname).getExtension(), extension);\n+ }\n+}\n","filename":"test\/jdk\/java\/nio\/file\/Path\/Extensions.java","additions":84,"deletions":0,"binary":false,"changes":84,"status":"added"}]}

jdk/8066/16/metadata.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"head":{"repo":{"full_name":"bplb\/jdk","html_url":"https:\/\/github.com\/bplb\/jdk"},"sha":"d8df514191153321ad4175bf803ed3465a4f34e3"},"created_at":"2022-07-29T18:01:34.933434235Z","base":{"repo":{"full_name":"openjdk\/jdk","html_url":"https:\/\/git.openjdk.org\/jdk"},"sha":"0ca74f538e1a8a351cc0631c5fe397a74653ce6f"}}

0 commit comments

Comments
 (0)