X4O: Removed iterator for tree walker and bettered tag folding code

This commit is contained in:
Willem Cazander 2025-11-08 23:59:30 +01:00
parent 045f6d07f6
commit 9638d876b5
6 changed files with 27 additions and 16 deletions

View file

@ -477,11 +477,11 @@ public class AbstractContentWriterHandler implements ContentHandler, Closeable {
}
private boolean allowEndElementFolding(String tag) {
if (getPropertyConfig().getProperty(OUTPUT_FOLD_EMPTY_TAGS) == null) {
return true;
}
if (foldEmptyTags == null) {
foldEmptyTags = new HashSet<>();
if (getPropertyConfig().getProperty(OUTPUT_FOLD_EMPTY_TAGS) != null) {
foldEmptyTags.addAll(getPropertyConfig().getPropertyList(OUTPUT_FOLD_EMPTY_TAGS));
}
foldEmptyTags = new HashSet<>(getPropertyConfig().getPropertyList(OUTPUT_FOLD_EMPTY_TAGS));
}
if (foldEmptyTags.isEmpty()) {
return true;