Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #82
Root cause — In FijiApposeTaskListener.errorListener() (src/main/java/fiji/plugin/appose/cellpose/FijiApposeTaskListener.java:114), the env-name was extracted with two independent whole-string searches:
On the first run the str passed by Appose's error stream is a large accumulated buffer (length 39273 in your trace), not a single line. In that buffer:
indexOf("The")matches the "The" in the finalThe … environment has been installed.line → begin = 39232indexOf("environment")matches the first "environment" that appeared much earlier in the log → end = 586So substring(39232, 586) has begin > end →
StringIndexOutOfBoundsException. It's non-blocking (thrown on a background stream-reader thread, cellpose keeps running) and doesn't recur because subsequent runs emit a short buffer where the two indexOf calls happen to align.Fix — Anchor on the real phrase and search backwards from it, with bounds guards:
lastIndexOf("The", envIdx)finds the "The" belonging to the same line as the installed-phrase, so begin never exceeds end regardless of buffer size, and the guard falls back to an empty name if the pattern isn't found. Uses of.trim()to fixed the missing space before "is ready." for a cleaner status message.Still to be tested to be sure all is good before merge!