diff --git a/spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java b/spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java index 3224b66c522..1074aa53f14 100644 --- a/spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java +++ b/spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java @@ -318,7 +318,6 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp callable.call(this.currentBeanDefinition); } return this.currentBeanDefinition.getBeanDefinition(); - } finally { this.currentBeanDefinition = current; @@ -371,9 +370,9 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp } else if ("ref".equals(name)) { String refName; - if (args[0] == null) + if (args[0] == null) { throw new IllegalArgumentException("Argument to ref() is not a valid bean or was not found"); - + } if (args[0] instanceof RuntimeBeanReference) { refName = ((RuntimeBeanReference) args[0]).getBeanName(); } @@ -492,11 +491,11 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp Map.Entry factoryBeanEntry = (Map.Entry) ((Map) args[0]).entrySet().iterator().next(); // If we have a closure body, that will be the last argument. // In between are the constructor args - int constructorArgsTest = hasClosureArgument?2:1; + int constructorArgsTest = (hasClosureArgument ? 2 : 1); // If we have more than this number of args, we have constructor args if (args.length > constructorArgsTest){ // factory-method requires args - int endOfConstructArgs = (hasClosureArgument? args.length - 1 : args.length); + int endOfConstructArgs = (hasClosureArgument ? args.length - 1 : args.length); this.currentBeanDefinition = new GroovyBeanDefinitionWrapper(beanName, null, resolveConstructorArguments(args, 1, endOfConstructArgs)); } @@ -514,7 +513,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp } else { List constructorArgs = resolveConstructorArguments(args, 0, hasClosureArgument ? args.length - 1 : args.length); - currentBeanDefinition = new GroovyBeanDefinitionWrapper(beanName, null, constructorArgs); + this.currentBeanDefinition = new GroovyBeanDefinitionWrapper(beanName, null, constructorArgs); } if (hasClosureArgument) { @@ -633,7 +632,7 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp /** * This method overrides property retrieval in the scope of the - * {@code GroovyBeanDefinitionReader} to either: + * {@code GroovyBeanDefinitionReader}. A property retrieval will either: *
* public class Bean {
@@ -216,7 +216,7 @@ class ExtendedBeanInfo implements BeanInfo {
}
private String propertyNameFor(Method method) {
- return Introspector.decapitalize(method.getName().substring(3, method.getName().length()));
+ return Introspector.decapitalize(method.getName().substring(3));
}
@@ -464,7 +464,7 @@ class ExtendedBeanInfo implements BeanInfo {
}
/*
- * See java.beans.IndexedPropertyDescriptor#equals(java.lang.Object)
+ * See java.beans.IndexedPropertyDescriptor#equals
*/
@Override
public boolean equals(Object other) {
diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java
index 6e0f3fbaa0b..2de74920948 100644
--- a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java
+++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java
@@ -622,6 +622,7 @@ public class DefaultSingletonBeanRegistry extends SimpleAliasRegistry implements
* should not have their own mutexes involved in singleton creation,
* to avoid the potential for deadlocks in lazy-init situations.
*/
+ @Override
public final Object getSingletonMutex() {
return this.singletonObjects;
}
diff --git a/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/JCacheAspectSupport.java b/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/JCacheAspectSupport.java
index d75f8eb1c73..19b57d45e56 100644
--- a/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/JCacheAspectSupport.java
+++ b/spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/JCacheAspectSupport.java
@@ -77,6 +77,7 @@ public class JCacheAspectSupport extends AbstractCacheInvoker implements Initial
return this.cacheOperationSource;
}
+ @Override
public void afterPropertiesSet() {
Assert.state(getCacheOperationSource() != null, "The 'cacheOperationSource' property is required: " +
"If there are no cacheable methods, then don't use a cache aspect.");