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

Items should have a Iterable<T> getAllItemsUnsorted(Class)

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      Lots of things need to walk all the items in Jenkins but do not care the order in which they walk them... or may not even care to complete the walk once the existence of at least one matching item has been confirmed.

      Items.getAllItems(Class) currently builds the full list of items and then sorts the list by item name... repeatedly sorting as the tree is traversed.

      A Iterable<T> getAllItemsUnsorted(Class<T> clazz) implementation (or two variants: depth first vs breadth first) could avoid allocation of the interim ArrayList instances and also avoid all the sorting while using a semi-lazy iterator.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Stephen Connolly
          Path:
          core/src/main/java/hudson/model/Items.java
          test/src/test/java/hudson/model/ItemsTest.java
          http://jenkins-ci.org/commit/jenkins/cf0fea0c1f1dfca2530a0787384ddaf762b1e713
          Log:
          [FIXED JENKINS-40252] Add an Iterable<T> that returns all items unsorted

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Stephen Connolly Path: core/src/main/java/hudson/model/Items.java test/src/test/java/hudson/model/ItemsTest.java http://jenkins-ci.org/commit/jenkins/cf0fea0c1f1dfca2530a0787384ddaf762b1e713 Log: [FIXED JENKINS-40252] Add an Iterable<T> that returns all items unsorted
          Hide
          oleg_nenashev Oleg Nenashev added a comment -

          Released in jenkins-2.37

          Show
          oleg_nenashev Oleg Nenashev added a comment - Released in jenkins-2.37

            People

            Assignee:
            stephenconnolly Stephen Connolly
            Reporter:
            stephenconnolly Stephen Connolly
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: