Fix [cast] compiler warnings
This commit is contained in:
committed by
Chris Beams
parent
b0986049a3
commit
6c14eaad61
@@ -100,7 +100,7 @@ public abstract class AbstractApplicationContextTests extends AbstractListableBe
|
||||
}
|
||||
|
||||
public void testGrandparentTypedDefinitionFound() throws Exception {
|
||||
TestBean dad = (TestBean) applicationContext.getBean("father", TestBean.class);
|
||||
TestBean dad = applicationContext.getBean("father", TestBean.class);
|
||||
assertTrue("Dad has correct name", dad.getName().equals("Albert"));
|
||||
}
|
||||
|
||||
|
||||
@@ -338,7 +338,7 @@ public class ServletAnnotationControllerTests {
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
servlet.service(request, response);
|
||||
assertEquals("Invalid response status", HttpServletResponse.SC_METHOD_NOT_ALLOWED, response.getStatus());
|
||||
String allowHeader = (String) response.getHeader("Allow");
|
||||
String allowHeader = response.getHeader("Allow");
|
||||
assertNotNull("No Allow header", allowHeader);
|
||||
Set<String> allowedMethods = new HashSet<String>();
|
||||
allowedMethods.addAll(Arrays.asList(StringUtils.delimitedListToStringArray(allowHeader, ", ")));
|
||||
|
||||
@@ -292,7 +292,7 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
|
||||
MockHttpServletResponse response = new MockHttpServletResponse();
|
||||
getServlet().service(request, response);
|
||||
assertEquals("Invalid response status", HttpServletResponse.SC_METHOD_NOT_ALLOWED, response.getStatus());
|
||||
String allowHeader = (String) response.getHeader("Allow");
|
||||
String allowHeader = response.getHeader("Allow");
|
||||
assertNotNull("No Allow header", allowHeader);
|
||||
Set<String> allowedMethods = new HashSet<String>();
|
||||
allowedMethods.addAll(Arrays.asList(StringUtils.delimitedListToStringArray(allowHeader, ", ")));
|
||||
|
||||
@@ -267,7 +267,7 @@ public class RadioButtonTagTests extends AbstractFormTagTests {
|
||||
}
|
||||
|
||||
public String getAsText() {
|
||||
return "F" + (Float) getValue();
|
||||
return "F" + getValue();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ public class SelectTagTests extends AbstractFormTagTests {
|
||||
if (value==null) {
|
||||
return null;
|
||||
}
|
||||
return ((Country) value).getName();
|
||||
return value.getName();
|
||||
}
|
||||
});
|
||||
getPageContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "testBean", bindingResult);
|
||||
@@ -295,7 +295,7 @@ public class SelectTagTests extends AbstractFormTagTests {
|
||||
if (value==null) {
|
||||
return "";
|
||||
}
|
||||
return ((Country) value).getName();
|
||||
return value.getName();
|
||||
}
|
||||
});
|
||||
getPageContext().getRequest().setAttribute(BindingResult.MODEL_KEY_PREFIX + "testBean", bindingResult);
|
||||
|
||||
@@ -297,7 +297,7 @@ public class BaseViewTests extends TestCase {
|
||||
private void checkContainsAll(Map expected, Map<String, Object> actual) {
|
||||
Set<String> keys = expected.keySet();
|
||||
for (Iterator<String> iter = keys.iterator(); iter.hasNext();) {
|
||||
String key = (String) iter.next();
|
||||
String key = iter.next();
|
||||
//System.out.println("Checking model key " + key);
|
||||
assertTrue("Value for model key '" + key + "' must match", actual.get(key) == expected.get(key));
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ public class InternalResourceViewTests extends TestCase {
|
||||
|
||||
Set<String> keys = model.keySet();
|
||||
for (Iterator<String> it = keys.iterator(); it.hasNext();) {
|
||||
String key = (String) it.next();
|
||||
String key = it.next();
|
||||
assertEquals(model.get(key), request.getAttribute(key));
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class InternalResourceViewTests extends TestCase {
|
||||
|
||||
Set<String> keys = model.keySet();
|
||||
for (Iterator<String> it = keys.iterator(); it.hasNext();) {
|
||||
String key = (String) it.next();
|
||||
String key = it.next();
|
||||
assertEquals(model.get(key), request.getAttribute(key));
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ public class InternalResourceViewTests extends TestCase {
|
||||
expectLastCall().andReturn(null);
|
||||
Set<String> keys = model.keySet();
|
||||
for (Iterator<String> iter = keys.iterator(); iter.hasNext();) {
|
||||
String key = (String) iter.next();
|
||||
String key = iter.next();
|
||||
request.setAttribute(key, model.get(key));
|
||||
expectLastCall().times(1);
|
||||
}
|
||||
@@ -186,7 +186,7 @@ public class InternalResourceViewTests extends TestCase {
|
||||
expectLastCall().andReturn(null);
|
||||
Set<String> keys = model.keySet();
|
||||
for (Iterator<String> iter = keys.iterator(); iter.hasNext();) {
|
||||
String key = (String) iter.next();
|
||||
String key = iter.next();
|
||||
request.setAttribute(key, model.get(key));
|
||||
expectLastCall().times(1);
|
||||
}
|
||||
@@ -220,7 +220,7 @@ public class InternalResourceViewTests extends TestCase {
|
||||
expectLastCall().andReturn(null);
|
||||
Set<String> keys = model.keySet();
|
||||
for (Iterator<String> iter = keys.iterator(); iter.hasNext();) {
|
||||
String key = (String) iter.next();
|
||||
String key = iter.next();
|
||||
request.setAttribute(key, model.get(key));
|
||||
expectLastCall().times(1);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class FreeMarkerConfigurerTests extends TestCase {
|
||||
FreeMarkerConfigurationFactoryBean fcfb = new FreeMarkerConfigurationFactoryBean();
|
||||
fcfb.setTemplateLoaderPath("file:/mydir");
|
||||
fcfb.afterPropertiesSet();
|
||||
Configuration cfg = (Configuration) fcfb.getObject();
|
||||
Configuration cfg = fcfb.getObject();
|
||||
assertTrue(cfg.getTemplateLoader() instanceof SpringTemplateLoader);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class FreeMarkerConfigurerTests extends TestCase {
|
||||
});
|
||||
fcfb.afterPropertiesSet();
|
||||
assertTrue(fcfb.getObject() instanceof Configuration);
|
||||
Configuration fc = (Configuration) fcfb.getObject();
|
||||
Configuration fc = fcfb.getObject();
|
||||
Template ft = fc.getTemplate("test");
|
||||
assertEquals("test", FreeMarkerTemplateUtils.processTemplateIntoString(ft, new HashMap()));
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class VelocityConfigurerTests extends TestCase {
|
||||
vefb.setVelocityPropertiesMap(map);
|
||||
vefb.afterPropertiesSet();
|
||||
assertTrue(vefb.getObject() instanceof VelocityEngine);
|
||||
VelocityEngine ve = (VelocityEngine) vefb.getObject();
|
||||
VelocityEngine ve = vefb.getObject();
|
||||
assertEquals("/mydir", ve.getProperty("myprop"));
|
||||
assertEquals(value, ve.getProperty("myentry"));
|
||||
}
|
||||
@@ -79,7 +79,7 @@ public class VelocityConfigurerTests extends TestCase {
|
||||
vefb.setResourceLoaderPath("file:/mydir");
|
||||
vefb.afterPropertiesSet();
|
||||
assertTrue(vefb.getObject() instanceof VelocityEngine);
|
||||
VelocityEngine ve = (VelocityEngine) vefb.getObject();
|
||||
VelocityEngine ve = vefb.getObject();
|
||||
assertEquals(new File("/mydir").getAbsolutePath(), ve.getProperty(VelocityEngine.FILE_RESOURCE_LOADER_PATH));
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public class VelocityConfigurerTests extends TestCase {
|
||||
});
|
||||
vefb.afterPropertiesSet();
|
||||
assertTrue(vefb.getObject() instanceof VelocityEngine);
|
||||
VelocityEngine ve = (VelocityEngine) vefb.getObject();
|
||||
VelocityEngine ve = vefb.getObject();
|
||||
assertEquals("test", VelocityEngineUtils.mergeTemplateIntoString(ve, "test", new HashMap()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user