I want to avoid Collections$UnmodifiableCollection

Answered

Hi,
I am creating a program like below,
but I do not know that it is a bug until imList.remove(s) is executed.
Is there a way to analyze such code statically in IntelliJ?
-----
List<String> imList = Collections.unmodifiableList(list);
for (String s : imList)
if (s.startsWith("c"))
imList.remove(s);

0
2 comments

This feature may appear in one of the future updates, please follow https://youtrack.jetbrains.com/issue/IDEA-167940 for progress.

0

Thanks for reply.
I am looking forward to providing this function.

0

Please sign in to leave a comment.