eclipse-ee4j / jaxb-fi

Apache License 2.0
8 stars 10 forks source link

StAXDocumentSerializer.writeEndDocument() don't close elements correctly #47

Open Tomas-Kraus opened 12 years ago

Tomas-Kraus commented 12 years ago

In StAXDocumentSerializer.writeEndDocument() there is a piece of code that try to close elements that are not closed :

for(;_stackCount >= 0; _stackCount--) { writeEndElement(); }

This code is wrong because _stackCount is decremented twice : in the for block and in writeEndElement(). Also, it doesn't manage well a single writeEmptyElement("x") in the document.

A solution should be :

if (_isEmptyElement) encodeTerminationAndCurrentElement(true); while (_stackCount >= 0) writeEndElement();

Affected Versions

[current]

Tomas-Kraus commented 5 years ago
Tomas-Kraus commented 12 years ago

@glassfishrobot Commented Reported by sylvain.spinelli

Tomas-Kraus commented 7 years ago

@glassfishrobot Commented This issue was imported from java.net JIRA FI-47