This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new e4c0f1fe3e Fix logic bug - with thanks to Tom Whitmore.
e4c0f1fe3e is described below

commit e4c0f1fe3e2d145fe6abb23eb2d09c7b01462a8d
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Mar 27 16:30:39 2023 +0100

    Fix logic bug - with thanks to Tom Whitmore.
---
 java/org/apache/catalina/webresources/CachedResource.java | 4 ++--
 webapps/docs/changelog.xml                                | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/java/org/apache/catalina/webresources/CachedResource.java 
b/java/org/apache/catalina/webresources/CachedResource.java
index 8cd119752a..744dad533b 100644
--- a/java/org/apache/catalina/webresources/CachedResource.java
+++ b/java/org/apache/catalina/webresources/CachedResource.java
@@ -467,7 +467,7 @@ public class CachedResource implements WebResource {
         @Override
         protected boolean equals(URL u1, URL u2) {
             // Deliberate use of ==
-            if (resourceURL == u1) {
+            if (associatedURL == u1) {
                 return resourceURL.equals(u2);
             }
             // Not the original resourceURL. Use the default implementation 
from URLStreamHandler.
@@ -484,7 +484,7 @@ public class CachedResource implements WebResource {
         @Override
         protected int hashCode(URL u) {
             // Deliberate use of ==
-            if (resourceURL == u) {
+            if (associatedURL == u) {
                 return resourceURL.hashCode();
             }
             // Not the original resourceURL. Use the default implementation 
from URLStreamHandler.
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8f8f5b1bcd..2117f1cda9 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -172,7 +172,8 @@
         and <code>hashcode()</code> algorithms, if present, will now be used 
for
         URLs for these resources. This addresses a potential performance issue
         with some OSGi custom URL schemes that can trigger potentially slow DNS
-        lookups in some configurations. (markt)
+        lookups in some configurations. Based on a patch provided by Tom
+        Whitmore. (markt)
       </fix>
       <fix>
         When using a custom session manager deployed as part of the web


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to