Browse Source

Fix unused type compiler warnings

pull/229/head
Phillip Webb 13 years ago
parent
commit
6a1e841952
  1. 4
      spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutTests.java
  2. 2
      spring-aop/src/test/java/org/springframework/aop/aspectj/TigerAspectJExpressionPointcutTests.java
  3. 2
      spring-aop/src/test/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptorTests.java
  4. 13
      spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/AbstractBeanConfigurerTests.java
  5. 4
      spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java
  6. 2
      spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java
  7. 10
      spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java
  8. 3
      spring-beans/src/test/java/org/springframework/beans/ConcurrentBeanWrapperTests.java
  9. 4
      spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
  10. 4
      spring-beans/src/test/java/org/springframework/beans/factory/parsing/CustomProblemReporterTests.java
  11. 4
      spring-beans/src/test/java/org/springframework/beans/factory/support/QualifierAnnotationAutowireBeanFactoryTests.java
  12. 6
      spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java
  13. 2
      spring-beans/src/test/java/org/springframework/beans/factory/xml/FactoryMethods.java
  14. 4
      spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomCollectionEditorTests.java
  15. 3
      spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java
  16. 3
      spring-beans/src/test/java/org/springframework/beans/support/PropertyComparatorTests.java
  17. 3
      spring-context/src/test/java/org/springframework/aop/framework/CglibProxyTests.java
  18. 3
      spring-context/src/test/java/org/springframework/beans/factory/support/InjectAnnotationAutowireContextTests.java
  19. 5
      spring-context/src/test/java/org/springframework/beans/factory/xml/QualifierAnnotationTests.java
  20. 3
      spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTestTypes.java
  21. 1
      spring-context/src/test/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessorTests.java
  22. 5
      spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserBeanDefinitionDefaultsTests.java
  23. 6
      spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassProcessingTests.java
  24. 4
      spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java
  25. 3
      spring-context/src/test/java/org/springframework/validation/DataBinderTests.java
  26. 3
      spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java
  27. 3
      spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java
  28. 6
      spring-core/src/test/java/org/springframework/core/type/AnnotationTypeFilterTests.java
  29. 4
      spring-core/src/test/java/org/springframework/core/type/AssignableTypeFilterTests.java
  30. 8
      spring-core/src/test/java/org/springframework/util/ClassUtilsTests.java
  31. 3
      spring-core/src/test/java/org/springframework/util/MethodInvokerTests.java
  32. 12
      spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericTableMetaDataProvider.java
  33. 6
      spring-jdbc/src/main/java/org/springframework/jdbc/datasource/DataSourceTransactionManager.java
  34. 2
      spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/BeanPropertySqlParameterSourceTests.java
  35. 6
      spring-jms/src/test/java/org/springframework/jms/listener/endpoint/DefaultJmsActivationSpecFactoryTests.java
  36. 1
      spring-orm/src/test/java/org/springframework/orm/jdo/JdoInterceptorTests.java
  37. 1
      spring-orm/src/test/java/org/springframework/orm/jpa/JpaInterceptorTests.java
  38. 4
      spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java
  39. 4
      spring-test/src/main/java/org/springframework/test/jpa/AbstractJpaTests.java
  40. 10
      spring-web/src/test/java/org/springframework/web/multipart/commons/CommonsMultipartResolverTests.java

4
spring-aop/src/test/java/org/springframework/aop/aspectj/AspectJExpressionPointcutTests.java

