From a790befbc173fdf0007a4f495d0dc029e1cfd646 Mon Sep 17 00:00:00 2001 From: Luke Robertson Date: Mon, 19 May 2014 21:07:43 +0100 Subject: [PATCH] Fix regressions in recent release 1. Use JSONObject optInt() instead of getInt() to handle null value or if value is not a number. 2. Value for Property Value not loaded from config file. --- .../ExtendedChoiceParameterDefinition.java | 2 +- .../ExtendedChoiceParameterDefinition/config.jelly | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition.java b/src/main/java/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition.java index c0a7a926..af0f0575 100644 --- a/src/main/java/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition.java +++ b/src/main/java/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition.java @@ -151,7 +151,7 @@ public ExtendedChoiceParameterDefinition newInstance(StaplerRequest req, JSONObj type = formData.getString("type"); description = formData.getString("description"); quoteValue = formData.getBoolean("quoteValue"); - visibleItemCount = formData.getInt("visibleItemCount"); + visibleItemCount = formData.optInt("visibleItemCount"); multiSelectDelimiter = formData.getString("multiSelectDelimiter"); JSONObject propertySourceJSON = (JSONObject)formData.get("propertySource"); diff --git a/src/main/resources/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition/config.jelly b/src/main/resources/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition/config.jelly index cd5cc5c9..466ca4ae 100644 --- a/src/main/resources/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition/config.jelly +++ b/src/main/resources/com/cwctravel/hudson/plugins/extended_choice_parameter/ExtendedChoiceParameterDefinition/config.jelly @@ -90,7 +90,7 @@ - +