From 4176c4678d4170424a1db1225fee9de5a06351ba Mon Sep 17 00:00:00 2001 From: Craig Perkins Date: Mon, 23 Dec 2024 16:41:06 -0500 Subject: [PATCH] Enable testing for ExtensiblePlugins using classpath plugins Signed-off-by: Craig Perkins --- .../main/java/org/opensearch/plugins/PluginsService.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/server/src/main/java/org/opensearch/plugins/PluginsService.java b/server/src/main/java/org/opensearch/plugins/PluginsService.java index c3db32874d260..9d3efbbfae5e9 100644 --- a/server/src/main/java/org/opensearch/plugins/PluginsService.java +++ b/server/src/main/java/org/opensearch/plugins/PluginsService.java @@ -525,8 +525,7 @@ private static void addSortedBundle( for (String dependency : bundle.plugin.getExtendedPlugins()) { Bundle depBundle = bundles.get(dependency); if (depBundle == null) { - continue; - // throw new IllegalArgumentException("Missing plugin [" + dependency + "], dependency of [" + name + "]"); + throw new IllegalArgumentException("Missing plugin [" + dependency + "], dependency of [" + name + "]"); } addSortedBundle(depBundle, bundles, sortedBundles, dependencyStack); assert sortedBundles.contains(depBundle); @@ -663,9 +662,7 @@ static void checkBundleJarHell(Set classpath, Bundle bundle, Map urls = new HashSet<>(); for (String extendedPlugin : exts) { Set pluginUrls = transitiveUrls.get(extendedPlugin); - if (pluginUrls == null) { - continue; - } + assert pluginUrls != null : "transitive urls should have already been set for " + extendedPlugin; Set intersection = new HashSet<>(urls); intersection.retainAll(pluginUrls);