void (@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); final PsiReferenceExpression methodExpression = expression.getMethodExpression(); @NonNls final String name = methodExpression.getReferenceName(); if (!"initCause".equals(name)) { return; } final PsiExpressionList argumentList = expression.getArgumentList(); final PsiExpression argument = ExpressionUtils.getOnlyExpressionInList(argumentList); if (!TypeUtils.expressionHasTypeOrSubtype(argument, CommonClassNames.JAVA_LANG_THROWABLE)) { return; } final PsiMethod method = expression.resolveMethod(); if (method == null) { return; } final PsiClass aClass = method.getContainingClass(); if (aClass == null || !CommonClassNames.JAVA_LANG_THROWABLE.equals(aClass.getQualifiedName())) { return; } final PsiExpression qualifier = PsiUtil.skipParenthesizedExprDown(methodExpression.getQualifierExpression()); final PsiNewExpression newExpression = findNewExpression(qualifier); if (!isCauseConstructorAvailable(newExpression, argument.getType()) || !canExpressionBeMovedBackwards(argument, newExpression)) { return; } final PsiElement nameToken = methodExpression.getReferenceNameElement(); if (nameToken == null) { return; } registerError(nameToken); }