private void inspectReferenceIfItIsSystemOutErr(@NotNull PsiReferenceExpression expression) {
      final String name = expression.getReferenceName();
      if (!HardcodedMethodConstants.OUT.equals(name) &&
          !HardcodedMethodConstants.ERR.equals(name)) {
        return;
      }
      final PsiElement referent = expression.resolve();
      if (!(referent instanceof PsiField field)) {
        return;
      }
      final PsiClass containingClass = field.getContainingClass();
      if (containingClass == null) {
        return;
      }
      final String className = containingClass.getQualifiedName();
      if (!JAVA_LANG_SYSTEM.equals(className)) {
        return;
      }

      if (expression.getParent() instanceof PsiReferenceExpression probablyReferenceToCall &&
          probablyReferenceToCall.getParent() instanceof PsiMethodCallExpression callExpression) {

        if (ThrowablePrintedToSystemOutInspection.getExceptionIsPrintedToSystemOutResult(callExpression) != null) {
          return;
        }

        boolean informationLevel = InspectionProjectProfileManager.isInformationLevel(getShortName(), expression);
        if (informationLevel) {
          registerError(callExpression, expression);
        }
      }

      registerError(expression, expression);
    }
private void inspectReferenceIfItIsSystemOutErr(@NotNull PsiReferenceExpression expression)