struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maurizio Cucchiara <mcucchi...@apache.org>
Subject Re: Some logic clarifications in com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter#doConvertToNumber(Map<String, Object>,Object,Class)
Date Wed, 08 Feb 2012 18:10:13 GMT
>
> Could existing uses be relying on the exceptions being thrown when doing
> a new BigDecimal("")?


There is no doubt that changing the order of instanceof/nullity check the
outcome is different.
As you yourself pointed out new BigDecimal("") throws a
NumberFormatException.
AFAIU the toType takes the precedence over the value itself.
Sounds like: if you want a BigDecimal and you provide a wrong value, you
will get an exception.

I could be wrong as I took a very quick look at the source code.
Did you check if there is a test which illustrates the expected behavior?


Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message