Conversation
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.
|
👋 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. |
Modified
Jp2kDecoderAsync.ktto checkstate == State.Initializedat the beginning of theinitmethod. If true, it immediately invokescallback.onSuccess(Unit)and returns. This prevents theIllegalStateExceptionthat 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