Skip to content

Commit b12cc92

Browse files
committed
Merge branch '2.12' into 2.13
2 parents a69acba + 5bb637a commit b12cc92

File tree

2 files changed

+74
-0
lines changed

2 files changed

+74
-0
lines changed

release-notes/VERSION-2.x

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ JSON library.
3939
#712: Optimize array allocation by `JsonStringEncoder`
4040
- Add `mvnw` wrapper
4141

42+
2.12.5 (27-Aug-2021)
43+
44+
#712: (partial) Optimize array allocation by `JsonStringEncoder`
45+
#713: Add back accidentally removed `JsonStringEncoder` related methods in
46+
`BufferRecyclers` (like `getJsonStringEncoder()`)
47+
4248
2.12.4 (06-Jul-2021)
4349

4450
#702: `ArrayOutOfBoundException` at `WriterBasedJsonGenerator.writeString(Reader, int)`

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)