Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ffcccc
langjava
// ...
for (final Integer i: list) {
  if (first) {
    first = false;
    i = new Integer(99); // compiler error: variable i might already have been assigned
  }
// ...

Compliant Solution

This compliant solution processes the "modified" list but leaves the actual list unchanged:

...