-
Improvement
-
Resolution: Fixed
-
Minor
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.