OPENWIRE-69 - Fix PartialCommand and ProducerAck sequence ids#4
OPENWIRE-69 - Fix PartialCommand and ProducerAck sequence ids#4cshannon merged 2 commits intoapache:mainfrom
Conversation
PartialCommand and ProducerAck duplicate the same sequence id on more than one property. This commit fixes the sequence and also adds validation to the marshaller to verify that sequences are not duplicated and if they are an IllegalArgumentException is thrown.
|
So I am going to mark this as a draft for now as it works but I think I will update this to be smarter. Right now it just looks for unique sequences which is a good start but I think we should be smarter and just iterate over it after we have sorted the list and also verify that there are no gaps. We wouldn't want sequence ids of something like 1,2,4 we would only want to allow 1,2,3 so I can fix that tomorrow and push a new commit. |
|
The change makes sense to me, will review tomorrow if you push more updates. It's likely there's more areas where deeper validation would be useful to prevent user error when updating / adding to openwire commands. |
|
@tabish121 - As i updated in my description, a lot more validatiion is now done. I am checking that sequences are positive, not contiguous and not duplicated. I also added a sanity check for the OpenWireType annotation to actually exist. As you noted a lot more validation like this probably needs ot be done elsewhere but this is a good start for this and more checks can be done in follow on issues. If it looks ok I can squash and merge the PR. |
|
Looks good, nice to validate all those cases for sure. |
PartialCommand and ProducerAck duplicate the same sequence id on more than one property. This commit fixes the sequence and also adds validation to the marshaller to verify that sequences are not negative or duplicated and that they are contiguous. If there is any issue with validation then an IllegalArgumentException is thrown.
I also added another check when creating the OpenWireTypeDescription object that the OpenWireType annotation exists.