Java Code Examples for java.lang.module.FindException#getCause()
The following examples show how to use
java.lang.module.FindException#getCause() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ModulePathValidator.java From Bytecoder with Apache License 2.0 | 7 votes |
/** * Scan a JAR file or exploded module. */ private Optional<ModuleReference> scanModule(Path entry) { ModuleFinder finder = ModuleFinder.of(entry); try { return finder.findAll().stream().findFirst(); } catch (FindException e) { out.println(entry); out.println(INDENT + e.getMessage()); Throwable cause = e.getCause(); if (cause != null) { out.println(INDENT + cause); } errorCount++; return Optional.empty(); } }
Example 2
Source File: LauncherHelper.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * Scan a JAR file or exploded module. */ private Optional<ModuleReference> scanModule(Path entry) { ModuleFinder finder = ModuleFinder.of(entry); try { return finder.findAll().stream().findFirst(); } catch (FindException e) { ostream.println(entry); ostream.println(INDENT + e.getMessage()); Throwable cause = e.getCause(); if (cause != null) { ostream.println(INDENT + cause); } errorFound = true; return Optional.empty(); } }