Title: Message Title
Jesse Glick created an issue
Jenkins / JENKINS-52996
Snippetizer listing arguments alphabetically without regard to mandatory vs. optional
Issue Type:
Bug
Assignee:
Kohsuke Kawaguchi
Components:
structs-plugin, workflow-cps-plugin
Created:
2018-08-11 13:56
Priority:
Minor
Reporter:
Jesse Glick
Martin Weber noted that Snippetizer always lists step parameters alphabetically. From what I can make out, Snippetizer.mapWithoutBracket2groovy merely follows the order from UninstantiatedDescribable.getArguments. Now DescribableModel. ensures that mandatory parameters are listed first by DescribableModel.getParameters, in the order they appear in @DataBoundConstructor; optional parameters are then listed alphabetically (since @DataBoundSetter includes no attribute to specify an order). But UninstantiatedDescribable.getArguments is derived from DescribableModel.uninstantiate2, which just uses a TreeMap where it should perhaps have been using a LinkedHashMap. Needs to be confirmed with both a unit test and an integration test with Snippetizer. Also need to check the behavior of nested Describable arguments with and without symbols; ideally these would also list mandatory followed by optional parameters.
Add Comm