This is an automated email from the ASF dual-hosted git repository. schultz pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push: new f53aa0059a Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=66524 f53aa0059a is described below commit f53aa0059ac70a2f7883bcf69a913362d58612d8 Author: Christopher Schultz <ch...@christopherschultz.net> AuthorDate: Tue Mar 14 17:19:17 2023 -0400 Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=66524 Evict WebResource cache entris in LRU order as intended. --- java/org/apache/catalina/webresources/Cache.java | 2 +- webapps/docs/changelog.xml | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/java/org/apache/catalina/webresources/Cache.java b/java/org/apache/catalina/webresources/Cache.java index 4893a289cb..467a43bf2e 100644 --- a/java/org/apache/catalina/webresources/Cache.java +++ b/java/org/apache/catalina/webresources/Cache.java @@ -208,7 +208,7 @@ public class Cache { // used first. This is a background process so we can afford to take the // time to order the elements first TreeSet<CachedResource> orderedResources = new TreeSet<>( - Comparator.comparingLong(CachedResource::getNextCheck).reversed()); + Comparator.comparingLong(CachedResource::getNextCheck)); orderedResources.addAll(resourceCache.values()); Iterator<CachedResource> iter = orderedResources.iterator(); diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 1ba1a3191a..d0470c6b74 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -128,6 +128,9 @@ <code>Tomcat.addWebapp()</code> methods that incorrectly stated that the <code>docBase</code> parameter could be a relative path. (markt) </fix> + <fix> + <bug>66524</bug> Correct eviction ordering in WebResource cache to + by LRU as intended. (schultz) </changelog> </subsection> <subsection name="Coyote"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org