Raw types

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1089971 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2011-04-07 20:06:21 +00:00
parent 306b3880e1
commit b084341cba
1 changed files with 3 additions and 3 deletions

View File

@ -1894,7 +1894,7 @@ public class StringUtilsTest extends TestCase {
// should take a String or String[] parameter and return String or String[]. // should take a String or String[] parameter and return String or String[].
// This test enforces that this is done. // This test enforces that this is done.
public void testStringUtilsCharSequenceContract() { public void testStringUtilsCharSequenceContract() {
Class c = StringUtils.class; Class<StringUtils> c = StringUtils.class;
Method[] methods = c.getMethods(); Method[] methods = c.getMethods();
for (int i=0; i<methods.length; i++) { for (int i=0; i<methods.length; i++) {
Method m = methods[i]; Method m = methods[i];
@ -1902,14 +1902,14 @@ public class StringUtilsTest extends TestCase {
// Assume this is mutable and ensure the first parameter is not CharSequence. // Assume this is mutable and ensure the first parameter is not CharSequence.
// It may be String or it may be something else (String[], Object, Object[]) so // It may be String or it may be something else (String[], Object, Object[]) so
// don't actively test for that. // don't actively test for that.
Class[] params = m.getParameterTypes(); Class<?>[] params = m.getParameterTypes();
if ( params.length > 0 && (params[0] == CharSequence.class || params[0] == CharSequence[].class)) { if ( params.length > 0 && (params[0] == CharSequence.class || params[0] == CharSequence[].class)) {
fail("The method " + m + " appears to be mutable in spirit and therefore must not accept a CharSequence"); fail("The method " + m + " appears to be mutable in spirit and therefore must not accept a CharSequence");
} }
} else { } else {
// Assume this is immutable in spirit and ensure the first parameter is not String. // Assume this is immutable in spirit and ensure the first parameter is not String.
// As above, it may be something other than CharSequence. // As above, it may be something other than CharSequence.
Class[] params = m.getParameterTypes(); Class<?>[] params = m.getParameterTypes();
if ( params.length > 0 && (params[0] == String.class || params[0] == String[].class)) { if ( params.length > 0 && (params[0] == String.class || params[0] == String[].class)) {
fail("The method " + m + " appears to be immutable in spirit and therefore must not accept a String"); fail("The method " + m + " appears to be immutable in spirit and therefore must not accept a String");
} }