ASF Bugzilla – Attachment 32147 Details for
Bug 57148
EL type conversion of empty string when there is a PropertyEditor (ELSupport.coerceToType())
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
2014-10-27_tc8_57148_v1.patch
2014-10-27_tc8_57148_v1.patch (text/plain), 1.33 KB, created by
Konstantin Kolinko
on 2014-10-26 22:49:27 UTC
(
hide
)
Description:
2014-10-27_tc8_57148_v1.patch
Filename:
MIME Type:
Creator:
Konstantin Kolinko
Created:
2014-10-26 22:49:27 UTC
Size:
1.33 KB
patch
obsolete
>Index: java/org/apache/el/lang/ELSupport.java >=================================================================== >--- java/org/apache/el/lang/ELSupport.java (revision 1634236) >+++ java/org/apache/el/lang/ELSupport.java (working copy) >@@ -465,12 +465,24 @@ > if (obj == null) > return null; > if (obj instanceof String) { >- if ("".equals(obj)) >- return null; > PropertyEditor editor = PropertyEditorManager.findEditor(type); >- if (editor != null) { >- editor.setAsText((String) obj); >- return editor.getValue(); >+ if (editor == null) { >+ if ("".equals(obj)) { >+ return null; >+ } >+ throw new ELException(MessageFactory.get("error.convert", obj, >+ obj.getClass(), type)); >+ } else { >+ try { >+ editor.setAsText((String) obj); >+ return editor.getValue(); >+ } catch (RuntimeException e) { >+ if ("".equals(obj)) { >+ return null; >+ } >+ throw new ELException(MessageFactory.get("error.convert", >+ obj, obj.getClass(), type), e); >+ } > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 57148
: 32147