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

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


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

commit 55404a0cc5509c362a7e98f79c13d0e2e81f7887
Author: Gary D. Gregory <garydgreg...@gmail.com>
AuthorDate: Mon Apr 28 16:22:25 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
---
 src/changes/changes.xml                                           | 3 ++-
 src/main/java/org/apache/commons/beanutils/ResultSetIterator.java | 4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index af012f3c..4284cc0a 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -33,7 +33,8 @@
       <action type="fix" dev="ggregory" due-to="Gary 
Gregory">BeanComparator.compare(T, T) now throws IllegalArgumentException 
instead of RuntimeException to wrap all cases of 
ReflectiveOperationException.</action>
       <action type="fix" dev="ggregory" due-to="Gary 
Gregory">MappedMethodReference.get() now throws IllegalStateException instead 
of RuntimeException to wrap cases of NoSuchMethodException.</action>
       <action type="fix" dev="ggregory" due-to="Gary 
Gregory">ResultSetIterator.get(String) now throws IllegalArgumentException 
instead of RuntimeException to wrap cases of SQLException.</action>
-      <action type="fix" dev="ggregory" due-to="Gary 
Gregory">ResultSetIterator.hasNext() now throws IllegalArgumentException 
instead of RuntimeException to wrap cases of SQLException.</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.set(String, Object) now throws 
IllegalArgumentException instead of RuntimeException to wrap cases of 
SQLException.</action>
       <action type="fix" dev="ggregory" due-to="Gary 
Gregory">ResultSetIterator.set(String, String, Object) now throws 
IllegalArgumentException instead of RuntimeException to wrap cases of 
SQLException.</action>
       <!-- ADD -->
diff --git a/src/main/java/org/apache/commons/beanutils/ResultSetIterator.java 
b/src/main/java/org/apache/commons/beanutils/ResultSetIterator.java
index cb20bad6..8a3e9855 100644
--- a/src/main/java/org/apache/commons/beanutils/ResultSetIterator.java
+++ b/src/main/java/org/apache/commons/beanutils/ResultSetIterator.java
@@ -176,7 +176,7 @@ public class ResultSetIterator implements DynaBean, 
Iterator<DynaBean> {
             advance();
             return !eof;
         } catch (final SQLException e) {
-            throw new IllegalArgumentException("hasNext():  SQLException:  " + 
e, e);
+            throw new IllegalStateException("hasNext():  SQLException:  " + e, 
e);
         }
     }
 
@@ -195,7 +195,7 @@ public class ResultSetIterator implements DynaBean, 
Iterator<DynaBean> {
             current = false;
             return this;
         } catch (final SQLException e) {
-            throw new IllegalArgumentException("next():  SQLException:  " + e, 
e);
+            throw new IllegalStateException("next():  SQLException:  " + e, e);
         }
 
     }

Reply via email to