Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
a9da1232
S
spring-framework
项目概览
爱吃血肠
/
spring-framework
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
spring-framework
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a9da1232
编写于
8月 19, 2010
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
temporarily disabled constructor argument caching for converted values (SPR-7423)
上级
001d676d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
11 addition
and
7 deletion
+11
-7
build-spring-framework/resources/changelog.txt
build-spring-framework/resources/changelog.txt
+2
-2
org.springframework.beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java
...gframework/beans/factory/support/ConstructorResolver.java
+7
-5
org.springframework.beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
...mework/beans/factory/DefaultListableBeanFactoryTests.java
+2
-0
未找到文件。
build-spring-framework/resources/changelog.txt
浏览文件 @
a9da1232
...
...
@@ -3,7 +3,7 @@ SPRING FRAMEWORK CHANGELOG
http://www.springsource.org
Changes in version 3.0.4 (2010-08-1
8
)
Changes in version 3.0.4 (2010-08-1
9
)
-------------------------------------
* support for Hibernate Core 3.6, Hibernate Validator 4.1, EclipseLink 2.1, EHCache 2.2
...
...
@@ -17,7 +17,7 @@ Changes in version 3.0.4 (2010-08-18)
* fixed double ConversionFailedException nesting for ObjectToObjectConverter invocations
* BeanWrapper preserves annotation information for individual array/list/map elements
* Spring's constructor resolution consistently finds non-public multi-arg constructors
* revised constructor argument caching
for highly concurrent creation scenario
s
* revised constructor argument caching
, avoiding a race condition for converted argument value
s
* SpEL passes full collection type context (generics, annotations) to ConversionService
* SpEL 'select last' operator now works consistently with maps
* BeanWrapper/DataBinder's "autoGrowNestedPaths" works for Maps as well
...
...
org.springframework.beans/src/main/java/org/springframework/beans/factory/support/ConstructorResolver.java
浏览文件 @
a9da1232
...
...
@@ -44,7 +44,6 @@ import org.springframework.beans.factory.UnsatisfiedDependencyException;
import
org.springframework.beans.factory.config.ConstructorArgumentValues
;
import
org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder
;
import
org.springframework.beans.factory.config.DependencyDescriptor
;
import
org.springframework.beans.factory.config.TypedStringValue
;
import
org.springframework.core.GenericTypeResolver
;
import
org.springframework.core.MethodParameter
;
import
org.springframework.core.ParameterNameDiscoverer
;
...
...
@@ -515,13 +514,13 @@ class ConstructorResolver {
}
if
(
factoryMethodToUse
==
null
)
{
boolean
hasArgs
=
resolvedValues
.
getArgumentCount
()
>
0
;
boolean
hasArgs
=
(
resolvedValues
.
getArgumentCount
()
>
0
)
;
String
argDesc
=
""
;
if
(
hasArgs
)
{
List
<
String
>
argTypes
=
new
ArrayList
<
String
>();
for
(
ValueHolder
value
:
resolvedValues
.
getIndexedArgumentValues
().
values
())
{
String
argType
=
value
.
getType
()
!=
null
?
ClassUtils
.
getShortName
(
value
.
getType
())
:
value
.
getValue
().
getClass
().
getSimpleName
();
String
argType
=
(
value
.
getType
()
!=
null
?
ClassUtils
.
getShortName
(
value
.
getType
())
:
value
.
getValue
().
getClass
().
getSimpleName
()
)
;
argTypes
.
add
(
argType
);
}
argDesc
=
StringUtils
.
collectionToCommaDelimitedString
(
argTypes
);
...
...
@@ -686,15 +685,18 @@ class ConstructorResolver {
try
{
convertedValue
=
converter
.
convertIfNecessary
(
originalValue
,
paramType
,
MethodParameter
.
forMethodOrConstructor
(
methodOrCtor
,
paramIndex
));
// TODO re-enable once race condition has been found (SPR-7423)
/*
if (originalValue == sourceValue || sourceValue instanceof TypedStringValue) {
// Either a converted value or still the original one: store converted value.
sourceHolder.setConvertedValue(convertedValue);
args.preparedArguments[paramIndex] = convertedValue;
}
else {
*/
args
.
resolveNecessary
=
true
;
args
.
preparedArguments
[
paramIndex
]
=
sourceValue
;
}
//
}
}
catch
(
TypeMismatchException
ex
)
{
throw
new
UnsatisfiedDependencyException
(
...
...
org.springframework.beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
浏览文件 @
a9da1232
...
...
@@ -36,6 +36,7 @@ import javax.security.auth.Subject;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
static
org
.
junit
.
Assert
.*;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
test.beans.DerivedTestBean
;
import
test.beans.DummyFactory
;
...
...
@@ -1752,6 +1753,7 @@ public class DefaultListableBeanFactoryTests {
*/
@Test
@Ignore
// TODO re-enable when ConstructorResolver TODO sorted out
public
void
testPrototypeCreationWithConstructorArgumentsIsFastEnough
()
{
if
(
factoryLog
.
isTraceEnabled
()
||
factoryLog
.
isDebugEnabled
())
{
// Skip this test: Trace logging blows the time limit.
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录