Skip to content

Commit f34de3d

Browse files
committed
Warnings clean up
1 parent 75303dd commit f34de3d

File tree

10 files changed

+39
-17
lines changed

10 files changed

+39
-17
lines changed

src/main/java/com/fasterxml/jackson/core/ErrorReportConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class ErrorReportConfiguration
2525
public static final int DEFAULT_MAX_ERROR_TOKEN_LENGTH = 256;
2626

2727
/**
28-
* Previous was {@link com.fasterxml.jackson.core.io.ContentReference#DEFAULT_MAX_CONTENT_SNIPPET}.
28+
* Previously was {@code com.fasterxml.jackson.core.io.ContentReference#DEFAULT_MAX_CONTENT_SNIPPET}.
2929
* Default value for {@link #_maxRawContentLength}.
3030
*/
3131
public static final int DEFAULT_MAX_RAW_CONTENT_LENGTH = 500;

src/test/java/com/fasterxml/jackson/core/JsonLocationTest.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,30 +156,36 @@ public void testLocationEquality() throws Exception
156156
}
157157

158158
private ContentReference _sourceRef(String rawSrc) {
159-
return ContentReference.construct(true, rawSrc, 0, rawSrc.length());
159+
return ContentReference.construct(true, rawSrc, 0, rawSrc.length(),
160+
ErrorReportConfiguration.defaults());
160161
}
161162

162163
private ContentReference _sourceRef(char[] rawSrc) {
163-
return ContentReference.construct(true, rawSrc, 0, rawSrc.length);
164+
return ContentReference.construct(true, rawSrc, 0, rawSrc.length,
165+
ErrorReportConfiguration.defaults());
164166
}
165167

166168
private ContentReference _sourceRef(byte[] rawSrc) {
167-
return ContentReference.construct(true, rawSrc, 0, rawSrc.length);
169+
return ContentReference.construct(true, rawSrc, 0, rawSrc.length,
170+
ErrorReportConfiguration.defaults());
168171
}
169172

170173
private ContentReference _sourceRef(byte[] rawSrc, int offset, int length) {
171-
return ContentReference.construct(true, rawSrc, offset, length);
174+
return ContentReference.construct(true, rawSrc, offset, length,
175+
ErrorReportConfiguration.defaults());
172176
}
173177

174178
private ContentReference _sourceRef(InputStream rawSrc) {
175-
return ContentReference.construct(true, rawSrc, -1, -1);
179+
return ContentReference.construct(true, rawSrc, -1, -1,
180+
ErrorReportConfiguration.defaults());
176181
}
177182

178183
private ContentReference _sourceRef(File rawSrc) {
179-
return ContentReference.construct(true, rawSrc, -1, -1);
184+
return ContentReference.construct(true, rawSrc, -1, -1,
185+
ErrorReportConfiguration.defaults());
180186
}
181187

182188
private ContentReference _rawSourceRef(boolean textual, Object rawSrc) {
183189
return ContentReference.rawReference(textual, rawSrc);
184190
}
185-
}
191+
}

src/test/java/com/fasterxml/jackson/core/TestJDKSerializability.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ public void testLocation() throws Exception
9696

9797
public void testSourceReference() throws Exception
9898
{
99-
ContentReference ref = ContentReference.construct(true, "text");
99+
ContentReference ref = ContentReference.construct(true, "text",
100+
ErrorReportConfiguration.defaults());
100101

101102
byte[] stuff = jdkSerialize(ref);
102103
ContentReference ref2 = jdkDeserialize(stuff);

src/test/java/com/fasterxml/jackson/core/TestVersions.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ private void assertVersion(Version v)
4949
private IOContext getIOContext() {
5050
return new IOContext(StreamReadConstraints.defaults(),
5151
StreamWriteConstraints.defaults(),
52+
ErrorReportConfiguration.defaults(),
5253
new BufferRecycler(), ContentReference.unknown(), false);
5354
}
5455
}

src/test/java/com/fasterxml/jackson/core/io/TestIOContext.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.fasterxml.jackson.core.io;
22

