local can be final: don't ignore problems found in lambda body (IDEA-145500)

This commit is contained in:
Anna Kozlova
2015-09-25 13:53:40 +03:00
parent 4c86da03ce
commit b29779ed87
3 changed files with 21 additions and 3 deletions
@@ -2,13 +2,21 @@
<problems>
<problem>
<file>Junk.java</file>
<line>4</line>
<line>6</line>
<entry_point TYPE="method" FQNAME="Issue void filterMap()" />
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Local variable or parameter can be final</problem_class>
<description>Variable &lt;code&gt;cc&lt;/code&gt; can have &lt;code&gt;final&lt;/code&gt; modifier</description>
</problem>
<problem>
<file>Junk.java</file>
<line>14</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Local variable or parameter can be final</problem_class>
<description>Variable &lt;code&gt;i&lt;/code&gt; can have &lt;code&gt;final&lt;/code&gt; modifier</description>
</problem>
<problem>
<file>Junk.java</file>
<line>3</line>
<line>13</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Local variable or parameter can be final</problem_class>
<description>Variable &lt;code&gt;r&lt;/code&gt; can have &lt;code&gt;final&lt;/code&gt; modifier</description>
</problem>
@@ -1,3 +1,13 @@
import java.util.HashMap;
class Issue {
public static void filterMap() {
new HashMap<String, String>().forEach((s1, s2) -> {
String cc = s1 + s2;
System.err.println(cc);
});
}
}
public final class Junk {
public void sillyMethod() {
Runnable r = () -> {