Skip to content

Commit

Permalink
Merge pull request #11 from jglick/BranchSourceList
Browse files Browse the repository at this point in the history
Ensure that SCMSource.setOwner is called
  • Loading branch information
jglick committed Oct 30, 2015
2 parents 36a6306 + 02e16af commit b8f6a22
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/main/java/jenkins/branch/MultiBranchProject.java
Expand Up @@ -89,7 +89,7 @@ public abstract class MultiBranchProject<P extends Job<P, R> & TopLevelItem,
/**
* The user supplied branch sources.
*/
private /*almost final*/ PersistedList<BranchSource> sources = new PersistedList<BranchSource>(this);
private /*almost final*/ PersistedList<BranchSource> sources = new BranchSourceList(this);

/**
* The source for dead branches.
Expand Down Expand Up @@ -675,4 +675,20 @@ public static String rawDecode(@NonNull String s) {
}
}

private static class BranchSourceList extends PersistedList<BranchSource> {

BranchSourceList(MultiBranchProject<?,?> owner) {
super(owner);
}

@Override
protected void onModified() throws IOException {
super.onModified();
for (BranchSource branchSource : this) {
branchSource.getSource().setOwner((MultiBranchProject) owner);
}
}

}

}

0 comments on commit b8f6a22

Please sign in to comment.