Skip to content

Commit

Permalink
Merge pull request #7 from mattmoor/master
Browse files Browse the repository at this point in the history
[JENKINS-25403] Add support for upcoming $class annotation change
  • Loading branch information
ikedam committed May 6, 2015
2 parents a2eee2f + 8ae0472 commit 440d75a
Showing 1 changed file with 5 additions and 4 deletions.
Expand Up @@ -179,12 +179,13 @@ private <T extends Describable<?>> T bindJSONWithDescriptor(
if (formData == null || formData.isNullObject()) {
return null;
}
if (!formData.has("stapler-class")) {
throw new FormException("No stapler-class is specified", fieldName);
String staplerClazzName = formData.optString("$class", null);
if (staplerClazzName == null) {
// Fall back on the legacy stapler-class attribute.
staplerClazzName = formData.optString("stapler-class", null);
}
String staplerClazzName = formData.getString("stapler-class");
if (staplerClazzName == null) {
throw new FormException("No stapler-class is specified", fieldName);
throw new FormException("No $class is specified", fieldName);
}
try {
@SuppressWarnings("unchecked")
Expand Down

0 comments on commit 440d75a

Please sign in to comment.