-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependency updates #134
Dependency updates #134
Conversation
…-case behaviors in older versions of commons-beanutils.
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
I think I figured out why the databinding bug has not been noticed before: as per JENKINS-27901, Jenkins form controls do not support binding collections of anything other than BTW diff --git a/core/src/test/java/org/kohsuke/stapler/DataBindingTest.java b/core/src/test/java/org/kohsuke/stapler/DataBindingTest.java
index 2d8c8e276..b267687ea 100644
--- a/core/src/test/java/org/kohsuke/stapler/DataBindingTest.java
+++ b/core/src/test/java/org/kohsuke/stapler/DataBindingTest.java
@@ -136,11 +136,12 @@ public class DataBindingTest extends TestCase {
}
public void testScalarToArray() throws Exception {
- ScalarToArray r = bind("{a:'x',b:'y',c:5,d:6}", ScalarToArray.class);
+ ScalarToArray r = bind("{a:'x',b:'y',c:5,d:6,e:7}", ScalarToArray.class);
assertEquals("x",r.a[0]);
assertEquals("y",r.b.get(0));
assertEquals(Integer.valueOf(5), r.c[0]);
assertEquals(Integer.valueOf(6), r.d.get(0));
+ assertEquals(7, r.e[0]);
}
public static class ScalarToArray {
@@ -148,13 +149,15 @@ public class DataBindingTest extends TestCase {
private List<String> b;
private Integer[] c;
private List<Integer> d;
+ private int[] e;
@DataBoundConstructor
- public ScalarToArray(String[] a, List<String> b, Integer[] c, List<Integer> d) {
+ public ScalarToArray(String[] a, List<String> b, Integer[] c, List<Integer> d, int[] e) {
this.a = a;
this.b = b;
this.c = c;
this.d = d;
+ this.e = e;
}
}
fails:
For the reasons mentioned here, I am not going to bother trying to fix that. |
@@ -742,7 +742,7 @@ public Object convertJSON(Object o) { | |||
if (converter==null) | |||
throw new IllegalArgumentException("Unable to convert to "+l.itemType); | |||
|
|||
l.add(converter.convert(type,o)); | |||
l.add(converter.convert(l.itemType, o)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐝 and @reviewbybees done
Subsumes #133 and fixes the bug turned up there.
@reviewbybees esp. @oleg-nenashev