-
Notifications
You must be signed in to change notification settings - Fork 5
Open
open-dis/opendis7-source-generator
#21Description
Bug
Six PDU tests report "String mismatch" failures due to duplicated list entries after unmarshal:
- EventReportPduTest
- ActionRequestPduTest
- ActionResponsePduTest
- AggregateStatePduTest
- MinefieldDataPduTest
- ResupplyReceivedPduTest
Root Cause
The generated unmarshal() methods (both DataInputStream and ByteBuffer variants) call .add() on list fields without first calling .clear(). When unmarshal() is called on a PDU object that already contains data, the new entries are appended to the existing ones instead of replacing them.
Fix
The fix is in opendis7-source-generator — the JavaGenerator.java template needs to emit a .clear() call on each list field before the unmarshal for-loop. After regeneration, all affected PDU classes will produce correct unmarshal code.
Affected PDU Fields
- EventReportPdu:
fixedDatums,variableDatums - ActionRequestPdu:
fixedDatums,variableDatums - ActionResponsePdu:
fixedDatums,variableDatums - AggregateStatePdu:
aggregateIDList,entityIDList,silentAggregateSystemList,silentEntitySystemList,variableDatumList - MinefieldDataPdu:
sensorTypes,mineLocation - ResupplyReceivedPdu:
supplies
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels