Fix unnecessary @SupressWarnings annotations
This commit is contained in:
parent
2b0d860923
commit
d89e30b864
|
@ -404,7 +404,6 @@ public abstract class AbstractAspectJAdvisorFactoryTests {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void testIntroductionOnTargetExcludedByTypePattern() {
|
||||
LinkedList target = new LinkedList();
|
||||
|
|
|
@ -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));
|
||||
|
|
|
@ -974,7 +974,6 @@ public class ExtendedBeanInfoTests {
|
|||
}
|
||||
|
||||
static class WithStaticWriteMethod {
|
||||
@SuppressWarnings("unused")
|
||||
public static void setProp1(String prop1) {
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -65,7 +65,6 @@ public class FooServiceImpl implements FooService {
|
|||
|
||||
private boolean initCalled = false;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@PostConstruct
|
||||
private void init() {
|
||||
if (this.initCalled) {
|
||||
|
|
|
@ -133,7 +133,6 @@ public class AnnotationConfigApplicationContextTests {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void getBeanByTypeAmbiguityRaisesException() {
|
||||
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(TwoTestBeanConfig.class);
|
||||
|
|
|
@ -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"; }
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -130,7 +130,6 @@ public class FormattingConversionServiceFactoryBeanTests {
|
|||
|
||||
private static class TestBean {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@NumberFormat(style = Style.PERCENT)
|
||||
private double percent;
|
||||
|
||||
|
|
|
@ -393,7 +393,6 @@ public class FormattingConversionServiceTests {
|
|||
|
||||
private static class ModelWithSubclassField {
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
@org.springframework.format.annotation.DateTimeFormat(style = "S-")
|
||||
public MyDate date;
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
||||
|
|
|
@ -74,7 +74,6 @@ public class EnableAsyncTests {
|
|||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test
|
||||
public void withAsyncBeanWithExecutorQualifiedByName() throws ExecutionException, InterruptedException {
|
||||
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue