PluginManager: don't duplicate dependency plugins if they already exist

If you had an external plugin with a PluginDependency on a core plugin
the core plugin would be included in the external `loadPlugins`
dependency graph, which would make it be instantiated twice. Since
external plugins can't depend on other external plugins, and core
plugins are guaranteed to be loaded first with no external dependencies,
we can just exclude dependency edges for nodes outside of the current
load list.
This commit is contained in:
Max Weber
2020-06-02 17:27:01 -06:00
committed by Adam
parent c67378c09e
commit 4652e8ede4

View File

@@ -320,7 +320,10 @@ public class PluginManager
for (PluginDependency pluginDependency : pluginDependencies)
{
graph.putEdge(pluginClazz, pluginDependency.value());
if (graph.nodes().contains(pluginDependency.value()))
{
graph.putEdge(pluginClazz, pluginDependency.value());
}
}
}