Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.7.2
-
Fix Version/s: 1.8.6, 2.0-beta-3
-
Component/s: groovy-jdk, XML Processing
-
Labels:None
-
Number of attachments :
Description
If a newly created element has no children then a NullPointerException is thrown.
IMO in these cases the method should create a new TextElement and add the contents to it.
How to reproduce:
import groovy.xml.dom.DOMCategory use(DOMCategory) { def prop = doc.createElement('property') prop.setAttribute('name', 'cache.class') prop.setValue('true') }
add code tags