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

@@ -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);

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.
@@ -608,6 +608,7 @@ public class InjectAnnotationAutowireContextTests {
}
@SuppressWarnings("unused")
private static class QualifiedFieldWithBaseQualifierDefaultValueTestBean {
@Inject

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.
@@ -199,6 +199,7 @@ public final class QualifierAnnotationTests {
}
@SuppressWarnings("unused")
private static class NonQualifiedTestBean {
@Autowired
@@ -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 {
}
@SuppressWarnings("unused")
private static class Person {
private String name;

View File

@@ -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 {
* @author Rod Johnson
* @author Juergen Hoeller
*/
@SuppressWarnings("unused")
class FactoryMethods {
public static FactoryMethods nullInstance() {

View File

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

View File

@@ -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 {
}
@SuppressWarnings("unused")
private static class DefaultsTestBean {
static int INIT_COUNT;
@@ -276,6 +277,7 @@ public class ComponentScanParserBeanDefinitionDefaultsTests {
}
@SuppressWarnings("unused")
private static class PropertyDependencyTestBean {
private String name;
@@ -290,6 +292,7 @@ public class ComponentScanParserBeanDefinitionDefaultsTests {
}
@SuppressWarnings("unused")
private static class ConstructorDependencyTestBean {
private String name;

View File

@@ -272,6 +272,7 @@ public class ConfigurationClassProcessingTests {
}
@SuppressWarnings("unused")
static class ConfigWithPostProcessor extends ConfigWithPrototypeBean {
@Value("${myProp}")
@@ -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 {
}
return bean;
}
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) {
return bean;
}
public int getOrder() {
return 0;
}

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. You may obtain a copy of
@@ -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() {
}

View File

@@ -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 {
}
@SuppressWarnings("unused")
private static class Book {
private String Title;
@@ -1728,6 +1730,7 @@ public class DataBinderTests extends TestCase {
}
@SuppressWarnings("unused")
private static class GrowingList<E> extends AbstractList<E> {
private List<E> list;