Program: 104425
Project: 104425
Buggy source:
/** 
 * Handle an incoming response. Cache answers, and pass them on to the appropriate questions.
 */
private void handleResponse(DNSIncoming msg) throws IOException {
  long now=System.currentTimeMillis();
  boolean hostConflictDetected=false;
  boolean serviceConflictDetected=false;
  logger.finest("String_Node_Str" + msg.answers.size() + "String_Node_Str");
  for (Iterator i=msg.answers.iterator(); i.hasNext(); ) {
    DNSRecord rec=(DNSRecord)i.next();
    logger.finest("String_Node_Str" + rec);
  }
  for (Iterator i=msg.answers.iterator(); i.hasNext(); ) {
    boolean isInformative=false;
    DNSRecord rec=(DNSRecord)i.next();
    boolean expired=rec.isExpired(now);
    logger.finest("String_Node_Str" + rec + "String_Node_Str"+ expired);
    DNSRecord c=(DNSRecord)cache.get(rec);
    if (c != null) {
      logger.finest("String_Node_Str" + rec + "String_Node_Str");
      if (expired) {
        isInformative=true;
        cache.remove(c);
      }
 else {
        logger.fine(new Boolean(c.isUnique()).toString() + c.getType() + c.getClazz()+ "String_Node_Str"+ DNSConstants.TYPE_TXT+ "String_Node_Str"+ DNSConstants.CLASS_IN);
        if ((rec.isUnique() && ((rec.getType() & DNSConstants.TYPE_TXT) != 0) && ((rec.getClazz() & DNSConstants.CLASS_IN) != 0))) {
          System.out.println("String_Node_Str");
          isInformative=true;
          cache.remove(c);
          cache.add(rec);
        }
 else {
          c.resetTTL(rec);
          rec=c;
        }
      }
    }
 else {
      if (!expired) {
        isInformative=true;
        logger.finest("String_Node_Str" + rec + "String_Node_Str");
        cache.add(rec);
      }
    }
switch (rec.type) {
case DNSConstants.TYPE_PTR:
      if (rec.getName().indexOf("String_Node_Str") >= 0) {
        if (!expired && rec.name.startsWith("String_Node_Str")) {
          isInformative=true;
          registerServiceType(((DNSRecord.Pointer)rec).alias);
        }
        continue;
      }
    registerServiceType(rec.name);
  break;
}
if ((rec.getType() == DNSConstants.TYPE_A) || (rec.getType() == DNSConstants.TYPE_AAAA)) {
hostConflictDetected|=rec.handleResponse(this);
}
 else {
serviceConflictDetected|=rec.handleResponse(this);
}
if (isInformative) {
updateRecord(now,rec);
}
}
if (hostConflictDetected || serviceConflictDetected) {
new Prober().start();
}
}

Fixed version (ground truth):
/** 
 * Handle an incoming response. Cache answers, and pass them on to the appropriate questions.
 */
private void handleResponse(DNSIncoming msg) throws IOException {
  long now=System.currentTimeMillis();
  boolean hostConflictDetected=false;
  boolean serviceConflictDetected=false;
  logger.trace("String_Node_Str" + msg.answers.size() + "String_Node_Str");
  for (Iterator i=msg.answers.iterator(); i.hasNext(); ) {
    DNSRecord rec=(DNSRecord)i.next();
    logger.trace("String_Node_Str" + rec);
  }
  for (Iterator i=msg.answers.iterator(); i.hasNext(); ) {
    boolean isInformative=false;
    DNSRecord rec=(DNSRecord)i.next();
    boolean expired=rec.isExpired(now);
    logger.trace("String_Node_Str" + rec + "String_Node_Str"+ expired);
    DNSRecord c=(DNSRecord)cache.get(rec);
    if (c != null) {
      logger.trace("String_Node_Str" + rec + "String_Node_Str");
      if (expired) {
        isInformative=true;
        cache.remove(c);
      }
 else {
        logger.trace(new Boolean(c.isUnique()).toString() + c.getType() + c.getClazz()+ "String_Node_Str"+ DNSConstants.TYPE_TXT+ "String_Node_Str"+ DNSConstants.CLASS_IN);
        if ((rec.isUnique() && ((rec.getType() & DNSConstants.TYPE_TXT) != 0) && ((rec.getClazz() & DNSConstants.CLASS_IN) != 0))) {
          System.out.println("String_Node_Str");
          isInformative=true;
          cache.remove(c);
          cache.add(rec);
        }
 else {
          c.resetTTL(rec);
          rec=c;
        }
      }
    }
 else {
      if (!expired) {
        isInformative=true;
        logger.trace("String_Node_Str" + rec + "String_Node_Str");
        cache.add(rec);
      }
    }
switch (rec.type) {
case DNSConstants.TYPE_PTR:
      if (rec.getName().indexOf("String_Node_Str") >= 0) {
        if (!expired && rec.name.startsWith("String_Node_Str")) {
          isInformative=true;
          registerServiceType(((DNSRecord.Pointer)rec).alias);
        }
        continue;
      }
    registerServiceType(rec.name);
  break;
}
if ((rec.getType() == DNSConstants.TYPE_A) || (rec.getType() == DNSConstants.TYPE_AAAA)) {
hostConflictDetected|=rec.handleResponse(this);
}
 else {
serviceConflictDetected|=rec.handleResponse(this);
}
if (isInformative) {
updateRecord(now,rec);
}
}
if (hostConflictDetected || serviceConflictDetected) {
new Prober().start();
}
}