From 89ebb8497f6e04281492e49b29eabbe72d6edc30 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Mon, 11 Nov 2013 16:48:21 -0800 Subject: [PATCH 1/2] allow null from the name --- core/src/main/java/jenkins/AgentProtocol.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/jenkins/AgentProtocol.java b/core/src/main/java/jenkins/AgentProtocol.java index f6524c6695..df702ac88f 100644 --- a/core/src/main/java/jenkins/AgentProtocol.java +++ b/core/src/main/java/jenkins/AgentProtocol.java @@ -27,6 +27,10 @@ public abstract class AgentProtocol implements ExtensionPoint { * Protocol name. * * This is a short string that consists of printable ASCII chars. Sent by the client to select the protocol. + * + * @return + * null to be disabled. This is useful for avoiding getting used + * until the protocol is properly configured. */ public abstract String getName(); @@ -44,7 +48,8 @@ public abstract class AgentProtocol implements ExtensionPoint { public static AgentProtocol of(String protocolName) { for (AgentProtocol p : all()) { - if (p.getName().equals(protocolName)) + String n = p.getName(); + if (n!=null && n.equals(protocolName)) return p; } return null; From d8eca0f5e7f8c57bf991039d8d255640547ed237 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Fri, 15 Nov 2013 15:34:48 -0800 Subject: [PATCH 2/2] [FIXED JENKINS-20163] Integrated the fix in Stapler. --- changelog.html | 3 +++ core/pom.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/changelog.html b/changelog.html index 724583a1d4..7b606a1d5c 100644 --- a/changelog.html +++ b/changelog.html @@ -55,6 +55,9 @@ Upcoming changes