Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
1.0-JSR-5
-
None
Description
DomBuilder.createNode() raises NPE exception if attribute value is null.
line 182 element.setAttribute(attrName, value.toString());
It's very inconveniently check every attribute for null value in script.
Exampe:
def element = xml.DOCUMENT (
ASSET: assetId == null ? "" : asset,
EXCHANGE_RATE: exchangeRate == null ? "" : exchangeRate,
...
At the same time SaxBuilder do this check
line 109 :
String valueText = (value != null) ? value.toString() : "";
I think DomBuilder.parseNode() must be done the same way. Null value must be interpreted like empty string.