diff --git a/src/main/java/com/fasterxml/jackson/core/ErrorReportConfiguration.java b/src/main/java/com/fasterxml/jackson/core/ErrorReportConfiguration.java index b0145d31e2..58aa18fb91 100644 --- a/src/main/java/com/fasterxml/jackson/core/ErrorReportConfiguration.java +++ b/src/main/java/com/fasterxml/jackson/core/ErrorReportConfiguration.java @@ -25,7 +25,7 @@ public class ErrorReportConfiguration public static final int DEFAULT_MAX_ERROR_TOKEN_LENGTH = 256; /** - * Previous was {@link com.fasterxml.jackson.core.io.ContentReference#DEFAULT_MAX_CONTENT_SNIPPET}. + * Previously was {@code com.fasterxml.jackson.core.io.ContentReference#DEFAULT_MAX_CONTENT_SNIPPET}. * Default value for {@link #_maxRawContentLength}. */ public static final int DEFAULT_MAX_RAW_CONTENT_LENGTH = 500; diff --git a/src/test/java/com/fasterxml/jackson/core/JsonLocationTest.java b/src/test/java/com/fasterxml/jackson/core/JsonLocationTest.java index 9a3e94b8a6..769d406df8 100644 --- a/src/test/java/com/fasterxml/jackson/core/JsonLocationTest.java +++ b/src/test/java/com/fasterxml/jackson/core/JsonLocationTest.java @@ -156,30 +156,36 @@ public void testLocationEquality() throws Exception } private ContentReference _sourceRef(String rawSrc) { - return ContentReference.construct(true, rawSrc, 0, rawSrc.length()); + return ContentReference.construct(true, rawSrc, 0, rawSrc.length(), + ErrorReportConfiguration.defaults()); } private ContentReference _sourceRef(char[] rawSrc) { - return ContentReference.construct(true, rawSrc, 0, rawSrc.length); + return ContentReference.construct(true, rawSrc, 0, rawSrc.length, + ErrorReportConfiguration.defaults()); } private ContentReference _sourceRef(byte[] rawSrc) { - return ContentReference.construct(true, rawSrc, 0, rawSrc.length); + return ContentReference.construct(true, rawSrc, 0, rawSrc.length, + ErrorReportConfiguration.defaults()); } private ContentReference _sourceRef(byte[] rawSrc, int offset, int length) { - return ContentReference.construct(true, rawSrc, offset, length); + return ContentReference.construct(true, rawSrc, offset, length, + ErrorReportConfiguration.defaults()); } private ContentReference _sourceRef(InputStream rawSrc) { - return ContentReference.construct(true, rawSrc, -1, -1); + return ContentReference.construct(true, rawSrc, -1, -1, + ErrorReportConfiguration.defaults()); } private ContentReference _sourceRef(File rawSrc) { - return ContentReference.construct(true, rawSrc, -1, -1); + return ContentReference.construct(true, rawSrc, -1, -1, + ErrorReportConfiguration.defaults()); } private ContentReference _rawSourceRef(boolean textual, Object rawSrc) { return ContentReference.rawReference(textual, rawSrc); } -} \ No newline at end of file +} diff --git a/src/test/java/com/fasterxml/jackson/core/TestJDKSerializability.java b/src/test/java/com/fasterxml/jackson/core/TestJDKSerializability.java index bdba2fe656..951748ca62 100644 --- a/src/test/java/com/fasterxml/jackson/core/TestJDKSerializability.java +++ b/src/test/java/com/fasterxml/jackson/core/TestJDKSerializability.java @@ -96,7 +96,8 @@ public void testLocation() throws Exception public void testSourceReference() throws Exception { - ContentReference ref = ContentReference.construct(true, "text"); + ContentReference ref = ContentReference.construct(true, "text", + ErrorReportConfiguration.defaults()); byte[] stuff = jdkSerialize(ref); ContentReference ref2 = jdkDeserialize(stuff); diff --git a/src/test/java/com/fasterxml/jackson/core/TestVersions.java b/src/test/java/com/fasterxml/jackson/core/TestVersions.java index 2b2e1abdf4..db1f2179b5 100644 --- a/src/test/java/com/fasterxml/jackson/core/TestVersions.java +++ b/src/test/java/com/fasterxml/jackson/core/TestVersions.java @@ -49,6 +49,7 @@ private void assertVersion(Version v) private IOContext getIOContext() { return new IOContext(StreamReadConstraints.defaults(), StreamWriteConstraints.defaults(), + ErrorReportConfiguration.defaults(), new BufferRecycler(), ContentReference.unknown(), false); } } diff --git a/src/test/java/com/fasterxml/jackson/core/io/TestIOContext.java b/src/test/java/com/fasterxml/jackson/core/io/TestIOContext.java index fd15b16ba9..e6ca0ce0bb 100644 --- a/src/test/java/com/fasterxml/jackson/core/io/TestIOContext.java +++ b/src/test/java/com/fasterxml/jackson/core/io/TestIOContext.java @@ -1,5 +1,6 @@ package com.fasterxml.jackson.core.io; +import com.fasterxml.jackson.core.ErrorReportConfiguration; import com.fasterxml.jackson.core.StreamReadConstraints; import com.fasterxml.jackson.core.StreamWriteConstraints; import com.fasterxml.jackson.core.util.BufferRecycler; @@ -9,7 +10,9 @@ public class TestIOContext { public void testAllocations() throws Exception { - IOContext ctxt = new IOContext(StreamReadConstraints.defaults(), StreamWriteConstraints.defaults(), + IOContext ctxt = new IOContext(StreamReadConstraints.defaults(), + StreamWriteConstraints.defaults(), + ErrorReportConfiguration.defaults(), new BufferRecycler(), ContentReference.rawReference("N/A"), true); diff --git a/src/test/java/com/fasterxml/jackson/core/io/TestMergedStream.java b/src/test/java/com/fasterxml/jackson/core/io/TestMergedStream.java index 8d9610c47f..6108e4f3a5 100644 --- a/src/test/java/com/fasterxml/jackson/core/io/TestMergedStream.java +++ b/src/test/java/com/fasterxml/jackson/core/io/TestMergedStream.java @@ -2,6 +2,7 @@ import java.io.*; +import com.fasterxml.jackson.core.ErrorReportConfiguration; import com.fasterxml.jackson.core.JsonEncoding; import com.fasterxml.jackson.core.StreamReadConstraints; import com.fasterxml.jackson.core.StreamWriteConstraints; @@ -15,6 +16,7 @@ public void testSimple() throws Exception BufferRecycler rec = new BufferRecycler(); IOContext ctxt = new IOContext(StreamReadConstraints.defaults(), StreamWriteConstraints.defaults(), + ErrorReportConfiguration.defaults(), rec, ContentReference.UNKNOWN_CONTENT, false); // bit complicated; must use recyclable buffer... byte[] first = ctxt.allocReadIOBuffer(); diff --git a/src/test/java/com/fasterxml/jackson/core/io/UTF8WriterTest.java b/src/test/java/com/fasterxml/jackson/core/io/UTF8WriterTest.java index f3d1060a8a..1606dd5d68 100644 --- a/src/test/java/com/fasterxml/jackson/core/io/UTF8WriterTest.java +++ b/src/test/java/com/fasterxml/jackson/core/io/UTF8WriterTest.java @@ -4,6 +4,7 @@ import org.junit.Assert; +import com.fasterxml.jackson.core.ErrorReportConfiguration; import com.fasterxml.jackson.core.StreamReadConstraints; import com.fasterxml.jackson.core.StreamWriteConstraints; import com.fasterxml.jackson.core.util.BufferRecycler; @@ -151,7 +152,9 @@ private IOContext _ioContext() { } private IOContext _ioContext(BufferRecycler br) { - return new IOContext(StreamReadConstraints.defaults(), StreamWriteConstraints.defaults(), + return new IOContext(StreamReadConstraints.defaults(), + StreamWriteConstraints.defaults(), + ErrorReportConfiguration.defaults(), br, ContentReference.unknown(), false); } } diff --git a/src/test/java/com/fasterxml/jackson/core/util/ReadConstrainedTextBufferTest.java b/src/test/java/com/fasterxml/jackson/core/util/ReadConstrainedTextBufferTest.java index cf83409123..6c4211ab77 100644 --- a/src/test/java/com/fasterxml/jackson/core/util/ReadConstrainedTextBufferTest.java +++ b/src/test/java/com/fasterxml/jackson/core/util/ReadConstrainedTextBufferTest.java @@ -1,5 +1,6 @@ package com.fasterxml.jackson.core.util; +import com.fasterxml.jackson.core.ErrorReportConfiguration; import com.fasterxml.jackson.core.StreamReadConstraints; import com.fasterxml.jackson.core.StreamWriteConstraints; import com.fasterxml.jackson.core.io.ContentReference; @@ -47,6 +48,7 @@ private static TextBuffer makeConstrainedBuffer(int maxStringLen) { IOContext ioContext = new IOContext( constraints, StreamWriteConstraints.defaults(), + ErrorReportConfiguration.defaults(), new BufferRecycler(), ContentReference.rawReference("N/A"), true); return ioContext.constructReadConstrainedTextBuffer(); diff --git a/src/test/java/com/fasterxml/jackson/core/write/UTF8GeneratorTest.java b/src/test/java/com/fasterxml/jackson/core/write/UTF8GeneratorTest.java index 5f0abc24a9..fbe38d26a9 100644 --- a/src/test/java/com/fasterxml/jackson/core/write/UTF8GeneratorTest.java +++ b/src/test/java/com/fasterxml/jackson/core/write/UTF8GeneratorTest.java @@ -19,7 +19,9 @@ public class UTF8GeneratorTest extends BaseTest public void testUtf8Issue462() throws Exception { ByteArrayOutputStream bytes = new ByteArrayOutputStream(); - IOContext ioc = new IOContext(StreamReadConstraints.defaults(), StreamWriteConstraints.defaults(), + IOContext ioc = new IOContext(StreamReadConstraints.defaults(), + StreamWriteConstraints.defaults(), + ErrorReportConfiguration.defaults(), new BufferRecycler(), ContentReference.rawReference(bytes), true); JsonGenerator gen = new UTF8JsonGenerator(ioc, 0, null, bytes, '"'); @@ -50,6 +52,7 @@ public void testNestingDepthWithSmallLimit() throws Exception ByteArrayOutputStream bytes = new ByteArrayOutputStream(); IOContext ioc = new IOContext(null, StreamWriteConstraints.builder().maxNestingDepth(1).build(), + ErrorReportConfiguration.defaults(), new BufferRecycler(), ContentReference.rawReference(bytes), true); try (JsonGenerator gen = new UTF8JsonGenerator(ioc, 0, null, bytes, '"')) { @@ -68,6 +71,7 @@ public void testNestingDepthWithSmallLimitNestedObject() throws Exception ByteArrayOutputStream bytes = new ByteArrayOutputStream(); IOContext ioc = new IOContext(null, StreamWriteConstraints.builder().maxNestingDepth(1).build(), + ErrorReportConfiguration.defaults(), new BufferRecycler(), ContentReference.rawReference(bytes), true); try (JsonGenerator gen = new UTF8JsonGenerator(ioc, 0, null, bytes, '"')) { diff --git a/src/test/java/com/fasterxml/jackson/core/write/WriterBasedJsonGeneratorTest.java b/src/test/java/com/fasterxml/jackson/core/write/WriterBasedJsonGeneratorTest.java index 3f4eb63ec1..f05a0fac51 100644 --- a/src/test/java/com/fasterxml/jackson/core/write/WriterBasedJsonGeneratorTest.java +++ b/src/test/java/com/fasterxml/jackson/core/write/WriterBasedJsonGeneratorTest.java @@ -1,7 +1,9 @@ package com.fasterxml.jackson.core.write; +import java.io.StringWriter; + import com.fasterxml.jackson.core.BaseTest; -import com.fasterxml.jackson.core.JsonFactory; +import com.fasterxml.jackson.core.ErrorReportConfiguration; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.StreamWriteConstraints; import com.fasterxml.jackson.core.exc.StreamConstraintsException; @@ -10,17 +12,14 @@ import com.fasterxml.jackson.core.json.WriterBasedJsonGenerator; import com.fasterxml.jackson.core.util.BufferRecycler; -import java.io.StringWriter; - public class WriterBasedJsonGeneratorTest extends BaseTest { - private final JsonFactory JSON_F = new JsonFactory(); - public void testNestingDepthWithSmallLimit() throws Exception { StringWriter sw = new StringWriter(); IOContext ioc = new IOContext(null, StreamWriteConstraints.builder().maxNestingDepth(1).build(), + ErrorReportConfiguration.defaults(), new BufferRecycler(), ContentReference.rawReference(sw), true); try (JsonGenerator gen = new WriterBasedJsonGenerator(ioc, 0, null, sw, '"')) { @@ -39,6 +38,7 @@ public void testNestingDepthWithSmallLimitNestedObject() throws Exception StringWriter sw = new StringWriter(); IOContext ioc = new IOContext(null, StreamWriteConstraints.builder().maxNestingDepth(1).build(), + ErrorReportConfiguration.defaults(), new BufferRecycler(), ContentReference.rawReference(sw), true); try (JsonGenerator gen = new WriterBasedJsonGenerator(ioc, 0, null, sw, '"')) {