Skip to content
Permalink
Browse files
[FIXED JENKINS-22720] Only call getAllItems in recursive ListView
(cherry picked from commit df9adaf)
  • Loading branch information
daniel-beck authored and olivergondza committed Jun 8, 2014
1 parent 7f29954 commit 819c1f1bdad2d83aa8a9033f23e4dd079b10118a
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 819c1f1

Please sign in to comment.