IDEA-68179 (Javac quirks inspection)

This commit is contained in:
Roman Shevchenko
2011-04-17 18:53:22 +02:00
parent ef1ca05563
commit 847ad86feb
8 changed files with 121 additions and 5 deletions
@@ -0,0 +1,8 @@
class C {
@interface TestAnnotation {
int[] value();
}
@TestAnnotation({0, 1<warning descr="Trailing comma in annotation array initializer may cause compilation error in some Javac versions (e.g. JDK 5 and JDK 6).">,</warning>})
void m() { }
}
@@ -3,6 +3,7 @@ package com.intellij.codeInsight.daemon;
import com.intellij.ExtensionPoints;
import com.intellij.codeInsight.daemon.impl.HighlightInfo;
import com.intellij.codeInspection.LocalInspectionTool;
import com.intellij.codeInspection.compiler.JavacQuirksInspection;
import com.intellij.codeInspection.deadCode.UnusedDeclarationInspection;
import com.intellij.codeInspection.defUse.DefUseInspection;
import com.intellij.codeInspection.reference.EntryPoint;
@@ -32,7 +33,11 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
@Override
protected LocalInspectionTool[] configureLocalInspectionTools() {
return new LocalInspectionTool[]{new UnusedSymbolLocalInspection(), new UncheckedWarningLocalInspection()};
return new LocalInspectionTool[]{
new UnusedSymbolLocalInspection(),
new UncheckedWarningLocalInspection(),
new JavacQuirksInspection()
};
}
public void testDuplicateAnnotations() throws Exception {
@@ -207,4 +212,8 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
public void testPreciseRethrow() throws Exception {
doTest(false, false);
}
public void testJavacQuirks() throws Exception {
doTest(true, false);
}
}
@@ -59,15 +59,15 @@ public class LightAdvHighlightingTest extends LightDaemonAnalyzerTestCase {
@Override
protected LocalInspectionTool[] configureLocalInspectionTools() {
myUnusedSymbolLocalInspection = new UnusedSymbolLocalInspection();
return new LocalInspectionTool[]{
new SillyAssignmentInspection(),
new AccessStaticViaInstance(),
new DeprecationInspection(),
new RedundantThrowsDeclaration(),
myUnusedSymbolLocalInspection,
myUnusedSymbolLocalInspection = new UnusedSymbolLocalInspection(),
new UnusedImportLocalInspection(),
new UncheckedWarningLocalInspection()};
new UncheckedWarningLocalInspection()
};
}
public void testCanHaveBody() throws Exception { doTest(false, false); }