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

code or javadoc is wrong to hide a descriptor.

    Details

    • Similar Issues:

      Description

       Jenkins code contradicts itself - leaving a developer to go "WUT"?

      hudson.model.Descriptor.getDisplayName()
      /**
      * Human readable name of this kind of configurable object.
      * Should be overridden for most descriptors, if the display name is visible somehow.
      * As a fallback it uses {@link Class#getSimpleName} on {@link #clazz}, so for example {@code MyThing} from {@code some.pkg.MyThing.DescriptorImpl}.
      * Historically some implementations returned null as a way of hiding the descriptor from the UI,
      * but this is generally managed by an explicit method such as {@code isEnabled} or {@code isApplicable}.
      */
      @Nonnull
      public String getDisplayName() {
      return clazz.getSimpleName();
      }
      hudson.model.ReconfigurableDescribable
      
       * <h1>Use Cases</h1>
       * <h2>Invisible Property</h2>
       * <p>
       * This mechanism can be used to create an entirely invisible {@link Describable}, which is handy
       * for {@link NodeProperty}, {@link JobProperty}, etc. To do so, define a descriptor with null
       * {@linkplain Descriptor#getDisplayName() display name} and empty config.jelly to prevent it from
       * showing up in the config UI, then implement {@link #reconfigure(StaplerRequest, JSONObject)}
       * and simply return {@code this}.
      

      So some code says to hide things use null in getDisplayName() - yet getDisplayName() is non-null.

        Attachments

          Activity

          Hide
          oleg_nenashev Oleg Nenashev added a comment -
          Show
          oleg_nenashev Oleg Nenashev added a comment - CC Jesse Glick , who was working on the original change in https://github.com/jenkinsci/jenkins/commit/50cde4b8e7d1c9f8160e2282347218555697b71d
          Hide
          jglick Jesse Glick added a comment -

          The ReconfigurableDescribable documentation is older and now obsolete I think.

          Show
          jglick Jesse Glick added a comment - The ReconfigurableDescribable documentation is older and now obsolete I think.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: ADSL
          Path:
          core/src/main/java/hudson/model/ReconfigurableDescribable.java
          http://jenkins-ci.org/commit/jenkins/a3ef5b6048d66e59e48455b48623e30c14be8df4
          Log:
          JENKINS-42590 : remove text mentioning getDisplayName==null

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: ADSL Path: core/src/main/java/hudson/model/ReconfigurableDescribable.java http://jenkins-ci.org/commit/jenkins/a3ef5b6048d66e59e48455b48623e30c14be8df4 Log: JENKINS-42590 : remove text mentioning getDisplayName==null
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/hudson/model/ReconfigurableDescribable.java
          http://jenkins-ci.org/commit/jenkins/0ae38f553a3f04d581ff83352e65ff3432cd3da2
          Log:
          Merge pull request #2785 from TristanFAURE/JENKINS-42590

          JENKINS-42590 : remove text mentioning getDisplayName==null

          Compare: https://github.com/jenkinsci/jenkins/compare/a3b939849c4b...0ae38f553a3f

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/model/ReconfigurableDescribable.java http://jenkins-ci.org/commit/jenkins/0ae38f553a3f04d581ff83352e65ff3432cd3da2 Log: Merge pull request #2785 from TristanFAURE/ JENKINS-42590 JENKINS-42590 : remove text mentioning getDisplayName==null Compare: https://github.com/jenkinsci/jenkins/compare/a3b939849c4b...0ae38f553a3f

            People

            • Assignee:
              Unassigned
              Reporter:
              teilo James Nord
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: