jhunters / jprotobuf

A useful utility library for java programmer using google protobuf
Apache License 2.0
879 stars 281 forks source link

EnableZigZap注解在特定情况下引起decode异常:InvalidProtocolBufferException #186

Open ChianghoGoNow opened 2 years ago

ChianghoGoNow commented 2 years ago

异常说明:While parsing a protocol message, the input ended unexpectedly in the middle of a field. This could mean either that the input has been truncated or that an embedded message misreported its own length!!!

bean结构: @ProtobufClass structA{ Map<int,structB> maps; }

@EnableZigZap @ProtobufClass structB{ List lst={0,100,2,100,3,100,4,100,100,100,9999,100}; }

测试环境:(JDK1.8-271)jProtobuf(2.4.8/2.4.15)

测试结果1:以上结构不变,数据不变,decode出现异常。 测试结果2:以上结构不变,structB数据:{0,100,2,100,3,100,4,100,5,100,6,100}; decode正常;其他随便输入了几个数字也正常 测试结果3:structA的结构改成 structA{ Set maps; } decode正常 测试结果4:结构/数据都不变,取消structB的EnableZigZap注解,decode正常

jhunters commented 1 year ago

收到,感谢反馈,我们跟进一下

jhunters commented 1 year ago

已发布 2.4.17-SNAPSHOT, 修正了该问题