boolean (PsiExpression call, PsiMethod method, @Nullable PsiElement errorContainer) { final PsiType returnType = method.getReturnType(); if (PsiTypes.voidType().equals(returnType) || TypeUtils.typeEquals(CommonClassNames.JAVA_LANG_VOID, returnType)) return false; final PsiClass aClass = method.getContainingClass(); if (aClass == null) return false; if (errorContainer != null && PsiUtilCore.hasErrorElementChild(errorContainer)) return false; if (call instanceof PsiMethodCallExpression) { final PsiMethodCallExpression previousCall = MethodCallUtils.getQualifierMethodCall((PsiMethodCallExpression)call); if (MOCK_LIBS_EXCLUDED_QUALIFIER_CALLS.test(previousCall)) return false; } if (PropertyUtil.isSimpleGetter(method)) { return !MethodUtils.hasCanIgnoreReturnValueAnnotation(method, null); } if (method instanceof PsiCompiledElement) { final PsiMethod sourceMethod = ObjectUtils.tryCast(method.getNavigationElement(), PsiMethod.class); if (sourceMethod != null && PropertyUtil.isSimpleGetter(sourceMethod)) { return !MethodUtils.hasCanIgnoreReturnValueAnnotation(method, null); } } if (isInTestContainer(call)) return false; if (m_reportAllNonLibraryCalls && !LibraryUtil.classIsInLibrary(aClass)) { return !MethodUtils.hasCanIgnoreReturnValueAnnotation(method, null); } if(isKnownArgumentSideEffect(call)){ return false; } if (isKnownExceptionalSideEffectCaught(call)) { return false; } if (isPureMethod(method, call)) { return !MethodUtils.hasCanIgnoreReturnValueAnnotation(method, null); } if (isHardcodedException(call)) return false; PsiElement stop; if (!myMethodMatcher.matches(method)) { final PsiAnnotation annotation = findCheckReturnValueAnnotation(method); if (annotation == null) return false; stop = (PsiElement)annotation.getOwner(); } else { stop = null; } return !MethodUtils.hasCanIgnoreReturnValueAnnotation(method, stop); }