type parameters should not cause deprecated constructor warning to appear (IDEA-124689)

This commit is contained in:
Anna Kozlova
2014-05-05 17:12:16 +04:00
parent 91f63083c7
commit 78e9bb7840
4 changed files with 13 additions and 0 deletions
@@ -189,6 +189,7 @@ public class DeprecationInspection extends BaseJavaBatchLocalInspectionTool {
@Override
public void visitClass(PsiClass aClass) {
if (aClass instanceof PsiTypeParameter) return;
final PsiMethod[] currentConstructors = aClass.getConstructors();
if (currentConstructors.length == 0) {
final PsiClass superClass = aClass.getSuperClass();
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems/>
@@ -0,0 +1,6 @@
class Test {
@Deprecated
protected Test() { }
static <T extends Test> void foo() {}
}
@@ -49,4 +49,8 @@ public class DeprecationInspectionTest extends InspectionTestCase {
doTest();
}
public void testDeprecatedDefaultConstructorFromTypeParameter() throws Exception {
doTest();
}
}