Deleting unnecessary TODOs and suppressing warnings.
This commit is contained in:
parent
03c267e93a
commit
2d6340af74
|
@ -121,12 +121,10 @@ public class ImportAwareTests {
|
||||||
static class BPP implements BeanFactoryAware, BeanPostProcessor {
|
static class BPP implements BeanFactoryAware, BeanPostProcessor {
|
||||||
|
|
||||||
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
|
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return bean;
|
return bean;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return bean;
|
return bean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,13 +17,10 @@ package test.beans;
|
||||||
|
|
||||||
import org.springframework.core.enums.ShortCodedLabeledEnum;
|
import org.springframework.core.enums.ShortCodedLabeledEnum;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: JAVADOC
|
|
||||||
*
|
|
||||||
* @author Rob Harrop
|
* @author Rob Harrop
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings({ "serial", "deprecation" })
|
||||||
public class Colour extends ShortCodedLabeledEnum {
|
public class Colour extends ShortCodedLabeledEnum {
|
||||||
|
|
||||||
public static final Colour RED = new Colour(0, "RED");
|
public static final Colour RED = new Colour(0, "RED");
|
||||||
|
|
|
@ -21,7 +21,6 @@ import java.util.Map;
|
||||||
import org.springframework.beans.factory.ObjectFactory;
|
import org.springframework.beans.factory.ObjectFactory;
|
||||||
import org.springframework.beans.factory.config.Scope;
|
import org.springframework.beans.factory.config.Scope;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple scope implementation which creates object based on a flag.
|
* Simple scope implementation which creates object based on a flag.
|
||||||
*
|
*
|
||||||
|
@ -34,11 +33,6 @@ public class CustomScope implements Scope {
|
||||||
|
|
||||||
private Map<String, Object> beans = new HashMap<String, Object>();
|
private Map<String, Object> beans = new HashMap<String, Object>();
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.beans.factory.config.Scope#get(java.lang.String,
|
|
||||||
* org.springframework.beans.factory.ObjectFactory)
|
|
||||||
*/
|
|
||||||
public Object get(String name, ObjectFactory<?> objectFactory) {
|
public Object get(String name, ObjectFactory<?> objectFactory) {
|
||||||
if (createNewScope) {
|
if (createNewScope) {
|
||||||
beans.clear();
|
beans.clear();
|
||||||
|
@ -56,33 +50,19 @@ public class CustomScope implements Scope {
|
||||||
return beans.get(name);
|
return beans.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.beans.factory.config.Scope#getConversationId()
|
|
||||||
*/
|
|
||||||
public String getConversationId() {
|
public String getConversationId() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.beans.factory.config.Scope#registerDestructionCallback(java.lang.String,
|
|
||||||
* java.lang.Runnable)
|
|
||||||
*/
|
|
||||||
public void registerDestructionCallback(String name, Runnable callback) {
|
public void registerDestructionCallback(String name, Runnable callback) {
|
||||||
// do nothing
|
// do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
* @see org.springframework.beans.factory.config.Scope#remove(java.lang.String)
|
|
||||||
*/
|
|
||||||
public Object remove(String name) {
|
public Object remove(String name) {
|
||||||
return beans.remove(name);
|
return beans.remove(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object resolveContextualObject(String key) {
|
public Object resolveContextualObject(String key) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,9 +15,8 @@
|
||||||
*/
|
*/
|
||||||
package test.beans;
|
package test.beans;
|
||||||
|
|
||||||
|
|
||||||
/** TODO: JAVADOC */
|
|
||||||
public class DependsOnTestBean {
|
public class DependsOnTestBean {
|
||||||
|
|
||||||
public TestBean tb;
|
public TestBean tb;
|
||||||
|
|
||||||
private int state;
|
private int state;
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
*/
|
*/
|
||||||
package test.beans;
|
package test.beans;
|
||||||
|
|
||||||
|
|
||||||
/** TODO: JAVADOC */
|
|
||||||
public interface INestedTestBean {
|
public interface INestedTestBean {
|
||||||
|
|
||||||
String getCompany();
|
String getCompany();
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
*/
|
*/
|
||||||
package test.beans;
|
package test.beans;
|
||||||
|
|
||||||
|
|
||||||
/** TODO: JAVADOC */
|
|
||||||
public interface IOther {
|
public interface IOther {
|
||||||
|
|
||||||
void absquatulate();
|
void absquatulate();
|
||||||
|
|
|
@ -27,8 +27,6 @@ import java.util.TreeSet;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: JAVADOC
|
|
||||||
*
|
|
||||||
* @author Juergen Hoeller
|
* @author Juergen Hoeller
|
||||||
* @since 11.11.2003
|
* @since 11.11.2003
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -41,6 +41,7 @@ import static org.junit.Assert.assertNull;
|
||||||
* @author Keith Donald
|
* @author Keith Donald
|
||||||
* @author Andy Clement
|
* @author Andy Clement
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
public class TypeDescriptorTests {
|
public class TypeDescriptorTests {
|
||||||
|
|
||||||
public List<String> listOfString;
|
public List<String> listOfString;
|
||||||
|
@ -204,7 +205,7 @@ public class TypeDescriptorTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void propertyComplex() throws Exception {
|
public void propertyComplex() throws Exception {
|
||||||
Property property = new Property(getClass(), getClass().getMethod("getComplexProperty", null), getClass().getMethod("setComplexProperty", Map.class));
|
Property property = new Property(getClass(), getClass().getMethod("getComplexProperty"), getClass().getMethod("setComplexProperty", Map.class));
|
||||||
TypeDescriptor desc = new TypeDescriptor(property);
|
TypeDescriptor desc = new TypeDescriptor(property);
|
||||||
assertEquals(String.class, desc.getMapKeyTypeDescriptor().getType());
|
assertEquals(String.class, desc.getMapKeyTypeDescriptor().getType());
|
||||||
assertEquals(Integer.class, desc.getMapValueTypeDescriptor().getElementTypeDescriptor().getElementTypeDescriptor().getType());
|
assertEquals(Integer.class, desc.getMapValueTypeDescriptor().getElementTypeDescriptor().getElementTypeDescriptor().getType());
|
||||||
|
@ -221,7 +222,7 @@ public class TypeDescriptorTests {
|
||||||
@Test
|
@Test
|
||||||
public void propertyGenericType() throws Exception {
|
public void propertyGenericType() throws Exception {
|
||||||
GenericType<Integer> genericBean = new IntegerType();
|
GenericType<Integer> genericBean = new IntegerType();
|
||||||
Property property = new Property(getClass(), genericBean.getClass().getMethod("getProperty", null), genericBean.getClass().getMethod("setProperty", Integer.class));
|
Property property = new Property(getClass(), genericBean.getClass().getMethod("getProperty"), genericBean.getClass().getMethod("setProperty", Integer.class));
|
||||||
TypeDescriptor desc = new TypeDescriptor(property);
|
TypeDescriptor desc = new TypeDescriptor(property);
|
||||||
assertEquals(Integer.class, desc.getType());
|
assertEquals(Integer.class, desc.getType());
|
||||||
}
|
}
|
||||||
|
@ -229,7 +230,7 @@ public class TypeDescriptorTests {
|
||||||
@Test
|
@Test
|
||||||
public void propertyTypeCovariance() throws Exception {
|
public void propertyTypeCovariance() throws Exception {
|
||||||
GenericType<Number> genericBean = new NumberType();
|
GenericType<Number> genericBean = new NumberType();
|
||||||
Property property = new Property(getClass(), genericBean.getClass().getMethod("getProperty", null), genericBean.getClass().getMethod("setProperty", Number.class));
|
Property property = new Property(getClass(), genericBean.getClass().getMethod("getProperty"), genericBean.getClass().getMethod("setProperty", Number.class));
|
||||||
TypeDescriptor desc = new TypeDescriptor(property);
|
TypeDescriptor desc = new TypeDescriptor(property);
|
||||||
assertEquals(Integer.class, desc.getType());
|
assertEquals(Integer.class, desc.getType());
|
||||||
}
|
}
|
||||||
|
@ -237,7 +238,7 @@ public class TypeDescriptorTests {
|
||||||
@Test
|
@Test
|
||||||
public void propertyGenericTypeList() throws Exception {
|
public void propertyGenericTypeList() throws Exception {
|
||||||
GenericType<Integer> genericBean = new IntegerType();
|
GenericType<Integer> genericBean = new IntegerType();
|
||||||
Property property = new Property(getClass(), genericBean.getClass().getMethod("getListProperty", null), genericBean.getClass().getMethod("setListProperty", List.class));
|
Property property = new Property(getClass(), genericBean.getClass().getMethod("getListProperty"), genericBean.getClass().getMethod("setListProperty", List.class));
|
||||||
TypeDescriptor desc = new TypeDescriptor(property);
|
TypeDescriptor desc = new TypeDescriptor(property);
|
||||||
assertEquals(List.class, desc.getType());
|
assertEquals(List.class, desc.getType());
|
||||||
assertEquals(Integer.class, desc.getElementTypeDescriptor().getType());
|
assertEquals(Integer.class, desc.getElementTypeDescriptor().getType());
|
||||||
|
@ -257,25 +258,18 @@ public class TypeDescriptorTests {
|
||||||
public class IntegerType implements GenericType<Integer> {
|
public class IntegerType implements GenericType<Integer> {
|
||||||
|
|
||||||
public Integer getProperty() {
|
public Integer getProperty() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setProperty(Integer t) {
|
public void setProperty(Integer t) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Integer> getListProperty() {
|
public List<Integer> getListProperty() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setListProperty(List<Integer> t) {
|
public void setListProperty(List<Integer> t) {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class NumberType implements GenericType<Number> {
|
public class NumberType implements GenericType<Number> {
|
||||||
|
@ -298,7 +292,7 @@ public class TypeDescriptorTests {
|
||||||
@Test
|
@Test
|
||||||
public void propertyGenericClassList() throws Exception {
|
public void propertyGenericClassList() throws Exception {
|
||||||
IntegerClass genericBean = new IntegerClass();
|
IntegerClass genericBean = new IntegerClass();
|
||||||
Property property = new Property(genericBean.getClass(), genericBean.getClass().getMethod("getListProperty", null), genericBean.getClass().getMethod("setListProperty", List.class));
|
Property property = new Property(genericBean.getClass(), genericBean.getClass().getMethod("getListProperty"), genericBean.getClass().getMethod("setListProperty", List.class));
|
||||||
TypeDescriptor desc = new TypeDescriptor(property);
|
TypeDescriptor desc = new TypeDescriptor(property);
|
||||||
assertEquals(List.class, desc.getType());
|
assertEquals(List.class, desc.getType());
|
||||||
assertEquals(Integer.class, desc.getElementTypeDescriptor().getType());
|
assertEquals(Integer.class, desc.getElementTypeDescriptor().getType());
|
||||||
|
@ -330,7 +324,7 @@ public class TypeDescriptorTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void property() throws Exception {
|
public void property() throws Exception {
|
||||||
Property property = new Property(getClass(), getClass().getMethod("getProperty", null), getClass().getMethod("setProperty", Map.class));
|
Property property = new Property(getClass(), getClass().getMethod("getProperty"), getClass().getMethod("setProperty", Map.class));
|
||||||
TypeDescriptor desc = new TypeDescriptor(property);
|
TypeDescriptor desc = new TypeDescriptor(property);
|
||||||
assertEquals(Map.class, desc.getType());
|
assertEquals(Map.class, desc.getType());
|
||||||
assertEquals(Integer.class, desc.getMapKeyTypeDescriptor().getElementTypeDescriptor().getType());
|
assertEquals(Integer.class, desc.getMapKeyTypeDescriptor().getElementTypeDescriptor().getType());
|
||||||
|
@ -600,7 +594,7 @@ public class TypeDescriptorTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void nestedPropertyTypeMapTwoLevels() throws Exception {
|
public void nestedPropertyTypeMapTwoLevels() throws Exception {
|
||||||
Property property = new Property(getClass(), getClass().getMethod("getTest4", null), getClass().getMethod("setTest4", List.class));
|
Property property = new Property(getClass(), getClass().getMethod("getTest4"), getClass().getMethod("setTest4", List.class));
|
||||||
TypeDescriptor t1 = TypeDescriptor.nested(property, 2);
|
TypeDescriptor t1 = TypeDescriptor.nested(property, 2);
|
||||||
assertEquals(String.class, t1.getType());
|
assertEquals(String.class, t1.getType());
|
||||||
}
|
}
|
||||||
|
@ -804,22 +798,4 @@ public class TypeDescriptorTests {
|
||||||
|
|
||||||
public Map<CharSequence, Number> isAssignableMapKeyValueTypes;
|
public Map<CharSequence, Number> isAssignableMapKeyValueTypes;
|
||||||
|
|
||||||
private void assignabilityExamples() {
|
|
||||||
Number num = null;
|
|
||||||
Integer integer = null;
|
|
||||||
num = integer;
|
|
||||||
|
|
||||||
List list = null;
|
|
||||||
List<String> listString = null;
|
|
||||||
list = listString;
|
|
||||||
listString = list;
|
|
||||||
|
|
||||||
Map map = null;
|
|
||||||
Map<String, String> mapString = null;
|
|
||||||
map = mapString;
|
|
||||||
mapString = map;
|
|
||||||
|
|
||||||
Map<String, String> mapString2 = null;
|
|
||||||
mapString = mapString2;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,6 +116,7 @@ public class CollectionToCollectionConverterTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void arrayCollectionToObjectInteraction() throws Exception {
|
public void arrayCollectionToObjectInteraction() throws Exception {
|
||||||
List<String>[] array = new List[2];
|
List<String>[] array = new List[2];
|
||||||
array[0] = Arrays.asList("9", "12");
|
array[0] = Arrays.asList("9", "12");
|
||||||
|
@ -127,6 +128,7 @@ public class CollectionToCollectionConverterTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void objectToCollection() throws Exception {
|
public void objectToCollection() throws Exception {
|
||||||
List<List<String>> list = new ArrayList<List<String>>();
|
List<List<String>> list = new ArrayList<List<String>>();
|
||||||
list.add(Arrays.asList("9", "12"));
|
list.add(Arrays.asList("9", "12"));
|
||||||
|
@ -147,6 +149,7 @@ public class CollectionToCollectionConverterTests {
|
||||||
public List<List<List<Integer>>> objectToCollection;
|
public List<List<List<Integer>>> objectToCollection;
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public void stringToCollection() throws Exception {
|
public void stringToCollection() throws Exception {
|
||||||
List<List<String>> list = new ArrayList<List<String>>();
|
List<List<String>> list = new ArrayList<List<String>>();
|
||||||
list.add(Arrays.asList("9,12"));
|
list.add(Arrays.asList("9,12"));
|
||||||
|
@ -220,62 +223,50 @@ public class CollectionToCollectionConverterTests {
|
||||||
public static abstract class BaseResource implements Resource {
|
public static abstract class BaseResource implements Resource {
|
||||||
|
|
||||||
public InputStream getInputStream() throws IOException {
|
public InputStream getInputStream() throws IOException {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean exists() {
|
public boolean exists() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isReadable() {
|
public boolean isReadable() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isOpen() {
|
public boolean isOpen() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public URL getURL() throws IOException {
|
public URL getURL() throws IOException {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public URI getURI() throws IOException {
|
public URI getURI() throws IOException {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public File getFile() throws IOException {
|
public File getFile() throws IOException {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long contentLength() throws IOException {
|
public long contentLength() throws IOException {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public long lastModified() throws IOException {
|
public long lastModified() throws IOException {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Resource createRelative(String relativePath) throws IOException {
|
public Resource createRelative(String relativePath) throws IOException {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFilename() {
|
public String getFilename() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
// TODO Auto-generated method stub
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -298,6 +289,7 @@ public class CollectionToCollectionConverterTests {
|
||||||
testCollectionConversionToArrayList(vector);
|
testCollectionConversionToArrayList(vector);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("rawtypes")
|
||||||
private void testCollectionConversionToArrayList(Collection<String> aSource) {
|
private void testCollectionConversionToArrayList(Collection<String> aSource) {
|
||||||
Object myConverted = (new CollectionToCollectionConverter(new GenericConversionService())).convert(
|
Object myConverted = (new CollectionToCollectionConverter(new GenericConversionService())).convert(
|
||||||
aSource, TypeDescriptor.forObject(aSource), TypeDescriptor.forObject(new ArrayList()));
|
aSource, TypeDescriptor.forObject(aSource), TypeDescriptor.forObject(new ArrayList()));
|
||||||
|
|
Loading…
Reference in New Issue