@@ -711,7 +711,10 @@ private JsonToken _handleRootKey(int tag) throws JacksonException
711711 }
712712 // array?
713713 if (f .repeated ) {
714- if (f .packed ) {
714+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
715+ // the actual wire type, not just the schema's declared `packed` flag:
716+ // proto3 permits either encoding for repeated scalar/enum fields.
717+ if (f .isPackedInWire (wireType )) {
715718 _state = STATE_ARRAY_START_PACKED ;
716719 } else {
717720 _state = STATE_ARRAY_START ;
@@ -755,7 +758,10 @@ private JsonToken _handleNestedKey(int tag) throws JacksonException
755758
756759 // array?
757760 if (f .repeated ) {
758- if (f .packed ) {
761+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
762+ // the actual wire type, not just the schema's declared `packed` flag:
763+ // proto3 permits either encoding for repeated scalar/enum fields.
764+ if (f .isPackedInWire (wireType )) {
759765 _state = STATE_ARRAY_START_PACKED ;
760766 } else {
761767 _state = STATE_ARRAY_START ;
@@ -1027,7 +1033,10 @@ public String nextName() throws JacksonException
10271033
10281034 // array?
10291035 if (_currentField .repeated ) {
1030- if (_currentField .packed ) {
1036+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
1037+ // the actual wire type, not just the schema's declared `packed` flag:
1038+ // proto3 permits either encoding for repeated scalar/enum fields.
1039+ if (_currentField .isPackedInWire (wireType )) {
10311040 _state = STATE_ARRAY_START_PACKED ;
10321041 } else {
10331042 _state = STATE_ARRAY_START ;
@@ -1064,7 +1073,10 @@ public String nextName() throws JacksonException
10641073
10651074 // array?
10661075 if (_currentField .repeated ) {
1067- if (_currentField .packed ) {
1076+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
1077+ // the actual wire type, not just the schema's declared `packed` flag:
1078+ // proto3 permits either encoding for repeated scalar/enum fields.
1079+ if (_currentField .isPackedInWire (wireType )) {
10681080 _state = STATE_ARRAY_START_PACKED ;
10691081 } else {
10701082 _state = STATE_ARRAY_START ;
@@ -1116,7 +1128,10 @@ public boolean nextName(SerializableString sstr) throws JacksonException
11161128
11171129 // array?
11181130 if (_currentField .repeated ) {
1119- if (_currentField .packed ) {
1131+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
1132+ // the actual wire type, not just the schema's declared `packed` flag:
1133+ // proto3 permits either encoding for repeated scalar/enum fields.
1134+ if (_currentField .isPackedInWire (wireType )) {
11201135 _state = STATE_ARRAY_START_PACKED ;
11211136 } else {
11221137 _state = STATE_ARRAY_START ;
@@ -1152,7 +1167,10 @@ public boolean nextName(SerializableString sstr) throws JacksonException
11521167
11531168 // array?
11541169 if (_currentField .repeated ) {
1155- if (_currentField .packed ) {
1170+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
1171+ // the actual wire type, not just the schema's declared `packed` flag:
1172+ // proto3 permits either encoding for repeated scalar/enum fields.
1173+ if (_currentField .isPackedInWire (wireType )) {
11561174 _state = STATE_ARRAY_START_PACKED ;
11571175 } else {
11581176 _state = STATE_ARRAY_START ;
@@ -1209,8 +1227,14 @@ public int nextNameMatch(PropertyNameMatcher matcher) throws JacksonException
12091227
12101228 // array?
12111229 if (_currentField .repeated ) {
1212- _state = _currentField .packed
1213- ? STATE_ARRAY_START_PACKED : STATE_ARRAY_START ;
1230+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
1231+ // the actual wire type, not just the schema's declared `packed` flag:
1232+ // proto3 permits either encoding for repeated scalar/enum fields.
1233+ if (_currentField .isPackedInWire (wireType )) {
1234+ _state = STATE_ARRAY_START_PACKED ;
1235+ } else {
1236+ _state = STATE_ARRAY_START ;
1237+ }
12141238 } else {
12151239 _state = STATE_ROOT_VALUE ;
12161240 }
@@ -1247,8 +1271,14 @@ public int nextNameMatch(PropertyNameMatcher matcher) throws JacksonException
12471271
12481272 // array?
12491273 if (_currentField .repeated ) {
1250- _state = _currentField .packed
1251- ? STATE_ARRAY_START_PACKED : STATE_ARRAY_START ;
1274+ // 03-Jul-2026, tatu: [dataformats-binary#134] Decide packed-vs-unpacked from
1275+ // the actual wire type, not just the schema's declared `packed` flag:
1276+ // proto3 permits either encoding for repeated scalar/enum fields.
1277+ if (_currentField .isPackedInWire (wireType )) {
1278+ _state = STATE_ARRAY_START_PACKED ;
1279+ } else {
1280+ _state = STATE_ARRAY_START ;
1281+ }
12521282 } else {
12531283 _state = STATE_NESTED_VALUE ;
12541284 }
0 commit comments