Skip to content

Commit

Permalink
Fully migrate to new constructor by deprecating old
Browse files Browse the repository at this point in the history
  • Loading branch information
JooHyukKim committed Aug 1, 2023
1 parent f6b86b4 commit 532a63a
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions src/main/java/com/fasterxml/jackson/core/io/ContentReference.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ public class ContentReference
/**********************************************************************
*/

/**
* @deprecated Since 2.16. Use {@link #ContentReference(boolean, Object, ErrorReportConfiguration)} instead.
*/
@Deprecated
protected ContentReference(boolean isContentTextual, Object rawContent) {
this(isContentTextual, rawContent, -1, -1);
}
Expand All @@ -112,6 +116,14 @@ protected ContentReference(boolean isContentTextual, Object rawContent,
this(isContentTextual, rawContent, offset, length, ErrorReportConfiguration.defaults());
}

/**
* @since 2.16
*/
protected ContentReference(boolean isContentTextual, Object rawContent, ErrorReportConfiguration errorReportConfiguration)
{
this(isContentTextual, rawContent, -1, -1, errorReportConfiguration);
}

/**
* @since 2.16
*/
Expand All @@ -125,15 +137,6 @@ protected ContentReference(boolean isContentTextual, Object rawContent,
_maxRawContentLength = errorReportConfiguration.getMaxRawContentLength();
}

/**
* @since 2.16
*/
public ContentReference(boolean isContentTextual, Object rawContent,
ErrorReportConfiguration errorReportConfiguration)
{
this(isContentTextual, rawContent, -1, -1, errorReportConfiguration);
}

/**
* Accessor for getting a placeholder for cases where actual content
* is not known (or is not something that system wants to expose).
Expand All @@ -158,9 +161,14 @@ public static ContentReference unknown() {
public static ContentReference redacted() {
return REDACTED_CONTENT;
}



/**
* @deprecated Since 2.16. Use {@link #construct(boolean, Object, ErrorReportConfiguration)} instead.
*/
@Deprecated
public static ContentReference construct(boolean isContentTextual, Object rawContent) {
return new ContentReference(isContentTextual, rawContent);
return new ContentReference(isContentTextual, rawContent, ErrorReportConfiguration.defaults());
}

/**
Expand Down

0 comments on commit 532a63a

Please sign in to comment.