Skip to content

[Cocoa] Clamp accessibility text ranges to the text length - #3716

Open
vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:cocoa-accessible-string-range-3339
Open

vogella wants to merge 1 commit into
eclipse-platform:masterfrom
vogella:cocoa-accessible-string-range-3339

Conversation

@vogella

@vogella vogella commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Accessibility clients such as VoiceOver ask for text ranges and indexes past the end of a control's text. The Cocoa Accessible passed them straight to substring, so the string for range, selected text and line for index queries threw StringIndexOutOfBoundsException, and the attributed string query looped forever because the style runs never reached the requested end. The ranges are now clamped to the text, and a Cocoa regression test covers all four queries. This builds on #3715 (the JUnit 5 move of the Cocoa test bundle), whose commit is included here until it is merged.

Fixes #3339

@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Test Results

  228 files  + 4    228 suites  +4   26m 24s ⏱️ +21s
5 035 tests + 4  5 007 ✅ + 4   28 💤 ±0  0 ❌ ±0 
7 486 runs  +16  7 271 ✅ +16  215 💤 ±0  0 ❌ ±0 

Results for commit 81ff645. ± Comparison against base commit 33459eb.

Accessibility clients such as VoiceOver request ranges and indexes past
the end of the text, which made the string, selected text and line
queries throw StringIndexOutOfBoundsException and the attributed string
query loop forever. Clamp them to the text and replace the placeholder
Cocoa test with a regression test.

Fixes eclipse-platform#3339

Assisted-by: multiple AI agents and layers of automated tooling 🤖
@vogella
vogella force-pushed the cocoa-accessible-string-range-3339 branch from 81ff645 to 0ffa296 Compare October 9, 2026 17:53
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Test Results (macosx)

   76 files     76 suites   5m 47s ⏱️
4 657 tests 4 392 ✅ 265 💤 0 ❌
2 362 runs  2 276 ✅  86 💤 0 ❌

Results for commit 0ffa296.

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.

Possible SIOOBE in Accessible.getStringForRangeParameterizedAttribute

1 participant