3+
import com.fasterxml.jackson.core.ErrorReportConfiguration;
34
import com.fasterxml.jackson.core.StreamReadConstraints;
45
import com.fasterxml.jackson.core.StreamWriteConstraints;
56
import com.fasterxml.jackson.core.util.BufferRecycler;
@@ -9,7 +10,9 @@ public class TestIOContext
910
{
1011
public void testAllocations() throws Exception
1112
{
12-
IOContext ctxt = new IOContext(StreamReadConstraints.defaults(), StreamWriteConstraints.defaults(),
13+
IOContext ctxt = new IOContext(StreamReadConstraints.defaults(),
14+
StreamWriteConstraints.defaults(),
15+
ErrorReportConfiguration.defaults(),
1316
new BufferRecycler(),
1417
ContentReference.rawReference("N/A"), true);
1518

src/test/java/com/fasterxml/jackson/core/io/TestMergedStream.java

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

33
import java.io.*;
44

5+
import com.fasterxml.jackson.core.ErrorReportConfiguration;
56
import com.fasterxml.jackson.core.JsonEncoding;
67
import com.fasterxml.jackson.core.StreamReadConstraints;
78
import com.fasterxml.jackson.core.StreamWriteConstraints;
@@ -15,6 +16,7 @@ public void testSimple() throws Exception
1516
BufferRecycler rec = new BufferRecycler();
1617
IOContext ctxt = new IOContext(StreamReadConstraints.defaults(),
1718
StreamWriteConstraints.defaults(),
19+
ErrorReportConfiguration.defaults(),
1820
rec, ContentReference.UNKNOWN_CONTENT, false);
1921
// bit complicated; must use recyclable buffer...
2022
byte[] first = ctxt.allocReadIOBuffer();

src/test/java/com/fasterxml/jackson/core/io/UTF8WriterTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import org.junit.Assert;
66

7+
import com.fasterxml.jackson.core.ErrorReportConfiguration;
78
import com.fasterxml.jackson.core.StreamReadConstraints;
89
import com.fasterxml.jackson.core.StreamWriteConstraints;
910
import com.fasterxml.jackson.core.util.BufferRecycler;
@@ -151,7 +152,9 @@ private IOContext _ioContext() {
151152
}
152153

153154
private IOContext _ioContext(BufferRecycler br) {
154-
return new IOContext(StreamReadConstraints.defaults(), StreamWriteConstraints.defaults(),
155+
return new IOContext(StreamReadConstraints.defaults(),
156+
StreamWriteConstraints.defaults(),
157+
ErrorReportConfiguration.defaults(),
155158
br, ContentReference.unknown(), false);
156159
}
157160
}

src/test/java/com/fasterxml/jackson/core/util/ReadConstrainedTextBufferTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.fasterxml.jackson.core.util;
22

3+
import com.fasterxml.jackson.core.ErrorReportConfiguration;
34
import com.fasterxml.jackson.core.StreamReadConstraints;
45
import com.fasterxml.jackson.core.StreamWriteConstraints;
56
import com.fasterxml.jackson.core.io.ContentReference;
@@ -47,6 +48,7 @@ private static TextBuffer makeConstrainedBuffer(int maxStringLen) {
4748
IOContext ioContext = new IOContext(
4849
constraints,
4950
StreamWriteConstraints.defaults(),
51+
ErrorReportConfiguration.defaults(),
5052
new BufferRecycler(),
5153
ContentReference.rawReference("N/A"), true);
5254
return ioContext.constructReadConstrainedTextBuffer();

src/test/java/com/fasterxml/jackson/core/write/UTF8GeneratorTest.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ public class UTF8GeneratorTest extends BaseTest
1919
public void testUtf8Issue462() throws Exception
2020
{
2121
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
22-
IOContext ioc = new IOContext(StreamReadConstraints.defaults(), StreamWriteConstraints.defaults(),
22+
IOContext ioc = new IOContext(StreamReadConstraints.defaults(),
23+
StreamWriteConstraints.defaults(),
24+
ErrorReportConfiguration.defaults(),
2325
new BufferRecycler(),
2426
ContentReference.rawReference(bytes), true);
2527
JsonGenerator gen = new UTF8JsonGenerator(ioc, 0, null, bytes, '"');
@@ -50,6 +52,7 @@ public void testNestingDepthWithSmallLimit() throws Exception
5052
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
5153
IOContext ioc = new IOContext(null,
5254
StreamWriteConstraints.builder().maxNestingDepth(1).build(),
55+
ErrorReportConfiguration.defaults(),
5356
new BufferRecycler(),
5457
ContentReference.rawReference(bytes), true);
5558
try (JsonGenerator gen = new UTF8JsonGenerator(ioc, 0, null, bytes, '"')) {
@@ -68,6 +71,7 @@ public void testNestingDepthWithSmallLimitNestedObject() throws Exception
6871
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
6972
IOContext ioc = new IOContext(null,
7073
StreamWriteConstraints.builder().maxNestingDepth(1).build(),
74+
ErrorReportConfiguration.defaults(),
7175
new BufferRecycler(),
7276
ContentReference.rawReference(bytes), true);
7377
try (JsonGenerator gen = new UTF8JsonGenerator(ioc, 0, null, bytes, '"')) {

src/test/java/com/fasterxml/jackson/core/write/WriterBasedJsonGeneratorTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package com.fasterxml.jackson.core.write;
22

3+
import java.io.StringWriter;
4+
35
import com.fasterxml.jackson.core.BaseTest;
4-
import com.fasterxml.jackson.core.JsonFactory;
6+
import com.fasterxml.jackson.core.ErrorReportConfiguration;
57
import com.fasterxml.jackson.core.JsonGenerator;
68
import com.fasterxml.jackson.core.StreamWriteConstraints;
79
import com.fasterxml.jackson.core.exc.StreamConstraintsException;
@@ -10,17 +12,14 @@
1012
import com.fasterxml.jackson.core.json.WriterBasedJsonGenerator;
1113
import com.fasterxml.jackson.core.util.BufferRecycler;
1214

13-
import java.io.StringWriter;
14-
1515
public class WriterBasedJsonGeneratorTest extends BaseTest
1616
{
17-
private final JsonFactory JSON_F = new JsonFactory();
18-
1917
public void testNestingDepthWithSmallLimit() throws Exception
2018
{
2119
StringWriter sw = new StringWriter();
2220
IOContext ioc = new IOContext(null,
2321
StreamWriteConstraints.builder().maxNestingDepth(1).build(),
22+
ErrorReportConfiguration.defaults(),
2423
new BufferRecycler(),
2524
ContentReference.rawReference(sw), true);
2625
try (JsonGenerator gen = new WriterBasedJsonGenerator(ioc, 0, null, sw, '"')) {
@@ -39,6 +38,7 @@ public void testNestingDepthWithSmallLimitNestedObject() throws Exception
3938
StringWriter sw = new StringWriter();
4039
IOContext ioc = new IOContext(null,
4140
StreamWriteConstraints.builder().maxNestingDepth(1).build(),
41+
ErrorReportConfiguration.defaults(),
4242
new BufferRecycler(),
4343
ContentReference.rawReference(sw), true);
4444
try (JsonGenerator gen = new WriterBasedJsonGenerator(ioc, 0, null, sw, '"')) {

0 commit comments

Comments
 (0)