jprotobuf icon indicating copy to clipboard operation
jprotobuf copied to clipboard

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

Open ChianghoGoNow opened this issue 2 years ago • 2 comments

异常说明: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<structB> maps; } decode正常 测试结果4:结构/数据都不变,取消structB的EnableZigZap注解,decode正常

ChianghoGoNow avatar Sep 05 '22 08:09 ChianghoGoNow

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

jhunters avatar Oct 10 '22 08:10 jhunters

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

jhunters avatar Oct 11 '22 04:10 jhunters