Skip to content

Conversation

@dehasi
Copy link
Contributor

@dehasi dehasi commented May 15, 2024

Check List:

Following 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 throws UnsupportedOperationException. However not all unmodifiable iterators behave like that, see my comment in the ticket.
That's why I check explicitly for Collections$EmptyIterator and Collections$EmptyListIterator.

cc @scordio

Copy link
Member

@scordio scordio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dehasi, here are some comments. The build is failing due to the usage of Java 9+ API (List.of).

@scordio scordio added this to the 3.27.0 milestone May 15, 2024
@dehasi
Copy link
Contributor Author

dehasi commented May 16, 2024

@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 🫤

@scordio scordio modified the milestones: 3.27.0, 3.26.0 May 20, 2024
@scordio scordio merged commit be4cf7c into assertj:3.x May 24, 2024
@scordio
Copy link
Member

scordio commented May 24, 2024

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
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.

isUnmodifiable assertion for Iterator instances

2 participants