Skip to content

Commit b1f5abc

Browse files
committed
MappedMethodReference.get() now throws IllegalStateException instead of
RuntimeException to wrap cases of NoSuchMethodException
1 parent 8bb5e61 commit b1f5abc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
<release version="1.10.2" date="YYYY-MM-DD" description="This is a maintenance release and requires Java 8.">
3232
<!-- FIX -->
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>
34+
<action type="fix" dev="ggregory" due-to="Gary Gregory">MappedMethodReference.get() now throws IllegalStateException instead of RuntimeException to wrap cases of NoSuchMethodException.</action>
3435
<!-- ADD -->
3536
<!-- UPDATE -->
3637
</release>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private Method get() {
122122
// Un-comment following line for testing
123123
// System.out.println("Recreated Method " + methodName + " for " + className);
124124
} catch (final NoSuchMethodException e) {
125-
throw new RuntimeException("Method " + methodName + " for " + className + " could not be reconstructed - method not found", e);
125+
throw new IllegalStateException("Method " + methodName + " for " + className + " could not be reconstructed - method not found", e);
126126
}
127127
methodRef = new SoftReference<>(m);
128128
}

0 commit comments

Comments
 (0)