mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 05:52:26 +00:00
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
This commit is contained in:
1 parent
903da46035
commit
fdb4e7253e
2 files changed
+7
-16
No files matched your search
@@ -66,17 +66,9 @@ public class RepositoryBrowsers {
|
||||
T createInstance(Class<T> type, StaplerRequest req, JSONObject parent, String fieldName) throws FormException {
|
||||
List<Descriptor<RepositoryBrowser<?>>> 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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user