Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
there is a bug in code below.
not sure how includeFilter supposed to work (should it override default exclusions or not), but as far as exclude filter is concerned, I guess it should be something like:
if (filter.accept(name) || (excludeFilter == null && excludeFilter.accept(name)))
i.e. if either filter accepts the name, it should be excluded...
======================================================
public static UrlSet applyBuiltinExcludes(final UrlSet urlSet, final Filter includeFilter, final Filter excludeFilter) throws MalformedURLException {
final Filter filter = Filters.prefixes(getExclusions());
//filter = Filters.optimize(filter, new PatternFilter("./openejb-."));
final List<URL> urls = urlSet.getUrls();
final Iterator<URL> iterator = urls.iterator();
while (iterator.hasNext()) {
final URL url = iterator.next();
final File file = URLs.toFile(url);
final String name = filter(file).getName();
if (filter.accept(name)
&& (includeFilter == null || !includeFilter.accept(name))
&& (excludeFilter == null || excludeFilter.accept(name)))
}
return new UrlSet(urls);
}