Skip to content

Commit 2cdff8f

Browse files
committed
Fix typo in exception message throws from
org.apache.commons.beanutils2.PropertyUtilsBean.setMappedProperty(Object, String, String, Object)
1 parent 286662e commit 2cdff8f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/changes/changes.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
<body>
3030
<release version="2.0.0-M3" date="YYYY-MM-DD" description="This is a major release and requires Java 8.">
3131
<!-- FIX -->
32+
<action type="fix" dev="ggregory" due-to="Gary Gregory">Fix typo in log event message in org.apache.commons.beanutils2.MethodUtils.setMethodAccessible(Method).</action>
33+
<action type="fix" dev="ggregory" due-to="Gary Gregory">Fix typo in exception message throws from org.apache.commons.beanutils2.PropertyUtilsBean.setMappedProperty(Object, String, String, Object).</action>
3234
<!-- ADD -->
3335
<!-- UPDATE -->
3436
<action type="update" dev="ggregory" due-to="Gary Gregory, Dependabot">Bump org.apache.commons:commons-lang3 from 3.17.0 to 3.18.0 #357.</action>

src/main/java/org/apache/commons/beanutils2/PropertyUtilsBean.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ public Object getIndexedProperty(final Object bean, final String name, final int
390390
// Otherwise, the underlying property must be an array
391391
final Method readMethod = getReadMethod(bean.getClass(), descriptor);
392392
if (readMethod == null) {
393-
throw new NoSuchMethodException("Property '" + name + "' has no " + "getter method on bean class '" + bean.getClass() + "'");
393+
throw new NoSuchMethodException("Property '" + name + "' has no getter method on bean class '" + bean.getClass() + "'");
394394
}
395395

396396
// Call the property getter and return the value
@@ -792,7 +792,7 @@ protected Object getPropertyOfMapBean(final Map<?, ?> bean, String propertyName)
792792
}
793793

794794
if (resolver.isIndexed(propertyName) || resolver.isMapped(propertyName)) {
795-
throw new IllegalArgumentException("Indexed or mapped properties are not supported on" + " objects of type Map: " + propertyName);
795+
throw new IllegalArgumentException("Indexed or mapped properties are not supported on objects of type Map: " + propertyName);
796796
}
797797

798798
return bean.get(propertyName);
@@ -1399,7 +1399,7 @@ public void setMappedProperty(final Object bean, final String name, final String
13991399
Method mappedWriteMethod = ((MappedPropertyDescriptor) descriptor).getMappedWriteMethod();
14001400
mappedWriteMethod = MethodUtils.getAccessibleMethod(bean.getClass(), mappedWriteMethod);
14011401
if (mappedWriteMethod == null) {
1402-
throw new NoSuchMethodException("Property '" + name + "' has no mapped setter method" + "on bean class '" + bean.getClass() + "'");
1402+
throw new NoSuchMethodException("Property '" + name + "' has no mapped setter method on bean class '" + bean.getClass() + "'");
14031403
}
14041404
if (LOG.isTraceEnabled()) {
14051405
final String valueClassName = value == null ? "<null>" : value.getClass().getName();
@@ -1537,7 +1537,7 @@ protected void setPropertyOfMapBean(final Map<String, Object> bean, String prope
15371537
}
15381538

15391539
if (resolver.isIndexed(propertyName) || resolver.isMapped(propertyName)) {
1540-
throw new IllegalArgumentException("Indexed or mapped properties are not supported on" + " objects of type Map: " + propertyName);
1540+
throw new IllegalArgumentException("Indexed or mapped properties are not supported on objects of type Map: " + propertyName);
15411541
}
15421542

15431543
bean.put(propertyName, value);

0 commit comments

Comments
 (0)