On Tue, 8 Apr 2025 12:20:02 GMT, Danish Nawab <d...@openjdk.org> wrote:
>> src/jdk.jdeps/share/classes/com/sun/tools/jnativescan/JNativeScanTask.java >> line 79: >> >>> 77: try(ClassResolver classesToScan = >>> ClassResolver.forClassFileSources(toScan, version); >>> 78: ClassResolver systemClassResolver = >>> ClassResolver.forSystemModules(version)) { >>> 79: NativeMethodFinder finder = NativeMethodFinder.create(err, >>> classesToScan, systemClassResolver); >> >> e.g. >> Suggestion: >> >> Set<String> errors = new HashSet<>(); // print these at the end >> Diagnostics diagnostics = (context, error) -> errors.add("Error >> while processing " + context + ": " + error.getMessage(); >> NativeMethodFinder finder = >> NativeMethodFinder.create(diagnostics, classesToScan, systemClassResolver); > > I see what you mean. Let me take a crack at it. One more though: I think we should only print the error messages as part of `dumpAll` and not `printNativeAccess`, so that the result of the latter can still be piped directly to `--enable-native-access`, even if there are errors. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24499#discussion_r2033074737