8132335: jimage tool extract and recreate options are not consistent
authorjfdenise
Fri, 24 Jul 2015 18:57:04 +0200
changeset 31872 eb13a70c73a5
parent 31842 f55df5cfe11c
child 31873 87b015c2cd36
8132335: jimage tool extract and recreate options are not consistent Summary: Incorrect fileName formatting. Replaced with getFileName() + removal of .jimage extension. Reviewed-by: jlaskey
jdk/src/java.base/share/classes/jdk/internal/jimage/ImageFileCreator.java
--- a/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageFileCreator.java	Wed Jul 05 20:43:22 2017 +0200
+++ b/jdk/src/java.base/share/classes/jdk/internal/jimage/ImageFileCreator.java	Fri Jul 24 18:57:04 2015 +0200
@@ -159,7 +159,11 @@
             throw new UnsupportedOperationException("Not supported, no external file "
                     + "in a jimage file");
         }, entriesForModule, order);
-        String fileName = jimageFile.getRoot().toString();
+        String fileName = jimageFile.getFileName().toString();
+        if (fileName.endsWith(IMAGE_EXT)) {
+            fileName = fileName.substring(0, fileName.length()
+                    - BasicImageWriter.IMAGE_EXT.length());
+        }
         generateJImage(jimageFile, fileName, resources, order);
     }