https://bz.apache.org/bugzilla/show_bug.cgi?id=66178

--- Comment #3 from Konstantin Kolinko <knst.koli...@gmail.com> ---
1. What version of Java have you tested with? (And what version of Tomcat?)

String handling rather differs between versions of JRE.


2. I spotted one bug within the patch (attachment 38343). Maybe there are
others:

> if (pathInJar.equals("")) {

As the pathInJar variable has been changed from a String to a StringBuilder,
the above comparison is now broken.

It could be `if (pathInJar.length() == 0)`


3. I do not follow:

> 
> This happens even if the resource is cached because of the code in
> Cache.getResource()
> 
> If the entry is found in the cache we call it here
>         if (cacheEntry != null &&
> !cacheEntry.validateResource(useClassLoaderResources)) {
>

How does a CachedResource#validateResource(...) call map to path calculations
in AbstractArchiveResourceSet?

- Looking into the code of CachedResource#validateResource(...), the validation
is performed only once in awhile, depending on the TTL of a cache entry. The
TTL of a Cache is configurable. Does changing the value of ttl improve your use
case?

- I have not tested, but it sounds odd to delve into path calculations to
validate an entry in a jar file. It would be better to validate the jar itself,
as a whole, just once.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to