title: Why is the "Variable used in Lambda expression must be final or effectively final" warning ignored for instance variables
body: <p>I'm studying java 8 streams and the only problem I have is understanding lambdas is why the effectively final warning in lambdas is ignored for instance(and static) variables. I can't seem to find any reference to it online, as most pages will just talk about the definition of being "effectively final".</p>
  
  <pre><code>public class LambdaTest {
  
      int instanceCounter = 0;
  
      public void method() {
          int localCounter = 0;
          instanceCounter = 5; //Re-assign instance counter so it is no longer effectively final
  
          Stream.of(1,2,3).forEach(elem -&gt; instanceCounter++); //WHY DOES THE COMPILER NOT COMPLAIN HERE
          Stream.of(1,2,3).forEach(elem -&gt; localCounter++); //Does not compile because localCounter is not effectively final
      }
  }
  </code></pre>