Polishing

(cherry picked from commit 2675ce7)
This commit is contained in:
Juergen Hoeller
2014-11-22 18:05:35 +01:00
parent 8854c33bf7
commit 5f58cd3b79
7 changed files with 84 additions and 74 deletions

View File

@@ -54,6 +54,7 @@ import org.springframework.core.io.DescriptiveResource;
import org.springframework.core.io.Resource;
import org.springframework.core.io.support.EncodedResource;
import org.springframework.core.io.support.ResourcePatternUtils;
import org.springframework.util.ObjectUtils;
/**
* A Groovy-based reader for Spring bean definitions: like a Groovy builder,
@@ -269,10 +270,9 @@ public class GroovyBeanDefinitionReader extends AbstractBeanDefinitionReader imp
try {
Closure callable = null;
Collection constructorArgs = null;
if (args != null && args.length > 0) {
if (!ObjectUtils.isEmpty(args)) {
int index = args.length;
Object lastArg = args[index-1];
if (lastArg instanceof Closure) {
callable = (Closure) lastArg;
index--;