mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
unchecked call: warning should be shown if instance method is called on raw type (IDEA-61449)
This commit is contained in:
+2
-1
@@ -421,6 +421,7 @@ public class UncheckedWarningLocalInspection extends BaseJavaLocalInspectionTool
|
||||
final PsiMethod method = (PsiMethod)resolveResult.getElement();
|
||||
if (method == null) return null;
|
||||
final PsiSubstitutor substitutor = resolveResult.getSubstitutor();
|
||||
if (!PsiUtil.isRawSubstitutor(method, substitutor)) return null;
|
||||
final PsiParameter[] parameters = method.getParameterList().getParameters();
|
||||
for (final PsiParameter parameter : parameters) {
|
||||
final PsiType parameterType = parameter.getType();
|
||||
@@ -448,7 +449,7 @@ public class UncheckedWarningLocalInspection extends BaseJavaLocalInspectionTool
|
||||
public Boolean visitWildcardType(PsiWildcardType wildcardType) {
|
||||
PsiType bound = wildcardType.getBound();
|
||||
if (bound != null) return bound.accept(this);
|
||||
return Boolean.FALSE;
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
|
||||
public Boolean visitEllipsisType(PsiEllipsisType ellipsisType) {
|
||||
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
class Test {
|
||||
{
|
||||
Class foo = Object.class;
|
||||
<warning descr="Unchecked call to 'isAssignableFrom(Class<?>)' as a member of raw type 'java.lang.Class'">foo.isAssignableFrom</warning>(Object.class);
|
||||
}
|
||||
}
|
||||
+1
@@ -164,4 +164,5 @@ public class LightAdvHighlightingJdk7Test extends LightDaemonAnalyzerTestCase {
|
||||
public void testUsedMethodsByMethodReferences() throws Exception { doTest(true, true, false); }
|
||||
public void testLambdaExpressions() throws Exception { doTest(false, true, false); }
|
||||
public void testJava7CastConventions() throws Exception { doTest(false, true, false); }
|
||||
public void testUncheckedWarning() throws Exception { doTest(true, false); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user