Skip to content

Add @SideEffectFree to unmodifiable*() methods#281

Merged
mernst merged 1 commit into
typetools:masterfrom
mernst:unmodifiableMethod-side-effect-free
Jun 5, 2026
Merged

Add @SideEffectFree to unmodifiable*() methods#281
mernst merged 1 commit into
typetools:masterfrom
mernst:unmodifiableMethod-side-effect-free

Conversation

@mernst

@mernst mernst commented Jun 5, 2026

Copy link
Copy Markdown
Member

No description provided.

@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ab95a4b2-f38e-49f4-a9bc-af6a68376e1d

📥 Commits

Reviewing files that changed from the base of the PR and between 0626ede and c11ae1a.

📒 Files selected for processing (1)
  • src/java.base/share/classes/java/util/Collections.java

📝 Walkthrough

Walkthrough

This pull request adds the @SideEffectFree annotation to nine public factory methods in Collections.java that create unmodifiable views. The annotated methods are: unmodifiableCollection, unmodifiableSequencedCollection, unmodifiableSortedSet, unmodifiableNavigableSet, unmodifiableList, unmodifiableMap, unmodifiableSequencedMap, unmodifiableSortedMap, and unmodifiableNavigableMap. These annotations indicate that these factory methods have no observable side effects.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mernst mernst merged commit 0e5bddd into typetools:master Jun 5, 2026
33 of 49 checks passed
@mernst mernst deleted the unmodifiableMethod-side-effect-free branch June 5, 2026 17:29
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.

1 participant