Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import java.net.URL;
import java.net.URLConnection;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Enumeration;
Expand Down Expand Up @@ -385,8 +384,6 @@ private Collection<Processor> lookupProcessors(ClassLoader cl, boolean onScan, b
if (instance instanceof Processor) {
result.add(new ErrorToleratingProcessor((Processor) instance));
}
} catch (ThreadDeath td) {
throw td;
} catch (Throwable t) {
LOG.log(Level.FINE, null, t);
}
Expand Down Expand Up @@ -732,9 +729,19 @@ private static boolean hasSourceCache(@NonNull final URL root) {
return SourceForBinaryQuery.findSourceRoots2(root).preferSources();
}

//keep synchronized with libs.javacapi/manifest.mf and libs.javacimpl/manifest.mf
//keep synchronized with java/libs.nbjavacapi/manifest.mf (OpenIDE-Module-Hide-Classpath-Packages attribute)
//when adding new packages, double-check the quick path in loadClass below:
private static final Iterable<? extends String> javacPackages = Arrays.asList("com.sun.javadoc.", "com.sun.source.", "javax.annotation.processing.", "javax.lang.model.", "javax.tools.", "com.sun.tools.javac.", "com.sun.tools.javadoc.", "com.sun.tools.classfile.", "com.sun.tools.hc.");
private static final List<String> javacPackages = List.of(
"javax.annotation.processing.",
"javax.lang.model.",
"javax.tools.",
"com.sun.source.",
"com.sun.tools.classfile.",
"com.sun.tools.javac.",
"com.sun.tools.doclint.",
"com.sun.tools.javap."
);

private static final class BypassOpenIDEUtilClassLoader extends ClassLoader {
private final ClassLoader contextCL;
public BypassOpenIDEUtilClassLoader(ClassLoader contextCL) {
Expand Down Expand Up @@ -993,7 +1000,7 @@ public SourceVersion getSupportedSourceVersion() {
public void init(ProcessingEnvironment processingEnv) {
try {
delegate.init(processingEnv);
} catch (ClientCodeException | ThreadDeath | Abort err) {
} catch (ClientCodeException | Abort err) {
initFailed = true;
throw err;
} catch (Throwable t) {
Expand All @@ -1016,7 +1023,7 @@ public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment
}
try {
return delegate.process(annotations, roundEnv);
} catch (ClientCodeException | ThreadDeath | Abort err) {
} catch (ClientCodeException | Abort err) {
processFailed = true;
throw err;
} catch (Throwable t) {
Expand Down
2 changes: 1 addition & 1 deletion java/libs.nbjavacapi/manifest.mf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ AutoUpdate-Show-In-Client: true
OpenIDE-Module: org.netbeans.libs.nbjavacapi
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/nbjavac/api/Bundle.properties
OpenIDE-Module-Specification-Version: 21.9
OpenIDE-Module-Hide-Classpath-Packages: com.sun.javadoc.**, com.sun.source.**, javax.annotation.processing.**, javax.lang.model.**, javax.tools.**, com.sun.tools.javac.** com.sun.tools.javac.**, com.sun.tools.javadoc.**, com.sun.tools.javap.**, com.sun.tools.classfile.**, com.sun.tools.doclint.**
OpenIDE-Module-Hide-Classpath-Packages: com.sun.source.**, javax.annotation.processing.**, javax.lang.model.**, javax.tools.**, com.sun.tools.javac.**, com.sun.tools.javap.**, com.sun.tools.classfile.**, com.sun.tools.doclint.**
OpenIDE-Module-Fragment-Host: org.netbeans.libs.javacapi
OpenIDE-Module-Provides: org.netbeans.libs.nbjavac
Loading