I am using SAPI and writing a streaming message parser. It calls the dp.parse repeatedly to parse the data, grabbing one message at a time from the data stream.
I need to enable tracing so I can see why a parse fails on the 4th message.
But this does not work:
Each call to parse calls notifyDebugging, which calls setDebugging, which checks that the position of the data input stream is bitPos0b == 0. But in a streaming situation, the bitPos0b won't be zero except when parsing at the start of the stream.
It is also questionable if this Java IllegalStateException should be getting thrown all the way to top level here. Since this is SAPI, this is probably Ok, but I would have expected Daffodil to issue an invariant failed here. This bug is an internal Daffodil issue, and not something SAPI uses should be having to think about catching.