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

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-dbcp.git


The following commit(s) were added to refs/heads/master by this push:
     new 54674122 Javadoc
54674122 is described below

commit 546741225ee06468a7c73aba8a179a972fb288ae
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Thu Feb 29 10:00:08 2024 -0500

    Javadoc
---
 .../java/org/apache/commons/dbcp2/DelegatingStatement.java  | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/commons/dbcp2/DelegatingStatement.java 
b/src/main/java/org/apache/commons/dbcp2/DelegatingStatement.java
index ba9ccc08..b9d819ec 100644
--- a/src/main/java/org/apache/commons/dbcp2/DelegatingStatement.java
+++ b/src/main/java/org/apache/commons/dbcp2/DelegatingStatement.java
@@ -450,20 +450,19 @@ public class DelegatingStatement extends AbandonedTrace 
implements Statement {
      * a "genuine" {@link Statement}.
      * </p>
      *
-     * @return The innermost delegate.
-     *
+     * @return The innermost delegate, may return null.
      * @see #getDelegate
      */
     @SuppressWarnings("resource")
     public Statement getInnermostDelegate() {
-        Statement s = statement;
-        while (s instanceof DelegatingStatement) {
-            s = ((DelegatingStatement) s).getDelegate();
-            if (this == s) {
+        Statement stmt = statement;
+        while (stmt instanceof DelegatingStatement) {
+            stmt = ((DelegatingStatement) stmt).getDelegate();
+            if (this == stmt) {
                 return null;
             }
         }
-        return s;
+        return stmt;
     }
 
     /**

Reply via email to