Skip to content

Commit

Permalink
Add comment to XContentBuilder.toString() (opensearch-project#13809) (o…
Browse files Browse the repository at this point in the history
…pensearch-project#13932)

* Add comment to XContentBuilder.toString

* Fix typo

---------

(cherry picked from commit bf43678)

Signed-off-by: Liyun Xiu <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: kkewwei <[email protected]>
  • Loading branch information
2 people authored and kkewwei committed Jul 24, 2024
1 parent 0268ce4 commit 0739a20
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ public static XContentBuilder builder(XContent xContent, Set<String> includes, S

/**
* Returns a string representation of the builder (only applicable for text based xcontent).
* Note: explicitly or implicitly (from debugger) calling toString() could cause XContentBuilder
* to close which is a side effect done by @see BytesReference#bytes().
* Trying to write more contents after toString() will cause NPE. Use it with caution.
*/
@Override
public String toString() {
Expand Down

0 comments on commit 0739a20

Please sign in to comment.