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') }
Activity
Paul King
made changes -
| Field | Original Value | New Value |
|---|---|---|
| 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') } |
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: {code} import groovy.xml.dom.DOMCategory use(DOMCategory) { def prop = doc.createElement('property') prop.setAttribute('name', 'cache.class') prop.setValue('true') } {code} |
Paul King
made changes -
| Status | Open [ 1 ] | Closed [ 6 ] |
| Assignee | Paul King [ paulk ] | |
| Fix Version/s | 2.0-beta-3 [ 18244 ] | |
| Fix Version/s | 1.8.6 [ 18245 ] | |
| Resolution | Fixed [ 1 ] |
add code tags