[
https://issues.apache.org/jira/browse/TOMEE-459?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Romain Manni-Bucau closed TOMEE-459.
------------------------------------
Resolution: Fixed
Fix Version/s: 1.5.1
> exclusions.list not working properly
> ------------------------------------
>
> Key: TOMEE-459
> URL: https://issues.apache.org/jira/browse/TOMEE-459
> Project: TomEE
> Issue Type: Bug
> Reporter: Andrei Militeev
> Priority: Minor
> Fix For: 1.5.1
>
>
> 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)))
> {
> iterator.remove();
> }
> }
> return new UrlSet(urls);
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira