Skip to content

Refine Jp2kDecoderAsync state behavior and documentation#72

Merged
keiji merged 1 commit intomainfrom
feature/decoder-state-behavior-4522723737214160150
Jan 3, 2026
Merged

Refine Jp2kDecoderAsync state behavior and documentation#72
keiji merged 1 commit intomainfrom
feature/decoder-state-behavior-4522723737214160150

Conversation

@google-labs-jules
Copy link
Contributor

This PR explicitly defines the behavior of Jp2kDecoderAsync methods based on the internal state and updates the implementation to match.

  1. Documentation Update: Added a table in docs/design.md specifying the expected behavior (Success, Error, Queueing) for each method in each state (Uninitialized, Initializing, Initialized, Decoding, Terminated).
  2. Implementation Refinement: Updated Jp2kDecoderAsync.kt to ensure strict adherence to these rules.
    • init: Returns IllegalStateException if called during Initializing or Decoding. Returns success if already Initialized.
    • decodeImage: Allows execution if Initialized or Decoding (queueing). Returns IllegalStateException otherwise.
    • getMemoryUsage: Follows same rules as decodeImage.
    • Refined error messages to clearly state "Cannot [action] while in state: [state]".

PR created automatically by Jules for task 4522723737214160150 started by @keiji

- 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.
@google-labs-jules
Copy link
Contributor Author

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@keiji keiji marked this pull request as ready for review January 3, 2026 05:46
@keiji keiji merged commit a9eca33 into main Jan 3, 2026
2 checks passed
@keiji keiji deleted the feature/decoder-state-behavior-4522723737214160150 branch January 3, 2026 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments