Search code examples
javamacosintellij-ideaintellij-14

Intellij doesn't report that a local variable is accessed from within inner class and needs to be declared final


I'm using intellij on OSX to write android apps. I've noticed that my intellij stopped reporting that a local variable is accessed from within inner class and needs to be declared final. This means that I don't see the red marker and only when I compile the app I get the error message from gradle.

Picture from intellij

enter image description here

userId should have red marker, like this

enter image description here

Error message:

enter image description here

Any idea how to fix it?


Solution

  • Have you changed "Language level" in Intellij or somewhere in Gradle files? Intellij probably thinks that files are for Java8, where "effective final", without keyword, is good enough.