From 5baac35748a188f3369a73b10a1ff625b283d53e Mon Sep 17 00:00:00 2001 From: kohsuke Date: Wed, 25 Feb 2009 01:34:33 +0000 Subject: [PATCH] Persistence of Slave bypasses the constructor, so nodeProperties need to be set back to non-null in readResolve. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15709 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/model/Slave.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/model/Slave.java b/core/src/main/java/hudson/model/Slave.java index 163ca5b0b0..eb2a3b9acf 100644 --- a/core/src/main/java/hudson/model/Slave.java +++ b/core/src/main/java/hudson/model/Slave.java @@ -54,7 +54,6 @@ import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; -import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.List; @@ -122,7 +121,7 @@ public abstract class Slave extends Node implements Serializable { */ private String label=""; - private final DescribableList,NodePropertyDescriptor> nodeProperties = new DescribableList,NodePropertyDescriptor>(Hudson.getInstance()); + private /*almost final*/ DescribableList,NodePropertyDescriptor> nodeProperties = new DescribableList,NodePropertyDescriptor>(Hudson.getInstance()); /** * Lazily computed set of labels from {@link #label}. @@ -416,6 +415,8 @@ public abstract class Slave extends Node implements Serializable { ? new JNLPLauncher() : new CommandLauncher(agentCommand); } + if(nodeProperties==null) + nodeProperties = new DescribableList,NodePropertyDescriptor>(Hudson.getInstance()); return this; } -- GitLab