Repository navigation
Modifiability annotations - #301
Merged
Merged
Conversation
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
This reverts commit 77afd0a.
* `SimpleDeque`: add the missing import for `@SideEffectFree`, without
which the jtreg support file does not compile.
* `Arrays.fill(long[], long)`: `@SideEffectsOnly("#1")` rather than
`@Pure`; the body writes `a[i] = val`, and the 15 sibling overloads
already use `@SideEffectsOnly("#1")`.
* `Collection`, `List`, `Set`, and `Collections.UnmodifiableEntrySet`:
remove `@SideEffectFree` from `toArray(T[] a)`, which writes into the
caller's array. Commit aa68716 did this for the other
implementations but missed these.
* `LinkedHashMap.keySet`: restore `@KeyFor({"this"})`, dropped by
accident; `HashMap.keySet`, which it overrides, declares it.
* `HashMap.entrySet`: the receiver is `@PolyModifiable`, matching `Map`,
`AbstractMap`, and `LinkedHashMap`. `@PolyModifiable` in the return
type had nothing to resolve against.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* Restore `@PolyNonEmpty` on `ArrayList.iterator()` and `ArrayList.listIterator()`.
* Remove unsound `@PolyNonEmpty` from `AbstractList.listIterator(int)`, which
returns an empty iterator when the index equals the size.
* Annotate `Collections.emptyIterator()` as `@Unmodifiable`, consistent with
`emptyListIterator()` and with the inherited `EmptyIterator.remove()`.
* Annotate the `SortedMap` and `NavigableMap` key accessors, and their
overrides, as `@Pure` rather than `@SideEffectFree`, matching the `SortedSet`
and `NavigableSet` accessors and `ConcurrentSkipListMap`. `firstEntry()` and
`lastEntry()` remain `@SideEffectFree` because each call returns a new entry.
* Annotate the set views that delegate to those accessors as `@Pure`.
* Move `@Modifiable` from the element type to the iterator in
`IdentityHashMap.EntrySet.iterator()`.
* Fix formatting: merged declarations in `ConcurrentLinkedDeque` and
`ListIterator`, trailing whitespace in `ConcurrentNavigableMap`, and missing
spaces in `ConcurrentMap` and `NavigableSet`.
* Remove redundant imports and an unnecessary `@SuppressWarnings("unchecked")`
from `Collections`.
* Fix a typo in `README.md`.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (4)
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. Comment |
…e into modifiability-annos
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.
No description provided.