mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 04:22:16 +00:00
Merge pull request #1443 from mattmoor/master
Change Jenkins to use a single consistent data-binding field.
This commit is contained in:
commit
4e0af4319c
8 files changed
+62
-23
No files matched your search
@@ -909,7 +909,11 @@ public abstract class Descriptor<T extends Describable<T>> implements Saveable {
|
||||
if (formData!=null) {
|
||||
for (Object o : JSONArray.fromObject(formData)) {
|
||||
JSONObject jo = (JSONObject)o;
|
||||
String kind = jo.getString("kind");
|
||||
String kind = jo.optString("$class", null);
|
||||
if (kind == null) {
|
||||
// Legacy: Remove once plugins have been staged onto $class
|
||||
kind = jo.getString("kind");
|
||||
}
|
||||
Descriptor<T> d = find(descriptors, kind);
|
||||
if (d != null) {
|
||||
items.add(d.newInstance(req, jo));
|
||||
|
||||
@@ -44,7 +44,7 @@ public class GlobalProjectNamingStrategyConfiguration extends GlobalConfiguratio
|
||||
final JSONObject optJSONObject = json.optJSONObject("useProjectNamingStrategy");
|
||||
if (optJSONObject != null) {
|
||||
final JSONObject strategyObject = optJSONObject.getJSONObject("namingStrategy");
|
||||
final String className = strategyObject.getString("stapler-class");
|
||||
final String className = strategyObject.getString("$class");
|
||||
try {
|
||||
Class clazz = Class.forName(className, true, Jenkins.getInstance().getPluginManager().uberClassLoader);
|
||||
final ProjectNamingStrategy strategy = (ProjectNamingStrategy) req.bindJSON(clazz, strategyObject);
|
||||
|
||||
Reference in new issue
Block a user