Skip to content
Permalink
Browse files

[JENKINS-34439] Clover plugin still has problems with pipeline builds

CloverBuildAction.java:
- Refactored this.projectAction access
  • Loading branch information...
piomis committed Jun 26, 2017
1 parent 18ee107 commit 02b183882a96d62e25c319ae1ca56b052c5faf24
Showing with 13 additions and 11 deletions.
  1. +13 −11 src/main/java/hudson/plugins/clover/CloverBuildAction.java
@@ -134,6 +134,15 @@ static CloverBuildAction getPreviousResult(Run<?, ?> start) {
}
}

private List<CloverProjectAction> getActions()
{
if( this.projectActions == null )
{
this.projectActions = new ArrayList<CloverProjectAction>();
}
return this.projectActions;
}

CloverBuildAction(String workspacePath, ProjectCoverage r, CoverageTarget healthyTarget, CoverageTarget unhealthyTarget) {
if (r != null) {
reports.put(this, r);
@@ -156,20 +165,13 @@ static CloverBuildAction getPreviousResult(Run<?, ?> start) {
if (c != null) {
c.setOwner(build);
}
if( this.projectActions == null )
{
this.projectActions = new ArrayList<CloverProjectAction>();
}
this.projectActions.add(new CloverProjectAction(build.getParent()));

getActions().add(new CloverProjectAction(build.getParent()));
}

@Override public void onLoad(Run<?,?> r) {
owner = r;
if( this.projectActions == null )
{
this.projectActions = new ArrayList<CloverProjectAction>();
}
this.projectActions.add(new CloverProjectAction(r.getParent()));
getActions().add(new CloverProjectAction(r.getParent()));
}

/**
@@ -296,7 +298,7 @@ public int getPackages() {

@Override
public Collection<? extends Action> getProjectActions() {
return this.projectActions;
return getActions();
}

private static final Logger logger = Logger.getLogger(CloverBuildAction.class.getName());

0 comments on commit 02b1838

Please sign in to comment.
You can’t perform that action at this time.