From 491e50797ac45939da8d1e80aa9ecdd0d73844b9 Mon Sep 17 00:00:00 2001 From: Dave Griffith Date: Tue, 15 Feb 2005 17:57:45 +0300 Subject: [PATCH] (no message) --- .../RawUseOfParameterizedTypeInspection.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/abstraction/RawUseOfParameterizedTypeInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/abstraction/RawUseOfParameterizedTypeInspection.java index a9b6954f45e4..9737f5a439af 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/abstraction/RawUseOfParameterizedTypeInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/abstraction/RawUseOfParameterizedTypeInspection.java @@ -42,6 +42,12 @@ public class RawUseOfParameterizedTypeInspection extends VariableInspection { checkTypeElement(typeElement); } + public void visitInstanceOfExpression(PsiInstanceOfExpression expression){ + super.visitInstanceOfExpression(expression); + final PsiTypeElement typeElement = expression.getCheckType(); + checkTypeElement(typeElement); + } + public void visitNewExpression(PsiNewExpression newExpression) { super.visitNewExpression(newExpression); final PsiJavaCodeReferenceElement classReference = @@ -57,7 +63,9 @@ public class RawUseOfParameterizedTypeInspection extends VariableInspection { if (!(referent instanceof PsiClass)) { return; } - if (!((PsiClass) referent).hasTypeParameters()) { + + final PsiClass referredClass = (PsiClass) referent; + if (!referredClass.hasTypeParameters()) { return; } if (newExpression.getTypeArgumentList() != null) {