Example #1
0
 private static boolean isInheritFromObject(@NotNull PsiMethod method) {
   List<HierarchicalMethodSignature> superSignatures =
       method.getHierarchicalMethodSignature().getSuperSignatures();
   for (HierarchicalMethodSignature s : superSignatures) {
     PsiClass containingClass = s.getMethod().getContainingClass();
     String qualifiedName = containingClass != null ? containingClass.getQualifiedName() : "";
     if (qualifiedName != null && qualifiedName.equals(JAVA_LANG_OBJECT)) {
       return true;
     }
   }
   return false;
 }
Example #2
0
 private static boolean isOverrideObjectDirect(@NotNull PsiMethod method) {
   List<HierarchicalMethodSignature> superSignatures =
       method.getHierarchicalMethodSignature().getSuperSignatures();
   if (superSignatures.size() == 1) {
     PsiClass containingClass = superSignatures.get(0).getMethod().getContainingClass();
     String qualifiedName = containingClass != null ? containingClass.getQualifiedName() : "";
     if (qualifiedName != null && qualifiedName.equals(JAVA_LANG_OBJECT)) {
       return true;
     }
   }
   return false;
 }
Example #3
0
 private static boolean normalCase(@NotNull PsiMethod method) {
   int counter = 0;
   for (HierarchicalMethodSignature s :
       method.getHierarchicalMethodSignature().getSuperSignatures()) {
     PsiClass containingClass = s.getMethod().getContainingClass();
     String qualifiedName = containingClass != null ? containingClass.getQualifiedName() : "";
     if (qualifiedName != null && !qualifiedName.equals(JAVA_LANG_OBJECT)) {
       counter++;
     }
   }
   return counter > 0;
 }