Skip to content
Permalink
Browse files
[JENKINS-16845] Diagnostics.
  • Loading branch information
jglick committed Apr 3, 2013
1 parent 750da1a commit e172407b2cb0fe588c6e0699e88f5201f333ba27
Showing with 8 additions and 1 deletion.
  1. +5 −1 core/src/main/java/hudson/model/AbstractBuild.java
  2. +3 −0 core/src/main/java/hudson/model/AbstractProject.java
@@ -213,7 +213,11 @@ public R getPreviousBuild() {

if (r==null) {
// having two neighbors pointing to each other is important to make RunMap.removeValue work
R pb = getParent().builds.search(number-1, Direction.DESC);
P _parent = getParent();
if (_parent == null) {
throw new IllegalStateException("no parent for " + this);
}
R pb = _parent._getRuns().search(number-1, Direction.DESC);
if (pb!=null) {
((AbstractBuild)pb).nextBuild = selfReference; // establish bi-di link
this.previousBuild = pb.selfReference;
@@ -1010,6 +1010,9 @@ public BuildAuthorizationToken getAuthToken() {

@Override
public RunMap<R> _getRuns() {
if (builds == null) {
throw new IllegalStateException("no run map created yet for " + this);
}
assert builds.baseDirInitialized() : "neither onCreatedFromScratch nor onLoad called on " + this + " yet";
return builds;
}

0 comments on commit e172407

Please sign in to comment.