From 449ed86748bf672b0a65f13e7f8573298b543384 Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Mon, 6 May 2024 08:57:50 -0700 Subject: [PATCH] Update javadoc to clarify buffering of JsonParser.getText(Writer) wrt #1288 --- src/main/java/com/fasterxml/jackson/core/JsonParser.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/fasterxml/jackson/core/JsonParser.java b/src/main/java/com/fasterxml/jackson/core/JsonParser.java index 03f0189fc1..cbd5655a4f 100644 --- a/src/main/java/com/fasterxml/jackson/core/JsonParser.java +++ b/src/main/java/com/fasterxml/jackson/core/JsonParser.java @@ -14,8 +14,7 @@ import com.fasterxml.jackson.core.exc.InputCoercionException; import com.fasterxml.jackson.core.json.JsonReadFeature; import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.core.util.JacksonFeatureSet; -import com.fasterxml.jackson.core.util.RequestPayload; +import com.fasterxml.jackson.core.util.*; /** * Base class that defines public API for reading JSON content. @@ -1575,6 +1574,12 @@ public String currentName() throws IOException { * but should typically be more efficient as longer content does need to * be combined into a single String to return, and write * can occur directly from intermediate buffers Jackson uses. + *

+ * NOTE: textual content will still be buffered (usually + * using {@link TextBuffer}) and will be accessible with + * other {@code getText()} calls (that is, it will not be consumed). + * So this accessor only avoids construction of {@link java.lang.String} + * compared to plain {@link #getText()} method. * * @param writer Writer to write textual content to *