Skip to content
Permalink
Browse files
[FIXED JENKINS-22720] Only call getAllItems in recursive ListView
  • Loading branch information
daniel-beck committed Apr 22, 2014
1 parent dcfeaf3 commit df9adaf8f1e23d57c60ec9fb9313287f6d458c7c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
@@ -170,7 +170,13 @@ public List<TopLevelItem> getItems() {
includeItems(parent, parentItems, names);

Boolean statusFilter = this.statusFilter; // capture the value to isolate us from concurrent update
for (TopLevelItem item : Items.getAllItems(getOwnerItemGroup(), TopLevelItem.class)) {
Iterable<? extends TopLevelItem> candidates;
if (recurse) {
candidates = Items.getAllItems(parent, TopLevelItem.class);
} else {
candidates = parent.getItems();
}
for (TopLevelItem item : candidates) {
if (!names.contains(item.getRelativeNameFrom(getOwnerItemGroup()))) continue;
// Add if no status filter or filter matches enabled/disabled status:
if(statusFilter == null || !(item instanceof AbstractProject)
@@ -119,6 +119,7 @@ private void checkLinkFromItemExistsAndIsValid(Item item, ItemGroup ig, Item top
FreeStyleProject p2 = sub.createProject(FreeStyleProject.class, "p2");
FreeStyleProject p3 = top.createProject(FreeStyleProject.class, "p3");
ListView v = new ListView("v");
v.setRecurse(true);
top.addView(v);
v.add(p1);
v.add(p2);

0 comments on commit df9adaf

Please sign in to comment.