Please review this patch:

$ hg qdiff -wb
diff --git a/test/lib/jdk/test/lib/util/JarUtils.java 
b/test/lib/jdk/test/lib/util/JarUtils.java
--- a/test/lib/jdk/test/lib/util/JarUtils.java
+++ b/test/lib/jdk/test/lib/util/JarUtils.java
@@ -28,6 +28,7 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.nio.file.Files;
+import java.nio.file.InvalidPathException;
 import java.nio.file.Path;
 import java.nio.file.Paths;
 import java.util.Enumeration;
@@ -88,12 +89,17 @@
             if (file.equals("-")) {
                 update = false;
             } else if (update) {
+                try {
                 Path p = Paths.get(file);
                 if (Files.exists(p)) {
                     changes.put(file, p);
                 } else {
                     changes.put(file, file);
                 }
+                } catch (InvalidPathException e) {
+                    // Fallback if file not a valid Path.
+                    changes.put(file, file);
+                }
             } else {
                 changes.put(file, Boolean.FALSE);
             }

This is a part of the JarUtils::updateJar method. When it adds a new entry into 
a jar, it will add the actual file if a file with the entry name exists, and 
fabricate some content if not. Unfortunately just creating a Path object on 
some systems would fail.

Noreg-self.

Thanks
Max

Reply via email to