You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kf...@apache.org on 2019/04/09 07:26:39 UTC

[tomcat] branch 7.0.x updated: Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63320 Ensure that StatementCache caches statements that include arrays in arguments.

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

kfujino pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/7.0.x by this push:
     new e5c260d  Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63320 Ensure that StatementCache caches statements that include arrays in arguments.
e5c260d is described below

commit e5c260d9a881271f374e5385519b4bc30a0c5bf8
Author: KeiichiFujino <kf...@apache.org>
AuthorDate: Tue Apr 9 16:25:43 2019 +0900

    Fix https://bz.apache.org/bugzilla/show_bug.cgi?id=63320
    Ensure that StatementCache caches statements that include arrays in
    arguments.
---
 .../org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java   | 4 ++--
 webapps/docs/changelog.xml                                        | 8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
index 90a5bb0..7f5d049 100644
--- a/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
+++ b/modules/jdbc-pool/src/main/java/org/apache/tomcat/jdbc/pool/interceptor/StatementCache.java
@@ -335,7 +335,7 @@ public class StatementCache extends StatementDecoratorInterceptor {
         public int hashCode() {
             final int prime = 31;
             int result = 1;
-            result = prime * result + Arrays.hashCode(args);
+            result = prime * result + Arrays.deepHashCode(args);
             result = prime * result
                     + ((stmtType == null) ? 0 : stmtType.hashCode());
             return result;
@@ -350,7 +350,7 @@ public class StatementCache extends StatementDecoratorInterceptor {
             if (getClass() != obj.getClass())
                 return false;
             CacheKey other = (CacheKey) obj;
-            if (!Arrays.equals(args, other.args))
+            if (!Arrays.deepEquals(args, other.args))
                 return false;
             if (stmtType == null) {
                 if (other.stmtType != null)
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 8813a12..71aeca6 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -172,6 +172,14 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="jdbc-pool">
+    <changelog>
+      <fix>
+        <bug>63320</bug>: Ensure that <code>StatementCache</code> caches
+        statements that include arrays in arguments. (kfujino)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Other">
     <changelog>
       <scode>


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