prototype beans receive independent collection/array even when based on single value (SPR-5512)

git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@663 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
Juergen Hoeller
2009-02-21 18:04:08 +00:00
parent 2e4d84d32d
commit 6656a76cae
4 changed files with 63 additions and 7 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2008 the original author or authors.
* Copyright 2002-2009 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@ import java.security.AccessController;
import java.security.PrivilegedAction;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -1249,7 +1250,8 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
}
deepCopy.add(pv);
}
else if (originalValue instanceof TypedStringValue && convertible) {
else if (originalValue instanceof TypedStringValue && convertible &&
!(convertedValue instanceof Collection || ObjectUtils.isArray(convertedValue))) {
pv.setConvertedValue(convertedValue);
deepCopy.add(pv);
}