Skip to content

Commit bb0bc3d

Browse files
committed
Polishing
1 parent 95d6265 commit bb0bc3d

File tree

2 files changed

+11
-8
lines changed

2 files changed

+11
-8
lines changed

spring-beans-groovy/src/main/java/org/springframework/beans/factory/groovy/GroovyBeanDefinitionReader.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import groovy.lang.GroovyShell;
3232
import groovy.lang.GroovySystem;
3333
import groovy.lang.MetaClass;
34-
3534
import org.codehaus.groovy.runtime.DefaultGroovyMethods;
3635
import org.codehaus.groovy.runtime.InvokerHelper;
3736

@@ -337,8 +336,8 @@ public void xmlns(Map<String, String> definition) {
337336
if (uri == null) {
338337
throw new IllegalArgumentException("Namespace definition must supply a non-null URI");
339338
}
340-
NamespaceHandler namespaceHandler = this.groovyDslXmlBeanDefinitionReader.getNamespaceHandlerResolver().resolve(
341-
uri);
339+
NamespaceHandler namespaceHandler =
340+
this.groovyDslXmlBeanDefinitionReader.getNamespaceHandlerResolver().resolve(uri);
342341
if (namespaceHandler == null) {
343342
throw new BeanDefinitionParsingException(new Problem("No namespace handler found for URI: " + uri,
344343
new Location(new DescriptiveResource(("Groovy")))));
@@ -375,7 +374,7 @@ else if ("ref".equals(name)) {
375374
throw new IllegalArgumentException("Argument to ref() is not a valid bean or was not found");
376375

377376
if (args[0] instanceof RuntimeBeanReference) {
378-
refName = ((RuntimeBeanReference)args[0]).getBeanName();
377+
refName = ((RuntimeBeanReference) args[0]).getBeanName();
379378
}
380379
else {
381380
refName = args[0].toString();
@@ -388,15 +387,16 @@ else if ("ref".equals(name)) {
388387
}
389388
return new RuntimeBeanReference(refName, parentRef);
390389
}
391-
else if (this.namespaces.containsKey(name) && args.length > 0 && (args[0] instanceof Closure)) {
390+
else if (this.namespaces.containsKey(name) && args.length > 0 && args[0] instanceof Closure) {
392391
GroovyDynamicElementReader reader = createDynamicElementReader(name);
393392
reader.invokeMethod("doCall", args);
394393
}
395394
else if (args.length > 0 && args[0] instanceof Closure) {
396395
// abstract bean definition
397396
return invokeBeanDefiningMethod(name, args);
398397
}
399-
else if (args.length > 0 && (args[0] instanceof Class || args[0] instanceof RuntimeBeanReference || args[0] instanceof Map)) {
398+
else if (args.length > 0 &&
399+
(args[0] instanceof Class || args[0] instanceof RuntimeBeanReference || args[0] instanceof Map)) {
400400
return invokeBeanDefiningMethod(name, args);
401401
}
402402
else if (args.length > 1 && args[args.length -1] instanceof Closure) {

spring-context/src/main/java/org/springframework/cache/Cache.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,11 @@ interface ValueWrapper {
152152
Object get();
153153
}
154154

155+
155156
/**
156-
* TODO
157+
* Wrapper exception to be thrown from {@link #get(Object, Callable)}
158+
* in case of the value loader callback failing with an exception.
159+
* @since 4.3
157160
*/
158161
@SuppressWarnings("serial")
159162
class ValueRetrievalException extends RuntimeException {
@@ -167,7 +170,7 @@ public ValueRetrievalException(Object key, Callable<?> loader, Throwable ex) {
167170
}
168171

169172
public Object getKey() {
170-
return key;
173+
return this.key;
171174
}
172175

173176
}

0 commit comments

Comments
 (0)