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

Code has to use AbstractOrganization yet all API uses BlueOrganisation

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Minor Minor
    • blueocean-plugin
    • None

      An AbstractOrganization can have an abirtray root - organisations do not have to exist at the root of Jenkins.

      However getGroup() is defined on AbstractOrganization and the API uses BlueOrganization so this leads to messy code with cast and instanceof.

      The structure of the code should be re-evaluated.

      example

          [JENKINS-45604] Code has to use AbstractOrganization yet all API uses BlueOrganisation

          James Nord added a comment - - edited

          Seems like we are supposed to use OrganizationFactory.getItemGroup(String orgname) but we are not pointed to that in AbstractOrganization.getGroup() which should probably be protected scope to force the use of the internal API along with a javadoc comment.

          James Nord added a comment - - edited Seems like we are supposed to use OrganizationFactory.getItemGroup(String orgname) but we are not pointed to that in AbstractOrganization.getGroup() which should probably be protected scope to force the use of the internal API along with a javadoc comment.

          James Dumay added a comment -

          teilo sorry, can you clarify what you want done here? Is it a JavaDoc update?

          James Dumay added a comment - teilo sorry, can you clarify what you want done here? Is it a JavaDoc update?

          James Nord added a comment -

          I would suggest a javadoc comment and make AbstractOrganization.getGroup() protected so you can not actually call it..

          (note making it protected will break API compatability - but there is only one extension that I know of so far - and I think I will be fine updating the usages (if any) there)

          James Nord added a comment - I would suggest a javadoc comment and make  AbstractOrganization.getGroup()  protected so you can not actually call it.. (note making it protected will break API compatability - but there is only one extension that I know of so far - and I think I will be fine updating the usages (if any) there)

            Unassigned Unassigned
            teilo James Nord
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: