Skip to content
Permalink
Browse files
[JENKINS-16845] Diagnostics.(cherry picked from commit e172407)
  • Loading branch information
jglick authored and vjuranek committed Apr 14, 2013
1 parent 6d13d4c commit e565acd39771da86dee2918d2d6feb9f0705730f
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 e565acd

Please sign in to comment.