Add @Override annotations to test sources
Issue: SPR-10129
This commit is contained in:
@@ -48,12 +48,14 @@ public class DerivedTestBean extends TestBean implements Serializable {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void setBeanName(String beanName) {
|
||||
if (this.beanName == null || beanName == null) {
|
||||
this.beanName = beanName;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBeanName() {
|
||||
return beanName;
|
||||
}
|
||||
@@ -72,10 +74,12 @@ public class DerivedTestBean extends TestBean implements Serializable {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
this.destroyed = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean wasDestroyed() {
|
||||
return destroyed;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,7 @@ public class NestedTestBean implements INestedTestBean {
|
||||
this.company = (company != null ? company : "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCompany() {
|
||||
return company;
|
||||
}
|
||||
|
||||
@@ -148,10 +148,12 @@ public class TestBean implements ITestBean, IOther, Comparable {
|
||||
return postProcessed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
@@ -167,10 +169,12 @@ public class TestBean implements ITestBean, IOther, Comparable {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAge(int age) {
|
||||
this.age = age;
|
||||
}
|
||||
@@ -183,14 +187,17 @@ public class TestBean implements ITestBean, IOther, Comparable {
|
||||
this.jedi = jedi;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITestBean getSpouse() {
|
||||
return (spouses != null ? spouses[0] : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSpouse(ITestBean spouse) {
|
||||
this.spouses = new ITestBean[] {spouse};
|
||||
}
|
||||
|
||||
@Override
|
||||
public ITestBean[] getSpouses() {
|
||||
return spouses;
|
||||
}
|
||||
@@ -217,10 +224,12 @@ public class TestBean implements ITestBean, IOther, Comparable {
|
||||
this.country = country;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getStringArray() {
|
||||
return stringArray;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setStringArray(String[] stringArray) {
|
||||
this.stringArray = stringArray;
|
||||
}
|
||||
@@ -289,6 +298,7 @@ public class TestBean implements ITestBean, IOther, Comparable {
|
||||
this.someProperties = someProperties;
|
||||
}
|
||||
|
||||
@Override
|
||||
public INestedTestBean getDoctor() {
|
||||
return doctor;
|
||||
}
|
||||
@@ -297,6 +307,7 @@ public class TestBean implements ITestBean, IOther, Comparable {
|
||||
this.doctor = doctor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public INestedTestBean getLawyer() {
|
||||
return lawyer;
|
||||
}
|
||||
@@ -329,6 +340,7 @@ public class TestBean implements ITestBean, IOther, Comparable {
|
||||
this.someBoolean = someBoolean;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IndexedTestBean getNestedIndexedBean() {
|
||||
return nestedIndexedBean;
|
||||
}
|
||||
@@ -357,18 +369,21 @@ public class TestBean implements ITestBean, IOther, Comparable {
|
||||
/**
|
||||
* @see ITestBean#exceptional(Throwable)
|
||||
*/
|
||||
@Override
|
||||
public void exceptional(Throwable t) throws Throwable {
|
||||
if (t != null) {
|
||||
throw t;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unreliableFileOperation() throws IOException {
|
||||
throw new IOException();
|
||||
}
|
||||
/**
|
||||
* @see ITestBean#returnsThis()
|
||||
*/
|
||||
@Override
|
||||
public Object returnsThis() {
|
||||
return this;
|
||||
}
|
||||
@@ -376,9 +391,11 @@ public class TestBean implements ITestBean, IOther, Comparable {
|
||||
/**
|
||||
* @see IOther#absquatulate()
|
||||
*/
|
||||
@Override
|
||||
public void absquatulate() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int haveBirthday() {
|
||||
return age++;
|
||||
}
|
||||
@@ -408,6 +425,7 @@ public class TestBean implements ITestBean, IOther, Comparable {
|
||||
return this.age;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object other) {
|
||||
if (this.name != null && other instanceof TestBean) {
|
||||
return this.name.compareTo(((TestBean) other).getName());
|
||||
|
||||
@@ -32,6 +32,7 @@ public class AttributeAccessorSupportTests extends TestCase {
|
||||
|
||||
private AttributeAccessor attributeAccessor;
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("serial")
|
||||
protected void setUp() throws Exception {
|
||||
this.attributeAccessor = new AttributeAccessorSupport() {
|
||||
@@ -64,6 +65,7 @@ public class AttributeAccessorSupportTests extends TestCase {
|
||||
assertTrue(Arrays.binarySearch(attributeNames, NAME) > -1);
|
||||
assertTrue(Arrays.binarySearch(attributeNames, "abc") > -1);
|
||||
}
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
this.attributeAccessor.removeAttribute(NAME);
|
||||
}
|
||||
|
||||
@@ -356,9 +356,11 @@ public class BridgeMethodResolverTests {
|
||||
public void someMethod(Integer theArg, Object otherArg) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void someMethod(String theArg, Object otherArg) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void someVarargMethod(String theArg, Object... otherArgs) {
|
||||
}
|
||||
}
|
||||
@@ -383,6 +385,7 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
public static class MyBar extends InterBar<String> {
|
||||
|
||||
@Override
|
||||
public void someMethod(String theArg, Object otherArg) {
|
||||
}
|
||||
|
||||
@@ -399,6 +402,7 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
public abstract class AbstractDateAdder implements Adder<Date> {
|
||||
|
||||
@Override
|
||||
public abstract void add(Date date);
|
||||
}
|
||||
|
||||
@@ -430,6 +434,7 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
public class ExtendsReallyDeepNow extends ReallyDeepNow<Long> {
|
||||
|
||||
@Override
|
||||
void someMethod(Integer s, String t, Long r) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -448,10 +453,12 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
public class MyBoo implements Boo<String, Integer> {
|
||||
|
||||
@Override
|
||||
public void foo(String e) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void foo(Integer t) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -478,12 +485,14 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
public interface SettingsDao<T extends Settings, S> extends Dao<T, S> {
|
||||
|
||||
@Override
|
||||
T load();
|
||||
}
|
||||
|
||||
|
||||
public interface ConcreteSettingsDao extends SettingsDao<ConcreteSettings, String> {
|
||||
|
||||
@Override
|
||||
String loadFromParent();
|
||||
}
|
||||
|
||||
@@ -500,6 +509,7 @@ public class BridgeMethodResolverTests {
|
||||
}
|
||||
|
||||
//@Transactional(readOnly = true)
|
||||
@Override
|
||||
public S loadFromParent() {
|
||||
return otherObject;
|
||||
}
|
||||
@@ -513,6 +523,7 @@ public class BridgeMethodResolverTests {
|
||||
}
|
||||
|
||||
//@Transactional(readOnly = true)
|
||||
@Override
|
||||
public ConcreteSettings load() {
|
||||
return super.object;
|
||||
}
|
||||
@@ -527,6 +538,7 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
private static class AbstractBounded<E> implements Bounded<E> {
|
||||
|
||||
@Override
|
||||
public boolean boundedOperation(E myE) {
|
||||
return true;
|
||||
}
|
||||
@@ -535,6 +547,7 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
private static class SerializableBounded<E extends HashMap & Delayed> extends AbstractBounded<E> {
|
||||
|
||||
@Override
|
||||
public boolean boundedOperation(E myE) {
|
||||
return false;
|
||||
}
|
||||
@@ -549,6 +562,7 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
private static class StringGenericParameter implements GenericParameter<String> {
|
||||
|
||||
@Override
|
||||
public String getFor(Class<String> cls) {
|
||||
return "foo";
|
||||
}
|
||||
@@ -561,94 +575,117 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
private static class StringList implements List<String> {
|
||||
|
||||
@Override
|
||||
public int size() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean contains(Object o) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterator<String> iterator() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] toArray() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T[] toArray(T[] a) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean add(String o) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean remove(Object o) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean containsAll(Collection<?> c) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addAll(Collection<? extends String> c) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addAll(int index, Collection<? extends String> c) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeAll(Collection<?> c) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean retainAll(Collection<?> c) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void clear() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String get(int index) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String set(int index, String element) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(int index, String element) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String remove(int index) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int indexOf(Object o) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int lastIndexOf(Object o) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListIterator<String> listIterator() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListIterator<String> listIterator(int index) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> subList(int fromIndex, int toIndex) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -665,6 +702,7 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
private int priority;
|
||||
|
||||
@Override
|
||||
public int getPriority() {
|
||||
return priority;
|
||||
}
|
||||
@@ -743,6 +781,7 @@ public class BridgeMethodResolverTests {
|
||||
*/
|
||||
public abstract Receiver<T> getInstance();
|
||||
|
||||
@Override
|
||||
public void setChannel(Channel channel) {
|
||||
this.channel = channel;
|
||||
}
|
||||
@@ -753,10 +792,12 @@ public class BridgeMethodResolverTests {
|
||||
this.beanName = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subscribe() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsubscribe() {
|
||||
|
||||
}
|
||||
@@ -800,6 +841,7 @@ public class BridgeMethodResolverTests {
|
||||
super(NewMessageEvent.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receive(MessageEvent event) {
|
||||
throw new UnsupportedOperationException("should not be called, use subclassed events");
|
||||
}
|
||||
@@ -861,6 +903,7 @@ public class BridgeMethodResolverTests {
|
||||
public void setRepos(R... reps) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> SimpleGenericRepository<T> getFor(Class<T> entityType) {
|
||||
return null;
|
||||
}
|
||||
@@ -896,40 +939,50 @@ public class BridgeMethodResolverTests {
|
||||
public void setPersistentClass(Class<T> c) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<T> getPersistentClass() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T findById(ID id, boolean lock) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<T> findAll() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<T> findByExample(T exampleInstance) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<T> findByQuery() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public T saveOrUpdate(T entity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(T entity) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public T refresh(T entity) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(ID id) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delete(Collection<T> entities) {
|
||||
}
|
||||
}
|
||||
@@ -937,9 +990,11 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
public class HibernateRepositoryRegistry extends SettableRepositoryRegistry<GenericHibernateRepository<?, ?>> {
|
||||
|
||||
@Override
|
||||
public void injectInto(GenericHibernateRepository<?, ?> rep) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> GenericHibernateRepository<T, ?> getFor(Class<T> entityType) {
|
||||
return null;
|
||||
}
|
||||
@@ -958,6 +1013,7 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
public class MyHomer<T extends Bounded<T>, L extends T> implements Homer<L> {
|
||||
|
||||
@Override
|
||||
public void foo(L t) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -966,6 +1022,7 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
public class YourHomer<T extends AbstractBounded<T>, L extends T> extends MyHomer<T, L> {
|
||||
|
||||
@Override
|
||||
public void foo(L t) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -984,6 +1041,7 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
public class GenericSqlMapDao<T extends Serializable> implements ConvenienceGenericDao<T> {
|
||||
|
||||
@Override
|
||||
public void saveOrUpdate(T t) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -992,6 +1050,7 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
public class GenericSqlMapIntegerDao<T extends Integer> extends GenericSqlMapDao<T> {
|
||||
|
||||
@Override
|
||||
public void saveOrUpdate(T t) {
|
||||
}
|
||||
}
|
||||
@@ -1027,9 +1086,11 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
public class UserDaoImpl extends AbstractDao<User> implements UserDao {
|
||||
|
||||
@Override
|
||||
public void save(Permission perm) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveVararg(User user, Object... args) {
|
||||
}
|
||||
}
|
||||
@@ -1053,9 +1114,11 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
public class BusinessDao extends BusinessGenericDao<Business<?>, Long> {
|
||||
|
||||
@Override
|
||||
public void save(Business<?> business) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Business<?> get(Long id) {
|
||||
return null;
|
||||
}
|
||||
@@ -1110,6 +1173,7 @@ public class BridgeMethodResolverTests {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void receive(MegaMessageEvent event) {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
@@ -1136,6 +1200,7 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
private static abstract class AbstractImplementsInterface<D extends DomainObjectSuper> implements IGenericInterface<D> {
|
||||
|
||||
@Override
|
||||
public <T> void doSomething(D domainObject, T value) {
|
||||
}
|
||||
|
||||
@@ -1175,10 +1240,12 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
private static class DomainObject extends AbstractDomainObject<ParameterType, byte[]> {
|
||||
|
||||
@Override
|
||||
public byte[] method1(ParameterType p) {
|
||||
return super.method1(p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void method2(ParameterType p, byte[] r) {
|
||||
super.method2(p, r);
|
||||
}
|
||||
@@ -1215,6 +1282,7 @@ public class BridgeMethodResolverTests {
|
||||
public static class ExternalMessageProvider<S extends ExternalMessage, T extends ExternalMessageSearchConditions<S>>
|
||||
implements IExternalMessageProvider<S, T> {
|
||||
|
||||
@Override
|
||||
public Collection<S> findBy(T conditions) {
|
||||
return null;
|
||||
}
|
||||
@@ -1235,6 +1303,7 @@ public class BridgeMethodResolverTests {
|
||||
|
||||
public static class TestEmailProvider extends EmailMessageProvider {
|
||||
|
||||
@Override
|
||||
public Collection<EmailMessage> findBy(EmailSearchConditions conditions) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ public class DefaultControlFlowTests extends AbstractControlFlowTests {
|
||||
public void testThisClassPlease() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ControlFlow createControlFlow() {
|
||||
return ControlFlowFactory.createControlFlow();
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import org.springframework.core.io.Resource;
|
||||
*/
|
||||
public class GenericCollectionTypeResolverTests extends AbstractGenericsTests {
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
this.targetClass = Foo.class;
|
||||
this.methods = new String[] {"a", "b", "b2", "b3", "c", "d", "d2", "d3", "e", "e2", "e3"};
|
||||
@@ -44,6 +45,7 @@ public class GenericCollectionTypeResolverTests extends AbstractGenericsTests {
|
||||
Integer.class, Integer.class, Integer.class, Integer.class, Integer.class};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Type getType(Method method) {
|
||||
return GenericCollectionTypeResolver.getMapValueReturnType(method);
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ public class Jdk14ControlFlowTests extends AbstractControlFlowTests {
|
||||
public void testThisClassPlease() {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ControlFlow createControlFlow() {
|
||||
return ControlFlowFactory.createControlFlow();
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ public final class OrderComparatorTests extends TestCase {
|
||||
private Comparator comparator;
|
||||
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
this.comparator = new OrderComparator();
|
||||
}
|
||||
@@ -64,6 +65,7 @@ public final class OrderComparatorTests extends TestCase {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOrder() {
|
||||
return this.order;
|
||||
}
|
||||
|
||||
@@ -31,18 +31,22 @@ public class PrioritizedParameterNameDiscovererTests extends TestCase {
|
||||
private static final String[] SOMETHING_ELSE = new String[] { "something", "else" };
|
||||
|
||||
ParameterNameDiscoverer returnsFooBar = new ParameterNameDiscoverer() {
|
||||
@Override
|
||||
public String[] getParameterNames(Method m) {
|
||||
return FOO_BAR;
|
||||
}
|
||||
@Override
|
||||
public String[] getParameterNames(Constructor ctor) {
|
||||
return FOO_BAR;
|
||||
}
|
||||
};
|
||||
|
||||
ParameterNameDiscoverer returnsSomethingElse = new ParameterNameDiscoverer() {
|
||||
@Override
|
||||
public String[] getParameterNames(Method m) {
|
||||
return SOMETHING_ELSE;
|
||||
}
|
||||
@Override
|
||||
public String[] getParameterNames(Constructor ctor) {
|
||||
return SOMETHING_ELSE;
|
||||
}
|
||||
|
||||
@@ -258,6 +258,7 @@ public class AnnotationUtilsTests {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromInterfaceImplementedByRoot() {
|
||||
|
||||
}
|
||||
@@ -290,6 +291,7 @@ public class AnnotationUtilsTests {
|
||||
|
||||
public static class SimpleFoo extends Foo<String> {
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void something(final String arg) {
|
||||
|
||||
@@ -339,12 +341,14 @@ public class AnnotationUtilsTests {
|
||||
|
||||
public static class ImplementsInterfaceWithAnnotatedMethod implements InterfaceWithAnnotatedMethod {
|
||||
|
||||
@Override
|
||||
public void foo() {
|
||||
}
|
||||
}
|
||||
|
||||
public static class SubOfImplementsInterfaceWithAnnotatedMethod extends ImplementsInterfaceWithAnnotatedMethod {
|
||||
|
||||
@Override
|
||||
public void foo() {
|
||||
}
|
||||
}
|
||||
@@ -354,6 +358,7 @@ public class AnnotationUtilsTests {
|
||||
|
||||
public static class SubOfAbstractImplementsInterfaceWithAnnotatedMethod extends AbstractDoesNotImplementInterfaceWithAnnotatedMethod {
|
||||
|
||||
@Override
|
||||
public void foo() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,34 +255,42 @@ public class TypeDescriptorTests {
|
||||
|
||||
public class IntegerType implements GenericType<Integer> {
|
||||
|
||||
@Override
|
||||
public Integer getProperty() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProperty(Integer t) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Integer> getListProperty() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setListProperty(List<Integer> t) {
|
||||
}
|
||||
}
|
||||
|
||||
public class NumberType implements GenericType<Number> {
|
||||
|
||||
@Override
|
||||
public Integer getProperty() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProperty(Number t) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Number> getListProperty() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setListProperty(List<Number> t) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +120,7 @@ public class ConvertingComparatorTests {
|
||||
|
||||
private static class StringToInteger implements Converter<String, Integer> {
|
||||
|
||||
@Override
|
||||
public Integer convert(String source) {
|
||||
return new Integer(source);
|
||||
}
|
||||
@@ -131,6 +132,7 @@ public class ConvertingComparatorTests {
|
||||
|
||||
private boolean called;
|
||||
|
||||
@Override
|
||||
public int compare(Integer o1, Integer o2) {
|
||||
assertThat(o1, instanceOf(Integer.class));
|
||||
assertThat(o2, instanceOf(Integer.class));
|
||||
|
||||
@@ -223,50 +223,62 @@ public class CollectionToCollectionConverterTests {
|
||||
|
||||
public static abstract class BaseResource implements Resource {
|
||||
|
||||
@Override
|
||||
public InputStream getInputStream() throws IOException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean exists() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isReadable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpen() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getURL() throws IOException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public URI getURI() throws IOException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public File getFile() throws IOException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long contentLength() throws IOException {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long lastModified() throws IOException {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Resource createRelative(String relativePath) throws IOException {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFilename() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -307,6 +307,7 @@ public class DefaultConversionTests {
|
||||
}
|
||||
|
||||
public class ColorConverter implements Converter<String, Color> {
|
||||
@Override
|
||||
public Color convert(String source) { if (!source.startsWith("#")) source = "#" + source; return Color.decode(source); }
|
||||
}
|
||||
|
||||
|
||||
@@ -143,6 +143,7 @@ public class GenericConversionServiceTests {
|
||||
public void addConverterNoSourceTargetClassInfoAvailable() {
|
||||
try {
|
||||
conversionService.addConverter(new Converter() {
|
||||
@Override
|
||||
public Object convert(Object source) {
|
||||
return source;
|
||||
}
|
||||
@@ -201,6 +202,7 @@ public class GenericConversionServiceTests {
|
||||
@Test
|
||||
public void convertSuperSourceType() {
|
||||
conversionService.addConverter(new Converter<CharSequence, Integer>() {
|
||||
@Override
|
||||
public Integer convert(CharSequence source) {
|
||||
return Integer.valueOf(source.toString());
|
||||
}
|
||||
@@ -218,6 +220,7 @@ public class GenericConversionServiceTests {
|
||||
}
|
||||
|
||||
public class ColorConverter implements Converter<String, Color> {
|
||||
@Override
|
||||
public Color convert(String source) { if (!source.startsWith("#")) source = "#" + source; return Color.decode(source); }
|
||||
}
|
||||
|
||||
@@ -503,6 +506,7 @@ public class GenericConversionServiceTests {
|
||||
|
||||
private static class MyBaseInterfaceConverter implements Converter<MyBaseInterface, String> {
|
||||
|
||||
@Override
|
||||
public String convert(MyBaseInterface source) {
|
||||
return "RESULT";
|
||||
}
|
||||
@@ -511,6 +515,7 @@ public class GenericConversionServiceTests {
|
||||
|
||||
private static class MyStringArrayToResourceArrayConverter implements Converter<String[], Resource[]> {
|
||||
|
||||
@Override
|
||||
public Resource[] convert(String[] source) {
|
||||
Resource[] result = new Resource[source.length];
|
||||
for (int i = 0; i < source.length; i++) {
|
||||
@@ -523,6 +528,7 @@ public class GenericConversionServiceTests {
|
||||
|
||||
private static class MyStringArrayToIntegerArrayConverter implements Converter<String[], Integer[]> {
|
||||
|
||||
@Override
|
||||
public Integer[] convert(String[] source) {
|
||||
Integer[] result = new Integer[source.length];
|
||||
for (int i = 0; i < source.length; i++) {
|
||||
@@ -535,6 +541,7 @@ public class GenericConversionServiceTests {
|
||||
|
||||
private static class MyStringToIntegerArrayConverter implements Converter<String, Integer[]> {
|
||||
|
||||
@Override
|
||||
public Integer[] convert(String source) {
|
||||
String[] srcArray = StringUtils.commaDelimitedListToStringArray(source);
|
||||
Integer[] result = new Integer[srcArray.length];
|
||||
@@ -673,10 +680,12 @@ public class GenericConversionServiceTests {
|
||||
GenericConversionService conversionService = new GenericConversionService();
|
||||
GenericConverter converter = new GenericConverter() {
|
||||
|
||||
@Override
|
||||
public Set<ConvertiblePair> getConvertibleTypes() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object convert(Object source, TypeDescriptor sourceType,
|
||||
TypeDescriptor targetType) {
|
||||
return null;
|
||||
@@ -716,6 +725,7 @@ public class GenericConversionServiceTests {
|
||||
public void convertCannotOptimizeArray() throws Exception {
|
||||
GenericConversionService conversionService = new GenericConversionService();
|
||||
conversionService.addConverter(new Converter<Byte, Byte>() {
|
||||
@Override
|
||||
public Byte convert(Byte source) {
|
||||
return (byte) (source + 1);
|
||||
}
|
||||
@@ -764,11 +774,13 @@ public class GenericConversionServiceTests {
|
||||
|
||||
private int matchAttempts = 0;
|
||||
|
||||
@Override
|
||||
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
|
||||
matchAttempts++;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Color convert(String source) {
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
@@ -783,15 +795,18 @@ public class GenericConversionServiceTests {
|
||||
|
||||
private List<TypeDescriptor> sourceTypes = new ArrayList<TypeDescriptor>();
|
||||
|
||||
@Override
|
||||
public Set<ConvertiblePair> getConvertibleTypes() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
|
||||
sourceTypes.add(sourceType);
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object convert(Object source, TypeDescriptor sourceType,
|
||||
TypeDescriptor targetType) {
|
||||
return null;
|
||||
@@ -809,11 +824,13 @@ public class GenericConversionServiceTests {
|
||||
|
||||
private int matchAttempts = 0;
|
||||
|
||||
@Override
|
||||
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
|
||||
matchAttempts++;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T extends Color> Converter<String, T> getConverter(Class<T> targetType) {
|
||||
return (Converter<String, T>) converter;
|
||||
@@ -834,6 +851,7 @@ public class GenericConversionServiceTests {
|
||||
|
||||
public static enum MyEnum implements MyEnumInterface {
|
||||
A {
|
||||
@Override
|
||||
public String getCode() {
|
||||
return "1";
|
||||
}
|
||||
@@ -842,6 +860,7 @@ public class GenericConversionServiceTests {
|
||||
|
||||
private static class MyEnumInterfaceToStringConverter<T extends MyEnumInterface>
|
||||
implements Converter<T, String> {
|
||||
@Override
|
||||
public String convert(T source) {
|
||||
return source.getCode();
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ public class LabeledEnumTests extends TestCase {
|
||||
|
||||
public static final Dog GOLDEN_RETRIEVER = new Dog(11, null) {
|
||||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
return "Golden Retriever";
|
||||
}
|
||||
@@ -143,6 +144,7 @@ public class LabeledEnumTests extends TestCase {
|
||||
// Overriding getType() is no longer necessary as of Spring 2.5;
|
||||
// however, this is left here to provide valid testing for
|
||||
// backwards compatibility.
|
||||
@Override
|
||||
public Class getType() {
|
||||
return Dog.class;
|
||||
}
|
||||
@@ -165,12 +167,14 @@ public class LabeledEnumTests extends TestCase {
|
||||
private static abstract class ValuedEnum extends StaticLabeledEnum {
|
||||
|
||||
public static final ValuedEnum ONE = new ValuedEnum(1, "one") {
|
||||
@Override
|
||||
public int getValue() {
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
|
||||
public static final ValuedEnum TWO = new ValuedEnum(2, "two") {
|
||||
@Override
|
||||
public int getValue() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@@ -186,9 +186,11 @@ public class ResourceTests {
|
||||
final String name = "test-resource";
|
||||
|
||||
Resource resource = new AbstractResource() {
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return name;
|
||||
}
|
||||
@Override
|
||||
public InputStream getInputStream() {
|
||||
return null;
|
||||
}
|
||||
@@ -222,9 +224,11 @@ public class ResourceTests {
|
||||
@Test
|
||||
public void testContentLength() throws IOException {
|
||||
AbstractResource resource = new AbstractResource() {
|
||||
@Override
|
||||
public InputStream getInputStream() throws IOException {
|
||||
return new ByteArrayInputStream(new byte[] { 'a', 'b', 'c' });
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return null;
|
||||
}
|
||||
@@ -235,9 +239,11 @@ public class ResourceTests {
|
||||
@Test(expected=IllegalStateException.class)
|
||||
public void testContentLength_withNullInputStream() throws IOException {
|
||||
AbstractResource resource = new AbstractResource() {
|
||||
@Override
|
||||
public InputStream getInputStream() throws IOException {
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.springframework.core.annotation.Order;
|
||||
@Order(1)
|
||||
public class MyDummyFactory1 implements DummyFactory {
|
||||
|
||||
@Override
|
||||
public String getString() {
|
||||
return "Foo";
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import org.springframework.core.annotation.Order;
|
||||
@Order(2)
|
||||
public class MyDummyFactory2 implements DummyFactory {
|
||||
|
||||
@Override
|
||||
public String getString() {
|
||||
return "Bar";
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ public class ToStringCreatorTests extends TestCase {
|
||||
|
||||
private SomeObject s1, s2, s3;
|
||||
|
||||
@Override
|
||||
protected void setUp() throws Exception {
|
||||
s1 = new SomeObject() {
|
||||
public String toString() {
|
||||
|
||||
@@ -56,6 +56,7 @@ public final class SimpleAsyncTaskExecutorTests extends TestCase {
|
||||
public void testThreadFactoryOverridesDefaults() throws Exception {
|
||||
final Object monitor = new Object();
|
||||
SimpleAsyncTaskExecutor executor = new SimpleAsyncTaskExecutor(new ThreadFactory() {
|
||||
@Override
|
||||
public Thread newThread(Runnable r) {
|
||||
return new Thread(r, "test");
|
||||
}
|
||||
@@ -88,6 +89,7 @@ public final class SimpleAsyncTaskExecutorTests extends TestCase {
|
||||
|
||||
private static final class NoOpRunnable implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
// no-op
|
||||
}
|
||||
@@ -102,6 +104,7 @@ public final class SimpleAsyncTaskExecutorTests extends TestCase {
|
||||
this.monitor = monitor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void run() {
|
||||
synchronized (this.monitor) {
|
||||
try {
|
||||
@@ -129,6 +132,7 @@ public final class SimpleAsyncTaskExecutorTests extends TestCase {
|
||||
return this.threadName;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doRun() {
|
||||
this.threadName = Thread.currentThread().getName();
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ public class AutoPopulatingListTests extends TestCase {
|
||||
|
||||
private static class MockElementFactory implements AutoPopulatingList.ElementFactory {
|
||||
|
||||
@Override
|
||||
public Object createElement(int index) {
|
||||
TestBean bean = new TestBean();
|
||||
bean.setAge(index);
|
||||
|
||||
@@ -99,6 +99,7 @@ public class CachingMapDecoratorTests extends TestCase {
|
||||
|
||||
private boolean createCalled;
|
||||
|
||||
@Override
|
||||
protected String create(String key) {
|
||||
createCalled = true;
|
||||
return (key != null ? "expensive value to cache" : null);
|
||||
|
||||
@@ -41,6 +41,7 @@ import org.springframework.beans.TestBean;
|
||||
*/
|
||||
public class ClassUtilsTests extends TestCase {
|
||||
|
||||
@Override
|
||||
public void setUp() {
|
||||
InnerClass.noArgCalled = false;
|
||||
InnerClass.argCalled = false;
|
||||
|
||||
@@ -490,6 +490,7 @@ public class ConcurrentReferenceHashMapTests {
|
||||
StopWatch mapTime = timeMultiThreaded("SynchronizedMap", synchronizedMap,
|
||||
new ValueFactory<WeakReference<String>>() {
|
||||
|
||||
@Override
|
||||
public WeakReference<String> newValue(int v) {
|
||||
return new WeakReference<String>(String.valueOf(v));
|
||||
}
|
||||
@@ -500,6 +501,7 @@ public class ConcurrentReferenceHashMapTests {
|
||||
StopWatch cacheTime = timeMultiThreaded("WeakConcurrentCache", this.map,
|
||||
new ValueFactory<String>() {
|
||||
|
||||
@Override
|
||||
public String newValue(int v) {
|
||||
return String.valueOf(v);
|
||||
}
|
||||
@@ -650,18 +652,22 @@ public class ConcurrentReferenceHashMapTests {
|
||||
this.queue = queue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Entry<K, V> get() {
|
||||
return this.entry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHash() {
|
||||
return this.hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Reference<K, V> getNext() {
|
||||
return this.next;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void release() {
|
||||
this.queue.add(this);
|
||||
this.entry = null;
|
||||
|
||||
@@ -73,6 +73,7 @@ public class FileSystemUtilsTests extends TestCase {
|
||||
assertTrue(!src.exists());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void tearDown() throws Exception {
|
||||
File tmp = new File("./tmp");
|
||||
if (tmp.exists()) {
|
||||
|
||||
@@ -227,6 +227,7 @@ public class MethodInvokerTests extends TestCase {
|
||||
|
||||
private static class Purchaser implements Greetable {
|
||||
|
||||
@Override
|
||||
public String getGreeting() {
|
||||
return "hello";
|
||||
}
|
||||
@@ -235,6 +236,7 @@ public class MethodInvokerTests extends TestCase {
|
||||
|
||||
private static class Shopper extends Purchaser implements Person {
|
||||
|
||||
@Override
|
||||
public String getGreeting() {
|
||||
return "may I help you?";
|
||||
}
|
||||
@@ -243,6 +245,7 @@ public class MethodInvokerTests extends TestCase {
|
||||
|
||||
private static class Salesman implements Person {
|
||||
|
||||
@Override
|
||||
public String getGreeting() {
|
||||
return "how are sales?";
|
||||
}
|
||||
@@ -251,6 +254,7 @@ public class MethodInvokerTests extends TestCase {
|
||||
|
||||
private static class Customer extends Shopper {
|
||||
|
||||
@Override
|
||||
public String getGreeting() {
|
||||
return "good day";
|
||||
}
|
||||
@@ -265,6 +269,7 @@ public class MethodInvokerTests extends TestCase {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGreeting() {
|
||||
return "welcome back " + name ;
|
||||
}
|
||||
@@ -277,6 +282,7 @@ public class MethodInvokerTests extends TestCase {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGreeting() {
|
||||
return "whassup dude?";
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ public class MockLog4jAppender extends AppenderSkeleton {
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.log4j.AppenderSkeleton#append(org.apache.log4j.spi.LoggingEvent)
|
||||
*/
|
||||
@Override
|
||||
protected void append(LoggingEvent evt) {
|
||||
//System.out.println("Adding " + evt.getMessage());
|
||||
loggingStrings.add(evt.getMessage());
|
||||
@@ -42,6 +43,7 @@ public class MockLog4jAppender extends AppenderSkeleton {
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.log4j.Appender#close()
|
||||
*/
|
||||
@Override
|
||||
public void close() {
|
||||
closeCalled = true;
|
||||
}
|
||||
@@ -49,6 +51,7 @@ public class MockLog4jAppender extends AppenderSkeleton {
|
||||
/* (non-Javadoc)
|
||||
* @see org.apache.log4j.Appender#requiresLayout()
|
||||
*/
|
||||
@Override
|
||||
public boolean requiresLayout() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ public class PropertyPlaceholderHelperTests {
|
||||
|
||||
assertEquals("foo=bar",
|
||||
this.helper.replacePlaceholders(text, new PropertyPlaceholderHelper.PlaceholderResolver() {
|
||||
@Override
|
||||
public String resolvePlaceholder(String placeholderName) {
|
||||
if ("foo".equals(placeholderName)) {
|
||||
return "bar";
|
||||
|
||||
@@ -212,6 +212,7 @@ public class ReflectionUtilsTests {
|
||||
public void doWithProtectedMethods() {
|
||||
ListSavingMethodCallback mc = new ListSavingMethodCallback();
|
||||
ReflectionUtils.doWithMethods(TestBean.class, mc, new ReflectionUtils.MethodFilter() {
|
||||
@Override
|
||||
public boolean matches(Method m) {
|
||||
return Modifier.isProtected(m.getModifiers());
|
||||
}
|
||||
@@ -353,6 +354,7 @@ public class ReflectionUtilsTests {
|
||||
|
||||
private List<Method> methods = new LinkedList<Method>();
|
||||
|
||||
@Override
|
||||
public void doWith(Method m) throws IllegalArgumentException, IllegalAccessException {
|
||||
this.methodNames.add(m.getName());
|
||||
this.methods.add(m);
|
||||
|
||||
@@ -63,6 +63,7 @@ public class ResourceUtilsTests extends TestCase {
|
||||
*/
|
||||
private static class DummyURLStreamHandler extends URLStreamHandler {
|
||||
|
||||
@Override
|
||||
protected URLConnection openConnection(URL url) throws IOException {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user