mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-04 15:45:52 +00:00
[FIXED JENKINS-47713] - Do not copy list of plugins on every call (#3109)
[FIXED JENKINS-47713] - Do not copy list of plugins on every call
This commit is contained in:
1 parent
cf69c2903a
commit
6e75f7349c
1 file changed
+2
-7
@@ -254,7 +254,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
|
||||
/**
|
||||
* All discovered plugins.
|
||||
*/
|
||||
protected final List<PluginWrapper> plugins = new ArrayList<PluginWrapper>();
|
||||
protected final List<PluginWrapper> plugins = new CopyOnWriteArrayList<>();
|
||||
|
||||
/**
|
||||
* All active plugins, topologically sorted so that when X depends on Y, Y appears in the list before X does.
|
||||
@@ -463,10 +463,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
|
||||
cgd.run(getPlugins());
|
||||
|
||||
// obtain topologically sorted list and overwrite the list
|
||||
ListIterator<PluginWrapper> litr = getPlugins().listIterator();
|
||||
for (PluginWrapper p : cgd.getSorted()) {
|
||||
litr.next();
|
||||
litr.set(p);
|
||||
if(p.isActive())
|
||||
activePlugins.add(p);
|
||||
}
|
||||
@@ -1132,9 +1129,7 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
|
||||
*/
|
||||
@Exported
|
||||
public List<PluginWrapper> getPlugins() {
|
||||
List<PluginWrapper> out = new ArrayList<PluginWrapper>(plugins.size());
|
||||
out.addAll(plugins);
|
||||
return out;
|
||||
return Collections.unmodifiableList(plugins);
|
||||
}
|
||||
|
||||
public List<FailedPlugin> getFailedPlugins() {
|
||||
|
||||
Reference in new issue
Block a user