mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-13 20:12:14 +00:00
use stream api to collect deprecated plugins
This commit is contained in:
1 file changed
+4
-7
@@ -2250,13 +2250,10 @@ public abstract class PluginManager extends AbstractModelObject implements OnMas
|
||||
|
||||
public boolean isActivated() {
|
||||
if (deprecatedPlugins == null) {
|
||||
deprecatedPlugins = new ArrayList<>();
|
||||
for (PluginWrapper p : Jenkins.get().getPluginManager().getPlugins()) {
|
||||
if (p.isDeprecated()) {
|
||||
deprecatedPlugins.add(p);
|
||||
isActive = true;
|
||||
}
|
||||
}
|
||||
deprecatedPlugins = Jenkins.get().getPluginManager().getPlugins().stream()
|
||||
.filter(PluginWrapper::isDeprecated)
|
||||
.collect(Collectors.toList());
|
||||
isActive = !deprecatedPlugins.isEmpty();
|
||||
}
|
||||
return isActive;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user