Skip to content

Commit

Permalink
fix: Fix XmlStringBuilder caching.
Browse files Browse the repository at this point in the history
XmlStringBuilder.append(Element) calls into the generic
append(CharSequence) method which breaks the caching.
  • Loading branch information
bgrozev committed Oct 25, 2023
1 parent 2e79a6b commit d0ec48e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,13 @@ public XmlStringBuilder condAttribute(boolean condition, String name, String val
@Override
public XmlStringBuilder append(CharSequence csq) {
assert csq != null;
sb.append(csq);
if (csq instanceof XmlStringBuilder) {
sb.append(((XmlStringBuilder) csq).sb);
} else if (csq instanceof LazyStringBuilder) {
sb.append((LazyStringBuilder) csq);
} else {
sb.append(csq);
}
return this;
}

Expand Down

0 comments on commit d0ec48e

Please sign in to comment.