Skip to content

Commit

Permalink
Merge branch '2.11' into 2.12
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Aug 26, 2021
2 parents cf5d622 + 0dcfde0 commit 8733bb4
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 1 deletion.
4 changes: 3 additions & 1 deletion release-notes/VERSION-2.x
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ JSON library.

(not yet released)

#712: (partial) Optimize array allocation by JsonStringEncoder
#712: (partial) Optimize array allocation by `JsonStringEncoder`
#713: Add back accidentally removed `JsonStringEncoder` related methods in
`BufferRecyclers` (like `getJsonStringEncoder()`)

2.12.4 (06-Jul-2021)

Expand Down
68 changes: 68 additions & 0 deletions src/main/java/com/fasterxml/jackson/core/util/BufferRecyclers.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

import java.lang.ref.SoftReference;

import com.fasterxml.jackson.core.io.JsonStringEncoder;

/**
* Helper entity used to control access to simple buffer recyling scheme used for
* some encoding, decoding tasks.
Expand Down Expand Up @@ -96,4 +98,70 @@ public static int releaseBuffers() {
}
return -1;
}

/*
/**********************************************************************
/* Obsolete things re-introduced in 2.12.5 after accidental direct
/* removal from 2.10.0
/**********************************************************************
*/

/**
* Not to be used any more: call {@link JsonStringEncoder#getInstance()} instead.
*
* @deprecated Since 2.10 (note: was accidentally removed but reintroduced as deprecated
* in 2.12.5, to be removed from 3.0)
*/
@Deprecated
public static JsonStringEncoder getJsonStringEncoder() {
return JsonStringEncoder.getInstance();
}

/**
* Not to be used any more: call {@link JsonStringEncoder#getInstance()} (and then
* {@code encodeAsUTF8()}) instead.
*
* @deprecated Since 2.10 (note: was accidentally removed but reintroduced as deprecated
* in 2.12.5, to be removed from 3.0)
*/
@Deprecated
public static byte[] encodeAsUTF8(String text) {
return JsonStringEncoder.getInstance().encodeAsUTF8(text);
}

/**
* Not to be used any more: call {@link JsonStringEncoder#getInstance()} (and then
* {@code quoteAsString()}) instead.
*
* @deprecated Since 2.10 (note: was accidentally removed but reintroduced as deprecated
* in 2.12.5, to be removed from 3.0)
*/
@Deprecated
public static char[] quoteAsJsonText(String rawText) {
return JsonStringEncoder.getInstance().quoteAsString(rawText);
}

/**
* Not to be used any more: call {@link JsonStringEncoder#getInstance()} (and then
* {@code quoteAsString()}) instead.
*
* @deprecated Since 2.10 (note: was accidentally removed but reintroduced as deprecated
* in 2.12.5, to be removed from 3.0)
*/
@Deprecated
public static void quoteAsJsonText(CharSequence input, StringBuilder output) {
JsonStringEncoder.getInstance().quoteAsString(input, output);
}

/**
* Not to be used any more: call {@link JsonStringEncoder#getInstance()} (and then
* {@code quoteAsUTF8()}) instead.
*
* @deprecated Since 2.10 (note: was accidentally removed but reintroduced as deprecated
* in 2.12.5, to be removed from 3.0)
*/
@Deprecated
public static byte[] quoteAsJsonUTF8(String rawText) {
return JsonStringEncoder.getInstance().quoteAsUTF8(rawText);
}
}

0 comments on commit 8733bb4

Please sign in to comment.