Refine Jp2kDecoderAsync state behavior and documentation#72
Conversation
- Update `docs/design.md` to include a behavior matrix for `Jp2kDecoderAsync` methods (`init`, `decodeImage`, `getMemoryUsage`, `release`) across all states. - Refine error messages in `Jp2kDecoderAsync.kt` to be more explicit about state conflicts. - Ensure `init` correctly handles idempotent calls (success on `Initialized`) and errors on invalid states (`Initializing`, `Decoding`, `Terminated`). - Ensure `decodeImage` and `getMemoryUsage` allow queueing during `Decoding` state as documented.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR explicitly defines the behavior of
Jp2kDecoderAsyncmethods based on the internal state and updates the implementation to match.docs/design.mdspecifying the expected behavior (Success, Error, Queueing) for each method in each state (Uninitialized,Initializing,Initialized,Decoding,Terminated).Jp2kDecoderAsync.ktto ensure strict adherence to these rules.init: ReturnsIllegalStateExceptionif called duringInitializingorDecoding. Returns success if alreadyInitialized.decodeImage: Allows execution ifInitializedorDecoding(queueing). ReturnsIllegalStateExceptionotherwise.getMemoryUsage: Follows same rules asdecodeImage.PR created automatically by Jules for task 4522723737214160150 started by @keiji