Try-with-resource support: variable usage inspection

This commit is contained in:
Roman Shevchenko
2011-02-22 17:50:42 +01:00
parent c59584e8ef
commit 0f2e1cd4f6
5 changed files with 136 additions and 47 deletions

View File

@@ -4,6 +4,7 @@ import com.intellij.ExtensionPoints;
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection;
import com.intellij.codeInspection.defUse.DefUseInspection;
import com.intellij.codeInspection.reference.EntryPoint;
import com.intellij.codeInspection.reference.RefElement;
import com.intellij.codeInspection.uncheckedWarnings.UncheckedWarningLocalInspection;
@@ -31,7 +32,7 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
@Override
protected LocalInspectionTool[] configureLocalInspectionTools() {
return new LocalInspectionTool[]{new UnusedSymbolLocalInspection(), new UncheckedWarningLocalInspection()};
return new LocalInspectionTool[]{new UnusedSymbolLocalInspection(), new UncheckedWarningLocalInspection(), new DefUseInspection()};
}
public void testDuplicateAnnotations() throws Exception {
@@ -192,6 +193,10 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
doTest(false, false);
}
public void testTryWithResourcesWarn() throws Exception {
doTest(true, false);
}
public void testSafeVarargsApplicability() throws Exception {
doTest(true, false);
}