#3458 isUnmodifiable assertion for Iterator instances#3477
Merged
scordio merged 2 commits intoassertj:3.xfrom May 24, 2024
Merged
#3458 isUnmodifiable assertion for Iterator instances#3477scordio merged 2 commits intoassertj:3.xfrom
scordio merged 2 commits intoassertj:3.xfrom
Conversation
scordio
reviewed
May 15, 2024
assertj-core/src/main/java/org/assertj/core/api/AbstractIteratorAssert.java
Show resolved
Hide resolved
assertj-core/src/main/java/org/assertj/core/api/AbstractIteratorAssert.java
Outdated
Show resolved
Hide resolved
...rtj-core/src/test/java/org/assertj/core/api/iterator/IteratorAssert_isUnmodifiable_Test.java
Outdated
Show resolved
Hide resolved
...rtj-core/src/test/java/org/assertj/core/api/iterator/IteratorAssert_isUnmodifiable_Test.java
Outdated
Show resolved
Hide resolved
...rtj-core/src/test/java/org/assertj/core/api/iterator/IteratorAssert_isUnmodifiable_Test.java
Outdated
Show resolved
Hide resolved
...rtj-core/src/test/java/org/assertj/core/api/iterator/IteratorAssert_isUnmodifiable_Test.java
Outdated
Show resolved
Hide resolved
scordio
reviewed
May 15, 2024
assertj-core/src/main/java/org/assertj/core/api/AbstractIteratorAssert.java
Show resolved
Hide resolved
Contributor
Author
|
@scordio I've squashed my changes. I think I can only struggle if the target branch is changed, and I might need assistance. Just afraid to mess with Git 🫤 |
Member
|
This is now merged. Thanks for your first contribution, @dehasi! |
genuss
pushed a commit
to genuss/assertj
that referenced
this pull request
May 28, 2024
nosan
pushed a commit
to nosan/assertj
that referenced
this pull request
Mar 4, 2025
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.
Check List:
isUnmodifiableassertion forIteratorinstances #3458Following the contributing guidelines will make it easier for us to review and accept your PR.
What was done
I can only check if an iterator is unmodifiable by calling
remove()and checking if the iterator throwsUnsupportedOperationException. However not all unmodifiable iterators behave like that, see my comment in the ticket.That's why I check explicitly for
Collections$EmptyIteratorandCollections$EmptyListIterator.cc @scordio