Skip to content

Commit 6b0125d

Browse files
committed
Mark some more methods deprecated, as forward-looking changes towards 3.0
1 parent b67bd63 commit 6b0125d

File tree

1 file changed

+37
-31
lines changed

1 file changed

+37
-31
lines changed

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

Lines changed: 37 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -742,22 +742,24 @@ public JsonLocation currentTokenLocation() {
742742
return getTokenLocation();
743743
}
744744

745-
// TODO: deprecate in 2.14 or later
746745
/**
747-
* Alias for {@link #currentLocation()}, to be deprecated in later
748-
* Jackson 2.x versions (and removed from Jackson 3.0).
746+
* Deprecated alias for {@link #currentLocation()} (removed from Jackson 3.0).
749747
*
750748
* @return Location of the last processed input unit (byte or character)
749+
*
750+
* @deprecated Since 2.17 use {@link #currentLocation()} instead
751751
*/
752+
@Deprecated // since 2.17
752753
public abstract JsonLocation getCurrentLocation();
753754

754-
// TODO: deprecate in 2.14 or later
755755
/**
756-
* Alias for {@link #currentTokenLocation()}, to be deprecated in later
757-
* Jackson 2.x versions (and removed from Jackson 3.0).
756+
* Deprecated alias for {@link #currentTokenLocation()} (removed from Jackson 3.0).
758757
*
759758
* @return Starting location of the token parser currently points to
759+
*
760+
* @deprecated Since 2.17 use {@link #currentTokenLocation()} instead
760761
*/
762+
@Deprecated // since 2.17
761763
public abstract JsonLocation getTokenLocation();
762764

763765
/**
@@ -776,8 +778,21 @@ public JsonLocation currentTokenLocation() {
776778
* @since 2.13 (added as replacement for older {@link #getCurrentValue()}
777779
*/
778780
public Object currentValue() {
779-
// TODO: implement directly in 2.14 or later, make getCurrentValue() call this
780-
return getCurrentValue();
781+
// Note: implemented directly in 2.17, no longer delegating to getCurrentValue()
782+
JsonStreamContext ctxt = getParsingContext();
783+
return (ctxt == null) ? null : ctxt.getCurrentValue();
784+
}
785+
786+
/**
787+
* Deprecated alias for {@link #currentValue()} (removed from Jackson 3.0).
788+
*
789+
* @return Location of the last processed input unit (byte or character)
790+
*
791+
* @deprecated Since 2.17 use {@link #currentValue()} instead
792+
*/
793+
@Deprecated // since 2.17
794+
public Object getCurrentValue() {
795+
return currentValue();
781796
}
782797

783798
/**
@@ -791,34 +806,23 @@ public Object currentValue() {
791806
* @since 2.13 (added as replacement for older {@link #setCurrentValue}
792807
*/
793808
public void assignCurrentValue(Object v) {
794-
// TODO: implement directly in 2.14 or later, make setCurrentValue() call this
795-
setCurrentValue(v);
796-
}
797-
798-
// TODO: deprecate in 2.14 or later
799-
/**
800-
* Alias for {@link #currentValue()}, to be deprecated in later
801-
* Jackson 2.x versions (and removed from Jackson 3.0).
802-
*
803-
* @return Location of the last processed input unit (byte or character)
804-
*/
805-
public Object getCurrentValue() {
809+
// Note: implemented directly in 2.17, no longer delegating to setCurrentValue()
806810
JsonStreamContext ctxt = getParsingContext();
807-
return (ctxt == null) ? null : ctxt.getCurrentValue();
811+
if (ctxt != null) {
812+
ctxt.setCurrentValue(v);
813+
}
808814
}
809815

810-
// TODO: deprecate in 2.14 or later
811816
/**
812-
* Alias for {@link #assignCurrentValue}, to be deprecated in later
813-
* Jackson 2.x versions (and removed from Jackson 3.0).
817+
* Deprecated alias for {@link #assignCurrentValue(Object)} (removed from Jackson 3.0).
814818
*
815819
* @param v Current value to assign for the current input context of this parser
820+
*
821+
* @deprecated Since 2.17 use {@link #assignCurrentValue} instead
816822
*/
823+
@Deprecated // since 2.17
817824
public void setCurrentValue(Object v) {
818-
JsonStreamContext ctxt = getParsingContext();
819-
if (ctxt != null) {
820-
ctxt.setCurrentValue(v);
821-
}
825+
assignCurrentValue(v);
822826
}
823827

824828
/*
@@ -1398,7 +1402,7 @@ public int currentTokenId() {
13981402
public boolean isExpectedNumberIntToken() { return currentToken() == JsonToken.VALUE_NUMBER_INT; }
13991403

14001404
/**
1401-
* Access for checking whether current token is a special
1405+
* Accessor for checking whether current token is a special
14021406
* "not-a-number" (NaN) token (including both "NaN" AND
14031407
* positive/negative infinity!). These values are not supported by all formats:
14041408
* JSON, for example, only supports them if
@@ -1417,7 +1421,7 @@ public int currentTokenId() {
14171421
* @throws IOException for low-level read issues, or
14181422
* {@link JsonParseException} for decoding problems
14191423
*
1420-
* @since 2.9
1424+
* @since 2.9 (slight change in semantics in 2.17)
14211425
*/
14221426
public boolean isNaN() throws IOException {
14231427
return false;
@@ -1473,15 +1477,17 @@ public boolean isNaN() throws IOException {
14731477
/**********************************************************
14741478
*/
14751479

1476-
// TODO: deprecate in 2.14 or later
14771480
/**
14781481
* Alias of {@link #currentName()}.
14791482
*
14801483
* @return Name of the current field in the parsing context
14811484
*
14821485
* @throws IOException for low-level read issues, or
14831486
* {@link JsonParseException} for decoding problems
1487+
*
1488+
* @deprecated use {@link #currentName} instead.
14841489
*/
1490+
@Deprecated
14851491
public abstract String getCurrentName() throws IOException;
14861492

14871493
/**

0 commit comments

Comments
 (0)