Skip to content

Commit 227583d

Browse files
committed
Fix typo in exception message throws from
org.apache.commons.beanutils.PropertyUtilsBean.setMappedProperty(Object, String, String, Object)
1 parent c3a2cbd commit 227583d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<body>
3131
<release version="1.11.1" date="YYYY-MM-DD" description="This is a maintenance release and requires Java 8.">
3232
<!-- FIX -->
33+
<action dev="ggregory" type="update" due-to="Gary Gregory">Fix typo in exception message throws from org.apache.commons.beanutils.PropertyUtilsBean.setMappedProperty(Object, String, String, Object).</action>
3334
<!-- ADD -->
3435
<!-- UPDATE -->
3536
<action dev="ggregory" type="update" due-to="Gary Gregory">Bump org.apache.commons:commons-parent from 84 to 85.</action>

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,7 +1280,7 @@ public Method getWriteMethod(final PropertyDescriptor descriptor) {
12801280
/** This just catches and wraps IllegalArgumentException. */
12811281
private Object invokeMethod(final Method method, final Object bean, final Object[] values) throws IllegalAccessException, InvocationTargetException {
12821282
if (bean == null) {
1283-
throw new IllegalArgumentException("No bean specified " + "- this should have been checked before reaching this method");
1283+
throw new IllegalArgumentException("No bean specified - this should have been checked before reaching this method");
12841284
}
12851285
try {
12861286
return method.invoke(bean, values);
@@ -1707,7 +1707,7 @@ public void setMappedProperty(final Object bean, final String name, final String
17071707
Method mappedWriteMethod = ((MappedPropertyDescriptor) descriptor).getMappedWriteMethod();
17081708
mappedWriteMethod = MethodUtils.getAccessibleMethod(bean.getClass(), mappedWriteMethod);
17091709
if (mappedWriteMethod == null) {
1710-
throw new NoSuchMethodException("Property '" + name + "' has no mapped setter method" + "on bean class '" + bean.getClass() + "'");
1710+
throw new NoSuchMethodException("Property '" + name + "' has no mapped setter method on bean class '" + bean.getClass() + "'");
17111711
}
17121712
final Object[] params = new Object[2];
17131713
params[0] = key;
@@ -1860,7 +1860,7 @@ protected void setPropertyOfMapBean(final Map<String, Object> bean, String prope
18601860
}
18611861

18621862
if (resolver.isIndexed(propertyName) || resolver.isMapped(propertyName)) {
1863-
throw new IllegalArgumentException("Indexed or mapped properties are not supported on" + " objects of type Map: " + propertyName);
1863+
throw new IllegalArgumentException("Indexed or mapped properties are not supported on objects of type Map: " + propertyName);
18641864
}
18651865

18661866
bean.put(propertyName, value);

src/test/java/org/apache/commons/beanutils/memoryleaktests/MemoryLeakTestCase.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ private String getMemoryStats() {
145145
final long free = runtime.freeMemory() / 1024;
146146
final long total = runtime.totalMemory() / 1024;
147147
final long used = total - free;
148-
return "MEMORY - Total: " + fmt.format(total) + "k " + "Used: "
149-
+ fmt.format(used) + "k " + "Free: "
148+
return "MEMORY - Total: " + fmt.format(total) + "k Used: "
149+
+ fmt.format(used) + "k Free: "
150150
+ fmt.format(free) + "k";
151151
}
152152

0 commit comments

Comments
 (0)