diff --git a/core/src/main/java/hudson/model/ListView.java b/core/src/main/java/hudson/model/ListView.java index dbe9cc3f56..9d0d6af1a5 100644 --- a/core/src/main/java/hudson/model/ListView.java +++ b/core/src/main/java/hudson/model/ListView.java @@ -73,13 +73,12 @@ public class ListView extends View { if (includePattern == null) { includePattern = Pattern.compile(includeRegex); } - - Collection allJobNames = owner.getJobNames(); - for (Iterator iterator = allJobNames.iterator(); iterator.hasNext();) { - String string = iterator.next(); - if (includePattern.matcher(string).matches()) { - names.add(string); - } + + for (TopLevelItem item : owner.getItems()) { + String itemName = item.getName(); + if (includePattern.matcher(itemName).matches()) { + names.add(itemName); + } } } catch (PatternSyntaxException pse) { }