8186227: jdk/nio/zipfs/ZeroDate.java fails on Windows with "IllegalArgumentException: Illegal character in opaque part at index 13"
authorsherman
Wed, 16 Aug 2017 13:15:45 -0700
changeset 46159 97256df3734f
parent 46158 e86ab8b9a00c
child 46160 c647e44ea1b9
8186227: jdk/nio/zipfs/ZeroDate.java fails on Windows with "IllegalArgumentException: Illegal character in opaque part at index 13" Reviewed-by: rriggs
jdk/test/jdk/nio/zipfs/ZeroDate.java
--- a/jdk/test/jdk/nio/zipfs/ZeroDate.java	Wed Aug 16 11:29:58 2017 -0700
+++ b/jdk/test/jdk/nio/zipfs/ZeroDate.java	Wed Aug 16 13:15:45 2017 -0700
@@ -44,7 +44,7 @@
 import java.util.zip.ZipOutputStream;
 
 /* @test
- * @bug 8184940
+ * @bug 8184940 8186227
  * @summary JDK 9 rejects zip files where the modified day or month is 0
  * @author Liam Miller-Cushon
  */
@@ -85,7 +85,7 @@
         try (OutputStream os = Files.newOutputStream(path)) {
             os.write(data);
         }
-        URI uri = URI.create("jar:file://" + path.toAbsolutePath());
+        URI uri = URI.create("jar:" + path.toUri());
         try (FileSystem fs = FileSystems.newFileSystem(uri, Collections.emptyMap())) {
             Path entry = fs.getPath("x");
             Instant actualInstant =