From 957595d2b4dbec3ea7f18679f9f9c7be0b6c81da Mon Sep 17 00:00:00 2001 From: Jesse Glick Date: Mon, 19 Aug 2013 16:19:20 -0400 Subject: [PATCH] You might expect new FilePath(null, "/local/path").getChannel() to be null. Confusingly, it is instead MasterComputer.localChannel! If that is fed back into FilePath.(VirtualChannel,String) rather than using .(FilePath,String) you get an object that behaves strangely and throws exceptions. --- core/src/main/java/hudson/FilePath.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index fdca5388ba..abfdef2c6b 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -196,7 +196,7 @@ public final class FilePath implements Serializable { * that's connected to that machine. If null, that means the local file path. */ public FilePath(VirtualChannel channel, String remote) { - this.channel = channel; + this.channel = channel == Jenkins.MasterComputer.localChannel ? null : channel; this.remote = normalize(remote); }