Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
爱吃血肠
spring-framework
提交
c69e6a36
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,发现更多精彩内容 >>
提交
c69e6a36
编写于
9月 13, 2016
作者:
J
Juergen Hoeller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revised IllegalArgumentException handling for Formatter parse calls
Issue: SPR-14661
上级
0c2e8a62
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
11 addition
and
7 deletion
+11
-7
spring-beans/src/main/java/org/springframework/beans/AbstractNestablePropertyAccessor.java
...ringframework/beans/AbstractNestablePropertyAccessor.java
+1
-1
spring-beans/src/main/java/org/springframework/beans/TypeConverterSupport.java
.../java/org/springframework/beans/TypeConverterSupport.java
+1
-1
spring-context/src/main/java/org/springframework/format/support/FormatterPropertyEditorAdapter.java
...mework/format/support/FormatterPropertyEditorAdapter.java
+4
-2
spring-context/src/main/java/org/springframework/format/support/FormattingConversionService.java
...framework/format/support/FormattingConversionService.java
+5
-3
未找到文件。
spring-beans/src/main/java/org/springframework/beans/AbstractNestablePropertyAccessor.java
浏览文件 @
c69e6a36
...
...
@@ -572,7 +572,7 @@ public abstract class AbstractNestablePropertyAccessor extends AbstractPropertyA
new
PropertyChangeEvent
(
this
.
rootObject
,
this
.
nestedPath
+
propertyName
,
oldValue
,
newValue
);
throw
new
ConversionNotSupportedException
(
pce
,
requiredType
,
ex
);
}
catch
(
Throwable
ex
)
{
catch
(
IllegalArgumentException
ex
)
{
PropertyChangeEvent
pce
=
new
PropertyChangeEvent
(
this
.
rootObject
,
this
.
nestedPath
+
propertyName
,
oldValue
,
newValue
);
throw
new
TypeMismatchException
(
pce
,
requiredType
,
ex
);
...
...
spring-beans/src/main/java/org/springframework/beans/TypeConverterSupport.java
浏览文件 @
c69e6a36
...
...
@@ -73,7 +73,7 @@ public abstract class TypeConverterSupport extends PropertyEditorRegistrySupport
catch
(
IllegalStateException
ex
)
{
throw
new
ConversionNotSupportedException
(
value
,
requiredType
,
ex
);
}
catch
(
Throwable
ex
)
{
catch
(
IllegalArgumentException
ex
)
{
throw
new
TypeMismatchException
(
value
,
requiredType
,
ex
);
}
}
...
...
spring-context/src/main/java/org/springframework/format/support/FormatterPropertyEditorAdapter.java
浏览文件 @
c69e6a36
...
...
@@ -18,7 +18,6 @@ package org.springframework.format.support;
import
java.beans.PropertyEditor
;
import
java.beans.PropertyEditorSupport
;
import
java.text.ParseException
;
import
org.springframework.context.i18n.LocaleContextHolder
;
import
org.springframework.format.Formatter
;
...
...
@@ -65,7 +64,10 @@ public class FormatterPropertyEditorAdapter extends PropertyEditorSupport {
try
{
setValue
(
this
.
formatter
.
parse
(
text
,
LocaleContextHolder
.
getLocale
()));
}
catch
(
ParseException
ex
)
{
catch
(
IllegalArgumentException
ex
)
{
throw
ex
;
}
catch
(
Throwable
ex
)
{
throw
new
IllegalArgumentException
(
"Parse attempt failed for value ["
+
text
+
"]"
,
ex
);
}
}
...
...
spring-context/src/main/java/org/springframework/format/support/FormattingConversionService.java
浏览文件 @
c69e6a36
...
...
@@ -17,7 +17,6 @@
package
org.springframework.format.support
;
import
java.lang.annotation.Annotation
;
import
java.text.ParseException
;
import
java.util.Collections
;
import
java.util.Map
;
import
java.util.Set
;
...
...
@@ -193,11 +192,14 @@ public class FormattingConversionService extends GenericConversionService
try
{
result
=
this
.
parser
.
parse
(
text
,
LocaleContextHolder
.
getLocale
());
}
catch
(
ParseException
ex
)
{
catch
(
IllegalArgumentException
ex
)
{
throw
ex
;
}
catch
(
Throwable
ex
)
{
throw
new
IllegalArgumentException
(
"Parse attempt failed for value ["
+
text
+
"]"
,
ex
);
}
if
(
result
==
null
)
{
throw
new
IllegalStateException
(
"Parsers are not allowed to return null
"
);
throw
new
IllegalStateException
(
"Parsers are not allowed to return null
: "
+
this
.
parser
);
}
TypeDescriptor
resultType
=
TypeDescriptor
.
valueOf
(
result
.
getClass
());
if
(!
resultType
.
isAssignableTo
(
targetType
))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录