Skip to content

Commit 6220b73

Browse files
committed
Fixes installed plugin score gathering
1 parent 40b47ee commit 6220b73

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

core/src/main/java/hudson/PluginWrapper.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,14 @@ public void injectJarsToClasspath(File... jars) throws Exception {
427427

428428
@Restricted(NoExternalUse.class) // Jelly use only
429429
public Integer getHealthScore() {
430+
if (this.healthScore == null) {
431+
this.healthScore = getInfoFromAllSites().stream()
432+
.filter(Objects::nonNull)
433+
.filter(p -> p.healthScore != null)
434+
.findFirst()
435+
.map(plugin -> plugin.healthScore)
436+
.orElse(null);
437+
}
430438
return this.healthScore;
431439
}
432440

@@ -507,12 +515,6 @@ public PluginWrapper(PluginManager parent, File archive, Manifest manifest, URL
507515
assert d.optional : d + " included among optionalDependencies of " + shortName + " but was not marked optional";
508516
}
509517
this.archive = archive;
510-
this.healthScore = getInfoFromAllSites().stream()
511-
.filter(Objects::nonNull)
512-
.filter(p -> p.healthScore != null)
513-
.findFirst()
514-
.map(plugin -> plugin.healthScore)
515-
.orElse(null);
516518
}
517519

518520
@Override

0 commit comments

Comments
 (0)