From 8899d864f7fba97a7417c7143bb83b153ab48818 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Wed, 25 Feb 2009 18:34:10 +0000 Subject: [PATCH] inconsistency in the code as to whether this can be null or not. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@15749 71c3de6d-444a-0410-be80-ed276b4c234a --- .../main/java/hudson/tools/ToolLocationNodeProperty.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/tools/ToolLocationNodeProperty.java b/core/src/main/java/hudson/tools/ToolLocationNodeProperty.java index 692fcf7ac1..735a310851 100644 --- a/core/src/main/java/hudson/tools/ToolLocationNodeProperty.java +++ b/core/src/main/java/hudson/tools/ToolLocationNodeProperty.java @@ -43,11 +43,14 @@ import java.util.List; * @since 1.286 */ public class ToolLocationNodeProperty extends NodeProperty { - + /** + * Override locations. Never null. + */ private final List locations; @DataBoundConstructor public ToolLocationNodeProperty(List locations) { + if(locations==null) throw new IllegalArgumentException(); this.locations = locations; } @@ -56,7 +59,6 @@ public class ToolLocationNodeProperty extends NodeProperty { } public List getLocations() { - if (locations == null) return Collections.emptyList(); return Collections.unmodifiableList(locations); } -- GitLab