提交 63ff1a9a 编写于 作者: A alanharder

Merge r37113 from https://svn.java.net/svn/hudson~svn

by willemv: Fixed boundary check error, and made variable names clearer.
上级 d39852bc
......@@ -358,20 +358,23 @@ public class MailSender {
return msg;
}
private void includeCulpritsOf(AbstractProject upstreamBuild, AbstractBuild<?, ?> currentBuild, BuildListener listener, Set<InternetAddress> recipientList) throws AddressException {
AbstractBuild<?,?> pb = currentBuild.getPreviousBuild();
AbstractBuild<?,?> ub = currentBuild.getUpstreamRelationshipBuild(upstreamBuild);
AbstractBuild<?,?> upb = pb!=null ? pb.getUpstreamRelationshipBuild(upstreamBuild) : null;
if(pb==null && ub==null && upb==null) {
listener.getLogger().println("Unable to compute the changesets in "+ upstreamBuild +". Is the fingerprint configured?");
private void includeCulpritsOf(AbstractProject upstreamProject, AbstractBuild<?, ?> currentBuild, BuildListener listener, Set<InternetAddress> recipientList) throws AddressException {
AbstractBuild<?,?> upstreamBuild = currentBuild.getUpstreamRelationshipBuild(upstreamProject);
AbstractBuild<?,?> previousBuild = currentBuild.getPreviousBuild();
AbstractBuild<?,?> previousBuildUpstreamBuild = previousBuild!=null ? previousBuild.getUpstreamRelationshipBuild(upstreamProject) : null;
if(previousBuild==null && upstreamBuild==null && previousBuildUpstreamBuild==null) {
listener.getLogger().println("Unable to compute the changesets in "+ upstreamProject +". Is the fingerprint configured?");
return;
}
if(pb==null || ub==null || upb==null) {
listener.getLogger().println("Unable to compute the changesets in "+ upstreamBuild);
if(previousBuild==null || upstreamBuild==null || previousBuildUpstreamBuild==null) {
listener.getLogger().println("Unable to compute the changesets in "+ upstreamProject);
return;
}
for( AbstractBuild<?,?> b=upb; b!=ub && b!=null; b=b.getNextBuild())
AbstractBuild<?,?> b=previousBuildUpstreamBuild;
do {
recipientList.addAll(buildCulpritList(listener,b.getCulprits()));
b = b.getNextBuild();
} while ( b != upstreamBuild && b != null );
}
private Set<InternetAddress> buildCulpritList(BuildListener listener, Set<User> culprits) throws AddressException {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册