From 349b53e4c142b8422d4f2c7bc4eed5550e84b84c Mon Sep 17 00:00:00 2001 From: Dave Griffith Date: Wed, 2 Mar 2005 23:54:53 +0300 Subject: [PATCH] (no message) --- plugins/InspectionGadgets/InspectionGadgetsSVN.ipr | 3 +++ .../ig/bugs/CastToIncompatibleInterfaceInspection.java | 6 +++++- .../ig/bugs/InstanceofIncompatibleInterfaceInspection.java | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/plugins/InspectionGadgets/InspectionGadgetsSVN.ipr b/plugins/InspectionGadgets/InspectionGadgetsSVN.ipr index 66a01920d532..e622de1dc83d 100644 --- a/plugins/InspectionGadgets/InspectionGadgetsSVN.ipr +++ b/plugins/InspectionGadgets/InspectionGadgetsSVN.ipr @@ -41,6 +41,9 @@ + + diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/bugs/CastToIncompatibleInterfaceInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/bugs/CastToIncompatibleInterfaceInspection.java index 020314481994..b12a88aea1ad 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/bugs/CastToIncompatibleInterfaceInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/bugs/CastToIncompatibleInterfaceInspection.java @@ -89,11 +89,15 @@ public class CastToIncompatibleInterfaceInspection extends ExpressionInspection{ if(aClass.isInheritor(anInterface, true)){ return true; } + if("java.lang.Object".equals(aClass.getQualifiedName())) + { + return true; + } final PsiManager psiManager = aClass.getManager(); final PsiSearchHelper searchHelper = psiManager.getSearchHelper(); final SearchScope searchScope = aClass.getUseScope(); final PsiClass[] inheritors = - searchHelper.findInheritors(aClass, searchScope, false); + searchHelper.findInheritors(aClass, searchScope, true); for(int i = 0; i < inheritors.length; i++){ final PsiClass inheritor = inheritors[i]; if(inheritor.isInheritor(anInterface, true)){ diff --git a/plugins/InspectionGadgets/src/com/siyeh/ig/bugs/InstanceofIncompatibleInterfaceInspection.java b/plugins/InspectionGadgets/src/com/siyeh/ig/bugs/InstanceofIncompatibleInterfaceInspection.java index 543fffbdd610..ff68f1c05e96 100644 --- a/plugins/InspectionGadgets/src/com/siyeh/ig/bugs/InstanceofIncompatibleInterfaceInspection.java +++ b/plugins/InspectionGadgets/src/com/siyeh/ig/bugs/InstanceofIncompatibleInterfaceInspection.java @@ -90,11 +90,14 @@ public class InstanceofIncompatibleInterfaceInspection extends ExpressionInspect if(aClass.isInheritor(anInterface, true)){ return true; } + if("java.lang.Object".equals(aClass.getQualifiedName())){ + return true; + } final PsiManager psiManager = aClass.getManager(); final PsiSearchHelper searchHelper = psiManager.getSearchHelper(); final SearchScope searchScope = aClass.getUseScope(); final PsiClass[] inheritors = - searchHelper.findInheritors(aClass, searchScope, false); + searchHelper.findInheritors(aClass, searchScope, true); for(int i = 0; i < inheritors.length; i++){ final PsiClass inheritor = inheritors[i]; if(inheritor.isInheritor(anInterface, true)){