Fix unnecessary @SupressWarnings annotations

This commit is contained in:
Phillip Webb 2013-01-29 15:37:25 -08:00
parent 2b0d860923
commit d89e30b864
20 changed files with 3 additions and 25 deletions

View File

@ -404,7 +404,6 @@ public abstract class AbstractAspectJAdvisorFactoryTests {
}
}
@SuppressWarnings("unchecked")
@Test
public void testIntroductionOnTargetExcludedByTypePattern() {
LinkedList target = new LinkedList();

View File

@ -157,7 +157,6 @@ public class BeanWrapperGenericsTests {
GenericBean<?> gb = new GenericBean<Object>();
BeanWrapper bw = new BeanWrapperImpl(gb);
bw.registerCustomEditor(Number.class, new CustomNumberEditor(Integer.class, false));
@SuppressWarnings("unchecked")
Map<String, Collection> input = new HashMap<String, Collection>();
HashSet<Integer> value1 = new HashSet<Integer>();
value1.add(new Integer(1));

View File

@ -974,7 +974,6 @@ public class ExtendedBeanInfoTests {
}
static class WithStaticWriteMethod {
@SuppressWarnings("unused")
public static void setProp1(String prop1) {
}
}

View File

@ -2200,7 +2200,6 @@ public class DefaultListableBeanFactoryTests {
doTestFieldSettingWithInstantiationAwarePostProcessor(true);
}
@SuppressWarnings("unchecked")
private void doTestFieldSettingWithInstantiationAwarePostProcessor(final boolean skipPropertyPopulation) {
DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);

View File

@ -87,7 +87,6 @@ public class SimpleApplicationEventMulticaster extends AbstractApplicationEventM
Executor executor = getTaskExecutor();
if (executor != null) {
executor.execute(new Runnable() {
@SuppressWarnings("unchecked")
public void run() {
listener.onApplicationEvent(event);
}

View File

@ -65,7 +65,6 @@ public class FooServiceImpl implements FooService {
private boolean initCalled = false;
@SuppressWarnings("unused")
@PostConstruct
private void init() {
if (this.initCalled) {

View File

@ -133,7 +133,6 @@ public class AnnotationConfigApplicationContextTests {
}
}
@SuppressWarnings("unchecked")
@Test
public void getBeanByTypeAmbiguityRaisesException() {
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TwoTestBeanConfig.class);

View File

@ -47,7 +47,7 @@ public class BeanMethodPolymorphismTests {
@Test
public void beanMethodOverloadingWithoutInheritance() {
@SuppressWarnings({ "unused", "hiding" })
@SuppressWarnings({ "hiding" })
@Configuration class Config {
@Bean String aString() { return "na"; }
@Bean String aString(Integer dependency) { return "na"; }

View File

@ -41,7 +41,6 @@ import org.springframework.context.annotation.DependsOn;
*
* @author Chris Beams
*/
@SuppressWarnings("unused") // for unused @Bean methods in local classes
public class BeanAnnotationAttributePropagationTests {
@Test

View File

@ -130,7 +130,6 @@ public class FormattingConversionServiceFactoryBeanTests {
private static class TestBean {
@SuppressWarnings("unused")
@NumberFormat(style = Style.PERCENT)
private double percent;

View File

@ -393,7 +393,6 @@ public class FormattingConversionServiceTests {
private static class ModelWithSubclassField {
@SuppressWarnings("unused")
@org.springframework.format.annotation.DateTimeFormat(style = "S-")
public MyDate date;
}

View File

@ -20,7 +20,6 @@ import org.junit.Ignore;
// converting away from old-style EasyMock APIs was problematic with this class
// glassfish dependencies no longer on classpath
@SuppressWarnings("deprecation")
@Ignore
public class GlassFishLoadTimeWeaverTests {

View File

@ -74,7 +74,6 @@ public class EnableAsyncTests {
}
@SuppressWarnings("unchecked")
@Test
public void withAsyncBeanWithExecutorQualifiedByName() throws ExecutionException, InterruptedException {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();

View File

@ -358,7 +358,6 @@ public class GenericConversionServiceTests {
GenericConversionService service = new DefaultConversionService();
List<String> list1 = Arrays.asList("Foo", "Bar");
List<String> list2 = Arrays.asList("Baz", "Boop");
@SuppressWarnings("unchecked")
List<List<String>> list = Arrays.asList(list1, list2);
String result = service.convert(list, String.class);
assertNotNull(result);

View File

@ -205,7 +205,6 @@ public class EmbeddedDatabaseFactory {
}
// getParentLogger() is required for JDBC 4.1 compatibility
@SuppressWarnings("unused")
public Logger getParentLogger() {
return Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
}

View File

@ -481,7 +481,6 @@ public class JdoTemplate extends JdoAccessor implements JdoOperations {
public Collection find(final String queryString) throws DataAccessException {
return execute(new JdoCallback<Collection>() {
@SuppressWarnings("unchecked")
public Collection doInJdo(PersistenceManager pm) throws JDOException {
Query query = pm.newQuery(queryString);
prepareQuery(query);

View File

@ -57,7 +57,6 @@ public class FlashAttributeResultMatchers {
*/
public <T> ResultMatcher attribute(final String name, final Object value) {
return new ResultMatcher() {
@SuppressWarnings("unchecked")
public void match(MvcResult result) throws Exception {
assertEquals("Flash attribute", value, result.getFlashMap().get(name));
}

View File

@ -72,7 +72,6 @@ public class FormHttpMessageConverterTests {
}
@Test
@SuppressWarnings("unchecked")
public void readForm() throws Exception {
String body = "name+1=value+1&name+2=value+2%2B1&name+2=value+2%2B2&name+3";
Charset iso88591 = Charset.forName("ISO-8859-1");

View File

@ -140,29 +140,25 @@ public class InitBinderDataBinderFactoryTests {
private static class InitBinderHandler {
@SuppressWarnings("unused")
@InitBinder
public void initBinder(WebDataBinder dataBinder) {
dataBinder.setDisallowedFields("id");
}
@SuppressWarnings("unused")
@InitBinder(value="foo")
public void initBinderWithAttributeName(WebDataBinder dataBinder) {
dataBinder.setDisallowedFields("id");
}
@SuppressWarnings("unused")
@InitBinder
public String initBinderReturnValue(WebDataBinder dataBinder) {
return "invalid";
}
@SuppressWarnings("unused")
@InitBinder
public void initBinderTypeConversion(WebDataBinder dataBinder, @RequestParam int requestParam) {
dataBinder.setDisallowedFields("requestParam-" + requestParam);
}
}
}
}

View File

@ -299,7 +299,6 @@ public class ModelAttributeMethodProcessorTests {
}
}
@SuppressWarnings("unused")
@ModelAttribute("modelAttrName")
private String annotatedReturnValue() {
return null;
@ -310,4 +309,4 @@ public class ModelAttributeMethodProcessorTests {
return null;
}
}
}