Skip to content

Commit

Permalink
Filter source roots to avoids clashes between moule-info files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jlahoda authored and lkishalmi committed Apr 12, 2022
1 parent cd760a4 commit efd05e3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand All @@ -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;
Expand Down

0 comments on commit efd05e3

Please sign in to comment.