Add missing @Override annotations

This commit is contained in:
Sam Brannen 2019-08-22 14:48:08 +02:00
parent 0b63db26b7
commit ad6231ad29
108 changed files with 321 additions and 0 deletions

View File

@ -182,10 +182,12 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
} }
@Override
public void setMetaClass(MetaClass metaClass) { public void setMetaClass(MetaClass metaClass) {
this.metaClass = metaClass; this.metaClass = metaClass;
} }
@Override
public MetaClass getMetaClass() { public MetaClass getMetaClass() {
return this.metaClass; return this.metaClass;
} }
@ -216,6 +218,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
* @return the number of bean definitions found * @return the number of bean definitions found
* @throws BeanDefinitionStoreException in case of loading or parsing errors * @throws BeanDefinitionStoreException in case of loading or parsing errors
*/ */
@Override
public int loadBeanDefinitions(Resource resource) throws BeanDefinitionStoreException { public int loadBeanDefinitions(Resource resource) throws BeanDefinitionStoreException {
return loadBeanDefinitions(new EncodedResource(resource)); return loadBeanDefinitions(new EncodedResource(resource));
} }
@ -376,6 +379,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
* This method overrides method invocation to create beans for each method name that * This method overrides method invocation to create beans for each method name that
* takes a class argument. * takes a class argument.
*/ */
@Override
@SuppressWarnings("rawtypes") @SuppressWarnings("rawtypes")
public Object invokeMethod(String name, Object arg) { public Object invokeMethod(String name, Object arg) {
Object[] args = (Object[])arg; Object[] args = (Object[])arg;
@ -609,6 +613,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
* This method overrides property setting in the scope of the {@code GroovyBeanDefinitionReader} * This method overrides property setting in the scope of the {@code GroovyBeanDefinitionReader}
* to set properties on the current bean definition. * to set properties on the current bean definition.
*/ */
@Override
public void setProperty(String name, Object value) { public void setProperty(String name, Object value) {
if (this.currentBeanDefinition != null) { if (this.currentBeanDefinition != null) {
applyPropertyToBeanDefinition(name, value); applyPropertyToBeanDefinition(name, value);
@ -656,6 +661,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
* properties from the {@code GroovyBeanDefinitionReader} itself * properties from the {@code GroovyBeanDefinitionReader} itself
* </ul> * </ul>
*/ */
@Override
public Object getProperty(String name) { public Object getProperty(String name) {
Binding binding = getBinding(); Binding binding = getBinding();
if (binding != null && binding.hasVariable(name)) { if (binding != null && binding.hasVariable(name)) {
@ -758,10 +764,12 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
this.metaClass = InvokerHelper.getMetaClass(this); this.metaClass = InvokerHelper.getMetaClass(this);
} }
@Override
public MetaClass getMetaClass() { public MetaClass getMetaClass() {
return this.metaClass; return this.metaClass;
} }
@Override
public Object getProperty(String property) { public Object getProperty(String property) {
if (property.equals("beanName")) { if (property.equals("beanName")) {
return getBeanName(); return getBeanName();
@ -778,14 +786,17 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
} }
} }
@Override
public Object invokeMethod(String name, Object args) { public Object invokeMethod(String name, Object args) {
return this.metaClass.invokeMethod(this, name, args); return this.metaClass.invokeMethod(this, name, args);
} }
@Override
public void setMetaClass(MetaClass metaClass) { public void setMetaClass(MetaClass metaClass) {
this.metaClass = metaClass; this.metaClass = metaClass;
} }
@Override
public void setProperty(String property, Object newValue) { public void setProperty(String property, Object newValue) {
if (!addDeferredProperty(property, newValue)) { if (!addDeferredProperty(property, newValue)) {
this.beanDefinition.getBeanDefinition().getPropertyValues().add(property, newValue); this.beanDefinition.getBeanDefinition().getPropertyValues().add(property, newValue);

View File

@ -612,6 +612,7 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
* should <i>not</i> have their own mutexes involved in singleton creation, * should <i>not</i> have their own mutexes involved in singleton creation,
* to avoid the potential for deadlocks in lazy-init situations. * to avoid the potential for deadlocks in lazy-init situations.
*/ */
@Override
public final Object getSingletonMutex() { public final Object getSingletonMutex() {
return this.singletonObjects; return this.singletonObjects;
} }

View File

@ -138,6 +138,7 @@ public class BeanWrapperTests extends AbstractPropertyAccessorTests {
} }
} }
@Override
@Test // Can't be shared: no type mismatch with a field @Test // Can't be shared: no type mismatch with a field
public void setPropertyTypeMismatch() { public void setPropertyTypeMismatch() {
PropertyTypeMismatch target = new PropertyTypeMismatch(); PropertyTypeMismatch target = new PropertyTypeMismatch();
@ -235,10 +236,12 @@ public class BeanWrapperTests extends AbstractPropertyAccessorTests {
private String name; private String name;
@Override
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
@Override
public String getName() { public String getName() {
if (this.name == null) { if (this.name == null) {
throw new RuntimeException("name property must be set"); throw new RuntimeException("name property must be set");

View File

@ -88,6 +88,7 @@ public class JCacheAspectSupport extends AbstractCacheInvoker implements Initial
return this.cacheOperationSource; return this.cacheOperationSource;
} }
@Override
public void afterPropertiesSet() { public void afterPropertiesSet() {
getCacheOperationSource(); getCacheOperationSource();

View File

@ -110,6 +110,7 @@ public class LocalDataSourceJobStore extends JobStoreCMT {
// Do nothing - a Spring-managed DataSource has its own lifecycle. // Do nothing - a Spring-managed DataSource has its own lifecycle.
} }
/* Quartz 2.2 initialize method */ /* Quartz 2.2 initialize method */
@Override
public void initialize() { public void initialize() {
// Do nothing - a Spring-managed DataSource has its own lifecycle. // Do nothing - a Spring-managed DataSource has its own lifecycle.
} }
@ -138,6 +139,7 @@ public class LocalDataSourceJobStore extends JobStoreCMT {
// Do nothing - a Spring-managed DataSource has its own lifecycle. // Do nothing - a Spring-managed DataSource has its own lifecycle.
} }
/* Quartz 2.2 initialize method */ /* Quartz 2.2 initialize method */
@Override
public void initialize() { public void initialize() {
// Do nothing - a Spring-managed DataSource has its own lifecycle. // Do nothing - a Spring-managed DataSource has its own lifecycle.
} }

View File

@ -81,6 +81,7 @@ public class ResourceLoaderClassLoadHelper implements ClassLoadHelper {
return ClassUtils.forName(name, this.resourceLoader.getClassLoader()); return ClassUtils.forName(name, this.resourceLoader.getClassLoader());
} }
@Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <T> Class<? extends T> loadClass(String name, Class<T> clazz) throws ClassNotFoundException { public <T> Class<? extends T> loadClass(String name, Class<T> clazz) throws ClassNotFoundException {
return (Class<? extends T>) loadClass(name); return (Class<? extends T>) loadClass(name);

View File

@ -367,12 +367,14 @@ public class SpringValidatorAdapterTests {
private String message; private String message;
@Override
public void initialize(Same constraintAnnotation) { public void initialize(Same constraintAnnotation) {
field = constraintAnnotation.field(); field = constraintAnnotation.field();
comparingField = constraintAnnotation.comparingField(); comparingField = constraintAnnotation.comparingField();
message = constraintAnnotation.message(); message = constraintAnnotation.message();
} }
@Override
public boolean isValid(Object value, ConstraintValidatorContext context) { public boolean isValid(Object value, ConstraintValidatorContext context) {
BeanWrapper beanWrapper = new BeanWrapperImpl(value); BeanWrapper beanWrapper = new BeanWrapperImpl(value);
Object fieldValue = beanWrapper.getPropertyValue(field); Object fieldValue = beanWrapper.getPropertyValue(field);

View File

@ -78,6 +78,7 @@ public class CacheEvictOperation extends CacheOperation {
return sb; return sb;
} }
@Override
public CacheEvictOperation build() { public CacheEvictOperation build() {
return new CacheEvictOperation(this); return new CacheEvictOperation(this);
} }

View File

@ -70,6 +70,7 @@ public class CachePutOperation extends CacheOperation {
return sb; return sb;
} }
@Override
public CachePutOperation build() { public CachePutOperation build() {
return new CachePutOperation(this); return new CachePutOperation(this);
} }

View File

@ -152,6 +152,7 @@ public class AnnotationConfigApplicationContext extends GenericApplicationContex
* @see #scan(String...) * @see #scan(String...)
* @see #refresh() * @see #refresh()
*/ */
@Override
public void register(Class<?>... annotatedClasses) { public void register(Class<?>... annotatedClasses) {
Assert.notEmpty(annotatedClasses, "At least one annotated class must be specified"); Assert.notEmpty(annotatedClasses, "At least one annotated class must be specified");
this.reader.register(annotatedClasses); this.reader.register(annotatedClasses);
@ -165,6 +166,7 @@ public class AnnotationConfigApplicationContext extends GenericApplicationContex
* @see #register(Class...) * @see #register(Class...)
* @see #refresh() * @see #refresh()
*/ */
@Override
public void scan(String... basePackages) { public void scan(String... basePackages) {
Assert.notEmpty(basePackages, "At least one base package must be specified"); Assert.notEmpty(basePackages, "At least one base package must be specified");
this.scanner.scan(basePackages); this.scanner.scan(basePackages);

View File

@ -45,6 +45,7 @@ public class DefaultEventListenerFactory implements EventListenerFactory, Ordere
} }
@Override
public boolean supportsMethod(Method method) { public boolean supportsMethod(Method method) {
return true; return true;
} }

View File

@ -225,18 +225,22 @@ public class GenericGroovyApplicationContext extends GenericApplicationContext i
// Implementation of the GroovyObject interface // Implementation of the GroovyObject interface
@Override
public void setMetaClass(MetaClass metaClass) { public void setMetaClass(MetaClass metaClass) {
this.metaClass = metaClass; this.metaClass = metaClass;
} }
@Override
public MetaClass getMetaClass() { public MetaClass getMetaClass() {
return this.metaClass; return this.metaClass;
} }
@Override
public Object invokeMethod(String name, Object args) { public Object invokeMethod(String name, Object args) {
return this.metaClass.invokeMethod(this, name, args); return this.metaClass.invokeMethod(this, name, args);
} }
@Override
public void setProperty(String property, Object newValue) { public void setProperty(String property, Object newValue) {
if (newValue instanceof BeanDefinition) { if (newValue instanceof BeanDefinition) {
registerBeanDefinition(property, (BeanDefinition) newValue); registerBeanDefinition(property, (BeanDefinition) newValue);
@ -246,6 +250,7 @@ public class GenericGroovyApplicationContext extends GenericApplicationContext i
} }
} }
@Override
@Nullable @Nullable
public Object getProperty(String property) { public Object getProperty(String property) {
if (containsBean(property)) { if (containsBean(property)) {

View File

@ -88,6 +88,7 @@ public class ConcurrentModel extends ConcurrentHashMap<String, Object> implement
* @param attributeValue the model attribute value (ignored if {@code null}, * @param attributeValue the model attribute value (ignored if {@code null},
* just removing an existing entry if any) * just removing an existing entry if any)
*/ */
@Override
public ConcurrentModel addAttribute(String attributeName, @Nullable Object attributeValue) { public ConcurrentModel addAttribute(String attributeName, @Nullable Object attributeValue) {
Assert.notNull(attributeName, "Model attribute name must not be null"); Assert.notNull(attributeName, "Model attribute name must not be null");
put(attributeName, attributeValue); put(attributeName, attributeValue);
@ -103,6 +104,7 @@ public class ConcurrentModel extends ConcurrentHashMap<String, Object> implement
* than for empty collections as is already done by JSTL tags.</i> * than for empty collections as is already done by JSTL tags.</i>
* @param attributeValue the model attribute value (never {@code null}) * @param attributeValue the model attribute value (never {@code null})
*/ */
@Override
public ConcurrentModel addAttribute(Object attributeValue) { public ConcurrentModel addAttribute(Object attributeValue) {
Assert.notNull(attributeValue, "Model attribute value must not be null"); Assert.notNull(attributeValue, "Model attribute value must not be null");
if (attributeValue instanceof Collection && ((Collection<?>) attributeValue).isEmpty()) { if (attributeValue instanceof Collection && ((Collection<?>) attributeValue).isEmpty()) {
@ -116,6 +118,7 @@ public class ConcurrentModel extends ConcurrentHashMap<String, Object> implement
* {@code Map}, using attribute name generation for each element. * {@code Map}, using attribute name generation for each element.
* @see #addAttribute(Object) * @see #addAttribute(Object)
*/ */
@Override
public ConcurrentModel addAllAttributes(@Nullable Collection<?> attributeValues) { public ConcurrentModel addAllAttributes(@Nullable Collection<?> attributeValues) {
if (attributeValues != null) { if (attributeValues != null) {
for (Object attributeValue : attributeValues) { for (Object attributeValue : attributeValues) {
@ -129,6 +132,7 @@ public class ConcurrentModel extends ConcurrentHashMap<String, Object> implement
* Copy all attributes in the supplied {@code Map} into this {@code Map}. * Copy all attributes in the supplied {@code Map} into this {@code Map}.
* @see #addAttribute(String, Object) * @see #addAttribute(String, Object)
*/ */
@Override
public ConcurrentModel addAllAttributes(@Nullable Map<String, ?> attributes) { public ConcurrentModel addAllAttributes(@Nullable Map<String, ?> attributes) {
if (attributes != null) { if (attributes != null) {
putAll(attributes); putAll(attributes);
@ -141,6 +145,7 @@ public class ConcurrentModel extends ConcurrentHashMap<String, Object> implement
* with existing objects of the same name taking precedence (i.e. not getting * with existing objects of the same name taking precedence (i.e. not getting
* replaced). * replaced).
*/ */
@Override
public ConcurrentModel mergeAttributes(@Nullable Map<String, ?> attributes) { public ConcurrentModel mergeAttributes(@Nullable Map<String, ?> attributes) {
if (attributes != null) { if (attributes != null) {
attributes.forEach((key, value) -> { attributes.forEach((key, value) -> {
@ -157,6 +162,7 @@ public class ConcurrentModel extends ConcurrentHashMap<String, Object> implement
* @param attributeName the name of the model attribute (never {@code null}) * @param attributeName the name of the model attribute (never {@code null})
* @return whether this model contains a corresponding attribute * @return whether this model contains a corresponding attribute
*/ */
@Override
public boolean containsAttribute(String attributeName) { public boolean containsAttribute(String attributeName) {
return containsKey(attributeName); return containsKey(attributeName);
} }

View File

@ -414,6 +414,7 @@ public class LocalValidatorFactoryBean extends SpringValidatorAdapter
throw new ValidationException("Cannot unwrap to " + type); throw new ValidationException("Cannot unwrap to " + type);
} }
@Override
public void close() { public void close() {
if (this.validatorFactory != null) { if (this.validatorFactory != null) {
this.validatorFactory.close(); this.validatorFactory.close();

View File

@ -57,6 +57,7 @@ public class SpringConstraintValidatorFactory implements ConstraintValidatorFact
} }
// Bean Validation 1.1 releaseInstance method // Bean Validation 1.1 releaseInstance method
@Override
public void releaseInstance(ConstraintValidator<?, ?> instance) { public void releaseInstance(ConstraintValidator<?, ?> instance) {
this.beanFactory.destroyBean(instance); this.beanFactory.destroyBean(instance);
} }

View File

@ -1003,22 +1003,27 @@ class TestScope implements Scope {
int instanceCount int instanceCount
@Override
public Object remove(String name) { public Object remove(String name) {
// do nothing // do nothing
} }
@Override
public void registerDestructionCallback(String name, Runnable callback) { public void registerDestructionCallback(String name, Runnable callback) {
} }
@Override
public String getConversationId() { public String getConversationId() {
return "mock" return "mock"
} }
@Override
public Object get(String name, ObjectFactory<?> objectFactory) { public Object get(String name, ObjectFactory<?> objectFactory) {
instanceCount++ instanceCount++
objectFactory.getObject() objectFactory.getObject()
} }
@Override
public Object resolveContextualObject(String s) { public Object resolveContextualObject(String s) {
return null; // noop return null; // noop
} }

View File

@ -183,6 +183,7 @@ public class CacheErrorHandlerTests {
return new SimpleService(); return new SimpleService();
} }
@Override
@Bean @Bean
public CacheManager cacheManager() { public CacheManager cacheManager() {
SimpleCacheManager cacheManager = new SimpleCacheManager(); SimpleCacheManager cacheManager = new SimpleCacheManager();

View File

@ -1281,6 +1281,7 @@ public class ConfigurationClassPostProcessorTests {
public interface RepositoryInterface<T> { public interface RepositoryInterface<T> {
@Override
String toString(); String toString();
} }

View File

@ -167,6 +167,7 @@ public class LazyAutowiredAnnotationBeanPostProcessorTests {
@Autowired @Lazy @Autowired @Lazy
private List<TestBean> testBeans; private List<TestBean> testBeans;
@Override
public TestBean getTestBean() { public TestBean getTestBean() {
return this.testBean; return this.testBean;
} }
@ -185,6 +186,7 @@ public class LazyAutowiredAnnotationBeanPostProcessorTests {
@Autowired(required = false) @Lazy @Autowired(required = false) @Lazy
private List<TestBean> testBeans; private List<TestBean> testBeans;
@Override
public TestBean getTestBean() { public TestBean getTestBean() {
return this.testBean; return this.testBean;
} }
@ -200,6 +202,7 @@ public class LazyAutowiredAnnotationBeanPostProcessorTests {
@LazyInject @LazyInject
private TestBean testBean; private TestBean testBean;
@Override
public TestBean getTestBean() { public TestBean getTestBean() {
return this.testBean; return this.testBean;
} }
@ -218,6 +221,7 @@ public class LazyAutowiredAnnotationBeanPostProcessorTests {
this.testBean = testBean; this.testBean = testBean;
} }
@Override
public TestBean getTestBean() { public TestBean getTestBean() {
return this.testBean; return this.testBean;
} }
@ -236,6 +240,7 @@ public class LazyAutowiredAnnotationBeanPostProcessorTests {
this.testBean = testBean; this.testBean = testBean;
} }
@Override
public TestBean getTestBean() { public TestBean getTestBean() {
return this.testBean; return this.testBean;
} }
@ -254,6 +259,7 @@ public class LazyAutowiredAnnotationBeanPostProcessorTests {
this.testBean = testBean; this.testBean = testBean;
} }
@Override
public TestBean getTestBean() { public TestBean getTestBean() {
return this.testBean; return this.testBean;
} }
@ -269,6 +275,7 @@ public class LazyAutowiredAnnotationBeanPostProcessorTests {
this.testBean = testBean; this.testBean = testBean;
} }
@Override
public TestBean getTestBean() { public TestBean getTestBean() {
return this.testBean; return this.testBean;
} }
@ -284,6 +291,7 @@ public class LazyAutowiredAnnotationBeanPostProcessorTests {
this.testBean = testBean; this.testBean = testBean;
} }
@Override
public TestBean getTestBean() { public TestBean getTestBean() {
return this.testBean; return this.testBean;
} }
@ -299,6 +307,7 @@ public class LazyAutowiredAnnotationBeanPostProcessorTests {
this.testBean = testBean; this.testBean = testBean;
} }
@Override
public TestBean getTestBean() { public TestBean getTestBean() {
return this.testBean; return this.testBean;
} }

View File

@ -361,6 +361,7 @@ public class ConfigurationClassProcessingTests {
static TestBean testBean = new TestBean(ConfigWithBeanWithProviderImplementation.class.getSimpleName()); static TestBean testBean = new TestBean(ConfigWithBeanWithProviderImplementation.class.getSimpleName());
@Override
@Bean(name = "customName") @Bean(name = "customName")
public TestBean get() { public TestBean get() {
return testBean; return testBean;
@ -373,6 +374,7 @@ public class ConfigurationClassProcessingTests {
static Set<String> set = Collections.singleton("value"); static Set<String> set = Collections.singleton("value");
@Override
@Bean(name = "customName") @Bean(name = "customName")
public Set<String> get() { public Set<String> get() {
return set; return set;

View File

@ -42,6 +42,7 @@ public class ScannedComponent {
@Scope(proxyMode = ScopedProxyMode.INTERFACES, value = "prototype") @Scope(proxyMode = ScopedProxyMode.INTERFACES, value = "prototype")
public static class StateImpl implements State { public static class StateImpl implements State {
@Override
public String anyMethod() { public String anyMethod() {
return "anyMethod called"; return "anyMethod called";
} }

View File

@ -840,6 +840,7 @@ public class AnnotationDrivenEventListenerTests {
this.eventCollector.addEvent(this, event); this.eventCollector.addEvent(this, event);
} }
@Override
@EventListener @EventListener
@Async @Async
public void handleAsync(AnotherTestEvent event) { public void handleAsync(AnotherTestEvent event) {
@ -866,6 +867,7 @@ public class AnnotationDrivenEventListenerTests {
this.eventCollector.addEvent(this, event); this.eventCollector.addEvent(this, event);
} }
@Override
@EventListener @EventListener
@Async @Async
public void handleAsync(AnotherTestEvent event) { public void handleAsync(AnotherTestEvent event) {
@ -988,11 +990,13 @@ public class AnnotationDrivenEventListenerTests {
super.handleString(payload); super.handleString(payload);
} }
@Override
@ConditionalEvent("#root.event.timestamp > #p0") @ConditionalEvent("#root.event.timestamp > #p0")
public void handleTimestamp(Long timestamp) { public void handleTimestamp(Long timestamp) {
collectEvent(timestamp); collectEvent(timestamp);
} }
@Override
@ConditionalEvent("@conditionEvaluator.valid(#p0)") @ConditionalEvent("@conditionEvaluator.valid(#p0)")
public void handleRatio(Double ratio) { public void handleRatio(Double ratio) {
collectEvent(ratio); collectEvent(ratio);

View File

@ -633,6 +633,7 @@ public class ApplicationContextEventTests extends AbstractApplicationEventListen
private ApplicationContext applicationContext; private ApplicationContext applicationContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext) { public void setApplicationContext(ApplicationContext applicationContext) {
this.applicationContext = applicationContext; this.applicationContext = applicationContext;
} }

View File

@ -77,14 +77,17 @@ public class FactoryBeanAccessTests {
static class CarFactoryBean implements FactoryBean<Car> { static class CarFactoryBean implements FactoryBean<Car> {
@Override
public Car getObject() { public Car getObject() {
return new Car(); return new Car();
} }
@Override
public Class<Car> getObjectType() { public Class<Car> getObjectType() {
return Car.class; return Car.class;
} }
@Override
public boolean isSingleton() { public boolean isSingleton() {
return false; return false;
} }

View File

@ -565,11 +565,13 @@ public class AsyncExecutionTests {
@Async @Async
public static class AsyncClassBeanWithInterface implements RegularInterface { public static class AsyncClassBeanWithInterface implements RegularInterface {
@Override
public void doSomething(int i) { public void doSomething(int i) {
boolean condition = !Thread.currentThread().getName().equals(originalThreadName); boolean condition = !Thread.currentThread().getName().equals(originalThreadName);
assertThat(condition).isTrue(); assertThat(condition).isTrue();
} }
@Override
public Future<String> returnSomething(int i) { public Future<String> returnSomething(int i) {
boolean condition = !Thread.currentThread().getName().equals(originalThreadName); boolean condition = !Thread.currentThread().getName().equals(originalThreadName);
assertThat(condition).isTrue(); assertThat(condition).isTrue();

View File

@ -322,12 +322,14 @@ public class SpringValidatorAdapterTests {
private String message; private String message;
@Override
public void initialize(Same constraintAnnotation) { public void initialize(Same constraintAnnotation) {
field = constraintAnnotation.field(); field = constraintAnnotation.field();
comparingField = constraintAnnotation.comparingField(); comparingField = constraintAnnotation.comparingField();
message = constraintAnnotation.message(); message = constraintAnnotation.message();
} }
@Override
public boolean isValid(Object value, ConstraintValidatorContext context) { public boolean isValid(Object value, ConstraintValidatorContext context) {
BeanWrapper beanWrapper = new BeanWrapperImpl(value); BeanWrapper beanWrapper = new BeanWrapperImpl(value);
Object fieldValue = beanWrapper.getPropertyValue(field); Object fieldValue = beanWrapper.getPropertyValue(field);

View File

@ -4,6 +4,7 @@ import org.springframework.scripting.Calculator
class GroovyCalculator implements Calculator { class GroovyCalculator implements Calculator {
@Override
int add(int x, int y) { int add(int x, int y) {
return x + y; return x + y;
} }

View File

@ -10,10 +10,12 @@ class GroovyCallCounter implements CallCounter {
count = 0; count = 0;
} }
@Override
void before() { void before() {
count++; count++;
} }
@Override
int getCalls() { int getCalls() {
return count; return count;
} }

View File

@ -6,6 +6,7 @@ class DelegatingCalculator implements Calculator {
def Calculator delegate; def Calculator delegate;
@Override
int add(int x, int y) { int add(int x, int y) {
//println "hello" //println "hello"
//println this.metaClass.getClass() //println this.metaClass.getClass()

View File

@ -9,10 +9,12 @@ class GroovyScriptBean implements ContextScriptBean, ApplicationContextAware {
private int age private int age
@Override
int getAge() { int getAge() {
return this.age return this.age
} }
@Override
void setAge(int age) { void setAge(int age) {
this.age = age this.age = age
} }

View File

@ -4,14 +4,17 @@ import org.springframework.beans.factory.FactoryBean
class TestFactoryBean implements FactoryBean { class TestFactoryBean implements FactoryBean {
@Override
public boolean isSingleton() { public boolean isSingleton() {
true true
} }
@Override
public Class getObjectType() { public Class getObjectType() {
String.class String.class
} }
@Override
public Object getObject() { public Object getObject() {
"test" "test"
} }

View File

@ -54,91 +54,113 @@ abstract class AbstractMergedAnnotation<A extends Annotation> implements MergedA
return !hasDefaultValue(attributeName); return !hasDefaultValue(attributeName);
} }
@Override
public byte getByte(String attributeName) { public byte getByte(String attributeName) {
return getRequiredAttributeValue(attributeName, Byte.class); return getRequiredAttributeValue(attributeName, Byte.class);
} }
@Override
public byte[] getByteArray(String attributeName) { public byte[] getByteArray(String attributeName) {
return getRequiredAttributeValue(attributeName, byte[].class); return getRequiredAttributeValue(attributeName, byte[].class);
} }
@Override
public boolean getBoolean(String attributeName) { public boolean getBoolean(String attributeName) {
return getRequiredAttributeValue(attributeName, Boolean.class); return getRequiredAttributeValue(attributeName, Boolean.class);
} }
@Override
public boolean[] getBooleanArray(String attributeName) { public boolean[] getBooleanArray(String attributeName) {
return getRequiredAttributeValue(attributeName, boolean[].class); return getRequiredAttributeValue(attributeName, boolean[].class);
} }
@Override
public char getChar(String attributeName) { public char getChar(String attributeName) {
return getRequiredAttributeValue(attributeName, Character.class); return getRequiredAttributeValue(attributeName, Character.class);
} }
@Override
public char[] getCharArray(String attributeName) { public char[] getCharArray(String attributeName) {
return getRequiredAttributeValue(attributeName, char[].class); return getRequiredAttributeValue(attributeName, char[].class);
} }
@Override
public short getShort(String attributeName) { public short getShort(String attributeName) {
return getRequiredAttributeValue(attributeName, Short.class); return getRequiredAttributeValue(attributeName, Short.class);
} }
@Override
public short[] getShortArray(String attributeName) { public short[] getShortArray(String attributeName) {
return getRequiredAttributeValue(attributeName, short[].class); return getRequiredAttributeValue(attributeName, short[].class);
} }
@Override
public int getInt(String attributeName) { public int getInt(String attributeName) {
return getRequiredAttributeValue(attributeName, Integer.class); return getRequiredAttributeValue(attributeName, Integer.class);
} }
@Override
public int[] getIntArray(String attributeName) { public int[] getIntArray(String attributeName) {
return getRequiredAttributeValue(attributeName, int[].class); return getRequiredAttributeValue(attributeName, int[].class);
} }
@Override
public long getLong(String attributeName) { public long getLong(String attributeName) {
return getRequiredAttributeValue(attributeName, Long.class); return getRequiredAttributeValue(attributeName, Long.class);
} }
@Override
public long[] getLongArray(String attributeName) { public long[] getLongArray(String attributeName) {
return getRequiredAttributeValue(attributeName, long[].class); return getRequiredAttributeValue(attributeName, long[].class);
} }
@Override
public double getDouble(String attributeName) { public double getDouble(String attributeName) {
return getRequiredAttributeValue(attributeName, Double.class); return getRequiredAttributeValue(attributeName, Double.class);
} }
@Override
public double[] getDoubleArray(String attributeName) { public double[] getDoubleArray(String attributeName) {
return getRequiredAttributeValue(attributeName, double[].class); return getRequiredAttributeValue(attributeName, double[].class);
} }
@Override
public float getFloat(String attributeName) { public float getFloat(String attributeName) {
return getRequiredAttributeValue(attributeName, Float.class); return getRequiredAttributeValue(attributeName, Float.class);
} }
@Override
public float[] getFloatArray(String attributeName) { public float[] getFloatArray(String attributeName) {
return getRequiredAttributeValue(attributeName, float[].class); return getRequiredAttributeValue(attributeName, float[].class);
} }
@Override
public String getString(String attributeName) { public String getString(String attributeName) {
return getRequiredAttributeValue(attributeName, String.class); return getRequiredAttributeValue(attributeName, String.class);
} }
@Override
public String[] getStringArray(String attributeName) { public String[] getStringArray(String attributeName) {
return getRequiredAttributeValue(attributeName, String[].class); return getRequiredAttributeValue(attributeName, String[].class);
} }
@Override
public Class<?> getClass(String attributeName) { public Class<?> getClass(String attributeName) {
return getRequiredAttributeValue(attributeName, Class.class); return getRequiredAttributeValue(attributeName, Class.class);
} }
@Override
public Class<?>[] getClassArray(String attributeName) { public Class<?>[] getClassArray(String attributeName) {
return getRequiredAttributeValue(attributeName, Class[].class); return getRequiredAttributeValue(attributeName, Class[].class);
} }
@Override
public <E extends Enum<E>> E getEnum(String attributeName, Class<E> type) { public <E extends Enum<E>> E getEnum(String attributeName, Class<E> type) {
Assert.notNull(type, "Type must not be null"); Assert.notNull(type, "Type must not be null");
return getRequiredAttributeValue(attributeName, type); return getRequiredAttributeValue(attributeName, type);
} }
@Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public <E extends Enum<E>> E[] getEnumArray(String attributeName, Class<E> type) { public <E extends Enum<E>> E[] getEnumArray(String attributeName, Class<E> type) {
Assert.notNull(type, "Type must not be null"); Assert.notNull(type, "Type must not be null");

View File

@ -87,6 +87,7 @@ final class MissingMergedAnnotation<A extends Annotation> extends AbstractMerged
return -1; return -1;
} }
@Override
public boolean hasNonDefaultValue(String attributeName) { public boolean hasNonDefaultValue(String attributeName) {
throw new NoSuchElementException( throw new NoSuchElementException(
"Unable to check non-default value for missing annotation"); "Unable to check non-default value for missing annotation");
@ -160,6 +161,7 @@ final class MissingMergedAnnotation<A extends Annotation> extends AbstractMerged
"Unable to get attribute value for missing annotation"); "Unable to get attribute value for missing annotation");
} }
@Override
protected A createSynthesized() { protected A createSynthesized() {
throw new NoSuchElementException("Unable to synthesize missing annotation"); throw new NoSuchElementException("Unable to synthesize missing annotation");
} }

View File

@ -377,6 +377,7 @@ final class TypeMappedAnnotation<A extends Annotation> extends AbstractMergedAnn
return String.valueOf(value); return String.valueOf(value);
} }
@Override
@Nullable @Nullable
protected <T> T getAttributeValue(String attributeName, Class<T> type) { protected <T> T getAttributeValue(String attributeName, Class<T> type) {
int attributeIndex = getAttributeIndex(attributeName, false); int attributeIndex = getAttributeIndex(attributeName, false);

View File

@ -562,6 +562,7 @@ final class TypeMappedAnnotations implements MergedAnnotations {
this.aggregateCursor = 0; this.aggregateCursor = 0;
} }
@Override
public boolean tryAdvance(Consumer<? super MergedAnnotation<A>> action) { public boolean tryAdvance(Consumer<? super MergedAnnotation<A>> action) {
while (this.aggregateCursor < this.aggregates.size()) { while (this.aggregateCursor < this.aggregates.size()) {
Aggregate aggregate = this.aggregates.get(this.aggregateCursor); Aggregate aggregate = this.aggregates.get(this.aggregateCursor);

View File

@ -118,15 +118,18 @@ public class OperatorMatches extends Operator {
this.access = access; this.access = access;
} }
@Override
public char charAt(int index) { public char charAt(int index) {
this.access.check(); this.access.check();
return this.value.charAt(index); return this.value.charAt(index);
} }
@Override
public CharSequence subSequence(int start, int end) { public CharSequence subSequence(int start, int end) {
return new MatcherInput(this.value.subSequence(start, end), this.access); return new MatcherInput(this.value.subSequence(start, end), this.access);
} }
@Override
public int length() { public int length() {
return this.value.length(); return this.value.length();
} }

View File

@ -5188,6 +5188,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
public static class MyMessage implements Message<String> { public static class MyMessage implements Message<String> {
@Override
public MessageHeaders getHeaders() { public MessageHeaders getHeaders() {
MessageHeaders mh = new MessageHeaders(); MessageHeaders mh = new MessageHeaders();
mh.put("command", "wibble"); mh.put("command", "wibble");
@ -5195,8 +5196,10 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
return mh; return mh;
} }
@Override
public int[] getIa() { return new int[] {5,3}; } public int[] getIa() { return new int[] {5,3}; }
@Override
@SuppressWarnings({"rawtypes", "unchecked"}) @SuppressWarnings({"rawtypes", "unchecked"})
public List getList() { public List getList() {
List l = new ArrayList(); List l = new ArrayList();
@ -5253,24 +5256,29 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
private Method method; private Method method;
@Override
public Class<?>[] getSpecificTargetClasses() { public Class<?>[] getSpecificTargetClasses() {
return new Class<?>[] {Payload2.class}; return new Class<?>[] {Payload2.class};
} }
@Override
public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException { public boolean canRead(EvaluationContext context, Object target, String name) throws AccessException {
// target is a Payload2 instance // target is a Payload2 instance
return true; return true;
} }
@Override
public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException { public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException {
Payload2 payload2 = (Payload2)target; Payload2 payload2 = (Payload2)target;
return new TypedValue(payload2.getField(name)); return new TypedValue(payload2.getField(name));
} }
@Override
public boolean canWrite(EvaluationContext context, Object target, String name) throws AccessException { public boolean canWrite(EvaluationContext context, Object target, String name) throws AccessException {
return false; return false;
} }
@Override
public void write(EvaluationContext context, Object target, String name, Object newValue) throws AccessException { public void write(EvaluationContext context, Object target, String name, Object newValue) throws AccessException {
} }
@ -5496,6 +5504,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
public Three getThree() { public Three getThree() {
return three; return three;
} }
@Override
public String toString() { public String toString() {
return "instanceof Two"; return "instanceof Two";
} }
@ -6108,6 +6117,7 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
return "pb"; return "pb";
} }
@Override
public String toString() { public String toString() {
return "sh"; return "sh";
} }

View File

@ -2261,6 +2261,7 @@ public class SpelReproTests extends AbstractExpressionTests {
this.string = string; this.string = string;
} }
@Override
public boolean equals(Object other) { public boolean equals(Object other) {
return (this == other || (other instanceof TestClass2 && return (this == other || (other instanceof TestClass2 &&
this.string.equals(((TestClass2) other).string))); this.string.equals(((TestClass2) other).string)));

View File

@ -280,92 +280,110 @@ final class LogAdapter {
this.logger = logger; this.logger = logger;
} }
@Override
public boolean isFatalEnabled() { public boolean isFatalEnabled() {
return isErrorEnabled(); return isErrorEnabled();
} }
@Override
public boolean isErrorEnabled() { public boolean isErrorEnabled() {
return this.logger.isErrorEnabled(); return this.logger.isErrorEnabled();
} }
@Override
public boolean isWarnEnabled() { public boolean isWarnEnabled() {
return this.logger.isWarnEnabled(); return this.logger.isWarnEnabled();
} }
@Override
public boolean isInfoEnabled() { public boolean isInfoEnabled() {
return this.logger.isInfoEnabled(); return this.logger.isInfoEnabled();
} }
@Override
public boolean isDebugEnabled() { public boolean isDebugEnabled() {
return this.logger.isDebugEnabled(); return this.logger.isDebugEnabled();
} }
@Override
public boolean isTraceEnabled() { public boolean isTraceEnabled() {
return this.logger.isTraceEnabled(); return this.logger.isTraceEnabled();
} }
@Override
public void fatal(Object message) { public void fatal(Object message) {
error(message); error(message);
} }
@Override
public void fatal(Object message, Throwable exception) { public void fatal(Object message, Throwable exception) {
error(message, exception); error(message, exception);
} }
@Override
public void error(Object message) { public void error(Object message) {
if (message instanceof String || this.logger.isErrorEnabled()) { if (message instanceof String || this.logger.isErrorEnabled()) {
this.logger.error(String.valueOf(message)); this.logger.error(String.valueOf(message));
} }
} }
@Override
public void error(Object message, Throwable exception) { public void error(Object message, Throwable exception) {
if (message instanceof String || this.logger.isErrorEnabled()) { if (message instanceof String || this.logger.isErrorEnabled()) {
this.logger.error(String.valueOf(message), exception); this.logger.error(String.valueOf(message), exception);
} }
} }
@Override
public void warn(Object message) { public void warn(Object message) {
if (message instanceof String || this.logger.isWarnEnabled()) { if (message instanceof String || this.logger.isWarnEnabled()) {
this.logger.warn(String.valueOf(message)); this.logger.warn(String.valueOf(message));
} }
} }
@Override
public void warn(Object message, Throwable exception) { public void warn(Object message, Throwable exception) {
if (message instanceof String || this.logger.isWarnEnabled()) { if (message instanceof String || this.logger.isWarnEnabled()) {
this.logger.warn(String.valueOf(message), exception); this.logger.warn(String.valueOf(message), exception);
} }
} }
@Override
public void info(Object message) { public void info(Object message) {
if (message instanceof String || this.logger.isInfoEnabled()) { if (message instanceof String || this.logger.isInfoEnabled()) {
this.logger.info(String.valueOf(message)); this.logger.info(String.valueOf(message));
} }
} }
@Override
public void info(Object message, Throwable exception) { public void info(Object message, Throwable exception) {
if (message instanceof String || this.logger.isInfoEnabled()) { if (message instanceof String || this.logger.isInfoEnabled()) {
this.logger.info(String.valueOf(message), exception); this.logger.info(String.valueOf(message), exception);
} }
} }
@Override
public void debug(Object message) { public void debug(Object message) {
if (message instanceof String || this.logger.isDebugEnabled()) { if (message instanceof String || this.logger.isDebugEnabled()) {
this.logger.debug(String.valueOf(message)); this.logger.debug(String.valueOf(message));
} }
} }
@Override
public void debug(Object message, Throwable exception) { public void debug(Object message, Throwable exception) {
if (message instanceof String || this.logger.isDebugEnabled()) { if (message instanceof String || this.logger.isDebugEnabled()) {
this.logger.debug(String.valueOf(message), exception); this.logger.debug(String.valueOf(message), exception);
} }
} }
@Override
public void trace(Object message) { public void trace(Object message) {
if (message instanceof String || this.logger.isTraceEnabled()) { if (message instanceof String || this.logger.isTraceEnabled()) {
this.logger.trace(String.valueOf(message)); this.logger.trace(String.valueOf(message));
} }
} }
@Override
public void trace(Object message, Throwable exception) { public void trace(Object message, Throwable exception) {
if (message instanceof String || this.logger.isTraceEnabled()) { if (message instanceof String || this.logger.isTraceEnabled()) {
this.logger.trace(String.valueOf(message), exception); this.logger.trace(String.valueOf(message), exception);
@ -486,74 +504,92 @@ final class LogAdapter {
this.logger = java.util.logging.Logger.getLogger(name); this.logger = java.util.logging.Logger.getLogger(name);
} }
@Override
public boolean isFatalEnabled() { public boolean isFatalEnabled() {
return isErrorEnabled(); return isErrorEnabled();
} }
@Override
public boolean isErrorEnabled() { public boolean isErrorEnabled() {
return this.logger.isLoggable(java.util.logging.Level.SEVERE); return this.logger.isLoggable(java.util.logging.Level.SEVERE);
} }
@Override
public boolean isWarnEnabled() { public boolean isWarnEnabled() {
return this.logger.isLoggable(java.util.logging.Level.WARNING); return this.logger.isLoggable(java.util.logging.Level.WARNING);
} }
@Override
public boolean isInfoEnabled() { public boolean isInfoEnabled() {
return this.logger.isLoggable(java.util.logging.Level.INFO); return this.logger.isLoggable(java.util.logging.Level.INFO);
} }
@Override
public boolean isDebugEnabled() { public boolean isDebugEnabled() {
return this.logger.isLoggable(java.util.logging.Level.FINE); return this.logger.isLoggable(java.util.logging.Level.FINE);
} }
@Override
public boolean isTraceEnabled() { public boolean isTraceEnabled() {
return this.logger.isLoggable(java.util.logging.Level.FINEST); return this.logger.isLoggable(java.util.logging.Level.FINEST);
} }
@Override
public void fatal(Object message) { public void fatal(Object message) {
error(message); error(message);
} }
@Override
public void fatal(Object message, Throwable exception) { public void fatal(Object message, Throwable exception) {
error(message, exception); error(message, exception);
} }
@Override
public void error(Object message) { public void error(Object message) {
log(java.util.logging.Level.SEVERE, message, null); log(java.util.logging.Level.SEVERE, message, null);
} }
@Override
public void error(Object message, Throwable exception) { public void error(Object message, Throwable exception) {
log(java.util.logging.Level.SEVERE, message, exception); log(java.util.logging.Level.SEVERE, message, exception);
} }
@Override
public void warn(Object message) { public void warn(Object message) {
log(java.util.logging.Level.WARNING, message, null); log(java.util.logging.Level.WARNING, message, null);
} }
@Override
public void warn(Object message, Throwable exception) { public void warn(Object message, Throwable exception) {
log(java.util.logging.Level.WARNING, message, exception); log(java.util.logging.Level.WARNING, message, exception);
} }
@Override
public void info(Object message) { public void info(Object message) {
log(java.util.logging.Level.INFO, message, null); log(java.util.logging.Level.INFO, message, null);
} }
@Override
public void info(Object message, Throwable exception) { public void info(Object message, Throwable exception) {
log(java.util.logging.Level.INFO, message, exception); log(java.util.logging.Level.INFO, message, exception);
} }
@Override
public void debug(Object message) { public void debug(Object message) {
log(java.util.logging.Level.FINE, message, null); log(java.util.logging.Level.FINE, message, null);
} }
@Override
public void debug(Object message, Throwable exception) { public void debug(Object message, Throwable exception) {
log(java.util.logging.Level.FINE, message, exception); log(java.util.logging.Level.FINE, message, exception);
} }
@Override
public void trace(Object message) { public void trace(Object message) {
log(java.util.logging.Level.FINEST, message, null); log(java.util.logging.Level.FINEST, message, null);
} }
@Override
public void trace(Object message, Throwable exception) { public void trace(Object message, Throwable exception) {
log(java.util.logging.Level.FINEST, message, exception); log(java.util.logging.Level.FINEST, message, exception);
} }

View File

@ -24,6 +24,7 @@ import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseType;
*/ */
public class HsqlDatabasePopulatorTests extends AbstractDatabasePopulatorTests { public class HsqlDatabasePopulatorTests extends AbstractDatabasePopulatorTests {
@Override
protected EmbeddedDatabaseType getEmbeddedDatabaseType() { protected EmbeddedDatabaseType getEmbeddedDatabaseType() {
return EmbeddedDatabaseType.HSQL; return EmbeddedDatabaseType.HSQL;
} }

View File

@ -34,6 +34,7 @@ import static org.springframework.jdbc.datasource.init.ScriptUtils.executeSqlScr
*/ */
public class ScriptUtilsIntegrationTests extends AbstractDatabaseInitializationTests { public class ScriptUtilsIntegrationTests extends AbstractDatabaseInitializationTests {
@Override
protected EmbeddedDatabaseType getEmbeddedDatabaseType() { protected EmbeddedDatabaseType getEmbeddedDatabaseType() {
return EmbeddedDatabaseType.HSQL; return EmbeddedDatabaseType.HSQL;
} }

View File

@ -89,6 +89,7 @@ class CachedMessageProducer implements MessageProducer, QueueSender, TopicPublis
return this.target.getDisableMessageTimestamp(); return this.target.getDisableMessageTimestamp();
} }
@Override
public void setDeliveryDelay(long deliveryDelay) throws JMSException { public void setDeliveryDelay(long deliveryDelay) throws JMSException {
if (this.originalDeliveryDelay == null) { if (this.originalDeliveryDelay == null) {
this.originalDeliveryDelay = this.target.getDeliveryDelay(); this.originalDeliveryDelay = this.target.getDeliveryDelay();
@ -96,6 +97,7 @@ class CachedMessageProducer implements MessageProducer, QueueSender, TopicPublis
this.target.setDeliveryDelay(deliveryDelay); this.target.setDeliveryDelay(deliveryDelay);
} }
@Override
public long getDeliveryDelay() throws JMSException { public long getDeliveryDelay() throws JMSException {
return this.target.getDeliveryDelay(); return this.target.getDeliveryDelay();
} }

View File

@ -65,91 +65,112 @@ public class StubTextMessage implements TextMessage {
} }
@Override
public String getText() throws JMSException { public String getText() throws JMSException {
return this.text; return this.text;
} }
@Override
public void setText(String text) throws JMSException { public void setText(String text) throws JMSException {
this.text = text; this.text = text;
} }
@Override
public void acknowledge() throws JMSException { public void acknowledge() throws JMSException {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@Override
public void clearBody() throws JMSException { public void clearBody() throws JMSException {
this.text = null; this.text = null;
} }
@Override
public void clearProperties() throws JMSException { public void clearProperties() throws JMSException {
this.properties.clear(); this.properties.clear();
} }
@Override
public boolean getBooleanProperty(String name) throws JMSException { public boolean getBooleanProperty(String name) throws JMSException {
Object value = this.properties.get(name); Object value = this.properties.get(name);
return (value instanceof Boolean) ? ((Boolean) value).booleanValue() : false; return (value instanceof Boolean) ? ((Boolean) value).booleanValue() : false;
} }
@Override
public byte getByteProperty(String name) throws JMSException { public byte getByteProperty(String name) throws JMSException {
Object value = this.properties.get(name); Object value = this.properties.get(name);
return (value instanceof Byte) ? ((Byte) value).byteValue() : 0; return (value instanceof Byte) ? ((Byte) value).byteValue() : 0;
} }
@Override
public double getDoubleProperty(String name) throws JMSException { public double getDoubleProperty(String name) throws JMSException {
Object value = this.properties.get(name); Object value = this.properties.get(name);
return (value instanceof Double) ? ((Double) value).doubleValue() : 0; return (value instanceof Double) ? ((Double) value).doubleValue() : 0;
} }
@Override
public float getFloatProperty(String name) throws JMSException { public float getFloatProperty(String name) throws JMSException {
Object value = this.properties.get(name); Object value = this.properties.get(name);
return (value instanceof Float) ? ((Float) value).floatValue() : 0; return (value instanceof Float) ? ((Float) value).floatValue() : 0;
} }
@Override
public int getIntProperty(String name) throws JMSException { public int getIntProperty(String name) throws JMSException {
Object value = this.properties.get(name); Object value = this.properties.get(name);
return (value instanceof Integer) ? ((Integer) value).intValue() : 0; return (value instanceof Integer) ? ((Integer) value).intValue() : 0;
} }
@Override
public String getJMSCorrelationID() throws JMSException { public String getJMSCorrelationID() throws JMSException {
return this.correlationId; return this.correlationId;
} }
@Override
public byte[] getJMSCorrelationIDAsBytes() throws JMSException { public byte[] getJMSCorrelationIDAsBytes() throws JMSException {
return this.correlationId.getBytes(); return this.correlationId.getBytes();
} }
@Override
public int getJMSDeliveryMode() throws JMSException { public int getJMSDeliveryMode() throws JMSException {
return this.deliveryMode; return this.deliveryMode;
} }
@Override
public Destination getJMSDestination() throws JMSException { public Destination getJMSDestination() throws JMSException {
return this.destination; return this.destination;
} }
@Override
public long getJMSExpiration() throws JMSException { public long getJMSExpiration() throws JMSException {
return this.expiration; return this.expiration;
} }
@Override
public String getJMSMessageID() throws JMSException { public String getJMSMessageID() throws JMSException {
return this.messageId; return this.messageId;
} }
@Override
public int getJMSPriority() throws JMSException { public int getJMSPriority() throws JMSException {
return this.priority; return this.priority;
} }
@Override
public boolean getJMSRedelivered() throws JMSException { public boolean getJMSRedelivered() throws JMSException {
return this.redelivered; return this.redelivered;
} }
@Override
public Destination getJMSReplyTo() throws JMSException { public Destination getJMSReplyTo() throws JMSException {
return this.replyTo; return this.replyTo;
} }
@Override
public long getJMSTimestamp() throws JMSException { public long getJMSTimestamp() throws JMSException {
return this.timestamp; return this.timestamp;
} }
@Override
public String getJMSType() throws JMSException { public String getJMSType() throws JMSException {
return this.type; return this.type;
} }
@ -159,93 +180,115 @@ public class StubTextMessage implements TextMessage {
return this.deliveryTime; return this.deliveryTime;
} }
@Override
public long getLongProperty(String name) throws JMSException { public long getLongProperty(String name) throws JMSException {
Object value = this.properties.get(name); Object value = this.properties.get(name);
return (value instanceof Long) ? ((Long) value).longValue() : 0; return (value instanceof Long) ? ((Long) value).longValue() : 0;
} }
@Override
public Object getObjectProperty(String name) throws JMSException { public Object getObjectProperty(String name) throws JMSException {
return this.properties.get(name); return this.properties.get(name);
} }
@Override
public Enumeration<?> getPropertyNames() throws JMSException { public Enumeration<?> getPropertyNames() throws JMSException {
return this.properties.keys(); return this.properties.keys();
} }
@Override
public short getShortProperty(String name) throws JMSException { public short getShortProperty(String name) throws JMSException {
Object value = this.properties.get(name); Object value = this.properties.get(name);
return (value instanceof Short) ? ((Short) value).shortValue() : 0; return (value instanceof Short) ? ((Short) value).shortValue() : 0;
} }
@Override
public String getStringProperty(String name) throws JMSException { public String getStringProperty(String name) throws JMSException {
Object value = this.properties.get(name); Object value = this.properties.get(name);
return (value instanceof String) ? (String) value : null; return (value instanceof String) ? (String) value : null;
} }
@Override
public boolean propertyExists(String name) throws JMSException { public boolean propertyExists(String name) throws JMSException {
return this.properties.containsKey(name); return this.properties.containsKey(name);
} }
@Override
public void setBooleanProperty(String name, boolean value) throws JMSException { public void setBooleanProperty(String name, boolean value) throws JMSException {
this.properties.put(name, value); this.properties.put(name, value);
} }
@Override
public void setByteProperty(String name, byte value) throws JMSException { public void setByteProperty(String name, byte value) throws JMSException {
this.properties.put(name, value); this.properties.put(name, value);
} }
@Override
public void setDoubleProperty(String name, double value) throws JMSException { public void setDoubleProperty(String name, double value) throws JMSException {
this.properties.put(name, value); this.properties.put(name, value);
} }
@Override
public void setFloatProperty(String name, float value) throws JMSException { public void setFloatProperty(String name, float value) throws JMSException {
this.properties.put(name, value); this.properties.put(name, value);
} }
@Override
public void setIntProperty(String name, int value) throws JMSException { public void setIntProperty(String name, int value) throws JMSException {
this.properties.put(name, value); this.properties.put(name, value);
} }
@Override
public void setJMSCorrelationID(String correlationId) throws JMSException { public void setJMSCorrelationID(String correlationId) throws JMSException {
this.correlationId = correlationId; this.correlationId = correlationId;
} }
@Override
public void setJMSCorrelationIDAsBytes(byte[] correlationID) throws JMSException { public void setJMSCorrelationIDAsBytes(byte[] correlationID) throws JMSException {
this.correlationId = new String(correlationID); this.correlationId = new String(correlationID);
} }
@Override
public void setJMSDeliveryMode(int deliveryMode) throws JMSException { public void setJMSDeliveryMode(int deliveryMode) throws JMSException {
this.deliveryMode = deliveryMode; this.deliveryMode = deliveryMode;
} }
@Override
public void setJMSDestination(Destination destination) throws JMSException { public void setJMSDestination(Destination destination) throws JMSException {
this.destination = destination; this.destination = destination;
} }
@Override
public void setJMSExpiration(long expiration) throws JMSException { public void setJMSExpiration(long expiration) throws JMSException {
this.expiration = expiration; this.expiration = expiration;
} }
@Override
public void setJMSMessageID(String id) throws JMSException { public void setJMSMessageID(String id) throws JMSException {
this.messageId = id; this.messageId = id;
} }
@Override
public void setJMSPriority(int priority) throws JMSException { public void setJMSPriority(int priority) throws JMSException {
this.priority = priority; this.priority = priority;
} }
@Override
public void setJMSRedelivered(boolean redelivered) throws JMSException { public void setJMSRedelivered(boolean redelivered) throws JMSException {
this.redelivered = redelivered; this.redelivered = redelivered;
} }
@Override
public void setJMSReplyTo(Destination replyTo) throws JMSException { public void setJMSReplyTo(Destination replyTo) throws JMSException {
this.replyTo = replyTo; this.replyTo = replyTo;
} }
@Override
public void setJMSTimestamp(long timestamp) throws JMSException { public void setJMSTimestamp(long timestamp) throws JMSException {
this.timestamp = timestamp; this.timestamp = timestamp;
} }
@Override
public void setJMSType(String type) throws JMSException { public void setJMSType(String type) throws JMSException {
this.type = type; this.type = type;
} }
@ -255,18 +298,22 @@ public class StubTextMessage implements TextMessage {
this.deliveryTime = deliveryTime; this.deliveryTime = deliveryTime;
} }
@Override
public void setLongProperty(String name, long value) throws JMSException { public void setLongProperty(String name, long value) throws JMSException {
this.properties.put(name, value); this.properties.put(name, value);
} }
@Override
public void setObjectProperty(String name, Object value) throws JMSException { public void setObjectProperty(String name, Object value) throws JMSException {
this.properties.put(name, value); this.properties.put(name, value);
} }
@Override
public void setShortProperty(String name, short value) throws JMSException { public void setShortProperty(String name, short value) throws JMSException {
this.properties.put(name, value); this.properties.put(name, value);
} }
@Override
public void setStringProperty(String name, String value) throws JMSException { public void setStringProperty(String name, String value) throws JMSException {
this.properties.put(name, value); this.properties.put(name, value);
} }

View File

@ -166,6 +166,7 @@ public class JmsListenerContainerFactoryIntegrationTests {
private final Map<String, Boolean> invocations = new HashMap<>(); private final Map<String, Boolean> invocations = new HashMap<>();
@Override
public void handleIt(@Payload String msg, @Header("my-header") String myHeader) { public void handleIt(@Payload String msg, @Header("my-header") String myHeader) {
invocations.put("handleIt", true); invocations.put("handleIt", true);
assertThat(msg).as("Unexpected payload message").isEqualTo("FOO-BAR"); assertThat(msg).as("Unexpected payload message").isEqualTo("FOO-BAR");

View File

@ -220,35 +220,43 @@ public class MessageHeaders implements Map<String, Object>, Serializable {
// Delegating Map implementation // Delegating Map implementation
@Override
public boolean containsKey(Object key) { public boolean containsKey(Object key) {
return this.headers.containsKey(key); return this.headers.containsKey(key);
} }
@Override
public boolean containsValue(Object value) { public boolean containsValue(Object value) {
return this.headers.containsValue(value); return this.headers.containsValue(value);
} }
@Override
public Set<Map.Entry<String, Object>> entrySet() { public Set<Map.Entry<String, Object>> entrySet() {
return Collections.unmodifiableMap(this.headers).entrySet(); return Collections.unmodifiableMap(this.headers).entrySet();
} }
@Override
@Nullable @Nullable
public Object get(Object key) { public Object get(Object key) {
return this.headers.get(key); return this.headers.get(key);
} }
@Override
public boolean isEmpty() { public boolean isEmpty() {
return this.headers.isEmpty(); return this.headers.isEmpty();
} }
@Override
public Set<String> keySet() { public Set<String> keySet() {
return Collections.unmodifiableSet(this.headers.keySet()); return Collections.unmodifiableSet(this.headers.keySet());
} }
@Override
public int size() { public int size() {
return this.headers.size(); return this.headers.size();
} }
@Override
public Collection<Object> values() { public Collection<Object> values() {
return Collections.unmodifiableCollection(this.headers.values()); return Collections.unmodifiableCollection(this.headers.values());
} }
@ -260,6 +268,7 @@ public class MessageHeaders implements Map<String, Object>, Serializable {
* Since MessageHeaders are immutable, the call to this method * Since MessageHeaders are immutable, the call to this method
* will result in {@link UnsupportedOperationException}. * will result in {@link UnsupportedOperationException}.
*/ */
@Override
public Object put(String key, Object value) { public Object put(String key, Object value) {
throw new UnsupportedOperationException("MessageHeaders is immutable"); throw new UnsupportedOperationException("MessageHeaders is immutable");
} }
@ -268,6 +277,7 @@ public class MessageHeaders implements Map<String, Object>, Serializable {
* Since MessageHeaders are immutable, the call to this method * Since MessageHeaders are immutable, the call to this method
* will result in {@link UnsupportedOperationException}. * will result in {@link UnsupportedOperationException}.
*/ */
@Override
public void putAll(Map<? extends String, ? extends Object> map) { public void putAll(Map<? extends String, ? extends Object> map) {
throw new UnsupportedOperationException("MessageHeaders is immutable"); throw new UnsupportedOperationException("MessageHeaders is immutable");
} }
@ -276,6 +286,7 @@ public class MessageHeaders implements Map<String, Object>, Serializable {
* Since MessageHeaders are immutable, the call to this method * Since MessageHeaders are immutable, the call to this method
* will result in {@link UnsupportedOperationException}. * will result in {@link UnsupportedOperationException}.
*/ */
@Override
public Object remove(Object key) { public Object remove(Object key) {
throw new UnsupportedOperationException("MessageHeaders is immutable"); throw new UnsupportedOperationException("MessageHeaders is immutable");
} }
@ -284,6 +295,7 @@ public class MessageHeaders implements Map<String, Object>, Serializable {
* Since MessageHeaders are immutable, the call to this method * Since MessageHeaders are immutable, the call to this method
* will result in {@link UnsupportedOperationException}. * will result in {@link UnsupportedOperationException}.
*/ */
@Override
public void clear() { public void clear() {
throw new UnsupportedOperationException("MessageHeaders is immutable"); throw new UnsupportedOperationException("MessageHeaders is immutable");
} }

View File

@ -303,6 +303,7 @@ public class SimpAnnotationMethodMessageHandler extends AbstractMethodMessageHan
} }
@Override
protected List<HandlerMethodArgumentResolver> initArgumentResolvers() { protected List<HandlerMethodArgumentResolver> initArgumentResolvers() {
ApplicationContext context = getApplicationContext(); ApplicationContext context = getApplicationContext();
ConfigurableBeanFactory beanFactory = (context instanceof ConfigurableApplicationContext ? ConfigurableBeanFactory beanFactory = (context instanceof ConfigurableApplicationContext ?

View File

@ -59,6 +59,7 @@ class OrderedMessageSender implements MessageChannel {
} }
@Override
public boolean send(Message<?> message) { public boolean send(Message<?> message) {
return send(message, -1); return send(message, -1);
} }

View File

@ -231,6 +231,7 @@ public class StompBrokerRelayRegistration extends AbstractBrokerRegistration {
} }
@Override
protected StompBrokerRelayMessageHandler getMessageHandler(SubscribableChannel brokerChannel) { protected StompBrokerRelayMessageHandler getMessageHandler(SubscribableChannel brokerChannel) {
StompBrokerRelayMessageHandler handler = new StompBrokerRelayMessageHandler( StompBrokerRelayMessageHandler handler = new StompBrokerRelayMessageHandler(

View File

@ -689,8 +689,10 @@ public class DefaultStompSession implements ConnectionHandlingStompSession {
if (conn != null) { if (conn != null) {
conn.send(HEARTBEAT).addCallback( conn.send(HEARTBEAT).addCallback(
new ListenableFutureCallback<Void>() { new ListenableFutureCallback<Void>() {
@Override
public void onSuccess(@Nullable Void result) { public void onSuccess(@Nullable Void result) {
} }
@Override
public void onFailure(Throwable ex) { public void onFailure(Throwable ex) {
handleFailure(ex); handleFailure(ex);
} }

View File

@ -1086,6 +1086,7 @@ public class StompBrokerRelayMessageHandler extends AbstractBrokerMessageHandler
return this.disconnect.get(); return this.disconnect.get();
} }
@Override
public String toString() { public String toString() {
return (connectionHandlers.size() + " sessions, " + getTcpClientInfo() + return (connectionHandlers.size() + " sessions, " + getTcpClientInfo() +
(isBrokerAvailable() ? " (available)" : " (not available)") + (isBrokerAvailable() ? " (available)" : " (not available)") +

View File

@ -53,6 +53,7 @@ public class StompReactorNettyCodec extends AbstractNioBufferReactorNettyCodec<b
return this.decoder.decode(nioBuffer); return this.decoder.decode(nioBuffer);
} }
@Override
protected ByteBuffer encodeInternal(Message<byte[]> message) { protected ByteBuffer encodeInternal(Message<byte[]> message) {
return ByteBuffer.wrap(this.encoder.encode(message)); return ByteBuffer.wrap(this.encoder.encode(message));
} }

View File

@ -47,6 +47,7 @@ public abstract class ChannelInterceptorAdapter implements ChannelInterceptor {
public void afterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, @Nullable Exception ex) { public void afterSendCompletion(Message<?> message, MessageChannel channel, boolean sent, @Nullable Exception ex) {
} }
@Override
public boolean preReceive(MessageChannel channel) { public boolean preReceive(MessageChannel channel) {
return true; return true;
} }

View File

@ -77,15 +77,18 @@ public class GenericMessage<T> implements Message<T>, Serializable {
} }
@Override
public T getPayload() { public T getPayload() {
return this.payload; return this.payload;
} }
@Override
public MessageHeaders getHeaders() { public MessageHeaders getHeaders() {
return this.headers; return this.headers;
} }
@Override
public boolean equals(@Nullable Object other) { public boolean equals(@Nullable Object other) {
if (this == other) { if (this == other) {
return true; return true;
@ -98,11 +101,13 @@ public class GenericMessage<T> implements Message<T>, Serializable {
return (ObjectUtils.nullSafeEquals(this.payload, otherMsg.payload) && this.headers.equals(otherMsg.headers)); return (ObjectUtils.nullSafeEquals(this.payload, otherMsg.payload) && this.headers.equals(otherMsg.headers));
} }
@Override
public int hashCode() { public int hashCode() {
// Using nullSafeHashCode for proper array hashCode handling // Using nullSafeHashCode for proper array hashCode handling
return (ObjectUtils.nullSafeHashCode(this.payload) * 23 + this.headers.hashCode()); return (ObjectUtils.nullSafeHashCode(this.payload) * 23 + this.headers.hashCode());
} }
@Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(getClass().getSimpleName()); StringBuilder sb = new StringBuilder(getClass().getSimpleName());
sb.append(" [payload="); sb.append(" [payload=");

View File

@ -190,6 +190,7 @@ public class MethodMessageHandlerTests {
super.detectHandlerMethods(handler); super.detectHandlerMethods(handler);
} }
@Override
public void registerHandlerMethod(Object handler, Method method, String mapping) { public void registerHandlerMethod(Object handler, Method method, String mapping) {
super.registerHandlerMethod(handler, method, mapping); super.registerHandlerMethod(handler, method, mapping);
} }

View File

@ -316,11 +316,13 @@ public class LocalContainerEntityManagerFactoryBeanTests extends AbstractEntityM
} }
// JPA 2.1 method // JPA 2.1 method
@Override
public void generateSchema(PersistenceUnitInfo persistenceUnitInfo, Map map) { public void generateSchema(PersistenceUnitInfo persistenceUnitInfo, Map map) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
// JPA 2.1 method // JPA 2.1 method
@Override
public boolean generateSchema(String persistenceUnitName, Map map) { public boolean generateSchema(String persistenceUnitName, Map map) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -102,11 +102,13 @@ public class LocalEntityManagerFactoryBeanTests extends AbstractEntityManagerFac
} }
// JPA 2.1 method // JPA 2.1 method
@Override
public void generateSchema(PersistenceUnitInfo persistenceUnitInfo, Map map) { public void generateSchema(PersistenceUnitInfo persistenceUnitInfo, Map map) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
// JPA 2.1 method // JPA 2.1 method
@Override
public boolean generateSchema(String persistenceUnitName, Map map) { public boolean generateSchema(String persistenceUnitName, Map map) {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -46,6 +46,7 @@ public class HibernateMultiEntityManagerFactoryIntegrationTests extends Abstract
} }
@Override
@Test @Test
public void testEntityManagerFactoryImplementsEntityManagerFactoryInfo() { public void testEntityManagerFactoryImplementsEntityManagerFactoryInfo() {
boolean condition = this.entityManagerFactory instanceof EntityManagerFactoryInfo; boolean condition = this.entityManagerFactory instanceof EntityManagerFactoryInfo;

View File

@ -53,6 +53,7 @@ public class HibernateNativeEntityManagerFactoryIntegrationTests extends Abstrac
} }
@Override
@Test @Test
public void testEntityManagerFactoryImplementsEntityManagerFactoryInfo() { public void testEntityManagerFactoryImplementsEntityManagerFactoryInfo() {
boolean condition = entityManagerFactory instanceof EntityManagerFactoryInfo; boolean condition = entityManagerFactory instanceof EntityManagerFactoryInfo;

View File

@ -118,6 +118,7 @@ public class DefaultTestContext implements TestContext {
* loader delegate is not <em>active</em> (i.e., has been closed) * loader delegate is not <em>active</em> (i.e., has been closed)
* @see CacheAwareContextLoaderDelegate#loadContext * @see CacheAwareContextLoaderDelegate#loadContext
*/ */
@Override
public ApplicationContext getApplicationContext() { public ApplicationContext getApplicationContext() {
ApplicationContext context = this.cacheAwareContextLoaderDelegate.loadContext(this.mergedContextConfiguration); ApplicationContext context = this.cacheAwareContextLoaderDelegate.loadContext(this.mergedContextConfiguration);
if (context instanceof ConfigurableApplicationContext) { if (context instanceof ConfigurableApplicationContext) {
@ -142,20 +143,24 @@ public class DefaultTestContext implements TestContext {
* that was supplied when this {@code TestContext} was constructed. * that was supplied when this {@code TestContext} was constructed.
* @see CacheAwareContextLoaderDelegate#closeContext * @see CacheAwareContextLoaderDelegate#closeContext
*/ */
@Override
public void markApplicationContextDirty(@Nullable HierarchyMode hierarchyMode) { public void markApplicationContextDirty(@Nullable HierarchyMode hierarchyMode) {
this.cacheAwareContextLoaderDelegate.closeContext(this.mergedContextConfiguration, hierarchyMode); this.cacheAwareContextLoaderDelegate.closeContext(this.mergedContextConfiguration, hierarchyMode);
} }
@Override
public final Class<?> getTestClass() { public final Class<?> getTestClass() {
return this.testClass; return this.testClass;
} }
@Override
public final Object getTestInstance() { public final Object getTestInstance() {
Object testInstance = this.testInstance; Object testInstance = this.testInstance;
Assert.state(testInstance != null, "No test instance"); Assert.state(testInstance != null, "No test instance");
return testInstance; return testInstance;
} }
@Override
public final Method getTestMethod() { public final Method getTestMethod() {
Method testMethod = this.testMethod; Method testMethod = this.testMethod;
Assert.state(testMethod != null, "No test method"); Assert.state(testMethod != null, "No test method");
@ -168,6 +173,7 @@ public class DefaultTestContext implements TestContext {
return this.testException; return this.testException;
} }
@Override
public void updateState(@Nullable Object testInstance, @Nullable Method testMethod, @Nullable Throwable testException) { public void updateState(@Nullable Object testInstance, @Nullable Method testMethod, @Nullable Throwable testException) {
this.testInstance = testInstance; this.testInstance = testInstance;
this.testMethod = testMethod; this.testMethod = testMethod;

View File

@ -106,6 +106,7 @@ final class HtmlUnitRequestBuilder implements RequestBuilder, Mergeable {
} }
@Override
public MockHttpServletRequest buildRequest(ServletContext servletContext) { public MockHttpServletRequest buildRequest(ServletContext servletContext) {
Charset charset = getCharset(); Charset charset = getCharset();
String httpMethod = this.webRequest.getHttpMethod().name(); String httpMethod = this.webRequest.getHttpMethod().name();

View File

@ -125,6 +125,7 @@ public final class MockMvcWebConnection implements WebConnection {
} }
@Override
public WebResponse getResponse(WebRequest webRequest) throws IOException { public WebResponse getResponse(WebRequest webRequest) throws IOException {
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
HtmlUnitRequestBuilder requestBuilder = new HtmlUnitRequestBuilder(this.sessions, this.webClient, webRequest); HtmlUnitRequestBuilder requestBuilder = new HtmlUnitRequestBuilder(this.sessions, this.webClient, webRequest);

View File

@ -67,6 +67,7 @@ public abstract class AbstractMockMvcBuilder<B extends AbstractMockMvcBuilder<B>
private final List<MockMvcConfigurer> configurers = new ArrayList<>(4); private final List<MockMvcConfigurer> configurers = new ArrayList<>(4);
@Override
public final <T extends B> T addFilters(Filter... filters) { public final <T extends B> T addFilters(Filter... filters) {
Assert.notNull(filters, "filters cannot be null"); Assert.notNull(filters, "filters cannot be null");
for (Filter f : filters) { for (Filter f : filters) {
@ -76,6 +77,7 @@ public abstract class AbstractMockMvcBuilder<B extends AbstractMockMvcBuilder<B>
return self(); return self();
} }
@Override
public final <T extends B> T addFilter(Filter filter, String... urlPatterns) { public final <T extends B> T addFilter(Filter filter, String... urlPatterns) {
Assert.notNull(filter, "filter cannot be null"); Assert.notNull(filter, "filter cannot be null");
Assert.notNull(urlPatterns, "urlPatterns cannot be null"); Assert.notNull(urlPatterns, "urlPatterns cannot be null");
@ -86,16 +88,19 @@ public abstract class AbstractMockMvcBuilder<B extends AbstractMockMvcBuilder<B>
return self(); return self();
} }
@Override
public final <T extends B> T defaultRequest(RequestBuilder requestBuilder) { public final <T extends B> T defaultRequest(RequestBuilder requestBuilder) {
this.defaultRequestBuilder = requestBuilder; this.defaultRequestBuilder = requestBuilder;
return self(); return self();
} }
@Override
public final <T extends B> T alwaysExpect(ResultMatcher resultMatcher) { public final <T extends B> T alwaysExpect(ResultMatcher resultMatcher) {
this.globalResultMatchers.add(resultMatcher); this.globalResultMatchers.add(resultMatcher);
return self(); return self();
} }
@Override
public final <T extends B> T alwaysDo(ResultHandler resultHandler) { public final <T extends B> T alwaysDo(ResultHandler resultHandler) {
this.globalResultHandlers.add(resultHandler); this.globalResultHandlers.add(resultHandler);
return self(); return self();
@ -106,11 +111,13 @@ public abstract class AbstractMockMvcBuilder<B extends AbstractMockMvcBuilder<B>
return self(); return self();
} }
@Override
public final <T extends B> T dispatchOptions(boolean dispatchOptions) { public final <T extends B> T dispatchOptions(boolean dispatchOptions) {
return addDispatcherServletCustomizer( return addDispatcherServletCustomizer(
dispatcherServlet -> dispatcherServlet.setDispatchOptionsRequest(dispatchOptions)); dispatcherServlet -> dispatcherServlet.setDispatchOptionsRequest(dispatchOptions));
} }
@Override
public final <T extends B> T apply(MockMvcConfigurer configurer) { public final <T extends B> T apply(MockMvcConfigurer configurer) {
configurer.afterConfigurerAdded(this); configurer.afterConfigurerAdded(this);
this.configurers.add(configurer); this.configurers.add(configurer);

View File

@ -46,6 +46,7 @@ public class RollbackOverrideDefaultRollbackFalseRollbackAnnotationTransactional
private static JdbcTemplate jdbcTemplate; private static JdbcTemplate jdbcTemplate;
@Override
@Autowired @Autowired
public void setDataSource(DataSource dataSource) { public void setDataSource(DataSource dataSource) {
jdbcTemplate = new JdbcTemplate(dataSource); jdbcTemplate = new JdbcTemplate(dataSource);

View File

@ -44,6 +44,7 @@ public class RollbackOverrideDefaultRollbackTrueTransactionalTests
private static JdbcTemplate jdbcTemplate; private static JdbcTemplate jdbcTemplate;
@Override
@Autowired @Autowired
public void setDataSource(DataSource dataSource) { public void setDataSource(DataSource dataSource) {
jdbcTemplate = new JdbcTemplate(dataSource); jdbcTemplate = new JdbcTemplate(dataSource);

View File

@ -38,6 +38,7 @@ public class PersonEntity extends PersistentEntity implements Person {
private Number favoriteNumber; private Number favoriteNumber;
@Override
public String getName() { public String getName() {
return this.name; return this.name;
} }
@ -47,6 +48,7 @@ public class PersonEntity extends PersistentEntity implements Person {
this.name = name; this.name = name;
} }
@Override
public int getAge() { public int getAge() {
return this.age; return this.age;
} }
@ -55,6 +57,7 @@ public class PersonEntity extends PersistentEntity implements Person {
this.age = age; this.age = age;
} }
@Override
public String getEyeColor() { public String getEyeColor() {
return this.eyeColor; return this.eyeColor;
} }
@ -63,6 +66,7 @@ public class PersonEntity extends PersistentEntity implements Person {
this.eyeColor = eyeColor; this.eyeColor = eyeColor;
} }
@Override
public boolean likesPets() { public boolean likesPets() {
return this.likesPets; return this.likesPets;
} }
@ -71,6 +75,7 @@ public class PersonEntity extends PersistentEntity implements Person {
this.likesPets = likesPets; this.likesPets = likesPets;
} }
@Override
public Number getFavoriteNumber() { public Number getFavoriteNumber() {
return this.favoriteNumber; return this.favoriteNumber;
} }

View File

@ -538,6 +538,7 @@ public class MockHttpServletRequestBuilderTests {
return this; return this;
} }
@Override
public MockHttpServletRequest postProcessRequest(MockHttpServletRequest request) { public MockHttpServletRequest postProcessRequest(MockHttpServletRequest request) {
request.setAttribute(attr, value); request.setAttribute(attr, value);
return request; return request;

View File

@ -115,6 +115,7 @@ public class EncodedUriTests {
@Component @Component
private static class HandlerMappingConfigurer implements BeanPostProcessor, PriorityOrdered { private static class HandlerMappingConfigurer implements BeanPostProcessor, PriorityOrdered {
@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
if (bean instanceof RequestMappingHandlerMapping) { if (bean instanceof RequestMappingHandlerMapping) {
RequestMappingHandlerMapping requestMappingHandlerMapping = (RequestMappingHandlerMapping) bean; RequestMappingHandlerMapping requestMappingHandlerMapping = (RequestMappingHandlerMapping) bean;
@ -125,10 +126,12 @@ public class EncodedUriTests {
return bean; return bean;
} }
@Override
public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException { public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
return bean; return bean;
} }
@Override
public int getOrder() { public int getOrder() {
return PriorityOrdered.HIGHEST_PRECEDENCE; return PriorityOrdered.HIGHEST_PRECEDENCE;
} }

View File

@ -249,6 +249,7 @@ public class AsyncTests {
public DeferredResult<Person> getDeferredResultWithDelayedError() { public DeferredResult<Person> getDeferredResultWithDelayedError() {
final DeferredResult<Person> deferredResult = new DeferredResult<>(); final DeferredResult<Person> deferredResult = new DeferredResult<>();
new Thread() { new Thread() {
@Override
public void run() { public void run() {
try { try {
Thread.sleep(100); Thread.sleep(100);

View File

@ -80,6 +80,7 @@ public abstract class AbstractGenericHttpMessageConverter<T> extends AbstractHtt
* This implementation sets the default headers by calling {@link #addDefaultHeaders}, * This implementation sets the default headers by calling {@link #addDefaultHeaders},
* and then calls {@link #writeInternal}. * and then calls {@link #writeInternal}.
*/ */
@Override
public final void write(final T t, @Nullable final Type type, @Nullable MediaType contentType, public final void write(final T t, @Nullable final Type type, @Nullable MediaType contentType,
HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException { HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException {

View File

@ -295,6 +295,7 @@ final class DefaultPathContainer implements PathContainer {
return this.value.hashCode(); return this.value.hashCode();
} }
@Override
public String toString() { public String toString() {
return "[value='" + this.value + "']"; return "[value='" + this.value + "']";
} }

View File

@ -83,6 +83,7 @@ public abstract class AbstractServerHttpRequest implements ServerHttpRequest {
} }
@Override
public String getId() { public String getId() {
if (this.id == null) { if (this.id == null) {
this.id = initId(); this.id = initId();

View File

@ -177,6 +177,7 @@ class ServletServerHttpRequest extends AbstractServerHttpRequest {
return new InetSocketAddress(this.request.getRemoteHost(), this.request.getRemotePort()); return new InetSocketAddress(this.request.getRemoteHost(), this.request.getRemotePort());
} }
@Override
@Nullable @Nullable
protected SslInfo initSslInfo() { protected SslInfo initSslInfo() {
X509Certificate[] certificates = getX509Certificates(); X509Certificate[] certificates = getX509Certificates();

View File

@ -45,6 +45,7 @@ public class SpringWebConstraintValidatorFactory implements ConstraintValidatorF
} }
// Bean Validation 1.1 releaseInstance method // Bean Validation 1.1 releaseInstance method
@Override
public void releaseInstance(ConstraintValidator<?, ?> instance) { public void releaseInstance(ConstraintValidator<?, ?> instance) {
getWebApplicationContext().getAutowireCapableBeanFactory().destroyBean(instance); getWebApplicationContext().getAutowireCapableBeanFactory().destroyBean(instance);
} }

View File

@ -118,6 +118,7 @@ public class WebAsyncTask<V> implements BeanFactoryAware {
* <p>This factory reference will automatically be set when * <p>This factory reference will automatically be set when
* {@code WebAsyncTask} is used within a Spring MVC controller. * {@code WebAsyncTask} is used within a Spring MVC controller.
*/ */
@Override
public void setBeanFactory(BeanFactory beanFactory) { public void setBeanFactory(BeanFactory beanFactory) {
this.beanFactory = beanFactory; this.beanFactory = beanFactory;
} }

View File

@ -147,6 +147,7 @@ public class AnnotationConfigWebApplicationContext extends AbstractRefreshableWe
* @see #setConfigLocation(String) * @see #setConfigLocation(String)
* @see #refresh() * @see #refresh()
*/ */
@Override
public void register(Class<?>... annotatedClasses) { public void register(Class<?>... annotatedClasses) {
Assert.notEmpty(annotatedClasses, "At least one annotated class must be specified"); Assert.notEmpty(annotatedClasses, "At least one annotated class must be specified");
Collections.addAll(this.annotatedClasses, annotatedClasses); Collections.addAll(this.annotatedClasses, annotatedClasses);
@ -162,6 +163,7 @@ public class AnnotationConfigWebApplicationContext extends AbstractRefreshableWe
* @see #setConfigLocation(String) * @see #setConfigLocation(String)
* @see #refresh() * @see #refresh()
*/ */
@Override
public void scan(String... basePackages) { public void scan(String... basePackages) {
Assert.notEmpty(basePackages, "At least one base package must be specified"); Assert.notEmpty(basePackages, "At least one base package must be specified");
Collections.addAll(this.basePackages, basePackages); Collections.addAll(this.basePackages, basePackages);

View File

@ -154,22 +154,27 @@ public class GroovyWebApplicationContext extends AbstractRefreshableWebApplicati
// Implementation of the GroovyObject interface // Implementation of the GroovyObject interface
@Override
public void setMetaClass(MetaClass metaClass) { public void setMetaClass(MetaClass metaClass) {
this.metaClass = metaClass; this.metaClass = metaClass;
} }
@Override
public MetaClass getMetaClass() { public MetaClass getMetaClass() {
return this.metaClass; return this.metaClass;
} }
@Override
public Object invokeMethod(String name, Object args) { public Object invokeMethod(String name, Object args) {
return this.metaClass.invokeMethod(this, name, args); return this.metaClass.invokeMethod(this, name, args);
} }
@Override
public void setProperty(String property, Object newValue) { public void setProperty(String property, Object newValue) {
this.metaClass.setProperty(this, property, newValue); this.metaClass.setProperty(this, property, newValue);
} }
@Override
@Nullable @Nullable
public Object getProperty(String property) { public Object getProperty(String property) {
if (containsBean(property)) { if (containsBean(property)) {

View File

@ -140,6 +140,7 @@ public class InMemoryWebSessionStore implements WebSessionStore {
return Mono.empty(); return Mono.empty();
} }
@Override
public Mono<WebSession> updateLastAccessTime(WebSession session) { public Mono<WebSession> updateLastAccessTime(WebSession session) {
return Mono.fromSupplier(() -> { return Mono.fromSupplier(() -> {
Assert.isInstanceOf(InMemoryWebSession.class, session); Assert.isInstanceOf(InMemoryWebSession.class, session);

View File

@ -127,6 +127,7 @@ public class ContentCachingResponseWrapper extends HttpServletResponseWrapper {
} }
// Overrides Servlet 3.1 setContentLengthLong(long) at runtime // Overrides Servlet 3.1 setContentLengthLong(long) at runtime
@Override
public void setContentLengthLong(long len) { public void setContentLengthLong(long len) {
if (len > Integer.MAX_VALUE) { if (len > Integer.MAX_VALUE) {
throw new IllegalArgumentException("Content-Length exceeds ContentCachingResponseWrapper's maximum (" + throw new IllegalArgumentException("Content-Length exceeds ContentCachingResponseWrapper's maximum (" +

View File

@ -195,16 +195,19 @@ public class DefaultUriBuilderFactory implements UriBuilderFactory {
// UriTemplateHandler // UriTemplateHandler
@Override
public URI expand(String uriTemplate, Map<String, ?> uriVars) { public URI expand(String uriTemplate, Map<String, ?> uriVars) {
return uriString(uriTemplate).build(uriVars); return uriString(uriTemplate).build(uriVars);
} }
@Override
public URI expand(String uriTemplate, Object... uriVars) { public URI expand(String uriTemplate, Object... uriVars) {
return uriString(uriTemplate).build(uriVars); return uriString(uriTemplate).build(uriVars);
} }
// UriBuilderFactory // UriBuilderFactory
@Override
public UriBuilder uriString(String uriTemplate) { public UriBuilder uriString(String uriTemplate) {
return new DefaultUriBuilder(uriTemplate); return new DefaultUriBuilder(uriTemplate);
} }

View File

@ -112,6 +112,7 @@ class CaptureTheRestPathElement extends PathElement {
} }
@Override
public String toString() { public String toString() {
return "CaptureTheRest(/{*" + this.variableName + "})"; return "CaptureTheRest(/{*" + this.variableName + "})";
} }

View File

@ -150,11 +150,13 @@ class CaptureVariablePathElement extends PathElement {
} }
@Override
public String toString() { public String toString() {
return "CaptureVariable({" + this.variableName + return "CaptureVariable({" + this.variableName +
(this.constraintPattern != null ? ":" + this.constraintPattern.pattern() : "") + "})"; (this.constraintPattern != null ? ":" + this.constraintPattern.pattern() : "") + "})";
} }
@Override
public char[] getChars() { public char[] getChars() {
StringBuilder b = new StringBuilder(); StringBuilder b = new StringBuilder();
b.append("{"); b.append("{");

View File

@ -113,11 +113,13 @@ class LiteralPathElement extends PathElement {
return this.len; return this.len;
} }
@Override
public char[] getChars() { public char[] getChars() {
return this.text; return this.text;
} }
@Override
public String toString() { public String toString() {
return "Literal(" + String.valueOf(this.text) + ")"; return "Literal(" + String.valueOf(this.text) + ")";
} }

View File

@ -203,6 +203,7 @@ class RegexPathElement extends PathElement {
} }
@Override
public String toString() { public String toString() {
return "Regex(" + String.valueOf(this.regex) + ")"; return "Regex(" + String.valueOf(this.regex) + ")";
} }

View File

@ -62,10 +62,12 @@ class SeparatorPathElement extends PathElement {
return 1; return 1;
} }
@Override
public String toString() { public String toString() {
return "Separator(" + this.separator + ")"; return "Separator(" + this.separator + ")";
} }
@Override
public char[] getChars() { public char[] getChars() {
return new char[] {this.separator}; return new char[] {this.separator};
} }

View File

@ -126,6 +126,7 @@ class SingleCharWildcardedPathElement extends PathElement {
} }
@Override
public String toString() { public String toString() {
return "SingleCharWildcarded(" + String.valueOf(this.text) + ")"; return "SingleCharWildcarded(" + String.valueOf(this.text) + ")";
} }

View File

@ -97,6 +97,7 @@ class WildcardPathElement extends PathElement {
} }
@Override
public String toString() { public String toString() {
return "Wildcard(*)"; return "Wildcard(*)";
} }

View File

@ -53,6 +53,7 @@ class WildcardTheRestPathElement extends PathElement {
} }
@Override
public String toString() { public String toString() {
return "WildcardTheRest(" + this.separator + "**)"; return "WildcardTheRest(" + this.separator + "**)";
} }

View File

@ -455,10 +455,12 @@ public class MappingJackson2HttpMessageConverterTests {
private String string; private String string;
@Override
public String getString() { public String getString() {
return string; return string;
} }
@Override
public void setString(String string) { public void setString(String string) {
this.string = string; this.string = string;
} }

View File

@ -228,6 +228,7 @@ public class SpringHandlerInstantiatorTests {
} }
// New in Jackson 2.7 // New in Jackson 2.7
@Override
public String getDescForKnownTypeIds() { public String getDescForKnownTypeIds() {
return null; return null;
} }

View File

@ -132,6 +132,7 @@ public final class ConsumesRequestCondition extends AbstractRequestCondition<Con
/** /**
* Whether the condition has any media type expressions. * Whether the condition has any media type expressions.
*/ */
@Override
public boolean isEmpty() { public boolean isEmpty() {
return this.expressions.isEmpty(); return this.expressions.isEmpty();
} }

View File

@ -69,6 +69,7 @@ public class ViewResolversBeanDefinitionParser implements BeanDefinitionParser {
public static final String VIEW_RESOLVER_BEAN_NAME = "mvcViewResolver"; public static final String VIEW_RESOLVER_BEAN_NAME = "mvcViewResolver";
@Override
public BeanDefinition parse(Element element, ParserContext context) { public BeanDefinition parse(Element element, ParserContext context) {
Object source = context.extractSource(element); Object source = context.extractSource(element);
context.pushContainingComponent(new CompositeComponentDefinition(element.getTagName(), source)); context.pushContainingComponent(new CompositeComponentDefinition(element.getTagName(), source));

View File

@ -78,6 +78,7 @@ class DefaultResourceTransformerChain implements ResourceTransformerChain {
} }
@Override
public ResourceResolverChain getResolverChain() { public ResourceResolverChain getResolverChain() {
return this.resolverChain; return this.resolverChain;
} }

View File

@ -121,6 +121,7 @@ public class GroovyMarkupConfigurer extends TemplateConfiguration
this.templateEngine = templateEngine; this.templateEngine = templateEngine;
} }
@Override
public MarkupTemplateEngine getTemplateEngine() { public MarkupTemplateEngine getTemplateEngine() {
Assert.state(this.templateEngine != null, "No MarkupTemplateEngine set"); Assert.state(this.templateEngine != null, "No MarkupTemplateEngine set");
return this.templateEngine; return this.templateEngine;

View File

@ -578,6 +578,7 @@ public class MvcUriComponentsBuilderTests {
static class PersonCrudController extends AbstractCrudController<Person, Long> { static class PersonCrudController extends AbstractCrudController<Person, Long> {
@Override
@RequestMapping(path = "/{id}", method = RequestMethod.GET) @RequestMapping(path = "/{id}", method = RequestMethod.GET)
public Person get(@PathVariable Long id) { public Person get(@PathVariable Long id) {
return new Person(); return new Person();

View File

@ -3230,11 +3230,13 @@ public class ServletAnnotationControllerHandlerMethodTests extends AbstractServl
@RequestMapping(path = ApiConstants.ARTICLES_PATH) @RequestMapping(path = ApiConstants.ARTICLES_PATH)
public static class ArticleController implements ApiConstants, ResourceEndpoint<Article, ArticlePredicate> { public static class ArticleController implements ApiConstants, ResourceEndpoint<Article, ArticlePredicate> {
@Override
@GetMapping(params = "page") @GetMapping(params = "page")
public Collection<Article> find(String pageable, ArticlePredicate predicate) { public Collection<Article> find(String pageable, ArticlePredicate predicate) {
throw new UnsupportedOperationException("not implemented"); throw new UnsupportedOperationException("not implemented");
} }
@Override
@GetMapping @GetMapping
public List<Article> find(boolean sort, ArticlePredicate predicate) { public List<Article> find(boolean sort, ArticlePredicate predicate) {
throw new UnsupportedOperationException("not implemented"); throw new UnsupportedOperationException("not implemented");

View File

@ -60,6 +60,7 @@ public abstract class AbstractWebSocketMessage<T> implements WebSocketMessage<T>
/** /**
* Return the message payload (never {@code null}). * Return the message payload (never {@code null}).
*/ */
@Override
public T getPayload() { public T getPayload() {
return this.payload; return this.payload;
} }
@ -67,6 +68,7 @@ public abstract class AbstractWebSocketMessage<T> implements WebSocketMessage<T>
/** /**
* Whether this is the last part of a message sent as a series of partial messages. * Whether this is the last part of a message sent as a series of partial messages.
*/ */
@Override
public boolean isLast() { public boolean isLast() {
return this.last; return this.last;
} }

View File

@ -139,6 +139,7 @@ public class StandardWebSocketSession extends AbstractWebSocketSession<Session>
return this.extensions; return this.extensions;
} }
@Override
public Principal getPrincipal() { public Principal getPrincipal() {
return this.user; return this.user;
} }

View File

@ -209,6 +209,7 @@ public class WebSocketMessageBrokerStats {
return str.substring(str.indexOf("pool"), str.length() - 1); return str.substring(str.indexOf("pool"), str.length() - 1);
} }
@Override
public String toString() { public String toString() {
return "WebSocketSession[" + getWebSocketSessionStatsInfo() + "]" + return "WebSocketSession[" + getWebSocketSessionStatsInfo() + "]" +
", stompSubProtocol[" + getStompSubProtocolStatsInfo() + "]" + ", stompSubProtocol[" + getStompSubProtocolStatsInfo() + "]" +

View File

@ -169,6 +169,7 @@ public class DefaultSimpUserRegistry implements SimpUserRegistry, SmartApplicati
return this.users.size(); return this.users.size();
} }
@Override
public Set<SimpSubscription> findSubscriptions(SimpSubscriptionMatcher matcher) { public Set<SimpSubscription> findSubscriptions(SimpSubscriptionMatcher matcher) {
Set<SimpSubscription> result = new HashSet<>(); Set<SimpSubscription> result = new HashSet<>();
for (LocalSimpSession session : this.sessions.values()) { for (LocalSimpSession session : this.sessions.values()) {

View File

@ -221,6 +221,7 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE
/** /**
* Handle incoming WebSocket messages from clients. * Handle incoming WebSocket messages from clients.
*/ */
@Override
public void handleMessageFromClient(WebSocketSession session, public void handleMessageFromClient(WebSocketSession session,
WebSocketMessage<?> webSocketMessage, MessageChannel outputChannel) { WebSocketMessage<?> webSocketMessage, MessageChannel outputChannel) {
@ -716,6 +717,7 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE
return this.disconnect.get(); return this.disconnect.get();
} }
@Override
public String toString() { public String toString() {
return "processed CONNECT(" + this.connect.get() + ")-CONNECTED(" + return "processed CONNECT(" + this.connect.get() + ")-CONNECTED(" +
this.connected.get() + ")-DISCONNECT(" + this.disconnect.get() + ")"; this.connected.get() + ")-DISCONNECT(" + this.disconnect.get() + ")";

Some files were not shown because too many files have changed in this diff Show More