Use predicate form in getItems(Class)
@@ -1796,8 +1796,7 @@ public class Jenkins extends AbstractCIBase implements DirectlyModifiableTopLeve
*/
public <T> List<T> getItems(Class<T> type) {
List<T> r = new ArrayList<>();
- for (TopLevelItem i : getItems())
- if (type.isInstance(i))
+ for (TopLevelItem i : getItems(type::isInstance))
r.add(type.cast(i));
return r;
}
