mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[java] modular JDK definition should only include modular roots (IDEA-165523)
This commit is contained in:
@@ -606,14 +606,17 @@ public class JavaSdkImpl extends JavaSdk {
|
||||
List<VirtualFile> result = ContainerUtil.newArrayList();
|
||||
VirtualFileManager fileManager = VirtualFileManager.getInstance();
|
||||
|
||||
VirtualFile jrt = fileManager.findFileByUrl(JrtFileSystem.PROTOCOL_PREFIX + getPath(file) + JrtFileSystem.SEPARATOR);
|
||||
if (jrt != null) {
|
||||
ContainerUtil.addAll(result, jrt.getChildren());
|
||||
if (JrtFileSystem.isModularJdk(file.getPath())) {
|
||||
VirtualFile jrt = fileManager.findFileByUrl(JrtFileSystem.PROTOCOL_PREFIX + getPath(file) + JrtFileSystem.SEPARATOR);
|
||||
if (jrt != null) {
|
||||
ContainerUtil.addAll(result, jrt.getChildren());
|
||||
}
|
||||
}
|
||||
|
||||
for (File root : JavaSdkUtil.getJdkClassesRoots(file, isJre)) {
|
||||
String url = VfsUtil.getUrlForLibraryRoot(root);
|
||||
ContainerUtil.addIfNotNull(result, fileManager.findFileByUrl(url));
|
||||
else {
|
||||
for (File root : JavaSdkUtil.getJdkClassesRoots(file, isJre)) {
|
||||
String url = VfsUtil.getUrlForLibraryRoot(root);
|
||||
ContainerUtil.addIfNotNull(result, fileManager.findFileByUrl(url));
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(result, Comparator.comparing(VirtualFile::getPath));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2016 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -58,8 +58,7 @@ public class JavaSdkUtil {
|
||||
}
|
||||
}
|
||||
else if (new File(home, "lib/modules").exists()) {
|
||||
File libDir = new File(home, "lib");
|
||||
jarDirs = new File[]{libDir};
|
||||
jarDirs = ArrayUtil.EMPTY_FILE_ARRAY;
|
||||
}
|
||||
else {
|
||||
File libDir = new File(home, isJre ? "lib" : "jre/lib");
|
||||
|
||||
Reference in New Issue
Block a user