Skip to content

Commit 7ca3f0a

Browse files
committed
and second part of fix for skipping
1 parent 9438c87 commit 7ca3f0a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -1086,6 +1086,7 @@ public String nextFieldName() throws IOException
10861086
if (_skipUnknownField(id, wireType) != JsonToken.FIELD_NAME) {
10871087
return null;
10881088
}
1089+
// sub-optimal as skip method already set it, but:
10891090
}
10901091
String name = _currentField.name;
10911092
_parsingContext.setCurrentName(name);
@@ -1119,9 +1120,10 @@ public String nextFieldName() throws IOException
11191120

11201121
ProtobufField f = _findField(id);
11211122
if (f == null) {
1122-
_skipUnknownField(id, wireType);
1123-
// may or may not match, but let caller figure it out
1124-
return null;
1123+
if (_skipUnknownField(id, wireType) != JsonToken.FIELD_NAME) {
1124+
return null;
1125+
}
1126+
// sub-optimal as skip method already set it, but:
11251127
}
11261128
final String name = _currentField.name;
11271129
_parsingContext.setCurrentName(name);

0 commit comments

Comments
 (0)