Skip to content

Commit 8733bb4

Browse files
committed
Merge branch '2.11' into 2.12
2 parents cf5d622 + 0dcfde0 commit 8733bb4

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed

release-notes/VERSION-2.x

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ JSON library.
1616

1717
(not yet released)
1818

19-
#712: (partial) Optimize array allocation by JsonStringEncoder
19+
#712: (partial) Optimize array allocation by `JsonStringEncoder`
20+
#713: Add back accidentally removed `JsonStringEncoder` related methods in
21+
`BufferRecyclers` (like `getJsonStringEncoder()`)
2022

2123
2.12.4 (06-Jul-2021)
2224

src/main/java/com/fasterxml/jackson/core/util/BufferRecyclers.java

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import java.lang.ref.SoftReference;
44

5+
import com.fasterxml.jackson.core.io.JsonStringEncoder;
6+
57
/**
68
* Helper entity used to control access to simple buffer recyling scheme used for
79
* some encoding, decoding tasks.
@@ -96,4 +98,70 @@ public static int releaseBuffers() {
9698
}
9799
return -1;
98100
}
101+
102+
/*
103+
/**********************************************************************
104+
/* Obsolete things re-introduced in 2.12.5 after accidental direct
105+
/* removal from 2.10.0
106+
/**********************************************************************
107+
*/
108+
109+
/**
110+
* Not to be used any more: call {@link JsonStringEncoder#getInstance()} instead.
111+
*
112+
* @deprecated Since 2.10 (note: was accidentally removed but reintroduced as deprecated
113+
* in 2.12.5, to be removed from 3.0)
114+
*/
115+
@Deprecated
116+
public static JsonStringEncoder getJsonStringEncoder() {
117+
return JsonStringEncoder.getInstance();
118+
}
119+
120+
/**
121+
* Not to be used any more: call {@link JsonStringEncoder#getInstance()} (and then
122+
* {@code encodeAsUTF8()}) instead.
123+
*
124+
* @deprecated Since 2.10 (note: was accidentally removed but reintroduced as deprecated
125+
* in 2.12.5, to be removed from 3.0)
126+
*/
127+
@Deprecated
128+
public static byte[] encodeAsUTF8(String text) {
129+
return JsonStringEncoder.getInstance().encodeAsUTF8(text);
130+
}
131+
132+
/**
133+
* Not to be used any more: call {@link JsonStringEncoder#getInstance()} (and then
134+
* {@code quoteAsString()}) instead.
135+
*
136+
* @deprecated Since 2.10 (note: was accidentally removed but reintroduced as deprecated
137+
* in 2.12.5, to be removed from 3.0)
138+
*/
139+
@Deprecated
140+
public static char[] quoteAsJsonText(String rawText) {
141+
return JsonStringEncoder.getInstance().quoteAsString(rawText);
142+
}
143+
144+
/**
145+
* Not to be used any more: call {@link JsonStringEncoder#getInstance()} (and then
146+
* {@code quoteAsString()}) instead.
147+
*
148+
* @deprecated Since 2.10 (note: was accidentally removed but reintroduced as deprecated
149+
* in 2.12.5, to be removed from 3.0)
150+
*/
151+
@Deprecated
152+
public static void quoteAsJsonText(CharSequence input, StringBuilder output) {
153+
JsonStringEncoder.getInstance().quoteAsString(input, output);
154+
}
155+
156+
/**
157+
* Not to be used any more: call {@link JsonStringEncoder#getInstance()} (and then
158+
* {@code quoteAsUTF8()}) instead.
159+
*
160+
* @deprecated Since 2.10 (note: was accidentally removed but reintroduced as deprecated
161+
* in 2.12.5, to be removed from 3.0)
162+
*/
163+
@Deprecated
164+
public static byte[] quoteAsJsonUTF8(String rawText) {
165+
return JsonStringEncoder.getInstance().quoteAsUTF8(rawText);
166+
}
99167
}

0 commit comments

Comments
 (0)