From fdb4e7253eb3547615196fd70ddba6a1222bf403 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Wed, 2 Jul 2008 01:15:41 +0000 Subject: [PATCH] applied the stapler subtype bindJSON change to SCM browsers, too. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10560 71c3de6d-444a-0410-be80-ed276b4c234a --- .../src/main/java/hudson/scm/RepositoryBrowsers.java | 12 ++---------- .../main/resources/lib/hudson/listScmBrowsers.jelly | 11 +++++------ 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/core/src/main/java/hudson/scm/RepositoryBrowsers.java b/core/src/main/java/hudson/scm/RepositoryBrowsers.java index f69863f41c..b0ac7349cc 100644 --- a/core/src/main/java/hudson/scm/RepositoryBrowsers.java +++ b/core/src/main/java/hudson/scm/RepositoryBrowsers.java @@ -66,17 +66,9 @@ public class RepositoryBrowsers { T createInstance(Class type, StaplerRequest req, JSONObject parent, String fieldName) throws FormException { List>> list = filter(type); - Object o = parent.get(fieldName); + JSONObject o = (JSONObject)parent.get(fieldName); if(o==null) return null; - if(o instanceof String && "auto".equals(o)) - return null; - - if (o instanceof JSONArray) { - JSONArray a = (JSONArray) o; - return type.cast(list.get(a.getInt(0)).newInstance(req,a.getJSONObject(1))); - } - - throw new AssertionError(o.getClass()+" : "+o); + return req.bindJSON(type,o); } } diff --git a/core/src/main/resources/lib/hudson/listScmBrowsers.jelly b/core/src/main/resources/lib/hudson/listScmBrowsers.jelly index 3fc986ecc6..2f8b0c0168 100644 --- a/core/src/main/resources/lib/hudson/listScmBrowsers.jelly +++ b/core/src/main/resources/lib/hudson/listScmBrowsers.jelly @@ -9,12 +9,11 @@ - - - - -
-
+ + + + +
-- GitLab