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
commit b1f5abce013b1dcdf08af94944746ace2a458701 Author: Gary D. Gregory <garydgreg...@gmail.com> AuthorDate: Mon Apr 28 15:35:52 2025 -0400 MappedMethodReference.get() now throws IllegalStateException instead of RuntimeException to wrap cases of NoSuchMethodException --- src/changes/changes.xml | 1 + .../java/org/apache/commons/beanutils/MappedPropertyDescriptor.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 6b01d13d..77a10c3f 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -31,6 +31,7 @@ <release version="1.10.2" date="YYYY-MM-DD" description="This is a maintenance release and requires Java 8."> <!-- FIX --> <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> <!-- ADD --> <!-- UPDATE --> </release> diff --git a/src/main/java/org/apache/commons/beanutils/MappedPropertyDescriptor.java b/src/main/java/org/apache/commons/beanutils/MappedPropertyDescriptor.java index 5cece7d6..23a463fd 100644 --- a/src/main/java/org/apache/commons/beanutils/MappedPropertyDescriptor.java +++ b/src/main/java/org/apache/commons/beanutils/MappedPropertyDescriptor.java @@ -122,7 +122,7 @@ public class MappedPropertyDescriptor extends PropertyDescriptor { // Un-comment following line for testing // System.out.println("Recreated Method " + methodName + " for " + className); } catch (final NoSuchMethodException e) { - throw new RuntimeException("Method " + methodName + " for " + className + " could not be reconstructed - method not found", e); + throw new IllegalStateException("Method " + methodName + " for " + className + " could not be reconstructed - method not found", e); } methodRef = new SoftReference<>(m); }