void (@Nullable Pair<PackageSetBase, NamedScopesHolder> filter, boolean showOnlyFilteredItems) { myFilePaths.sort((path1, path2) -> path1.compareToIgnoreCase(path2)); boolean apply = false; for (final String filePath : myFilePaths) { final FileTreeNode child = new FileTreeNode(filePath, myInvalidAttributes, myProject, null); if (filter != null) { if (child.acceptFilter(filter, showOnlyFilteredItems)) { apply = true; } else if (showOnlyFilteredItems) { Disposer.dispose(child); continue; } } final String error = myErrorsMap.get(filePath); if (error != null) { child.setErrorText(error); } add(child); Disposer.register(this, child); } applyFilter(apply); }