unchecked warning (IDEA-99357)

This commit is contained in:
Anna Kozlova
2013-01-21 15:10:29 +04:00
parent 83226fdc9d
commit 85cc736b86
3 changed files with 14 additions and 0 deletions
@@ -437,6 +437,7 @@ public class UncheckedWarningLocalInspection extends BaseJavaLocalInspectionTool
public Boolean visitClassType(PsiClassType classType) {
PsiClass psiClass = classType.resolve();
if (psiClass instanceof PsiTypeParameter) {
if (((PsiTypeParameter)psiClass).getOwner() == method) return Boolean.FALSE;
return substitutor.substitute((PsiTypeParameter)psiClass) == null ? Boolean.TRUE : Boolean.FALSE;
}
PsiType[] parameters = classType.getParameters();
@@ -0,0 +1,12 @@
class Test {
public static void main(String[] args) {
Foo f = new Foo();
System.out.println(f.get());
}
}
class Foo<<warning descr="Type parameter 'T' is never used">T</warning>> {
public <T1> T1 get() {
return null;
}
}
@@ -158,6 +158,7 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
public void testUncheckedWarningIDEA70620() throws Exception { doTest(true, false); }
public void testUncheckedWarningIDEA60166() throws Exception { doTest(true, false); }
public void testUncheckedWarningIDEA21432() throws Exception { doTest(true, false); }
public void testUncheckedWarningIDEA99357() throws Exception { doTest(true, false); }
public void testUncheckedWarningIDEA26738() throws Exception { doTest(true, false); }
public void testDefaultMethodVisibility() throws Exception { doTest(true, false); }
public void testInheritUnrelatedDefaults() throws Exception { doTest(true, false); }