Skip to content

Commit 71f18a1

Browse files
authored
Merge pull request #9093 from lahodaj/use-file-to-get-classpath
Read classpath for the file, rather then for the directory, to help with cases where files have classpath, but directories don't.
2 parents 496fe06 + ff73431 commit 71f18a1

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

java/java.source.base/src/org/netbeans/modules/java/source/JavaSourceUtilImpl.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -153,31 +153,31 @@ protected Map<String, byte[]> generate(
153153
.register(FileManagerTransaction.class, FileManagerTransaction.writeThrough())
154154
.register(ProcessorGenerated.class, ProcessorGenerated.create(srcRoot.toURL()));
155155
try {
156-
ClassPath src = ClassPath.getClassPath(srcRoot, ClassPath.SOURCE);
156+
ClassPath src = ClassPath.getClassPath(file, ClassPath.SOURCE);
157157
if (src == null) {
158158
src = ClassPathSupport.createClassPath(srcRoot);
159159
}
160-
ClassPath moduleSrc = ClassPath.getClassPath(srcRoot, JavaClassPathConstants.MODULE_SOURCE_PATH);
160+
ClassPath moduleSrc = ClassPath.getClassPath(file, JavaClassPathConstants.MODULE_SOURCE_PATH);
161161
if (moduleSrc == null) {
162162
moduleSrc = ClassPath.EMPTY;
163163
}
164-
ClassPath boot = ClassPath.getClassPath(srcRoot, ClassPath.BOOT);
164+
ClassPath boot = ClassPath.getClassPath(file, ClassPath.BOOT);
165165
if (boot == null) {
166166
boot = JavaPlatform.getDefault().getBootstrapLibraries();
167167
}
168-
ClassPath moduleBoot = ClassPath.getClassPath(srcRoot, JavaClassPathConstants.MODULE_BOOT_PATH);
168+
ClassPath moduleBoot = ClassPath.getClassPath(file, JavaClassPathConstants.MODULE_BOOT_PATH);
169169
if (moduleBoot == null) {
170170
moduleBoot = ClassPath.EMPTY;
171171
}
172-
ClassPath compile = ClassPath.getClassPath(srcRoot, ClassPath.COMPILE);
172+
ClassPath compile = ClassPath.getClassPath(file, ClassPath.COMPILE);
173173
if (compile == null) {
174174
compile = ClassPath.EMPTY;
175175
}
176-
ClassPath moduleCompile = ClassPath.getClassPath(srcRoot, JavaClassPathConstants.MODULE_COMPILE_PATH);
176+
ClassPath moduleCompile = ClassPath.getClassPath(file, JavaClassPathConstants.MODULE_COMPILE_PATH);
177177
if (moduleCompile == null) {
178178
moduleCompile = ClassPath.EMPTY;
179179
}
180-
ClassPath moduleClass = ClassPath.getClassPath(srcRoot, JavaClassPathConstants.MODULE_CLASS_PATH);
180+
ClassPath moduleClass = ClassPath.getClassPath(file, JavaClassPathConstants.MODULE_CLASS_PATH);
181181
if (moduleClass == null) {
182182
moduleClass = ClassPath.EMPTY;
183183
}

0 commit comments

Comments
 (0)