Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Parasoft Jtest 2020.2

...

Modifying a Collection while iterating over it results in undefined behavior.

Rule

Severity

Likelihood

Remediation Cost

Priority

Level

MSC06-J

Low

Probable

Medium

P4

L3

Automated Detection

Some static analysis tools can detect cases where an iterator is being used after the source container of the iterator is modified.

ToolVersionCheckerDescription
Parasoft Jtest
Include Page
java:
Parasoft_V
java:
Parasoft_V
BD.CO.ITMOD
Implemented
Do not modify collection while iterating over it

Related Vulnerabilities

The Apache Harmony bug HARMONY-6236 documents an ArrayList breaking when given concurrent collections as input.

Bibliography

...


...