Fix [varargs] compiler warnings

Remove unnecessary 'null' argument from calls to vararg supported
methods and fix cast in ValidationUtils.invokeValidator().
This commit is contained in:
Phillip Webb
2012-12-19 14:40:17 -08:00
committed by Chris Beams
parent 731d5be644
commit 7f0aa5cfb2
6 changed files with 14 additions and 14 deletions

View File

@@ -185,7 +185,7 @@ public class LocalVariableTableParameterNameDiscovererTests extends TestCase {
assertEquals("x", names[1]);
assertEquals("i", names[2]);
m = clazz.getMethod("getDate", null);
m = clazz.getMethod("getDate");
names = discoverer.getParameterNames(m);
assertEquals(0, names.length);
@@ -202,7 +202,7 @@ public class LocalVariableTableParameterNameDiscovererTests extends TestCase {
Class clazz = Component.class;
String methodName = "list";
Method m = clazz.getMethod(methodName, null);
Method m = clazz.getMethod(methodName);
String[] names = discoverer.getParameterNames(m);
assertNull(names);

View File

@@ -111,7 +111,7 @@ public class ToStringCreatorTests extends TestCase {
}
public void testMethod() throws Exception {
String str = new ToStringCreator(this).append("myMethod", this.getClass().getMethod("testMethod", null))
String str = new ToStringCreator(this).append("myMethod", this.getClass().getMethod("testMethod"))
.toString();
assertEquals("[ToStringCreatorTests@" + ObjectUtils.getIdentityHexString(this)
+ " myMethod = testMethod@ToStringCreatorTests]", str);

View File

@@ -171,14 +171,14 @@ public class ClassUtilsTests extends TestCase {
}
public void testHasMethod() throws Exception {
assertTrue(ClassUtils.hasMethod(Collection.class, "size", null));
assertTrue(ClassUtils.hasMethod(Collection.class, "remove", new Class[] {Object.class}));
assertFalse(ClassUtils.hasMethod(Collection.class, "remove", null));
assertFalse(ClassUtils.hasMethod(Collection.class, "someOtherMethod", null));
assertTrue(ClassUtils.hasMethod(Collection.class, "size"));
assertTrue(ClassUtils.hasMethod(Collection.class, "remove", Object.class));
assertFalse(ClassUtils.hasMethod(Collection.class, "remove"));
assertFalse(ClassUtils.hasMethod(Collection.class, "someOtherMethod"));
}
public void testGetMethodIfAvailable() throws Exception {
Method method = ClassUtils.getMethodIfAvailable(Collection.class, "size", null);
Method method = ClassUtils.getMethodIfAvailable(Collection.class, "size");
assertNotNull(method);
assertEquals("size", method.getName());
@@ -186,8 +186,8 @@ public class ClassUtilsTests extends TestCase {
assertNotNull(method);
assertEquals("remove", method.getName());
assertNull(ClassUtils.getMethodIfAvailable(Collection.class, "remove", null));
assertNull(ClassUtils.getMethodIfAvailable(Collection.class, "someOtherMethod", null));
assertNull(ClassUtils.getMethodIfAvailable(Collection.class, "remove"));
assertNull(ClassUtils.getMethodIfAvailable(Collection.class, "someOtherMethod"));
}
public void testGetMethodCountForName() {