8366582: Test jdk/jshell/ToolSimpleTest.java failed: provider not found

Reviewed-by: asotona
This commit is contained in:
Jan Lahoda 2025-09-29 05:36:18 +00:00
parent e19ec6f785
commit d53190ac44
2 changed files with 6 additions and 3 deletions

View File

@ -2303,7 +2303,8 @@ class SourceCodeAnalysisImpl extends SourceCodeAnalysis {
//if an index exists for the given entry, the existing index is kept unless the timestamp is modified
private ClassIndex indexForPath(Path path) {
if (!Files.isDirectory(path)) {
if (Files.exists(path)) {
if (Files.exists(path) &&
!isJRTMarkerFile(path)) { //don't directly index lib/modules
return PATH_TO_INDEX.compute(path, (p, index) -> {
try {
long lastModified = Files.getLastModifiedTime(p).toMillis();
@ -2334,6 +2335,10 @@ class SourceCodeAnalysisImpl extends SourceCodeAnalysis {
}
}
private static boolean isJRTMarkerFile(Path path) {
return path.equals(Paths.get(System.getProperty("java.home"), "lib", "modules"));
}
//create an index based on the content of the given dirs; the original JavaFileManager entry is originalPath.
private ClassIndex doIndex(long timestamp, Path originalPath, Iterable<? extends Path> dirs) {
Set<String> packages = new HashSet<>();

View File

@ -52,8 +52,6 @@ jdk/jshell/UserJdiUserRemoteTest.java
jdk/jshell/UserInputTest.java 8169536 generic-all
jdk/jshell/ToolBasicTest.java 8265357 macosx-aarch64
jdk/jshell/HighlightUITest.java 8284144 generic-all
jdk/jshell/ToolSimpleTest.java 8366582 generic-all
jdk/jshell/ToolLocalSimpleTest.java 8366582 generic-all
###########################################################################
#