trigger = false;
}
else {
AbstractBuild<?,?> dlb = downstreamProject.getLastBuild(); // can be null.
for (AbstractMavenProject up : Util.filter(downstreamProject.getUpstreamProjects(),AbstractMavenProject.class)) {
Run ulb;
if(up==parent) {
// the current build itself is not registered as lastSuccessfulBuild
// at this point, so we have to take that into account. ugly.
if(build.getResult()==null || !build.getResult().isWorseThan(Result.UNSTABLE))
ulb = build;
else
ulb = up.getLastSuccessfulBuild();
} else
ulb = up.getLastSuccessfulBuild();
if(ulb==null) {
// if no usable build is available from the upstream,
// then we have to wait at least until this build is ready
if(AbstractMavenBuild.debug)
listener.getLogger().println(" -> No, because another upstream "+up+" for "+downstreamProject+" has no successful build");
trigger = false;
break;
}
// if no record of the relationship in the last build
// is available, we'll just have to assume that the condition
// for the new build is met, or else no build will be fired forever.
if(dlb==null) continue;
int n = dlb.getUpstreamRelationship(up);
if(n==-1) continue;
assert ulb.getNumber()>=n;
}
}
return trigger;
}