diff --git a/core/src/main/java/hudson/scm/RepositoryBrowsers.java b/core/src/main/java/hudson/scm/RepositoryBrowsers.java index f69863f41cb498a602c479758208a764fe4cc9b3..b0ac7349cc938ec5cfbd71c1290fdd9cd1788e94 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 3fc986ecc6dde0f08c35e623ff13a574be8d853b..2f8b0c01687e3cdee6b1b8a1f226f270fed97767 100644 --- a/core/src/main/resources/lib/hudson/listScmBrowsers.jelly +++ b/core/src/main/resources/lib/hudson/listScmBrowsers.jelly @@ -9,12 +9,11 @@ - - - - -
-
+ + + + +