From f68aa5b7a46bb2a736c7bc8bd4a85e427a92d9fc Mon Sep 17 00:00:00 2001 From: redsolo Date: Wed, 2 Apr 2008 10:42:37 +0000 Subject: [PATCH] Fixed the view's regex handling of top level items (issue #1487) git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@8199 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/model/ListView.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) 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) { }