@ -309,10 +309,6 @@ public final class AspectJExpressionPointcutTests { @@ -309,10 +309,6 @@ public final class AspectJExpressionPointcutTests {
assertTrue("Expression should match TestBean class", classFilter.matches(TestBean.class));
}
private void assertDoesNotMatchStringClass(ClassFilter classFilter) {
assertFalse("Expression should not match String class", classFilter.matches(String.class));
}
@Test
public void testWithUnsupportedPointcutPrimitive() throws Exception {
String expression = "call(int org.springframework.tests.sample.beans.TestBean.getAge())";

2
spring-aop/src/test/java/org/springframework/aop/aspectj/TigerAspectJExpressionPointcutTests.java

@ -89,6 +89,8 @@ public final class TigerAspectJExpressionPointcutTests { @@ -89,6 +89,8 @@ public final class TigerAspectJExpressionPointcutTests {
@Test
public void testMatchVarargs() throws SecurityException, NoSuchMethodException {
@SuppressWarnings("unused")
class MyTemplate {
public int queryForInt(String sql, Object... params) {
return 0;

2
spring-aop/src/test/java/org/springframework/aop/framework/adapter/ThrowsAdviceInterceptorTests.java

@ -144,7 +144,7 @@ public final class ThrowsAdviceInterceptorTests { @@ -144,7 +144,7 @@ public final class ThrowsAdviceInterceptorTests {
}
@SuppressWarnings("serial")
private static class MyThrowsHandler extends MethodCounter implements ThrowsAdvice {
static class MyThrowsHandler extends MethodCounter implements ThrowsAdvice {
// Full method signature
public void afterThrowing(Method m, Object[] args, Object target, IOException ex) {
count("ioException");

13
spring-aspects/src/test/java/org/springframework/beans/factory/aspectj/AbstractBeanConfigurerTests.java

@ -304,7 +304,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase { @@ -304,7 +304,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase {
// }
// }
@SuppressWarnings("unused")
private static class ShouldNotBeConfiguredBySpring {
private String name;
@ -335,6 +335,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase { @@ -335,6 +335,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase {
@Configurable
@SuppressWarnings("unused")
private static class ShouldBeConfiguredBySpringUsingTypeNameAsBeanName {
private String name;
@ -350,6 +351,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase { @@ -350,6 +351,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase {
@Configurable(autowire=Autowire.BY_TYPE)
@SuppressWarnings("unused")
private static class ShouldBeConfiguredBySpringUsingAutowireByType {
private TestBean friend = null;
@ -365,6 +367,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase { @@ -365,6 +367,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase {
@Configurable(autowire=Autowire.BY_NAME)
@SuppressWarnings("unused")
private static class ValidAutowireByName {
private TestBean friend = null;
@ -380,6 +383,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase { @@ -380,6 +383,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase {
@Configurable(autowire=Autowire.BY_NAME, dependencyCheck=true)
@SuppressWarnings("unused")
private static class InvalidAutowireByName {
private TestBean friend;
@ -393,7 +397,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase { @@ -393,7 +397,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase {
}
}
@SuppressWarnings("unused")
private static class ArbitraryExistingPojo {
private TestBean friend;
@ -426,6 +430,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase { @@ -426,6 +430,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase {
@Configurable
@SuppressWarnings("unused")
private static class BaseBean {
public int setterCount;
@ -447,7 +452,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase { @@ -447,7 +452,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase {
}
@Configurable
@SuppressWarnings("serial")
@SuppressWarnings({"serial", "unused"})
private static class BaseSerializableBean implements Serializable {
public int setterCount;
@ -467,6 +472,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase { @@ -467,6 +472,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase {
@Aspect
@SuppressWarnings("unused")
private static class WireArbitraryExistingPojo extends AbstractBeanConfigurerAspect {
@Pointcut("initialization(ArbitraryExistingPojo.new(..)) && this(beanInstance)")
@ -477,6 +483,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase { @@ -477,6 +483,7 @@ public abstract class AbstractBeanConfigurerTests extends TestCase {
@Aspect
@SuppressWarnings("unused")
private static class AspectThatWillNotBeUsed extends AbstractBeanConfigurerAspect {
@Pointcut("initialization(ClassThatWillNotActuallyBeWired.new(..)) && this(beanInstance)")

4
spring-beans/src/test/java/org/springframework/beans/BeanUtilsTests.java

@ -267,6 +267,7 @@ public final class BeanUtilsTests { @@ -267,6 +267,7 @@ public final class BeanUtilsTests {
}
@SuppressWarnings("unused")
private static class NameAndSpecialProperty {
private String name;
@ -291,6 +292,7 @@ public final class BeanUtilsTests { @@ -291,6 +292,7 @@ public final class BeanUtilsTests {
}
@SuppressWarnings("unused")
private static class ContainerBean {
private ContainedBean[] containedBeans;
@ -305,6 +307,7 @@ public final class BeanUtilsTests { @@ -305,6 +307,7 @@ public final class BeanUtilsTests {
}
@SuppressWarnings("unused")
private static class ContainedBean {
private String name;
@ -319,6 +322,7 @@ public final class BeanUtilsTests { @@ -319,6 +322,7 @@ public final class BeanUtilsTests {
}
@SuppressWarnings("unused")
private static class MethodSignatureBean {
public void doSomething() {

2
spring-beans/src/test/java/org/springframework/beans/BeanWrapperGenericsTests.java

@ -497,6 +497,7 @@ public class BeanWrapperGenericsTests { @@ -497,6 +497,7 @@ public class BeanWrapperGenericsTests {
}
@SuppressWarnings("unused")
private static class NestedGenericCollectionBean extends BaseGenericCollectionBean {
private Map<String, Integer> mapOfInteger;
@ -544,6 +545,7 @@ public class BeanWrapperGenericsTests { @@ -544,6 +545,7 @@ public class BeanWrapperGenericsTests {
}
@SuppressWarnings("unused")
private static class ComplexMapHolder {
private Map<List<Integer>, List<Long>> genericMap;

10
spring-beans/src/test/java/org/springframework/beans/BeanWrapperTests.java

@ -1569,6 +1569,7 @@ public final class BeanWrapperTests { @@ -1569,6 +1569,7 @@ public final class BeanWrapperTests {
}
@SuppressWarnings("unused")
private static class Foo {
private List list;
@ -1598,6 +1599,7 @@ public final class BeanWrapperTests { @@ -1598,6 +1599,7 @@ public final class BeanWrapperTests {
}
@SuppressWarnings("unused")
private static class NoRead {
public void setAge(int age) {
@ -1605,6 +1607,7 @@ public final class BeanWrapperTests { @@ -1605,6 +1607,7 @@ public final class BeanWrapperTests {
}
@SuppressWarnings("unused")
private static class EnumTester {
private Autowire autowire;
@ -1619,6 +1622,7 @@ public final class BeanWrapperTests { @@ -1619,6 +1622,7 @@ public final class BeanWrapperTests {
}
@SuppressWarnings("unused")
private static class PropsTester {
private Properties props;
@ -1647,6 +1651,7 @@ public final class BeanWrapperTests { @@ -1647,6 +1651,7 @@ public final class BeanWrapperTests {
}
@SuppressWarnings("unused")
private static class GetterBean {
private String name;
@ -1664,6 +1669,7 @@ public final class BeanWrapperTests { @@ -1664,6 +1669,7 @@ public final class BeanWrapperTests {
}
@SuppressWarnings("unused")
private static class ThrowsException {
public void doSomething(Throwable t) throws Throwable {
@ -1672,6 +1678,7 @@ public final class BeanWrapperTests { @@ -1672,6 +1678,7 @@ public final class BeanWrapperTests {
}
@SuppressWarnings("unused")
private static class PrimitiveArrayBean {
private int[] array;
@ -1686,6 +1693,7 @@ public final class BeanWrapperTests { @@ -1686,6 +1693,7 @@ public final class BeanWrapperTests {
}
@SuppressWarnings("unused")
private static class NumberPropertyBean {
private byte myPrimitiveByte;
@ -1804,6 +1812,7 @@ public final class BeanWrapperTests { @@ -1804,6 +1812,7 @@ public final class BeanWrapperTests {
}
@SuppressWarnings("unused")
private static class IntelliBean {
public void setName(String name) {}
@ -1818,6 +1827,7 @@ public final class BeanWrapperTests { @@ -1818,6 +1827,7 @@ public final class BeanWrapperTests {
}
@SuppressWarnings("unused")
private static class Employee extends TestBean {
private String co;

3
spring-beans/src/test/java/org/springframework/beans/ConcurrentBeanWrapperTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -135,6 +135,7 @@ public final class ConcurrentBeanWrapperTests { @@ -135,6 +135,7 @@ public final class ConcurrentBeanWrapperTests {
}
@SuppressWarnings("unused")
private static class TestBean {
private Properties properties;

4
spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java

@ -2334,6 +2334,7 @@ public class DefaultListableBeanFactoryTests { @@ -2334,6 +2334,7 @@ public class DefaultListableBeanFactoryTests {
this.spouse = spouse;
}
@SuppressWarnings("unused")
private ConstructorDependency(TestBean spouse, TestBean otherSpouse) {
throw new IllegalArgumentException("Should never be called");
}
@ -2560,6 +2561,7 @@ public class DefaultListableBeanFactoryTests { @@ -2560,6 +2561,7 @@ public class DefaultListableBeanFactoryTests {
/**
* Bean with a dependency on a {@link FactoryBean}.
*/
@SuppressWarnings("unused")
private static class FactoryBeanDependentBean {
private FactoryBean<?> factoryBean;
@ -2646,6 +2648,7 @@ public class DefaultListableBeanFactoryTests { @@ -2646,6 +2648,7 @@ public class DefaultListableBeanFactoryTests {
}
@SuppressWarnings("unused")
private static class TestSecuredBean {
private String userName;
@ -2675,6 +2678,7 @@ public class DefaultListableBeanFactoryTests { @@ -2675,6 +2678,7 @@ public class DefaultListableBeanFactoryTests {
}
}
@SuppressWarnings("unused")
private static class KnowsIfInstantiated {
private static boolean instantiated;

4
spring-beans/src/test/java/org/springframework/beans/factory/parsing/CustomProblemReporterTests.java

@ -91,10 +91,6 @@ public final class CustomProblemReporterTests { @@ -91,10 +91,6 @@ public final class CustomProblemReporterTests {
System.out.println(problem);
this.warnings.add(problem);
}
public Problem[] getWarnings() {
return this.warnings.toArray(new Problem[this.warnings.size()]);
}
}
}

4
spring-beans/src/test/java/org/springframework/beans/factory/support/QualifierAnnotationAutowireBeanFactoryTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -208,6 +208,7 @@ public class QualifierAnnotationAutowireBeanFactoryTests { @@ -208,6 +208,7 @@ public class QualifierAnnotationAutowireBeanFactoryTests {
}
@SuppressWarnings("unused")
private static class QualifiedTestBean {
@TestQualifier
@ -226,6 +227,7 @@ public class QualifierAnnotationAutowireBeanFactoryTests { @@ -226,6 +227,7 @@ public class QualifierAnnotationAutowireBeanFactoryTests {
}
@SuppressWarnings("unused")
private static class Person {
private String name;

6
spring-beans/src/test/java/org/springframework/beans/factory/support/security/CallbacksSecurityTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -75,6 +75,7 @@ public class CallbacksSecurityTests { @@ -75,6 +75,7 @@ public class CallbacksSecurityTests {
private DefaultListableBeanFactory beanFactory;
private SecurityContextProvider provider;
@SuppressWarnings("unused")
private static class NonPrivilegedBean {
private String expectedName;
@ -117,6 +118,7 @@ public class CallbacksSecurityTests { @@ -117,6 +118,7 @@ public class CallbacksSecurityTests {
}
}
@SuppressWarnings("unused")
private static class NonPrivilegedSpringCallbacksBean implements
InitializingBean, DisposableBean, BeanClassLoaderAware,
BeanFactoryAware, BeanNameAware {
@ -161,6 +163,7 @@ public class CallbacksSecurityTests { @@ -161,6 +163,7 @@ public class CallbacksSecurityTests {
}
}
@SuppressWarnings("unused")
private static class NonPrivilegedFactoryBean implements SmartFactoryBean {
private String expectedName;
@ -204,6 +207,7 @@ public class CallbacksSecurityTests { @@ -204,6 +207,7 @@ public class CallbacksSecurityTests {
}
}
@SuppressWarnings("unused")
private static class NonPrivilegedFactory {
private final String expectedName;

2
spring-beans/src/test/java/org/springframework/beans/factory/xml/FactoryMethods.java

@ -62,6 +62,7 @@ public class FactoryMethods { @@ -62,6 +62,7 @@ public class FactoryMethods {
return new FactoryMethods(tb, null, num);
}
@SuppressWarnings("unused")
private static List listInstance() {
return Collections.EMPTY_LIST;
}
@ -99,6 +100,7 @@ public class FactoryMethods { @@ -99,6 +100,7 @@ public class FactoryMethods {
return this.tb;
}
@SuppressWarnings("unused")
private TestBean privateGetTestBean() {
return this.tb;
}

4
spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomCollectionEditorTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2006 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -85,7 +85,7 @@ public final class CustomCollectionEditorTests { @@ -85,7 +85,7 @@ public final class CustomCollectionEditorTests {
}
@SuppressWarnings("serial")
@SuppressWarnings({ "serial", "unused" })
private static final class CollectionTypeWithNoNoArgCtor extends ArrayList<Object> {
public CollectionTypeWithNoNoArgCtor(String anArg) {
}

3
spring-beans/src/test/java/org/springframework/beans/propertyeditors/CustomEditorTests.java

@ -1506,6 +1506,7 @@ public class CustomEditorTests { @@ -1506,6 +1506,7 @@ public class CustomEditorTests {
}
@SuppressWarnings("unused")
private static class PrimitiveArrayBean {
private byte[] byteArray;
@ -1530,6 +1531,7 @@ public class CustomEditorTests { @@ -1530,6 +1531,7 @@ public class CustomEditorTests {
}
@SuppressWarnings("unused")
private static class CharBean {
private char myChar;
@ -1554,6 +1556,7 @@ public class CustomEditorTests { @@ -1554,6 +1556,7 @@ public class CustomEditorTests {
}
@SuppressWarnings("unused")
private static class OldCollectionsBean {
private Vector<?> vector;

3
spring-beans/src/test/java/org/springframework/beans/support/PropertyComparatorTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -96,6 +96,7 @@ public class PropertyComparatorTests { @@ -96,6 +96,7 @@ public class PropertyComparatorTests {
}
@SuppressWarnings("unused")
private static class Dog implements Comparable<Object> {
private String nickName;

3
spring-context/src/test/java/org/springframework/aop/framework/CglibProxyTests.java

@ -137,10 +137,13 @@ public final class CglibProxyTests extends AbstractAopProxyTests implements Seri @@ -137,10 +137,13 @@ public final class CglibProxyTests extends AbstractAopProxyTests implements Seri
@Test
public void testCglibProxyingGivesMeaningfulExceptionIfAskedToProxyNonvisibleClass() {
@SuppressWarnings("unused")
class YouCantSeeThis {
void hidden() {
}
}
YouCantSeeThis mine = new YouCantSeeThis();
try {
ProxyFactory pf = new ProxyFactory(mine);

3
spring-context/src/test/java/org/springframework/beans/factory/support/InjectAnnotationAutowireContextTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -608,6 +608,7 @@ public class InjectAnnotationAutowireContextTests { @@ -608,6 +608,7 @@ public class InjectAnnotationAutowireContextTests {
}
@SuppressWarnings("unused")
private static class QualifiedFieldWithBaseQualifierDefaultValueTestBean {
@Inject

5
spring-context/src/test/java/org/springframework/beans/factory/xml/QualifierAnnotationTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -199,6 +199,7 @@ public final class QualifierAnnotationTests { @@ -199,6 +199,7 @@ public final class QualifierAnnotationTests {
}
@SuppressWarnings("unused")
private static class NonQualifiedTestBean {
@Autowired
@ -305,6 +306,7 @@ public final class QualifierAnnotationTests { @@ -305,6 +306,7 @@ public final class QualifierAnnotationTests {
}
@SuppressWarnings("unused")
private static class QualifiedByAttributesTestBean {
@Autowired @MultipleAttributeQualifier(name="moe", age=42)
@ -323,6 +325,7 @@ public final class QualifierAnnotationTests { @@ -323,6 +325,7 @@ public final class QualifierAnnotationTests {
}
@SuppressWarnings("unused")
private static class Person {
private String name;

3
spring-context/src/test/java/org/springframework/beans/factory/xml/XmlBeanFactoryTestTypes.java

@ -198,7 +198,7 @@ abstract class ConstructorInjectedOverrides { @@ -198,7 +198,7 @@ abstract class ConstructorInjectedOverrides {
* @author Juergen Hoeller
* @since 09.11.2003
*/
@SuppressWarnings("serial")
@SuppressWarnings({ "serial", "unused" })
class DerivedConstructorDependenciesBean extends ConstructorDependenciesBean {
boolean initialized;
@ -332,6 +332,7 @@ class DummyReferencer { @@ -332,6 +332,7 @@ class DummyReferencer {
* @author Rod Johnson
* @author Juergen Hoeller
*/
@SuppressWarnings("unused")
class FactoryMethods {
public static FactoryMethods nullInstance() {

1
spring-context/src/test/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessorTests.java

@ -700,6 +700,7 @@ public class CommonAnnotationBeanPostProcessorTests { @@ -700,6 +700,7 @@ public class CommonAnnotationBeanPostProcessorTests {
}
@SuppressWarnings("unused")
private static class NullFactory {
public static Object create() {

5
spring-context/src/test/java/org/springframework/context/annotation/ComponentScanParserBeanDefinitionDefaultsTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2007 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -214,6 +214,7 @@ public class ComponentScanParserBeanDefinitionDefaultsTests { @@ -214,6 +214,7 @@ public class ComponentScanParserBeanDefinitionDefaultsTests {
}
@SuppressWarnings("unused")
private static class DefaultsTestBean {
static int INIT_COUNT;
@ -276,6 +277,7 @@ public class ComponentScanParserBeanDefinitionDefaultsTests { @@ -276,6 +277,7 @@ public class ComponentScanParserBeanDefinitionDefaultsTests {
}
@SuppressWarnings("unused")
private static class PropertyDependencyTestBean {
private String name;
@ -290,6 +292,7 @@ public class ComponentScanParserBeanDefinitionDefaultsTests { @@ -290,6 +292,7 @@ public class ComponentScanParserBeanDefinitionDefaultsTests {
}
@SuppressWarnings("unused")
private static class ConstructorDependencyTestBean {
private String name;

6
spring-context/src/test/java/org/springframework/context/annotation/configuration/ConfigurationClassProcessingTests.java

@ -272,6 +272,7 @@ public class ConfigurationClassProcessingTests { @@ -272,6 +272,7 @@ public class ConfigurationClassProcessingTests {
}
@SuppressWarnings("unused")
static class ConfigWithPostProcessor extends ConfigWithPrototypeBean {
@Value("${myProp}")
@ -280,10 +281,13 @@ public class ConfigurationClassProcessingTests { @@ -280,10 +281,13 @@ public class ConfigurationClassProcessingTests {
@Bean
public POBPP beanPostProcessor() {
return new POBPP() {
String nameSuffix = "-processed-" + myProp;
public void setNameSuffix(String nameSuffix) {
this.nameSuffix = nameSuffix;
}
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) {
if (bean instanceof ITestBean) {
@ -291,10 +295,12 @@ public class ConfigurationClassProcessingTests { @@ -291,10 +295,12 @@ public class ConfigurationClassProcessingTests {
}
return bean;
}
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) {
return bean;
}
public int getOrder() {
return 0;
}

4
spring-context/src/test/java/org/springframework/jmx/JmxTestBean.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
@ -138,12 +138,14 @@ public class JmxTestBean implements IJmxTestBean { @@ -138,12 +138,14 @@ public class JmxTestBean implements IJmxTestBean {
protected void someProtectedMethod() {
}
@SuppressWarnings("unused")
private void somePrivateMethod() {
}
protected void getSomething() {
}
@SuppressWarnings("unused")
private void getSomethingElse() {
}

3
spring-context/src/test/java/org/springframework/validation/DataBinderTests.java

@ -1630,6 +1630,7 @@ public class DataBinderTests extends TestCase { @@ -1630,6 +1630,7 @@ public class DataBinderTests extends TestCase {
}
@SuppressWarnings("unused")
private static class BeanWithIntegerList {
private List<Integer> integerList;
@ -1644,6 +1645,7 @@ public class DataBinderTests extends TestCase { @@ -1644,6 +1645,7 @@ public class DataBinderTests extends TestCase {
}
@SuppressWarnings("unused")
private static class Book {
private String Title;
@ -1728,6 +1730,7 @@ public class DataBinderTests extends TestCase { @@ -1728,6 +1730,7 @@ public class DataBinderTests extends TestCase {
}
@SuppressWarnings("unused")
private static class GrowingList<E> extends AbstractList<E> {
private List<E> list;

3
spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -658,6 +658,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol @@ -658,6 +658,7 @@ public class PathMatchingResourcePatternResolver implements ResourcePatternResol
/**
* VFS visitor for path matching purposes.
*/
@SuppressWarnings("unused")
private static class PatternVirtualFileVisitor implements InvocationHandler {
private final String subPattern;

3
spring-core/src/test/java/org/springframework/core/BridgeMethodResolverTests.java

@ -560,6 +560,7 @@ public class BridgeMethodResolverTests { @@ -560,6 +560,7 @@ public class BridgeMethodResolverTests {
}
@SuppressWarnings("unused")
private static class StringGenericParameter implements GenericParameter<String> {
@Override
@ -1163,6 +1164,7 @@ public class BridgeMethodResolverTests { @@ -1163,6 +1164,7 @@ public class BridgeMethodResolverTests {
}
@SuppressWarnings("unused")
private static class MegaMessageProducerImpl extends Other<Long, String> implements MegaMessageProducer {
public void receive(NewMegaMessageEvent event) {
@ -1198,6 +1200,7 @@ public class BridgeMethodResolverTests { @@ -1198,6 +1200,7 @@ public class BridgeMethodResolverTests {
}
@SuppressWarnings("unused")
private static abstract class AbstractImplementsInterface<D extends DomainObjectSuper> implements IGenericInterface<D> {
@Override

6
spring-core/src/test/java/org/springframework/core/type/AnnotationTypeFilterTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2011 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -122,10 +122,12 @@ public class AnnotationTypeFilterTests { @@ -122,10 +122,12 @@ public class AnnotationTypeFilterTests {
}
@SuppressWarnings("unused")
private static class SomeSubClassOfSomeComponentInterface implements SomeComponentInterface {
}
@SuppressWarnings("unused")
private static class SomeSubClassOfSomeComponent extends SomeComponent {
}
@ -139,10 +141,12 @@ public class AnnotationTypeFilterTests { @@ -139,10 +141,12 @@ public class AnnotationTypeFilterTests {
}
@SuppressWarnings("unused")
private static class SomeSubclassOfSomeClassMarkedWithNonInheritedAnnotation extends SomeClassMarkedWithNonInheritedAnnotation {
}
@SuppressWarnings("unused")
private static class SomeNonCandidateClass {
}

4
spring-core/src/test/java/org/springframework/core/type/AssignableTypeFilterTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -81,6 +81,7 @@ public class AssignableTypeFilterTests extends TestCase { @@ -81,6 +81,7 @@ public class AssignableTypeFilterTests extends TestCase {
}
@SuppressWarnings("unused")
private static class TestInterfaceImpl implements TestInterface {
}
@ -89,6 +90,7 @@ public class AssignableTypeFilterTests extends TestCase { @@ -89,6 +90,7 @@ public class AssignableTypeFilterTests extends TestCase {
}
@SuppressWarnings("unused")
private static class SomeDaoLikeImpl extends SimpleJdbcDaoSupport implements SomeDaoLikeInterface {
}

8
spring-core/src/test/java/org/springframework/util/ClassUtilsTests.java

@ -308,19 +308,25 @@ public class ClassUtilsTests extends TestCase { @@ -308,19 +308,25 @@ public class ClassUtilsTests extends TestCase {
}
}
@SuppressWarnings("unused")
private static class OverloadedMethodsClass {
public void print(String messages) {
/* no-op */
}
public void print(String[] messages) {
/* no-op */
}
}
private static class SubOverloadedMethodsClass extends OverloadedMethodsClass{
@SuppressWarnings("unused")
private static class SubOverloadedMethodsClass extends OverloadedMethodsClass {
public void print(String header, String[] messages) {
/* no-op */
}
void print(String header, String[] messages, String footer) {
/* no-op */
}

3
spring-core/src/test/java/org/springframework/util/MethodInvokerTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -191,6 +191,7 @@ public class MethodInvokerTests extends TestCase { @@ -191,6 +191,7 @@ public class MethodInvokerTests extends TestCase {
}
@SuppressWarnings("unused")
public static class Greeter {
// should handle Salesman (only interface)

12
spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericTableMetaDataProvider.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -310,7 +310,6 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { @@ -310,7 +310,6 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider {
tmd.setCatalogName(tables.getString("TABLE_CAT"));
tmd.setSchemaName(tables.getString("TABLE_SCHEM"));
tmd.setTableName(tables.getString("TABLE_NAME"));
tmd.setType(tables.getString("TABLE_TYPE"));
if (tmd.getSchemaName() == null) {
tableMeta.put(userName != null ? userName.toUpperCase() : "", tmd);
}
@ -445,7 +444,6 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { @@ -445,7 +444,6 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider {
private String tableName;
private String type;
public void setCatalogName(String catalogName) {
this.catalogName = catalogName;
@ -470,14 +468,6 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { @@ -470,14 +468,6 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider {
public String getTableName() {
return this.tableName;
}
public void setType(String type) {
this.type = type;
}
public String getType() {
return this.type;
}
}
}

6
spring-jdbc/src/main/java/org/springframework/jdbc/datasource/DataSourceTransactionManager.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -348,10 +348,6 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan @@ -348,10 +348,6 @@ public class DataSourceTransactionManager extends AbstractPlatformTransactionMan
return this.newConnectionHolder;
}
public boolean hasTransaction() {
return (getConnectionHolder() != null && getConnectionHolder().isTransactionActive());
}
public void setMustRestoreAutoCommit(boolean mustRestoreAutoCommit) {
this.mustRestoreAutoCommit = mustRestoreAutoCommit;
}

2
spring-jdbc/src/test/java/org/springframework/jdbc/core/namedparam/BeanPropertySqlParameterSourceTests.java

@ -81,6 +81,8 @@ public class BeanPropertySqlParameterSourceTests { @@ -81,6 +81,8 @@ public class BeanPropertySqlParameterSourceTests {
assertFalse(source.hasValue("noOp"));
}
@SuppressWarnings("unused")
private static final class NoReadableProperties {
public void setNoOp(String noOp) {

6
spring-jms/src/test/java/org/springframework/jms/listener/endpoint/DefaultJmsActivationSpecFactoryTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -20,8 +20,8 @@ import javax.jms.Destination; @@ -20,8 +20,8 @@ import javax.jms.Destination;
import javax.jms.Session;
import junit.framework.TestCase;
import org.easymock.MockControl;
import org.easymock.MockControl;
import org.springframework.jca.StubResourceAdapter;
import org.springframework.jms.StubQueue;
import org.springframework.jms.support.destination.DestinationResolver;
@ -89,6 +89,7 @@ public class DefaultJmsActivationSpecFactoryTests extends TestCase { @@ -89,6 +89,7 @@ public class DefaultJmsActivationSpecFactoryTests extends TestCase {
}
@SuppressWarnings("unused")
private static class StubActiveMQActivationSpec extends StubJmsActivationSpec {
private int maxSessions;
@ -133,6 +134,7 @@ public class DefaultJmsActivationSpecFactoryTests extends TestCase { @@ -133,6 +134,7 @@ public class DefaultJmsActivationSpecFactoryTests extends TestCase {
}
@SuppressWarnings("unused")
private static class StubWebSphereActivationSpecImpl extends StubJmsActivationSpec {
private Destination destination;

1
spring-orm/src/test/java/org/springframework/orm/jdo/JdoInterceptorTests.java

@ -77,6 +77,7 @@ public class JdoInterceptorTests { @@ -77,6 +77,7 @@ public class JdoInterceptorTests {
}
@SuppressWarnings("unused")
private static class TestInvocation implements MethodInvocation {
private PersistenceManagerFactory persistenceManagerFactory;

1
spring-orm/src/test/java/org/springframework/orm/jpa/JpaInterceptorTests.java

@ -198,6 +198,7 @@ public class JpaInterceptorTests { @@ -198,6 +198,7 @@ public class JpaInterceptorTests {
}
@SuppressWarnings("unused")
private static class TestInvocation implements MethodInvocation {
private EntityManagerFactory entityManagerFactory;

4
spring-oxm/src/test/java/org/springframework/oxm/jaxb/Jaxb2MarshallerTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -311,10 +311,12 @@ public class Jaxb2MarshallerTests extends AbstractMarshallerTests { @@ -311,10 +311,12 @@ public class Jaxb2MarshallerTests extends AbstractMarshallerTests {
private String s = "Hello";
}
@SuppressWarnings("unused")
private JAXBElement<DummyRootElement> createDummyRootElement() {
return null;
}
@SuppressWarnings("unused")
private JAXBElement<DummyType> createDummyType() {
return null;
}

4
spring-test/src/main/java/org/springframework/test/jpa/AbstractJpaTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -326,6 +326,7 @@ public abstract class AbstractJpaTests extends AbstractAnnotationAwareTransactio @@ -326,6 +326,7 @@ public abstract class AbstractJpaTests extends AbstractAnnotationAwareTransactio
private final LoadTimeWeaver ltw;
@SuppressWarnings("unused")
public LoadTimeWeaverInjectingBeanPostProcessor(LoadTimeWeaver ltw) {
this.ltw = ltw;
}
@ -346,6 +347,7 @@ public abstract class AbstractJpaTests extends AbstractAnnotationAwareTransactio @@ -346,6 +347,7 @@ public abstract class AbstractJpaTests extends AbstractAnnotationAwareTransactio
private final ClassLoader shadowingClassLoader;
@SuppressWarnings("unused")
public ShadowingLoadTimeWeaver(ClassLoader shadowingClassLoader) {
this.shadowingClassLoader = shadowingClassLoader;
}

10
spring-web/src/test/java/org/springframework/web/multipart/commons/CommonsMultipartResolverTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -465,19 +465,11 @@ public class CommonsMultipartResolverTests { @@ -465,19 +465,11 @@ public class CommonsMultipartResolverTests {
this.writtenFile = file;
}
public File getWrittenFile() {
return writtenFile;
}
@Override
public void delete() {
this.deleted = true;
}
public boolean isDeleted() {
return deleted;
}
@Override
public String getFieldName() {
return fieldName;

Loading…
Cancel
Save