hunterhacker/jdom — pull request #124 by siddhadev (2013-11-25 12:57:44+00:00)
Title: merging CDATAs can producing an ending tag ]]> in the resulting CDATA leading to an exception

Imagine you have the following XML input:

```xml
expected:<[[D/0]]> but was:<[null]>
```

this would be a legal XML representing the following string:

expected:<[[D/0]]> but was: <[null]>

now when SAXHandler.characters() gets called, it would try to merge subsequent CDATAs, and call setText() which would fail with:

Caused by: org.jdom.IllegalDataException: The data " expected:<[[D/0]]> but was:<[null]>" is not legal for a JDOM CDATA section: CDATA cannot internally contain a CDATA ending delimiter (]]>).
at org.jdom.CDATA.setText(CDATA.java:121)
at org.jdom.CDATA.(CDATA.java:95)
at org.jdom.DefaultJDOMFactory.cdata(DefaultJDOMFactory.java:97)
at org.jdom.input.SAXHandler.flushCharacters(SAXHandler.java:652)
at org.jdom.input.SAXHandler.flushCharacters(SAXHandler.java:623)
at org.jdom.input.SAXHandler.endElement(SAXHandler.java:678)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)

It's not a nice fix, but its an easy workaround.