private List<TopLevelItem> getItems(boolean recurse) {
        SortedSet<String> names;
        List<TopLevelItem> items = new ArrayList<>();

        synchronized (this) {
            names = new TreeSet<>(jobNames);
        }

        ItemGroup<? extends TopLevelItem> parent = getOwner().getItemGroup();
        List<TopLevelItem> parentItems = new ArrayList<>(parent.getItems());
        includeItems(parent, parentItems, names);

        Boolean statusFilter = this.statusFilter; // capture the value to isolate us from concurrent update
        Iterable<? extends TopLevelItem> candidates;
        if (recurse) {
            candidates = parent.getAllItems(TopLevelItem.class);
        } else {
            candidates = parent.getItems();
        }
        for (TopLevelItem item : candidates) {
            if (!names.contains(item.getRelativeNameFrom(getOwner().getItemGroup()))) continue;
            // Add if no status filter or filter matches enabled/disabled status:
            if(statusFilter == null || !(item instanceof ParameterizedJobMixIn.ParameterizedJob) // TODO or better to call the more generic Job.isBuildable?
                              || ((ParameterizedJobMixIn.ParameterizedJob)item).isDisabled() ^ statusFilter)
                items.add(item);
        }

        // check the filters
        Iterable<ViewJobFilter> jobFilters = getJobFilters();
        List<TopLevelItem> allItems = new ArrayList<>(parentItems);
        if (recurse) allItems = expand(allItems, new ArrayList<>());
    	for (ViewJobFilter jobFilter: jobFilters) {
    		items = jobFilter.filter(items, allItems, this);
    	}
        // for sanity, trim off duplicates
        items = new ArrayList<>(new LinkedHashSet<>(items));
        
        return items;
    }
private List < TopLevelItem > getItems ( boolean recurse ) { SortedSet < String > names ; List < TopLevelItem > items = new ArrayList < > ( ) ; synchronized ( this ) { names = new TreeSet < > ( jobNames ) ; } ItemGroup < ? extends TopLevelItem > parent = getOwner ( ) . getItemGroup ( ) ; List < TopLevelItem > parentItems = new ArrayList < > ( parent . getItems ( ) ) ; includeItems ( parent , parentItems , names ) ; Boolean statusFilter = this . statusFilter ; Iterable < ? extends TopLevelItem > candidates ; if ( recurse ) { candidates = parent . getAllItems ( TopLevelItem . class ) ; } else { candidates = parent . getItems ( ) ; } for ( TopLevelItem item : candidates ) { if ( ! names . contains ( item . getRelativeNameFrom ( getOwner ( ) . getItemGroup ( ) ) ) ) continue ; if ( statusFilter == null || ! ( item instanceof ParameterizedJobMixIn . ParameterizedJob ) || ( ( ParameterizedJobMixIn . ParameterizedJob ) item ) . isDisabled ( ) ^ statusFilter ) items . add ( item ) ; } Iterable < ViewJobFilter > jobFilters = getJobFilters ( ) ; List < TopLevelItem > allItems = new ArrayList < > ( parentItems ) ; if ( recurse ) allItems = expand ( allItems , new ArrayList < > ( ) ) ; for ( ViewJobFilter jobFilter : jobFilters ) { items = jobFilter . filter ( items , allItems , this ) ; } items = new ArrayList < > ( new LinkedHashSet < > ( items ) ) ; return items ; }
Returns a read-only view of all {@link Job}s in this view.


<p>
This method returns a separate copy each time to avoid
concurrent modification issue.
@param recurse {@code false} not to recurse in ItemGroups
true to recurse in ItemGroups