File tree 3 files changed +8
-5
lines changed
main/java/com/fasterxml/jackson/dataformat/cbor
test/java/com/fasterxml/jackson/dataformat/cbor/parse 3 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,11 @@ public final class CBORConstants
113
113
114
114
public final static int INT_BREAK = 0xFF ;
115
115
116
+ /**
117
+ * Marker for "undefined" value in CBOR spec.
118
+ *
119
+ * @since 2.20
120
+ */
116
121
public final static int SIMPLE_VALUE_UNDEFINED = 0xF7 ;
117
122
118
123
/*
Original file line number Diff line number Diff line change @@ -49,15 +49,13 @@ public enum Feature implements FormatFeature
49
49
50
50
/**
51
51
* Feature that determines how an ` undefined ` value (0xF7) is decoded.
52
- *
53
52
* <p>
54
53
* When enabled, the parser returns {@link JsonToken#VALUE_EMBEDDED_OBJECT} with a
55
54
* value of {@code null}, allowing the caller to distinguish `undefined` from actual
56
55
* {@link JsonToken#VALUE_NULL}.
57
56
*<p>
58
57
* When disabled (default, for backwards compatibility), `undefined` value is
59
- * reported as {@link JsonToken#VALUE_NULL}, maintaining legacy behavior from Jackson 2.9.6 to 2.19.
60
- *<p>
58
+ * reported as {@link JsonToken#VALUE_NULL}, maintaining legacy behavior from Jackson 2.10 to 2.19.
61
59
*
62
60
* @since 2.20
63
61
*/
@@ -1943,7 +1941,7 @@ private final byte[] _getBinaryFromString(Base64Variant variant) throws IOExcept
1943
1941
* @since 2.20
1944
1942
*/
1945
1943
public boolean isUndefined () {
1946
- if ((_currToken == JsonToken .VALUE_NULL ) || (_currToken == JsonToken .VALUE_NULL )) {
1944
+ if ((_currToken == JsonToken .VALUE_NULL ) || (_currToken == JsonToken .VALUE_EMBEDDED_OBJECT )) {
1947
1945
return (_inputBuffer != null )
1948
1946
&& (_inputBuffer [_inputPtr - 1 ] & 0xFF ) == SIMPLE_VALUE_UNDEFINED ;
1949
1947
}
Original file line number Diff line number Diff line change 14
14
// for [dataformat-binary#93]
15
15
public class UndefinedValueTest extends CBORTestBase
16
16
{
17
- private final static byte BYTE_UNDEFINED = (byte ) 0xF7 ;
17
+ private final static byte BYTE_UNDEFINED = (byte ) CBORConstants . SIMPLE_VALUE_UNDEFINED ;
18
18
19
19
private final CBORFactory CBOR_F = cborFactory ();
20
20
You can’t perform that action at this time.
0 commit comments