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

DescribableHelper.uninstantiate should omit default values of @DataBoundSetter fields

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • pipeline

      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.

          [JENKINS-25779] DescribableHelper.uninstantiate should omit default values of @DataBoundSetter fields

          Jesse Glick added a comment -

          Specifying null for a constructor parameter (which would be null by default) is actually bad, as this would suggest node(null) {} when we want node {}.

          Jesse Glick added a comment - Specifying null for a constructor parameter (which would be null by default) is actually bad, as this would suggest node(null) { } when we want node { }.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          core/src/main/java/hudson/tasks/ArtifactArchiver.java
          test/src/test/java/hudson/tasks/ArtifactArchiverTest.java
          http://jenkins-ci.org/commit/jenkins/0d8ebb17c2ea2109eb8d8577029c9358b17f6074
          Log:
          JENKINS-25779 Fix an NPE when ArtifactArchiver.setAllowEmptyArchive is not explicitly called.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: core/src/main/java/hudson/tasks/ArtifactArchiver.java test/src/test/java/hudson/tasks/ArtifactArchiverTest.java http://jenkins-ci.org/commit/jenkins/0d8ebb17c2ea2109eb8d8577029c9358b17f6074 Log: JENKINS-25779 Fix an NPE when ArtifactArchiver.setAllowEmptyArchive is not explicitly called.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3979
          JENKINS-25779 Fix an NPE when ArtifactArchiver.setAllowEmptyArchive is not explicitly called. (Revision 0d8ebb17c2ea2109eb8d8577029c9358b17f6074)

          Result = SUCCESS
          Jesse Glick : 0d8ebb17c2ea2109eb8d8577029c9358b17f6074
          Files :

          • test/src/test/java/hudson/tasks/ArtifactArchiverTest.java
          • core/src/main/java/hudson/tasks/ArtifactArchiver.java

          dogfood added a comment - Integrated in jenkins_main_trunk #3979 JENKINS-25779 Fix an NPE when ArtifactArchiver.setAllowEmptyArchive is not explicitly called. (Revision 0d8ebb17c2ea2109eb8d8577029c9358b17f6074) Result = SUCCESS Jesse Glick : 0d8ebb17c2ea2109eb8d8577029c9358b17f6074 Files : test/src/test/java/hudson/tasks/ArtifactArchiverTest.java core/src/main/java/hudson/tasks/ArtifactArchiver.java

          Code changed in jenkins
          User: Jesse Glick
          Path:
          cps/src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java
          step-api/src/test/java/org/jenkinsci/plugins/workflow/structs/DescribableHelperTest.java
          support/src/test/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepTest.java
          http://jenkins-ci.org/commit/workflow-plugin/240173e89fc5da4adfc23135ba9ae4c28b9a02d1
          Log:
          JENKINS-25779 Established test baseline of current behavior.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: cps/src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java step-api/src/test/java/org/jenkinsci/plugins/workflow/structs/DescribableHelperTest.java support/src/test/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepTest.java http://jenkins-ci.org/commit/workflow-plugin/240173e89fc5da4adfc23135ba9ae4c28b9a02d1 Log: JENKINS-25779 Established test baseline of current behavior.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          cps/src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java
          step-api/src/main/java/org/jenkinsci/plugins/workflow/structs/DescribableHelper.java
          step-api/src/test/java/org/jenkinsci/plugins/workflow/structs/DescribableHelperTest.java
          support/src/test/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepTest.java
          http://jenkins-ci.org/commit/workflow-plugin/cfe1713b5fe9e966399ad7a2d47ba86b4058ae8c
          Log:
          JENKINS-25779 Making DescribableHelper.uninstantiate respect non-null default values.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: cps/src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java step-api/src/main/java/org/jenkinsci/plugins/workflow/structs/DescribableHelper.java step-api/src/test/java/org/jenkinsci/plugins/workflow/structs/DescribableHelperTest.java support/src/test/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepTest.java http://jenkins-ci.org/commit/workflow-plugin/cfe1713b5fe9e966399ad7a2d47ba86b4058ae8c Log: JENKINS-25779 Making DescribableHelper.uninstantiate respect non-null default values.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          CHANGES.md
          cps/src/main/java/org/jenkinsci/plugins/workflow/cps/Snippetizer.java
          cps/src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java
          step-api/src/main/java/org/jenkinsci/plugins/workflow/structs/DescribableHelper.java
          step-api/src/test/java/org/jenkinsci/plugins/workflow/structs/DescribableHelperTest.java
          support/src/test/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepTest.java
          http://jenkins-ci.org/commit/workflow-plugin/1714a18dff390651095edd5491d0433aa38b6f71
          Log:
          Merge pull request #58 from jglick/DescribableHelper-default-JENKINS-25779

          JENKINS-25779 DescribableHelper.uninstantiate and default values

          Compare: https://github.com/jenkinsci/workflow-plugin/compare/40b9acf658a1...1714a18dff39

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: CHANGES.md cps/src/main/java/org/jenkinsci/plugins/workflow/cps/Snippetizer.java cps/src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java step-api/src/main/java/org/jenkinsci/plugins/workflow/structs/DescribableHelper.java step-api/src/test/java/org/jenkinsci/plugins/workflow/structs/DescribableHelperTest.java support/src/test/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepTest.java http://jenkins-ci.org/commit/workflow-plugin/1714a18dff390651095edd5491d0433aa38b6f71 Log: Merge pull request #58 from jglick/DescribableHelper-default- JENKINS-25779 JENKINS-25779 DescribableHelper.uninstantiate and default values Compare: https://github.com/jenkinsci/workflow-plugin/compare/40b9acf658a1...1714a18dff39

          Code changed in jenkins
          User: Jesse Glick
          Path:
          support/src/test/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepTest.java
          http://jenkins-ci.org/commit/pipeline-input-step-plugin/4546ac04a84345424dcd71140793455cdcf7a6d5
          Log:
          JENKINS-25779 Established test baseline of current behavior.
          Originally-Committed-As: 240173e89fc5da4adfc23135ba9ae4c28b9a02d1

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: support/src/test/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepTest.java http://jenkins-ci.org/commit/pipeline-input-step-plugin/4546ac04a84345424dcd71140793455cdcf7a6d5 Log: JENKINS-25779 Established test baseline of current behavior. Originally-Committed-As: 240173e89fc5da4adfc23135ba9ae4c28b9a02d1

          Code changed in jenkins
          User: Jesse Glick
          Path:
          support/src/test/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepTest.java
          http://jenkins-ci.org/commit/pipeline-input-step-plugin/b884971ddde2506e0dc0713221f51dd31d4b1b8c
          Log:
          JENKINS-25779 Making DescribableHelper.uninstantiate respect non-null default values.
          Originally-Committed-As: cfe1713b5fe9e966399ad7a2d47ba86b4058ae8c

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: support/src/test/java/org/jenkinsci/plugins/workflow/support/steps/input/InputStepTest.java http://jenkins-ci.org/commit/pipeline-input-step-plugin/b884971ddde2506e0dc0713221f51dd31d4b1b8c Log: JENKINS-25779 Making DescribableHelper.uninstantiate respect non-null default values. Originally-Committed-As: cfe1713b5fe9e966399ad7a2d47ba86b4058ae8c

          Code changed in jenkins
          User: Jesse Glick
          Path:
          cps/src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java
          http://jenkins-ci.org/commit/workflow-cps-plugin/8134067bd7a24db55fbbf52c2781ab3bd4f4a16a
          Log:
          JENKINS-25779 Established test baseline of current behavior.
          Originally-Committed-As: 240173e89fc5da4adfc23135ba9ae4c28b9a02d1

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: cps/src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/8134067bd7a24db55fbbf52c2781ab3bd4f4a16a Log: JENKINS-25779 Established test baseline of current behavior. Originally-Committed-As: 240173e89fc5da4adfc23135ba9ae4c28b9a02d1

          Code changed in jenkins
          User: Jesse Glick
          Path:
          cps/src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java
          http://jenkins-ci.org/commit/workflow-cps-plugin/24f91927932a7f8c5568b5a4259fb6ae75427beb
          Log:
          JENKINS-25779 Making DescribableHelper.uninstantiate respect non-null default values.
          Originally-Committed-As: cfe1713b5fe9e966399ad7a2d47ba86b4058ae8c

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: cps/src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java http://jenkins-ci.org/commit/workflow-cps-plugin/24f91927932a7f8c5568b5a4259fb6ae75427beb Log: JENKINS-25779 Making DescribableHelper.uninstantiate respect non-null default values. Originally-Committed-As: cfe1713b5fe9e966399ad7a2d47ba86b4058ae8c

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: