Skip to content

Commit

Permalink
Apply review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
NotStirred committed Sep 23, 2024
1 parent 7fb0107 commit a228b41
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chunky/src/java/se/llbit/chunky/main/Chunky.java
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ private void loadPlugins() {
.filter(jarName -> !jarName.isEmpty())
.map(jarName -> pluginsPath.resolve(jarName).toAbsolutePath().toFile())
.map(PluginManager::parsePluginManifest)
.flatMap(o -> o.map(Stream::of).orElseGet(Stream::empty)) // replace with Optional::stream in java9+
.flatMap(Optional::stream)
.collect(Collectors.toSet());

// Load plugins
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void load(BiConsumer<Plugin, PluginManifest> onLoad, PluginManifest plugi
} catch (IOException | ClassNotFoundException e) {
Log.error("Could not load the plugin", e);
} catch (ClassCastException e) {
Log.error("Plugin main class has wrong type", e);
Log.error("Plugin main class has wrong type (must implement se.llbit.chunky.Plugin)", e);
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException e) {
Log.error("Could not create plugin instance", e);
}
Expand Down

0 comments on commit a228b41

Please sign in to comment.