Skip to content

Commit 55404a0

Browse files
committed
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
1 parent 5469692 commit 55404a0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/changes/changes.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
<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>
3434
<action type="fix" dev="ggregory" due-to="Gary Gregory">MappedMethodReference.get() now throws IllegalStateException instead of RuntimeException to wrap cases of NoSuchMethodException.</action>
3535
<action type="fix" dev="ggregory" due-to="Gary Gregory">ResultSetIterator.get(String) now throws IllegalArgumentException instead of RuntimeException to wrap cases of SQLException.</action>
36-
<action type="fix" dev="ggregory" due-to="Gary Gregory">ResultSetIterator.hasNext() now throws IllegalArgumentException instead of RuntimeException to wrap cases of SQLException.</action>
36+
<action type="fix" dev="ggregory" due-to="Gary Gregory">ResultSetIterator.hasNext() now throws IllegalStateException instead of RuntimeException to wrap cases of SQLException.</action>
37+
<action type="fix" dev="ggregory" due-to="Gary Gregory">ResultSetIterator.next() now throws IllegalStateException instead of RuntimeException to wrap cases of SQLException.</action>
3738
<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>
3839
<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>
3940
<!-- ADD -->

src/main/java/org/apache/commons/beanutils/ResultSetIterator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public boolean hasNext() {
176176
advance();
177177
return !eof;
178178
} catch (final SQLException e) {
179-
throw new IllegalArgumentException("hasNext(): SQLException: " + e, e);
179+
throw new IllegalStateException("hasNext(): SQLException: " + e, e);
180180
}
181181
}
182182

@@ -195,7 +195,7 @@ public DynaBean next() {
195195
current = false;
196196
return this;
197197
} catch (final SQLException e) {
198-
throw new IllegalArgumentException("next(): SQLException: " + e, e);
198+
throw new IllegalStateException("next(): SQLException: " + e, e);
199199
}
200200

201201
}

0 commit comments

Comments
 (0)