Skip to content

Commit

Permalink
Clean up references to old `ContentReference.DEFAULT_MAX_CONTENT_SNIP…
Browse files Browse the repository at this point in the history
…PET`
  • Loading branch information
JooHyukKim committed Jul 29, 2023
1 parent 8bfe3fb commit d3d02ae
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/fasterxml/jackson/core/JsonLocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class JsonLocation
private static final long serialVersionUID = 2L; // in 2.13

/**
* @deprecated Since 2.13 use {@link ContentReference#DEFAULT_MAX_CONTENT_SNIPPET} instead
* @deprecated Since 2.13 use {@link ErrorReportConfiguration#DEFAULT_MAX_RAW_CONTENT_LENGTH} instead
*/
@Deprecated
public static final int MAX_CONTENT_SNIPPET = 500;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ public class ContentReference
* as configured by {@link ErrorReportConfiguration.Builder#maxRawContentLength(int)}
* will be used instead.
*/
@Deprecated
public static final int DEFAULT_MAX_CONTENT_SNIPPET = 500;

/**
Expand Down Expand Up @@ -106,6 +107,7 @@ protected ContentReference(boolean isContentTextual, Object rawContent) {
/**
* @deprecated Since 2.16. Use {@link #ContentReference(boolean, Object, int, int, ErrorReportConfiguration)} instead.
*/
@Deprecated
protected ContentReference(boolean isContentTextual, Object rawContent,
int offset, int length)
{
Expand All @@ -126,7 +128,8 @@ protected ContentReference(boolean isContentTextual, Object rawContent,
* @since 2.16
*/
public ContentReference(boolean isContentTextual, Object rawContent,
ErrorReportConfiguration errorReportConfiguration) {
ErrorReportConfiguration errorReportConfiguration)
{
this(isContentTextual, rawContent, -1, -1, errorReportConfiguration);
}

Expand Down Expand Up @@ -168,15 +171,17 @@ public static ContentReference construct(boolean isContentTextual, Object rawCon
* @since 2.16
*/
public static ContentReference construct(boolean isContentTextual, Object rawContent,
int offset, int length, ErrorReportConfiguration errorReportConfiguration)
int offset, int length, ErrorReportConfiguration errorReportConfiguration)
{
return new ContentReference(isContentTextual, rawContent, offset, length, errorReportConfiguration);
}

/**
* @since 2.16
*/
public static ContentReference construct(boolean isContentTextual, Object rawContent, ErrorReportConfiguration errorReportConfiguration) {
public static ContentReference construct(boolean isContentTextual, Object rawContent,
ErrorReportConfiguration errorReportConfiguration)
{
return new ContentReference(isContentTextual, rawContent, errorReportConfiguration);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void testBasicToString() throws Exception
public void testTruncatedSource() throws Exception
{
StringBuilder sb = new StringBuilder();
for (int i = 0; i < ContentReference.DEFAULT_MAX_CONTENT_SNIPPET; ++i) {
for (int i = 0; i < ErrorReportConfiguration.DEFAULT_MAX_RAW_CONTENT_LENGTH; ++i) {
sb.append("x");
}
String main = sb.toString();
Expand Down

0 comments on commit d3d02ae

Please sign in to comment.