If given a bean from a class that has at least one @DataBoundSetter, uninstantiate should create another bean using the @DataBoundConstructor and the same constructor parameters, then compare the values of the setter fields. If any are equals to the values from the "control" bean, omit them in the map.
This would be useful for example for omitting changelog: true from git in the snippet generator.
- is blocking
-
JENKINS-26094 DescribableHelper
-
- Resolved
-
- links to
Would also allow the special-case handling of null values in both uninstantiate and Snippetizer to be removed: in the normal case that null is actually the default value of a reference-valued field with @DataBoundSetter, the map entry would be omitted anyway; when the field actually had a non-null default, nulling it out (if the bean actually permits this) needs to be explicit in the map to make round-tripping work. When a @DataBoundConstructor parameter is null it is probably also wise to be explicit about this in the map, though the round-trip behavior in that case is unchanged.