code: private boolean shouldReport(JCDiagnostic d) {
          JavaFileObject file = d.getSource();
  
          if (file == null)
              return true;
  
          if (!shouldReport(file, d.getIntPosition()))
              return false;
  
          if (!d.isFlagSet(DiagnosticFlag.SOURCE_LEVEL))
              return true;
  
          Pair<JavaFileObject, String> coords = new Pair<>(file, d.getCode());
          boolean shouldReport = !recordedSourceLevelErrors.contains(coords);
          if (shouldReport)
              recordedSourceLevelErrors.add(coords);
          return shouldReport;
      }
docs: Returns true if a diagnostics needs to be reported.