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-dbutils.git


The following commit(s) were added to refs/heads/master by this push:
     new 8c9b5b8  ResultSetIterator.hasNext() now throws IllegalStateException 
instead of RuntimeException to wrap cases of SQLException
8c9b5b8 is described below

commit 8c9b5b826682fb9d75b888396ae2f88571cd3450
Author: Gary D. Gregory <garydgreg...@gmail.com>
AuthorDate: Mon Apr 28 17:07:39 2025 -0400

    ResultSetIterator.hasNext() now throws IllegalStateException instead of
    RuntimeException to wrap cases of SQLException
    
    - ResultSetIterator.next() now throws IllegalStateException instead of
    RuntimeException to wrap cases of SQLException
    - ResultSetIterator.remove() now throws IllegalStateException instead of
    RuntimeException to wrap cases of SQLException
---
 src/changes/changes.xml                                         | 5 ++++-
 src/main/java/org/apache/commons/dbutils/ResultSetIterator.java | 4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index e305209..b39fa0f 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -54,8 +54,11 @@ The <action> type attribute can be add,update,fix,remove.
       <action type="fix" dev="ggregory" due-to="Gary 
Gregory">AbstractQueryRunner.fillStatementWithBean(PreparedStatement, Object, 
String...) now throws IllegalArgumentException instead of 
RuntimeException.</action>
       <action type="fix" dev="ggregory" due-to="strangelookingnerd, Gary 
Gregory">Migrate tests to JUnit5 #324.</action>
       <action type="fix" dev="ggregory" due-to="strangelookingnerd, Gary 
Gregory">Deprecate DbUtils.DbUtils().</action>
+      <action type="fix" dev="ggregory" due-to="Gary 
Gregory">ResultSetIterator.hasNext() now throws IllegalStateException instead 
of RuntimeException to wrap cases of SQLException.</action>
+      <action type="fix" dev="ggregory" due-to="Gary 
Gregory">ResultSetIterator.next() now throws IllegalStateException instead of 
RuntimeException to wrap cases of SQLException.</action>
+      <action type="fix" dev="ggregory" due-to="Gary 
Gregory">ResultSetIterator.remove() now throws IllegalStateException instead of 
RuntimeException to wrap cases of SQLException.</action>
       <!-- ADD -->
-      <action type="fix" dev="ggregory" due-to="strangelookingnerd, Gary 
Gregory">BaseResultSetHandler implements ResultSet.</action>
+      <action type="add" dev="ggregory" due-to="strangelookingnerd, Gary 
Gregory">BaseResultSetHandler implements ResultSet.</action>
       <!-- UPDATE -->
       <action dev="ggregory" type="update" due-to="Gary Gregory">Bump Java 
from 8 to 11.</action>
       <action dev="ggregory" type="update" due-to="Gary Gregory">Bump 
commons-parent from 62 to 81 #256, #277, #295, #301, #305, #308, #314.</action>
diff --git a/src/main/java/org/apache/commons/dbutils/ResultSetIterator.java 
b/src/main/java/org/apache/commons/dbutils/ResultSetIterator.java
index 8bd9f41..f14e72f 100644
--- a/src/main/java/org/apache/commons/dbutils/ResultSetIterator.java
+++ b/src/main/java/org/apache/commons/dbutils/ResultSetIterator.java
@@ -121,13 +121,13 @@ public class ResultSetIterator implements 
Iterator<Object[]> {
     }
 
     /**
-     * Rethrow the SQLException as a RuntimeException.  This implementation
+     * Rethrows the SQLException as a RuntimeException.  This implementation
      * creates a new RuntimeException with the SQLException's error message.
      * @param e SQLException to rethrow
      * @since 1.1
      */
     protected void rethrow(final SQLException e) {
-        throw new RuntimeException(e.getMessage());
+        throw new IllegalStateException(e.getMessage());
     }
 
 }

Reply via email to