Fix unused type compiler warnings

This commit is contained in:
Phillip Webb
2013-01-25 12:08:55 -08:00
parent 88f5dd6ce1
commit 6a1e841952
40 changed files with 119 additions and 57 deletions

View File

@@ -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 {
}
@SuppressWarnings("unused")
private static class ContainerBean {
private ContainedBean[] containedBeans;
@@ -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 {
}
@SuppressWarnings("unused")
private static class MethodSignatureBean {
public void doSomething() {

View File

@@ -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 {
}
@SuppressWarnings("unused")
private static class ComplexMapHolder {
private Map<List<Integer>, List<Long>> genericMap;

View File

@@ -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 {
}
@SuppressWarnings("unused")
private static class NoRead {
public void setAge(int age) {
@@ -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 {
}
@SuppressWarnings("unused")
private static class PropsTester {
private Properties props;
@@ -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 {
}
@SuppressWarnings("unused")
private static class ThrowsException {
public void doSomething(Throwable t) throws Throwable {
@@ -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 {
}
@SuppressWarnings("unused")
private static class NumberPropertyBean {
private byte myPrimitiveByte;
@@ -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 {
}
@SuppressWarnings("unused")
private static class Employee extends TestBean {
private String co;

View File

@@ -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 {
}
@SuppressWarnings("unused")
private static class TestBean {
private Properties properties;

View File

@@ -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 {
/**
* Bean with a dependency on a {@link FactoryBean}.
*/
@SuppressWarnings("unused")
private static class FactoryBeanDependentBean {
private FactoryBean<?> factoryBean;
@@ -2646,6 +2648,7 @@ public class DefaultListableBeanFactoryTests {
}
@SuppressWarnings("unused")
private static class TestSecuredBean {
private String userName;
@@ -2675,6 +2678,7 @@ public class DefaultListableBeanFactoryTests {
}
}
@SuppressWarnings("unused")
private static class KnowsIfInstantiated {
private static boolean instantiated;

View File

@@ -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()]);
}
}
}

View File

@@ -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 {
}
@SuppressWarnings("unused")
private static class QualifiedTestBean {
@TestQualifier
@@ -226,6 +227,7 @@ public class QualifierAnnotationAutowireBeanFactoryTests {
}
@SuppressWarnings("unused")
private static class Person {
private String name;

View File

@@ -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 {
private DefaultListableBeanFactory beanFactory;
private SecurityContextProvider provider;
@SuppressWarnings("unused")
private static class NonPrivilegedBean {
private String expectedName;
@@ -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 {
}
}
@SuppressWarnings("unused")
private static class NonPrivilegedFactoryBean implements SmartFactoryBean {
private String expectedName;
@@ -204,6 +207,7 @@ public class CallbacksSecurityTests {
}
}
@SuppressWarnings("unused")
private static class NonPrivilegedFactory {
private final String expectedName;

View File

@@ -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 {
return this.tb;
}
@SuppressWarnings("unused")
private TestBean privateGetTestBean() {
return this.tb;
}

View File

@@ -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 {
}
@SuppressWarnings("serial")
@SuppressWarnings({ "serial", "unused" })
private static final class CollectionTypeWithNoNoArgCtor extends ArrayList<Object> {
public CollectionTypeWithNoNoArgCtor(String anArg) {
}

View File

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

View File

@@ -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 {
}
@SuppressWarnings("unused")
private static class Dog implements Comparable<Object> {
private String nickName;