Given a databound type with a List<SomeClass> property, and SomeClass$StaplerConverterImpl existing, this code appears to invoke the converter, passing the List<SomeClass> object, asking to get a SomeClass, when exporting a configuration:
|
final Attribute a = createAttribute(names[i], TypePair.of(p)); |
|
if (a != null) { |
|
Object value = a.getValue(instance); |
|
if (value != null) { |
|
Object converted = Stapler.CONVERT_UTILS.convert(value, a.getType()); |
The correct behavior is implementation-dependent, but likely involves returning a List<?>.
This seems unexpected. My expectation was that the converter is invoked once for each SomeClass list entry.
See https://github.com/jenkinsci/matrix-auth-plugin/pull/145/files#diff-a714ec3c04d484b6a8bb5fa7b0bf64cf3ebb61dfc095fb4b826cdac479c257bfR62-R69 for an example of this in matrix-auth.
Given a databound type with a
List<SomeClass>property, andSomeClass$StaplerConverterImplexisting, this code appears to invoke the converter, passing theList<SomeClass>object, asking to get aSomeClass, when exporting a configuration:configuration-as-code-plugin/plugin/src/main/java/io/jenkins/plugins/casc/impl/configurators/DataBoundConfigurator.java
Lines 300 to 304 in 8264363
The correct behavior is implementation-dependent, but likely involves returning a
List<?>.This seems unexpected. My expectation was that the converter is invoked once for each
SomeClasslist entry.See https://github.com/jenkinsci/matrix-auth-plugin/pull/145/files#diff-a714ec3c04d484b6a8bb5fa7b0bf64cf3ebb61dfc095fb4b826cdac479c257bfR62-R69 for an example of this in
matrix-auth.