Polishing

(cherry picked from commit a31ebb6)
This commit is contained in:
Juergen Hoeller
2014-08-15 00:07:25 +02:00
parent 0c89279d61
commit 0492c9955c
10 changed files with 54 additions and 87 deletions

View File

@@ -495,8 +495,7 @@ public abstract class ReflectionUtils {
mc.doWith(method);
}
catch (IllegalAccessException ex) {
throw new IllegalStateException("Shouldn't be illegal to access method '" + method.getName()
+ "': " + ex);
throw new IllegalStateException("Shouldn't be illegal to access method '" + method.getName() + "': " + ex);
}
}
if (clazz.getSuperclass() != null) {
@@ -605,8 +604,7 @@ public abstract class ReflectionUtils {
fc.doWith(field);
}
catch (IllegalAccessException ex) {
throw new IllegalStateException(
"Shouldn't be illegal to access field '" + field.getName() + "': " + ex);
throw new IllegalStateException("Shouldn't be illegal to access field '" + field.getName() + "': " + ex);
}
}
targetClass = targetClass.getSuperclass();
@@ -628,8 +626,8 @@ public abstract class ReflectionUtils {
throw new IllegalArgumentException("Destination for field copy cannot be null");
}
if (!src.getClass().isAssignableFrom(dest.getClass())) {
throw new IllegalArgumentException("Destination class [" + dest.getClass().getName()
+ "] must be same or subclass as source class [" + src.getClass().getName() + "]");
throw new IllegalArgumentException("Destination class [" + dest.getClass().getName() +
"] must be same or subclass as source class [" + src.getClass().getName() + "]");
}
doWithFields(src.getClass(), new FieldCallback() {
public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {