Exemplo n.º 1
0
  private void checkMatchingConflict(
      final Element element, final LinkedList<Pair<XMLPattern, SimpleAutomatonID>> matchings) {
    if (!logger.isDebugEnabled()) return;

    boolean same = true;
    final Set<String> names = new HashSet<String>();
    names.add(matchings.getFirst().getFirst().getName());
    for (final Pair<XMLPattern, SimpleAutomatonID> match : matchings)
      if (names.add(match.getFirst().getName())) {
        same = false;
        break;
      }
    if (!same) {
      logger.debug("This code:");
      logger.debug(element.asXML());
      logger.debug("can be matched by more than one " + "distinct rule:");
      for (final Pair<XMLPattern, SimpleAutomatonID> match : matchings) {
        final XMLPattern pat = match.getFirst();
        logger.debug(pat.getName() + ": " + pat.getPatternXMLelement().asXML());
      }
    }
  }