Fix [cast] compiler warnings

This commit is contained in:
Phillip Webb
2012-12-18 18:06:44 -08:00
committed by Chris Beams
parent b0986049a3
commit 6c14eaad61
63 changed files with 122 additions and 122 deletions

View File

@@ -322,7 +322,7 @@ public abstract class GenericCollectionTypeResolver {
Type resolvedType = type;
if (type instanceof TypeVariable && typeVariableMap != null) {
Type mappedType = typeVariableMap.get((TypeVariable) type);
Type mappedType = typeVariableMap.get(type);
if (mappedType != null) {
resolvedType = mappedType;
}
@@ -383,7 +383,7 @@ public abstract class GenericCollectionTypeResolver {
}
Type paramType = paramTypes[typeIndex];
if (paramType instanceof TypeVariable && typeVariableMap != null) {
Type mappedType = typeVariableMap.get((TypeVariable) paramType);
Type mappedType = typeVariableMap.get(paramType);
if (mappedType != null) {
paramType = mappedType;
}

View File

@@ -106,7 +106,7 @@ public class AnnotationAttributes extends LinkedHashMap<String, Object> {
@SuppressWarnings("unchecked")
public <T> Class<? extends T> getClass(String attributeName) {
return (Class<T>)doGet(attributeName, Class.class);
return doGet(attributeName, Class.class);
}
public Class<?>[] getClassArray(String attributeName) {

View File

@@ -71,8 +71,8 @@ public class CollectionToCollectionConverterTests {
@SuppressWarnings("unchecked")
List<String> result = (List<String>) conversionService.convert(list, sourceType, targetType);
assertFalse(list.equals(result));
assertEquals((Integer) 9, result.get(0));
assertEquals((Integer) 37, result.get(1));
assertEquals(9, result.get(0));
assertEquals(37, result.get(1));
}
public ArrayList<Integer> scalarListTarget;

View File

@@ -298,7 +298,7 @@ public class DefaultConversionTests {
@Test
public void testSpr7766() throws Exception {
ConverterRegistry registry = ((ConverterRegistry) conversionService);
ConverterRegistry registry = (conversionService);
registry.addConverter(new ColorConverter());
List<Color> colors = (List<Color>) conversionService.convert(new String[] { "ffffff", "#000000" }, TypeDescriptor.valueOf(String[].class), new TypeDescriptor(new MethodParameter(getClass().getMethod("handlerMethod", List.class), 0)));
assertEquals(2, colors.size());

View File

@@ -147,7 +147,7 @@ public class AnnotationMetadataTests {
assertThat(specialAttrs.getString("clazz"), is(String.class.getName()));
AnnotationAttributes nestedAnno = specialAttrs.getAnnotation("nestedAnno");
assertArrayEquals(new String[]{String.class.getName()}, (String[])nestedAnno.getStringArray("classArray"));
assertArrayEquals(new String[]{String.class.getName()}, nestedAnno.getStringArray("classArray"));
assertArrayEquals(new String[]{String.class.getName()}, nestedAnno.getStringArray("classArray"));
AnnotationAttributes[] nestedAnnoArray = specialAttrs.getAnnotationArray("nestedAnnoArray");