File tree 2 files changed +10
-6
lines changed
main/java/com/fasterxml/jackson/dataformat/cbor
test/java/com/fasterxml/jackson/dataformat/cbor/parse
2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -1201,7 +1201,9 @@ public String nextFieldName() throws IOException
1201
1201
// inlined "_decodeFieldName()"
1202
1202
1203
1203
if (_inputPtr >= _inputEnd ) {
1204
- loadMoreGuaranteed ();
1204
+ if (!loadMore ()) {
1205
+ _eofAsNextToken ();
1206
+ }
1205
1207
}
1206
1208
final int ch = _inputBuffer [_inputPtr ++];
1207
1209
final int type = ((ch >> 5 ) & 0x7 );
@@ -2560,7 +2562,11 @@ protected byte[] _finishLongContiguousBytes(final int expLen) throws IOException
2560
2562
protected final JsonToken _decodePropertyName () throws IOException
2561
2563
{
2562
2564
if (_inputPtr >= _inputEnd ) {
2563
- loadMoreGuaranteed ();
2565
+ // 30-Jan-2021, tatu: To get more specific exception, won't use
2566
+ // "loadMoreGuaranteed()" but instead:
2567
+ if (!loadMore ()) {
2568
+ _eofAsNextToken ();
2569
+ }
2564
2570
}
2565
2571
final int ch = _inputBuffer [_inputPtr ++];
2566
2572
final int type = ((ch >> 5 ) & 0x7 );
Original file line number Diff line number Diff line change @@ -40,7 +40,6 @@ public void testIncompleteMarkerBasedArray() throws Exception
40
40
}
41
41
42
42
// And might as well do the same for Objects too
43
- /*
44
43
public void testIncompleteFixedSizeObject () throws Exception
45
44
{
46
45
final byte [] input = { (byte ) 0xA3 };
@@ -50,7 +49,6 @@ public void testIncompleteFixedSizeObject() throws Exception
50
49
p .nextToken ();
51
50
fail ("Should NOT pass" );
52
51
} catch (StreamReadException e ) {
53
- e.printStackTrace();
54
52
verifyException (e , "Unexpected end-of-input in Object value: expected 3 more" );
55
53
}
56
54
}
@@ -65,9 +63,9 @@ public void testIncompleteMarkerBasedObject() throws Exception
65
63
p .nextToken ();
66
64
fail ("Should NOT pass" );
67
65
} catch (StreamReadException e ) {
68
- verifyException(e, "Unexpected end-of-input in Object value: expected an element or ");
66
+ verifyException (e ,
67
+ "Unexpected end-of-input in Object value: expected a property or close marker" );
69
68
}
70
69
}
71
70
}
72
- */
73
71
}
You can’t perform that action at this time.
0 commit comments