< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DiagnosticsOutputDirectory.java

Print this page
rev 52509 : [mq]: graal

@@ -84,10 +84,11 @@
                 }
             }
         }
         if (CLOSED.equals(path)) {
             TTY.println("Warning: Graal diagnostic directory already closed");
+            return null;
         }
         return path;
     }
 
     /**

@@ -127,19 +128,20 @@
             // while it is being archived and deleted.
             path = CLOSED;
 
             Path dir = Paths.get(outDir);
             if (dir.toFile().exists()) {
+                String prefix = new File(outDir).getName() + "/";
                 File zip = new File(outDir + ".zip").getAbsoluteFile();
                 List<Path> toDelete = new ArrayList<>();
                 try (ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zip))) {
                     zos.setLevel(Deflater.BEST_COMPRESSION);
                     Files.walkFileTree(dir, Collections.emptySet(), Integer.MAX_VALUE, new SimpleFileVisitor<Path>() {
                         @Override
                         public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
                             if (attrs.isRegularFile()) {
-                                String name = dir.relativize(file).toString();
+                                String name = prefix + dir.relativize(file).toString();
                                 ZipEntry ze = new ZipEntry(name);
                                 zos.putNextEntry(ze);
                                 Files.copy(file, zos);
                                 zos.closeEntry();
                             }
< prev index next >