Skip to content

Fix index bounds check in DefaultRedisList.get - #3470

Closed
ryujungkyun wants to merge 2 commits into
spring-projects:mainfrom
ryujungkyun:fix-redis-list-get-index-boundary
Closed

ryujungkyun wants to merge 2 commits into
spring-projects:mainfrom
ryujungkyun:fix-redis-list-get-index-boundary

Conversation

@ryujungkyun

@ryujungkyun ryujungkyun commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Closes #3471

DefaultRedisList.get(size()) does not throw the IndexOutOfBoundsException required by the List contract. This affects both get(3) on [A, B, C] and get(0) on an empty list.

This change rejects indices equal to the list size and covers both cases in the existing integration tests.

Related documentation: Java List.get(int) contract
Related API: Spring Data Redis — RedisList

Signed-off-by: RyuJungKyun <prank01@naver.com>
Signed-off-by: RyuJungKyun <prank01@naver.com>
@ryujungkyun
ryujungkyun force-pushed the fix-redis-list-get-index-boundary branch from 5c42a47 to c539ee6 Compare October 15, 2026 11:36
@mp911de mp911de added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 19, 2026
@mhalbritter mhalbritter added this to the 4.0.9 (2025.1.9) milestone Oct 26, 2026
mhalbritter pushed a commit that referenced this pull request Oct 26, 2026
Closes #3471
Original pull request: #3470

Signed-off-by: RyuJungKyun <prank01@naver.com>
mhalbritter added a commit that referenced this pull request Oct 26, 2026
See #3471
Original pull request: #3470
mhalbritter pushed a commit that referenced this pull request Oct 26, 2026
Closes #3471
Original pull request: #3470

Signed-off-by: RyuJungKyun <prank01@naver.com>
mhalbritter added a commit that referenced this pull request Oct 26, 2026
See #3471
Original pull request: #3470
mhalbritter pushed a commit that referenced this pull request Oct 26, 2026
Closes #3471
Original pull request: #3470

Signed-off-by: RyuJungKyun <prank01@naver.com>
mhalbritter added a commit that referenced this pull request Oct 26, 2026
See #3471
Original pull request: #3470
@mhalbritter

Copy link
Copy Markdown
Contributor

Thanks @ryujungkyun. Merged and backported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug A general bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DefaultRedisList.get(int) does not reject an index equal to the list size

4 participants