Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52996

Snippetizer listing arguments alphabetically without regard to mandatory vs. optional


      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.<init> 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.

            Unassigned Unassigned
            jglick Jesse Glick
            0 Vote for this issue
            1 Start watching this issue