Skip to content

Make Jp2kDecoderAsync.init idempotent#70

Merged
keiji merged 2 commits intomainfrom
feature/idempotent-init-2027274266713026583
Jan 3, 2026
Merged

Make Jp2kDecoderAsync.init idempotent#70
keiji merged 2 commits intomainfrom
feature/idempotent-init-2027274266713026583

Conversation

@google-labs-jules
Copy link
Contributor

Modified Jp2kDecoderAsync.kt to check state == State.Initialized at the beginning of the init method. If true, it immediately invokes callback.onSuccess(Unit) and returns. This prevents the IllegalStateException that was previously thrown and allows for safe re-initialization attempts. Verified via code review and manual logic verification as local Android unit tests are constrained by environment limitations.


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

Previously, calling `init` on a `Jp2kDecoderAsync` (or `Jp2kDecoder`) instance that was already in the `Initialized` state would result in an `IllegalStateException`. This change updates `init` to check for the `Initialized` state and return success immediately, treating the call as a no-op. This improves robustness and aligns with common initialization patterns.
@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:29
@keiji keiji merged commit a56081a into main Jan 3, 2026
2 checks passed
@keiji keiji deleted the feature/idempotent-init-2027274266713026583 branch January 3, 2026 05:30
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