Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Not A Bug
-
Affects Version/s: 1.4.2
-
Fix Version/s: 1.x Maintenance
-
Component/s: Converters
-
Labels:None
Description
<myInstrument>
<myInstrumentId>20</paymentInstrumentId>
<nickName>XYZ</nickName>
<defaultInstrument/>
</myInstrument>
I have define the data type for defaultInstrument to be Boolean. And I expect this value to be null if nothing is passed in the request so that I don't end up updating the already stored default value of this instrument. I looked into the BooleanConvertor code.
public Object fromString(final String str) {
if (caseSensitive)
else
{ return positive.equalsIgnoreCase(str) ? Boolean.TRUE : Boolean.FALSE; }}
There is no check if its primitive type or an Object and to take a decision that value can be null for the object. Is there a way to handle this wo\ithout having to right a custom converter.
The converter cannot receive null, therefore no such check is required.