From efd05e33dc04ce834d09876d411f0ea7ec9cece6 Mon Sep 17 00:00:00 2001 From: Jan Lahoda Date: Mon, 4 Apr 2022 06:22:16 +0200 Subject: [PATCH] Filter source roots to avoids clashes between moule-info files. --- .../java/platform/classpath/PlatformClassPathProvider.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/java/java.platform/src/org/netbeans/modules/java/platform/classpath/PlatformClassPathProvider.java b/java/java.platform/src/org/netbeans/modules/java/platform/classpath/PlatformClassPathProvider.java index 699211eae6f9..ccfdbb574994 100644 --- a/java/java.platform/src/org/netbeans/modules/java/platform/classpath/PlatformClassPathProvider.java +++ b/java/java.platform/src/org/netbeans/modules/java/platform/classpath/PlatformClassPathProvider.java @@ -78,9 +78,13 @@ public ClassPath findClassPath(FileObject fo, String type) { ClassPath libraryPath = jp.getStandardLibraries(); ClassPath sourcePath = jp.getSourceFolders(); FileObject root = null; + boolean jdk9 = JAVA_9.compareTo(jp.getSpecification().getVersion()) <= 0; if (ClassPath.SOURCE.equals(type) && sourcePath != null && (root = sourcePath.findOwnerRoot(fo))!=null) { this.setLastUsedPlatform (root,jp); + if (jdk9) { + return ClassPathSupport.createClassPath(root); + } return sourcePath; } else if (ClassPath.BOOT.equals(type) && (root = getArtefactOwner(fo, bootClassPath, libraryPath, sourcePath)) != null ) { @@ -96,7 +100,7 @@ else if ((bootClassPath != null && (root = bootClassPath.findOwnerRoot (fo))!=nu return this.getEmptyClassPath (); } } else if (JavaClassPathConstants.MODULE_BOOT_PATH.equals(type) && - JAVA_9.compareTo(jp.getSpecification().getVersion()) <= 0 && + jdk9 && (root = getArtefactOwner(fo, bootClassPath, libraryPath, sourcePath)) != null) { this.setLastUsedPlatform (root,jp); return bootClassPath;