Removal of some unused internal methods, plus additional tests for some areas lacking coverage.

This commit is contained in:
Luke Taylor
2011-02-07 00:24:20 +00:00
parent 20e65a93ea
commit eb9482b33b
15 changed files with 259 additions and 82 deletions

View File

@@ -23,29 +23,13 @@ import java.lang.reflect.Field;
/**
* Offers static methods for directly manipulating static fields.
* Offers static methods for directly manipulating fields.
*
* @author Ben Alex
*/
public final class FieldUtils {
//~ Constructors ===================================================================================================
private FieldUtils() {
}
//~ Methods ========================================================================================================
public static String getAccessorName(String fieldName, Class<?> type) {
Assert.hasText(fieldName, "FieldName required");
Assert.notNull(type, "Type required");
if (type.getName().equals("boolean")) {
return "is" + org.springframework.util.StringUtils.capitalize(fieldName);
} else {
return "get" + org.springframework.util.StringUtils.capitalize(fieldName);
}
}
/**
* Attempts to locate the specified field on the class.
*
@@ -98,12 +82,6 @@ public final class FieldUtils {
}
public static String getMutatorName(String fieldName) {
Assert.hasText(fieldName, "FieldName required");
return "set" + org.springframework.util.StringUtils.capitalize(fieldName);
}
public static Object getProtectedFieldValue(String protectedField, Object object) {
Field field = FieldUtils.getField(object.getClass(), protectedField);

View File

@@ -63,7 +63,7 @@ public class InMemoryResource extends AbstractResource {
}
public int hashCode() {
return source.hashCode();
return 1;
}
public boolean equals(Object res) {

View File

@@ -31,10 +31,6 @@ import org.springframework.util.Assert;
* @author Ben Alex
*/
public final class MethodInvocationUtils {
//~ Constructors ===================================================================================================
private MethodInvocationUtils() {
}
//~ Methods ========================================================================================================