8132335: jimage tool extract and recreate options are not consistent
Summary: Incorrect fileName formatting. Replaced with getFileName() + removal of .jimage extension.
Reviewed-by: jlaskey
--- 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);
}