hiSandog opened a new pull request, #18629: URL: https://github.com/apache/dolphinscheduler/pull/18629
## Was this PR generated or assisted by AI? YES. OpenAI Codex assisted with the implementation, regression tests, and validation. ## Purpose of the pull request Fixes #17139, which is still reproducible on current `dev`. The previous PR #17140 was closed without merging. `rollViewLogLines` checks the UTF-8 byte length but uses the 65,535 limit as a string index. A line containing 22,000 Chinese characters is 66,000 bytes, so log preview attempts to read past the end of the string and throws `IndexOutOfBoundsException`. ## Brief change log Use character counts consistently for the single-line cutoff, accumulated page limit, and truncation message, following the approach discussed in #17140. Add regression coverage for multibyte lines, ASCII and multibyte truncation, and the accumulated character limit. ## Verify this pull request The new multibyte cases reproduce the exception before the fix. With JDK 17 and the repository's dependency versions, the following checks pass: ```sh ./mvnw -o -pl dolphinscheduler-common '-DspotlessFiles=.*LogUtils.*[.]java' spotless:apply ./mvnw -o -pl dolphinscheduler-common -Dtest=LogUtilsTest test git diff --check ``` All 3 tests pass. The Maven test command also passes the module's Spotless check. The full repository test suite was not run. ## Pull Request Notice [Pull Request Notice](https://github.com/apache/dolphinscheduler/blob/dev/docs/docs/en/contribute/join/pull-request.md) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
