コード例 #1
0
  /** {@inheritDoc} */
  public boolean accept(AuditEvent aEvent) {
    // file and check match?
    if ((aEvent.getFileName() == null)
        || !mFileRegexp.matcher(aEvent.getFileName()).find()
        || (aEvent.getLocalizedMessage() == null)
        || ((mModuleId != null) && !mModuleId.equals(aEvent.getModuleId()))
        || ((mCheckRegexp != null) && !mCheckRegexp.matcher(aEvent.getSourceName()).find())) {
      return true;
    }

    // reject if no line/column matching
    if ((mLineFilter == null) && (mColumnFilter == null)) {
      return false;
    }

    // reject if line matches a line CSV value.
    if (mLineFilter != null) {
      if (mLineFilter.accept(aEvent.getLine())) {
        return false;
      }
    }

    // reject if column matches a column CSV value.
    if (mColumnFilter != null) {
      if (mColumnFilter.accept(aEvent.getColumn())) {
        return false;
      }
    }
    return true;
  }
コード例 #2
0
  @Override
  public boolean accept(AuditEvent event) {
    boolean accepted = true;

    if (event.getLocalizedMessage() != null) {
      // Lazy update. If the first event for the current file, update file
      // contents and tag suppressions
      final FileContents currentContents = FileContentsHolder.getContents();

      if (currentContents != null) {
        if (getFileContents() != currentContents) {
          setFileContents(currentContents);
          tagSuppressions();
        }
        if (matchesTag(event)) {
          accepted = false;
        }
      }
    }
    return accepted;
  }