boolean (PsiMethodCallExpression call) { if (call == null) return false; PsiReferenceExpression methodExpression = call.getMethodExpression(); @NonNls final String referenceName = methodExpression.getReferenceName(); if (!"toString".equals(referenceName) || !call.getArgumentList().isEmpty()) return false; final PsiExpression qualifier = ExpressionUtils.getEffectiveQualifier(methodExpression); if (qualifier == null || qualifier.getType() instanceof PsiArrayType) { // do not warn on nonsensical code return false; } if (qualifier instanceof PsiSuperExpression) return false; final boolean throwable = TypeUtils.expressionHasTypeOrSubtype(qualifier, CommonClassNames.JAVA_LANG_THROWABLE); return !ExpressionUtils.isConversionToStringNecessary(call, throwable); }