@@ -1939,10 +1939,15 @@ private final byte[] _getBinaryFromString(Base64Variant variant) throws IOExcept
1939
1939
* and the token is reported as {@link JsonToken#VALUE_NULL}.
1940
1940
*
1941
1941
* @return {@code true} if current token is an `undefined`, {@code false} otherwise
1942
+ *
1942
1943
* @since 2.20
1943
1944
*/
1944
1945
public boolean isUndefined () {
1945
- return (_inputBuffer [_inputPtr - 1 ] & 0xFF ) == SIMPLE_VALUE_UNDEFINED ;
1946
+ if ((_currToken == JsonToken .VALUE_NULL ) || (_currToken == JsonToken .VALUE_NULL )) {
1947
+ return (_inputBuffer != null )
1948
+ && (_inputBuffer [_inputPtr - 1 ] & 0xFF ) == SIMPLE_VALUE_UNDEFINED ;
1949
+ }
1950
+ return false ;
1946
1951
}
1947
1952
1948
1953
/*
@@ -3686,20 +3691,20 @@ private final static long _long(int i1, int i2)
3686
3691
* Helper method to encapsulate details of handling of mysterious `undefined` value
3687
3692
* that is allowed to be used as something encoder could not handle (as per spec),
3688
3693
* whatever the heck that should be.
3689
- *
3690
3694
* <p>
3691
- * For backward compatibility with Jackson 2.9.6 to 2.19, this value is decoded
3695
+ * For backward compatibility with Jackson 2.10 to 2.19, this value is decoded
3692
3696
* as {@link JsonToken#VALUE_NULL} by default.
3693
3697
* <p>
3694
3698
*
3695
3699
* since 2.20 If {@link CBORParser.Feature#HANDLE_UNDEFINED_AS_EMBEDDED_OBJECT} is enabled,
3696
3700
* the value will instead be decoded as {@link JsonToken#VALUE_EMBEDDED_OBJECT}
3697
3701
* with an embedded value of {@code null}.
3698
3702
*
3699
- * @since 2.9.6
3703
+ * @since 2.10
3700
3704
*/
3701
3705
protected JsonToken _decodeUndefinedValue () {
3702
- if (CBORParser .Feature .HANDLE_UNDEFINED_AS_EMBEDDED_OBJECT .enabledIn (_formatFeatures )) {
3706
+ if (Feature .HANDLE_UNDEFINED_AS_EMBEDDED_OBJECT .enabledIn (_formatFeatures )) {
3707
+ _binaryValue = null ; // should be clear but just in case
3703
3708
return JsonToken .VALUE_EMBEDDED_OBJECT ;
3704
3709
}
3705
3710
return JsonToken .VALUE_NULL ;
0 commit comments