Skip to content

Commit 9438c87

Browse files
committed
Minor fix to protobuf parser's nextFieldName() impl (when skipping unknown field ids)
1 parent 59aa102 commit 9438c87

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

protobuf/src/main/java/com/fasterxml/jackson/dataformat/protobuf/ProtobufParser.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,9 +1083,9 @@ public String nextFieldName() throws IOException
10831083

10841084
ProtobufField f = _findField(id);
10851085
if (f == null) {
1086-
_skipUnknownField(id, wireType);
1087-
// may or may not match, but let caller figure it out
1088-
return null;
1086+
if (_skipUnknownField(id, wireType) != JsonToken.FIELD_NAME) {
1087+
return null;
1088+
}
10891089
}
10901090
String name = _currentField.name;
10911091
_parsingContext.setCurrentName(name);

release-notes/VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Modules:
1515
(contributed by philipa@github)
1616
#116: (protobuf) Should skip the positive byte which is the last byte of an varint
1717
(contributed by marsqing@github)
18+
- (protobuf) Minor fix to skipping with `nextFieldName()`
1819

1920
2.9.2 (14-Oct-2017)
2021

0 commit comments

Comments
 (0)