|
50 | 50 | import java.util.Collections; |
51 | 51 | import java.util.HashMap; |
52 | 52 | import java.util.HashSet; |
| 53 | +import java.util.LinkedHashMap; |
53 | 54 | import java.util.LinkedHashSet; |
54 | 55 | import java.util.List; |
55 | 56 | import java.util.Locale; |
@@ -102,7 +103,8 @@ record LoadedPlugin(PluginDescriptor descriptor, Plugin instance, ClassLoader lo |
102 | 103 | private final Path configPath; |
103 | 104 |
|
104 | 105 | /** |
105 | | - * We keep around a list of plugins and modules |
| 106 | + * We keep around a list of plugins and modules. The order of |
| 107 | + * this list is that which the plugins and modules were loaded in. |
106 | 108 | */ |
107 | 109 | private final List<LoadedPlugin> plugins; |
108 | 110 | private final PluginsAndModules info; |
@@ -156,7 +158,7 @@ public PluginsService(Settings settings, Path configPath, Path modulesDirectory, |
156 | 158 | } |
157 | 159 | } |
158 | 160 |
|
159 | | - Map<String, LoadedPlugin> loadedPlugins = loadBundles(seenBundles); |
| 161 | + LinkedHashMap<String, LoadedPlugin> loadedPlugins = loadBundles(seenBundles); |
160 | 162 |
|
161 | 163 | var inspector = PluginIntrospector.getInstance(); |
162 | 164 | this.info = new PluginsAndModules(getRuntimeInfos(inspector, pluginsList, loadedPlugins), modulesList); |
@@ -280,8 +282,8 @@ protected List<LoadedPlugin> plugins() { |
280 | 282 | return this.plugins; |
281 | 283 | } |
282 | 284 |
|
283 | | - private Map<String, LoadedPlugin> loadBundles(Set<PluginBundle> bundles) { |
284 | | - Map<String, LoadedPlugin> loaded = new HashMap<>(); |
| 285 | + private LinkedHashMap<String, LoadedPlugin> loadBundles(Set<PluginBundle> bundles) { |
| 286 | + LinkedHashMap<String, LoadedPlugin> loaded = new LinkedHashMap<>(); |
285 | 287 | Map<String, Set<URL>> transitiveUrls = new HashMap<>(); |
286 | 288 | List<PluginBundle> sortedBundles = PluginsUtils.sortBundles(bundles); |
287 | 289 | Set<URL> systemLoaderURLs = JarHell.parseModulesAndClassPath(); |
|
0 commit comments