Program: 34159
Project: 34159
Buggy source:
@Override public void execute(Tuple tuple){
  if (ruleStream.equals(tuple.getSourceStreamId())) {
    Set<Rule> rules=(Set<Rule>)tuple.getValue(0);
    Set<String> rulesToRemove=new HashSet<String>();
    for (    Rule rule : rulesMap.values()) {
      if (!rules.contains(rule))       rulesToRemove.add(rule.getId());
    }
    for (    String ruleId : rulesToRemove) {
      rulesMap.remove(ruleId);
      buffers.remove(ruleId);
    }
    for (    Rule rule : rules) {
      if (rulesMap.get(rule.getId()) != null && !rulesMap.get(rule.getId()).equals(rule) || !rulesMap.containsKey(rule.getId())) {
        rulesMap.put(rule.getId(),rule);
        rule.initTriggerFunction();
        buffers.remove(rule.getId());
      }
    }
  }
 else   if ("String_Node_Str".equals(tuple.getSourceComponent()) && "String_Node_Str".equals(tuple.getSourceStreamId())) {
    if (rulesMap.size() > 0) {
      for (      Rule rule : rulesMap.values()) {
        if (rule.getExpirationPolicy() == Policy.TIME) {
          for (          SlidingWindowBuffer buffer : buffers.get(rule.getId()).values())           buffer.ageExpire(rule.getExpirationThreshold());
        }
        if (rule.getTriggerPolicy() == Policy.TIME) {
          Map<String,SlidingWindowBuffer> buffersForRule=buffers.get(rule.getId());
          if (buffersForRule != null) {
            for (            SlidingWindowBuffer buffer : buffersForRule.values()) {
              if (buffer.getTriggerTicks() == rule.getTriggerThreshold() && (Boolean)rule.invokeTriggerFunction(buffer.getEvents())) {
                collector.emit(new Values(rule.getId(),buffer));
                System.out.println("String_Node_Str" + buffer);
                buffer.resetTriggerTicks();
              }
 else {
                buffer.incTriggerTicks();
              }
            }
          }
        }
      }
    }
  }
 else {
    if (rulesMap.size() > 0) {
      String ruleId=tuple.getString(0);
      String hash=tuple.getString(1);
      Event event=(Event)tuple.getValue(2);
      Rule rule=rulesMap.get(ruleId);
      Map<String,SlidingWindowBuffer> buffersForRule=buffers.get(rule.getId());
      SlidingWindowBuffer buffer;
      if (buffersForRule != null) {
        buffer=buffersForRule.get(hash);
        if (buffer != null) {
          if (rule.getExpirationPolicy() == Policy.COUNT) {
            if (buffer.size() == rule.getExpirationThreshold())             buffer.expire();
          }
        }
      }
 else {
        buffersForRule=new HashMap<String,SlidingWindowBuffer>();
        buffer=new SlidingWindowBuffer(hash);
        buffersForRule.put(hash,buffer);
        buffers.put(rule.getId(),buffersForRule);
      }
      buffer.add(event);
      if (rule.getTriggerPolicy() == Policy.COUNT && buffer.size() >= rule.getTriggerThreshold())       if ((Boolean)rule.invokeTriggerFunction(buffer.getEvents())) {
        collector.emit(new Values(ruleId,buffer));
        System.out.println("String_Node_Str" + buffer);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void execute(Tuple tuple){
  if (ruleStream.equals(tuple.getSourceStreamId())) {
    Set<Rule> rules=(Set<Rule>)tuple.getValue(0);
    Set<String> rulesToRemove=new HashSet<String>();
    for (    Rule rule : rulesMap.values()) {
      if (!rules.contains(rule))       rulesToRemove.add(rule.getId());
    }
    for (    String ruleId : rulesToRemove) {
      rulesMap.remove(ruleId);
      buffers.remove(ruleId);
    }
    for (    Rule rule : rules) {
      if (rulesMap.get(rule.getId()) != null && !rulesMap.get(rule.getId()).equals(rule) || !rulesMap.containsKey(rule.getId())) {
        rulesMap.put(rule.getId(),rule);
        rule.initTriggerFunction();
        buffers.remove(rule.getId());
      }
    }
  }
 else   if ("String_Node_Str".equals(tuple.getSourceComponent()) && "String_Node_Str".equals(tuple.getSourceStreamId())) {
    if (rulesMap.size() > 0) {
      for (      Rule rule : rulesMap.values()) {
        if (rule.getEvictionPolicy() == Policy.TIME) {
          for (          SlidingWindowBuffer buffer : buffers.get(rule.getId()).values())           buffer.timeEvict(rule.getEvictionThreshold());
        }
        if (rule.getTriggerPolicy() == Policy.TIME) {
          Map<String,SlidingWindowBuffer> buffersForRule=buffers.get(rule.getId());
          if (buffersForRule != null) {
            for (            SlidingWindowBuffer buffer : buffersForRule.values()) {
              if (buffer.getEvictionTicks() == rule.getTriggerThreshold() && (Boolean)rule.invokeTriggerFunction(buffer.getEvents())) {
                collector.emit(new Values(rule.getId(),buffer));
                System.out.println("String_Node_Str" + buffer);
                buffer.resetEvictionTicks();
              }
 else {
                buffer.incrEvictionTick();
              }
            }
          }
        }
      }
    }
  }
 else {
    if (rulesMap.size() > 0) {
      String ruleId=tuple.getString(0);
      String hash=tuple.getString(1);
      Event event=(Event)tuple.getValue(2);
      Rule rule=rulesMap.get(ruleId);
      Map<String,SlidingWindowBuffer> buffersForRule=buffers.get(rule.getId());
      SlidingWindowBuffer buffer;
      if (buffersForRule != null) {
        buffer=buffersForRule.get(hash);
        if (buffer != null) {
          if (rule.getEvictionPolicy() == Policy.COUNT) {
            if (buffer.size() == rule.getEvictionThreshold())             buffer.expire();
          }
        }
      }
 else {
        buffersForRule=new HashMap<String,SlidingWindowBuffer>();
        buffer=new SlidingWindowBuffer(hash);
        buffersForRule.put(hash,buffer);
        buffers.put(rule.getId(),buffersForRule);
      }
      buffer.add(event);
      if (rule.getTriggerPolicy() == Policy.COUNT)       buffer.incrTriggerTicks();
      if (buffer.getTriggerTicks() == rule.getTriggerThreshold()) {
        if ((Boolean)rule.invokeTriggerFunction(buffer.getEvents())) {
          collector.emit(new Values(ruleId,buffer));
          System.out.println("String_Node_Str" + buffer);
          buffer.resetTriggerTicks();
        }
      }
    }
  }
}