void (@NotNull PsiMethodCallExpression expression) { super.visitMethodCallExpression(expression); final PsiReferenceExpression methodExpression = expression.getMethodExpression(); @NonNls final String methodName = methodExpression.getReferenceName(); if (!"print".equals(methodName) && !"println".equals(methodName)) { return; } final PsiExpressionList argumentList = expression.getArgumentList(); final PsiExpression[] arguments = argumentList.getExpressions(); if (arguments.length != 1) { return; } final PsiExpression argument = arguments[0]; if (!TypeUtils.expressionHasTypeOrSubtype(argument, CommonClassNames.JAVA_LANG_THROWABLE)) { return; } final PsiMethod method = expression.resolveMethod(); if (method == null) { return; } final PsiExpression qualifier = methodExpression.getQualifierExpression(); if (!(qualifier instanceof PsiReferenceExpression qualifierReference)) { return; } final PsiElement target = qualifierReference.resolve(); if (!(target instanceof PsiField field)) { return; } @NonNls final String fieldName = field.getName(); if (!"out".equals(fieldName) && !"err".equals(fieldName)) { return; } final PsiClass aClass = field.getContainingClass(); if (aClass == null || !"java.lang.System".equals(aClass.getQualifiedName())) { return; } registerError(argument, fieldName, methodName); }