IDEA-115452 ("Local variable or parameter can be final" -- "Report local variables" setting doesn't work)

This commit is contained in:
Bas Leijdekkers
2013-10-26 21:57:24 +02:00
parent 86b09842d4
commit a0a5570958
4 changed files with 37 additions and 8 deletions
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>ForeachNotReported.java</file>
<line>5</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Local variable or parameter can be final</problem_class>
<description>Parameter &lt;code&gt;list&lt;/code&gt; can have &lt;code&gt;final&lt;/code&gt; modifier</description>
</problem>
</problems>
@@ -0,0 +1,8 @@
import java.util.*;
class ForeachNotReported {
void f(List<String> list) {
for (String s : list) {}
}
}
@@ -123,4 +123,10 @@ public class LocalCanBeFinalTest extends InspectionTestCase {
myTool.REPORT_VARIABLES = true;
doTest();
}
public void testForeachNotReported() throws Exception {
myTool.REPORT_PARAMETERS = true;
myTool.REPORT_VARIABLES = false;
doTest();
}
}