mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
IDEA-115452 ("Local variable or parameter can be final" -- "Report local variables" setting doesn't work)
This commit is contained in:
@@ -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 <code>list</code> can have <code>final</code> modifier</description>
|
||||
</problem>
|
||||
</problems>
|
||||
+8
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user