mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 17:56:17 +01:00
Resolve plugin installation conflict were the same plugin was tried to be installed multiple times for one single action. (#2138)
The pending queue is updated after all the plugins to be installed are collected, and then we already may have duplicate entries. Because of this we check right on the collecting step if the plugin was already added during this single action.
This commit is contained in:
@@ -357,7 +357,13 @@ public class DefaultPluginManager implements PluginManager {
|
||||
}
|
||||
}
|
||||
|
||||
plugins.add(plugin);
|
||||
if (pluginWasNotAddedYet(plugins, plugin)) {
|
||||
plugins.add(plugin);
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean pluginWasNotAddedYet(List<AvailablePlugin> plugins, AvailablePlugin plugin) {
|
||||
return plugins.stream().noneMatch(p -> p.getDescriptor().getInformation().getName().equals(plugin.getDescriptor().getInformation().getName()));
|
||||
}
|
||||
|
||||
private boolean isInstalledOrPending(String name) {
|
||||
|
||||
Reference in New Issue
Block a user