diff --git a/src/main/java/tools/jackson/core/TSFBuilder.java b/src/main/java/tools/jackson/core/TSFBuilder.java index 0519934782..3d9f7e7f4d 100644 --- a/src/main/java/tools/jackson/core/TSFBuilder.java +++ b/src/main/java/tools/jackson/core/TSFBuilder.java @@ -3,7 +3,7 @@ import java.util.Objects; import tools.jackson.core.util.BufferRecycler; -import tools.jackson.core.util.JsonBufferRecyclers; +import tools.jackson.core.util.JsonRecyclerPools; import tools.jackson.core.util.RecyclerPool; /** @@ -64,7 +64,7 @@ public abstract class TSFBuilder _getRecyclerPool() { // scheme, for cases where it is considered harmful (possibly // on Android, for example) if (!Feature.USE_THREAD_LOCAL_FOR_BUFFER_RECYCLING.enabledIn(_factoryFeatures)) { - return JsonBufferRecyclers.nonRecyclingPool(); + return JsonRecyclerPools.nonRecyclingPool(); } return _recyclerPool; } diff --git a/src/main/java/tools/jackson/core/util/JsonBufferRecyclers.java b/src/main/java/tools/jackson/core/util/JsonRecyclerPools.java similarity index 99% rename from src/main/java/tools/jackson/core/util/JsonBufferRecyclers.java rename to src/main/java/tools/jackson/core/util/JsonRecyclerPools.java index 76930d05fd..fd250210c2 100644 --- a/src/main/java/tools/jackson/core/util/JsonBufferRecyclers.java +++ b/src/main/java/tools/jackson/core/util/JsonRecyclerPools.java @@ -14,7 +14,7 @@ * JSON-backed {@link JsonFactory} for recycling {@link BufferRecycler} * containers. */ -public final class JsonBufferRecyclers +public final class JsonRecyclerPools { /** * @return the default {@link RecyclerPool} implementation diff --git a/src/main/java/tools/jackson/core/util/TextBuffer.java b/src/main/java/tools/jackson/core/util/TextBuffer.java index 5364e405cd..04692c7a5c 100644 --- a/src/main/java/tools/jackson/core/util/TextBuffer.java +++ b/src/main/java/tools/jackson/core/util/TextBuffer.java @@ -890,11 +890,9 @@ public char[] finishCurrentSegment() throws JacksonException { * delimiter or end-of-line * @param trimTrailingSpaces Whether trailing spaces should be trimmed or not * @return token as text - * @throws IOException If length constraints (of longest allowed Text value) are violated - * - * @since 2.15 */ - public String finishAndReturn(int lastSegmentEnd, boolean trimTrailingSpaces) throws JacksonException + public String finishAndReturn(int lastSegmentEnd, boolean trimTrailingSpaces) + throws JacksonException { if (trimTrailingSpaces) { // First, see if it's enough to trim end of current segment: diff --git a/src/test/java/tools/jackson/core/CoreJDKSerializabilityTest.java b/src/test/java/tools/jackson/core/CoreJDKSerializabilityTest.java index 811236a4b5..a7fe4da468 100644 --- a/src/test/java/tools/jackson/core/CoreJDKSerializabilityTest.java +++ b/src/test/java/tools/jackson/core/CoreJDKSerializabilityTest.java @@ -7,7 +7,7 @@ import tools.jackson.core.io.ContentReference; import tools.jackson.core.json.JsonFactory; import tools.jackson.core.util.DefaultPrettyPrinter; -import tools.jackson.core.util.JsonBufferRecyclers; +import tools.jackson.core.util.JsonRecyclerPools; import tools.jackson.core.util.RecyclerPool; /** @@ -121,19 +121,19 @@ public void testRecyclerPools() throws Exception { // First: shared/global pools that will always remain/become globally // shared instances - _testRecyclerPoolGlobal(JsonBufferRecyclers.nonRecyclingPool()); - _testRecyclerPoolGlobal(JsonBufferRecyclers.threadLocalPool()); + _testRecyclerPoolGlobal(JsonRecyclerPools.nonRecyclingPool()); + _testRecyclerPoolGlobal(JsonRecyclerPools.threadLocalPool()); - _testRecyclerPoolGlobal(JsonBufferRecyclers.sharedConcurrentDequePool()); - _testRecyclerPoolGlobal(JsonBufferRecyclers.sharedLockFreePool()); - JsonBufferRecyclers.BoundedPool bounded = (JsonBufferRecyclers.BoundedPool) - _testRecyclerPoolGlobal(JsonBufferRecyclers.sharedBoundedPool()); + _testRecyclerPoolGlobal(JsonRecyclerPools.sharedConcurrentDequePool()); + _testRecyclerPoolGlobal(JsonRecyclerPools.sharedLockFreePool()); + JsonRecyclerPools.BoundedPool bounded = (JsonRecyclerPools.BoundedPool) + _testRecyclerPoolGlobal(JsonRecyclerPools.sharedBoundedPool()); assertEquals(RecyclerPool.BoundedPoolBase.DEFAULT_CAPACITY, bounded.capacity()); - _testRecyclerPoolNonShared(JsonBufferRecyclers.newConcurrentDequePool()); - _testRecyclerPoolNonShared(JsonBufferRecyclers.newLockFreePool()); - bounded = (JsonBufferRecyclers.BoundedPool) - _testRecyclerPoolNonShared(JsonBufferRecyclers.newBoundedPool(250)); + _testRecyclerPoolNonShared(JsonRecyclerPools.newConcurrentDequePool()); + _testRecyclerPoolNonShared(JsonRecyclerPools.newLockFreePool()); + bounded = (JsonRecyclerPools.BoundedPool) + _testRecyclerPoolNonShared(JsonRecyclerPools.newBoundedPool(250)); assertEquals(250, bounded.capacity()); } diff --git a/src/test/java/tools/jackson/core/io/BufferRecyclerPoolTest.java b/src/test/java/tools/jackson/core/io/BufferRecyclerPoolTest.java index bba0b0d970..635d8ef4af 100644 --- a/src/test/java/tools/jackson/core/io/BufferRecyclerPoolTest.java +++ b/src/test/java/tools/jackson/core/io/BufferRecyclerPoolTest.java @@ -9,30 +9,30 @@ import tools.jackson.core.json.JsonFactory; import tools.jackson.core.json.JsonGeneratorBase; import tools.jackson.core.util.BufferRecycler; -import tools.jackson.core.util.JsonBufferRecyclers; +import tools.jackson.core.util.JsonRecyclerPools; import tools.jackson.core.util.RecyclerPool; public class BufferRecyclerPoolTest extends BaseTest { public void testNoOp() throws Exception { // no-op pool doesn't actually pool anything, so avoid checking it - checkBufferRecyclerPoolImpl(JsonBufferRecyclers.nonRecyclingPool(), false); + checkBufferRecyclerPoolImpl(JsonRecyclerPools.nonRecyclingPool(), false); } public void testThreadLocal() throws Exception { - checkBufferRecyclerPoolImpl(JsonBufferRecyclers.threadLocalPool(), true); + checkBufferRecyclerPoolImpl(JsonRecyclerPools.threadLocalPool(), true); } public void testLockFree() throws Exception { - checkBufferRecyclerPoolImpl(JsonBufferRecyclers.newLockFreePool(), true); + checkBufferRecyclerPoolImpl(JsonRecyclerPools.newLockFreePool(), true); } public void testConcurrentDequeue() throws Exception { - checkBufferRecyclerPoolImpl(JsonBufferRecyclers.newConcurrentDequePool(), true); + checkBufferRecyclerPoolImpl(JsonRecyclerPools.newConcurrentDequePool(), true); } public void testBounded() throws Exception { - checkBufferRecyclerPoolImpl(JsonBufferRecyclers.newBoundedPool(1), true); + checkBufferRecyclerPoolImpl(JsonRecyclerPools.newBoundedPool(1), true); } public void testPluggingPool() throws Exception {