Skip to content

Commit 1f82df7

Browse files
committed
Minor tweaking for ErrorReportConfiguration handling
1 parent 5239017 commit 1f82df7

File tree

3 files changed

+23
-22
lines changed

3 files changed

+23
-22
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,8 @@ public static int collectDefaults() {
285285
protected StreamReadConstraints _streamReadConstraints;
286286

287287
/**
288-
* Container for configuration values used when handling errorneous token inputs.
288+
* Container for configuration values used when handling erroneous token inputs.
289289
*
290-
* @see ErrorReportConfiguration
291290
* @since 2.16
292291
*/
293292
protected ErrorReportConfiguration _errorReportConfiguration;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected static ContentReference _wrap(Object srcRef) {
101101
if (srcRef instanceof ContentReference) {
102102
return (ContentReference) srcRef;
103103
}
104-
return ContentReference.construct(false, srcRef);
104+
return ContentReference.construct(false, srcRef, ErrorReportConfiguration.defaults());
105105
}
106106

107107
/*

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

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

33
import java.util.ArrayList;
44
import java.util.List;
5+
import java.util.Objects;
56

67
import com.fasterxml.jackson.core.io.InputDecorator;
78
import com.fasterxml.jackson.core.io.OutputDecorator;
@@ -82,32 +83,32 @@ public abstract class TSFBuilder<F extends JsonFactory,
8283
protected OutputDecorator _outputDecorator;
8384

8485
/**
85-
* Optional StreamReadConstraints.
86+
* {@link StreamReadConstraints} to use.
8687
*
8788
* @since 2.15
8889
*/
8990
protected StreamReadConstraints _streamReadConstraints;
9091

9192
/**
92-
* Optional StreamWriteConstraints.
93+
* {@link StreamWriteConstraints} to use.
9394
*
9495
* @since 2.16
9596
*/
9697
protected StreamWriteConstraints _streamWriteConstraints;
9798

9899
/**
100+
* {@link ErrorReportConfiguration} to use.
101+
*
99102
* @since 2.16
100103
*/
101-
protected List<JsonGeneratorDecorator> _generatorDecorators;
104+
protected ErrorReportConfiguration _errorReportConfiguration;
102105

103106
/**
104-
* Optional {@link ErrorReportConfiguration} to use.
105-
*
106107
* @since 2.16
107108
*/
108-
protected ErrorReportConfiguration _errorReportConfiguration;
109+
protected List<JsonGeneratorDecorator> _generatorDecorators;
110+
109111

110-
/*
111112
/**********************************************************************
112113
/* Construction
113114
/**********************************************************************
@@ -325,34 +326,35 @@ public B addDecorator(JsonGeneratorDecorator decorator) {
325326
* Sets the constraints for streaming reads.
326327
*
327328
* @param streamReadConstraints constraints for streaming reads
328-
* @return this factory
329+
* @return this builder (for call chaining)
329330
* @since 2.15
330331
*/
331332
public B streamReadConstraints(StreamReadConstraints streamReadConstraints) {
332-
_streamReadConstraints = streamReadConstraints;
333+
_streamReadConstraints = Objects.requireNonNull(streamReadConstraints);
333334
return _this();
334335
}
335336

336337
/**
337-
* Sets the configuration for error tokens.
338+
* Sets the constraints for streaming writes.
338339
*
339-
* @param errorReportConfiguration configuration values used for handling errorneous token inputs.
340-
* @return this factory
340+
* @param streamWriteConstraints constraints for streaming reads
341+
* @return this builder (for call chaining)
341342
* @since 2.16
342343
*/
343-
public B errorReportConfiguration(ErrorReportConfiguration errorReportConfiguration) {
344-
_errorReportConfiguration = errorReportConfiguration;
344+
public B streamWriteConstraints(StreamWriteConstraints streamWriteConstraints) {
345+
_streamWriteConstraints = Objects.requireNonNull(streamWriteConstraints);
345346
return _this();
346347
}
348+
347349
/**
348-
* Sets the constraints for streaming writes.
350+
* Sets the configuration for error reporting.
349351
*
350-
* @param streamWriteConstraints constraints for streaming reads
351-
* @return this factory
352+
* @param errorReportConfiguration configuration values used for handling erroneous token inputs.
353+
* @return this builder (for call chaining)
352354
* @since 2.16
353355
*/
354-
public B streamWriteConstraints(StreamWriteConstraints streamWriteConstraints) {
355-
_streamWriteConstraints = streamWriteConstraints;
356+
public B errorReportConfiguration(ErrorReportConfiguration errorReportConfiguration) {
357+
_errorReportConfiguration = Objects.requireNonNull(errorReportConfiguration);
356358
return _this();
357359
}
358360

0 commit comments

Comments
 (0)