@@ -718,7 +718,10 @@ private JsonToken _handleRootKey(int tag) throws JacksonException
718718 }
719719 // array?
720720 if (f .repeated ) {
721- if (f .packed ) {
721+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
722+ // the actual wire type, not just the schema's declared `packed` flag:
723+ // proto3 permits either encoding for repeated scalar/enum fields.
724+ if (f .isPackedInWire (wireType )) {
722725 _state = STATE_ARRAY_START_PACKED ;
723726 } else {
724727 _state = STATE_ARRAY_START ;
@@ -762,7 +765,10 @@ private JsonToken _handleNestedKey(int tag) throws JacksonException
762765
763766 // array?
764767 if (f .repeated ) {
765- if (f .packed ) {
768+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
769+ // the actual wire type, not just the schema's declared `packed` flag:
770+ // proto3 permits either encoding for repeated scalar/enum fields.
771+ if (f .isPackedInWire (wireType )) {
766772 _state = STATE_ARRAY_START_PACKED ;
767773 } else {
768774 _state = STATE_ARRAY_START ;
@@ -1034,7 +1040,10 @@ public String nextName() throws JacksonException
10341040
10351041 // array?
10361042 if (_currentField .repeated ) {
1037- if (_currentField .packed ) {
1043+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
1044+ // the actual wire type, not just the schema's declared `packed` flag:
1045+ // proto3 permits either encoding for repeated scalar/enum fields.
1046+ if (_currentField .isPackedInWire (wireType )) {
10381047 _state = STATE_ARRAY_START_PACKED ;
10391048 } else {
10401049 _state = STATE_ARRAY_START ;
@@ -1071,7 +1080,10 @@ public String nextName() throws JacksonException
10711080
10721081 // array?
10731082 if (_currentField .repeated ) {
1074- if (_currentField .packed ) {
1083+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
1084+ // the actual wire type, not just the schema's declared `packed` flag:
1085+ // proto3 permits either encoding for repeated scalar/enum fields.
1086+ if (_currentField .isPackedInWire (wireType )) {
10751087 _state = STATE_ARRAY_START_PACKED ;
10761088 } else {
10771089 _state = STATE_ARRAY_START ;
@@ -1123,7 +1135,10 @@ public boolean nextName(SerializableString sstr) throws JacksonException
11231135
11241136 // array?
11251137 if (_currentField .repeated ) {
1126- if (_currentField .packed ) {
1138+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
1139+ // the actual wire type, not just the schema's declared `packed` flag:
1140+ // proto3 permits either encoding for repeated scalar/enum fields.
1141+ if (_currentField .isPackedInWire (wireType )) {
11271142 _state = STATE_ARRAY_START_PACKED ;
11281143 } else {
11291144 _state = STATE_ARRAY_START ;
@@ -1159,7 +1174,10 @@ public boolean nextName(SerializableString sstr) throws JacksonException
11591174
11601175 // array?
11611176 if (_currentField .repeated ) {
1162- if (_currentField .packed ) {
1177+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
1178+ // the actual wire type, not just the schema's declared `packed` flag:
1179+ // proto3 permits either encoding for repeated scalar/enum fields.
1180+ if (_currentField .isPackedInWire (wireType )) {
11631181 _state = STATE_ARRAY_START_PACKED ;
11641182 } else {
11651183 _state = STATE_ARRAY_START ;
@@ -1216,8 +1234,14 @@ public int nextNameMatch(PropertyNameMatcher matcher) throws JacksonException
12161234
12171235 // array?
12181236 if (_currentField .repeated ) {
1219- _state = _currentField .packed
1220- ? STATE_ARRAY_START_PACKED : STATE_ARRAY_START ;
1237+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
1238+ // the actual wire type, not just the schema's declared `packed` flag:
1239+ // proto3 permits either encoding for repeated scalar/enum fields.
1240+ if (_currentField .isPackedInWire (wireType )) {
1241+ _state = STATE_ARRAY_START_PACKED ;
1242+ } else {
1243+ _state = STATE_ARRAY_START ;
1244+ }
12211245 } else {
12221246 _state = STATE_ROOT_VALUE ;
12231247 }
@@ -1254,8 +1278,14 @@ public int nextNameMatch(PropertyNameMatcher matcher) throws JacksonException
12541278
12551279 // array?
12561280 if (_currentField .repeated ) {
1257- _state = _currentField .packed
1258- ? STATE_ARRAY_START_PACKED : STATE_ARRAY_START ;
1281+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
1282+ // the actual wire type, not just the schema's declared `packed` flag:
1283+ // proto3 permits either encoding for repeated scalar/enum fields.
1284+ if (_currentField .isPackedInWire (wireType )) {
1285+ _state = STATE_ARRAY_START_PACKED ;
1286+ } else {
1287+ _state = STATE_ARRAY_START ;
1288+ }
12591289 } else {
12601290 _state = STATE_NESTED_VALUE ;
12611291 }
0 commit comments