提交 609b321e 编写于 作者: C Christoph Kutzinski

[JENKINS-11458] when building with Maven 3, Channel.current() inside...

[JENKINS-11458] when building with Maven 3, Channel.current() inside FilterImpl sometimes returns null. Therefore pass channel into constructor, thus effectively restoring pre-1.435 behaviour.
上级 e5f9cfda
......@@ -163,16 +163,33 @@ public abstract class AbstractMavenBuilder implements DelegatingCallable<Result,
protected class FilterImpl extends MavenBuildProxy2.Filter<MavenBuildProxy2> implements Serializable {
private MavenBuildInformation mavenBuildInformation;
private Channel channel;
public FilterImpl(MavenBuildProxy2 core, MavenBuildInformation mavenBuildInformation) {
super(core);
this.mavenBuildInformation = mavenBuildInformation;
}
public FilterImpl(MavenBuildProxy2 core, MavenBuildInformation mavenBuildInformation, Channel channel) {
super(core);
this.mavenBuildInformation = mavenBuildInformation;
if (channel == null) {
throw new NullPointerException("channel must not be null!");
}
this.channel = channel;
}
@Override
public void executeAsync(final BuildCallable<?,?> program) throws IOException {
Channel ch = this.channel != null ? this.channel : Channel.current();
if (ch == null) {
throw new NullPointerException("current channel not available!");
}
recordAsynchronousExecution(
Channel.current().callAsync(
ch.callAsync(
new AsyncInvoker(core,program)));
}
......
......@@ -89,7 +89,7 @@ public class Maven3Builder extends AbstractMavenBuilder implements DelegatingCal
sourceProxies = new HashMap<ModuleName, ProxyImpl2>(proxies);
this.proxies = new HashMap<ModuleName, MavenBuildProxy2>(proxies);
for (Entry<ModuleName,MavenBuildProxy2> e : this.proxies.entrySet())
e.setValue(new FilterImpl(e.getValue(), this.mavenBuildInformation));
e.setValue(new FilterImpl(e.getValue(), this.mavenBuildInformation, Channel.current()));
this.reporters.putAll( reporters );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册