< prev index next >
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/OptimisticTypesPersistence.java
Print this page
rev 1377 : 8077168: CodeStoreAndPathTest.java fails in jtreg mode on Mac
@@ -396,11 +396,11 @@
return "dev-" + new SimpleDateFormat("yyyyMMdd-HHmmss").format(new Date(getLastModifiedClassFile(
dir, 0L)));
} else if(protocol.equals("jrt")) {
return getJrtVersionDirName();
} else {
- throw new AssertionError();
+ throw new AssertionError("unknown protocol");
}
}
private static long getLastModifiedClassFile(final File dir, final long max) {
long currentMax = max;
@@ -554,17 +554,19 @@
return UNLIMITED_FILES;
}
return Math.max(0, Integer.parseInt(str));
}
+ private static final String JRT_NASHORN_DIR = "/modules/jdk.scripting.nashorn";
+
// version directory name if nashorn is loaded from jrt:/ URL
private static String getJrtVersionDirName() throws Exception {
final FileSystem fs = getJrtFileSystem();
// consider all .class resources under nashorn module to compute checksum
- final Path nashorn = fs.getPath("/jdk.scripting.nashorn");
+ final Path nashorn = fs.getPath(JRT_NASHORN_DIR);
if (! Files.isDirectory(nashorn)) {
- throw new FileNotFoundException("missing /jdk.scripting.nashorn dir in jrt fs");
+ throw new FileNotFoundException("missing " + JRT_NASHORN_DIR + " dir in jrt fs");
}
final MessageDigest digest = MessageDigest.getInstance("SHA-1");
Files.walk(nashorn).forEach(new Consumer<Path>() {
@Override
public void accept(final Path p) {
< prev index next >