Program: 4460
Project: 4460
Buggy source:
/** 
 * Creates a new LimeXMLReplyCollection.  The reply collection will retain only those XMLDocs that match the given schema URI.
 * @param fds The list of shared FileDescs.
 * @param URI This collection's schema URI
 * @param audio Whether this is a collection of audio files.
 */
public LimeXMLReplyCollection(FileDesc[] fds,String URI,boolean audio){
  this.schemaURI=URI;
  this.audio=audio;
  debug("String_Node_Str" + audio);
  mainMap=new HashMap();
  trieMap=new HashMap();
  MapSerializer ms=initializeMapSerializer(URI);
  Map hashToXML;
  if (ms == null)   hashToXML=new HashMap();
 else   hashToXML=ms.getMap();
  boolean requiresConversion=false;
{
    Iterator iter=hashToXML.keySet().iterator();
    if (iter.hasNext())     requiresConversion=(iter.next() instanceof String);
    debug("String_Node_Str" + requiresConversion);
  }
  for (int i=0; i < fds.length; i++) {
    FileDesc fd=fds[i];
    if (fd instanceof IncompleteFileDesc)     continue;
    File file=fd.getFile();
    URN hash=fd.getSHA1Urn();
    Object xml=null;
    LimeXMLDocument doc=null;
    if (requiresConversion) {
      String miniHash=null;
      try {
        miniHash=new String(LimeXMLUtils.hashFile(file));
      }
 catch (      IOException e) {
        continue;
      }
      xml=hashToXML.get(miniHash);
      if (xml != null && xml instanceof LimeXMLDocument) {
        doc=(LimeXMLDocument)xml;
      }
 else {
        doc=constructDocument((String)xml,file);
      }
    }
 else {
      xml=hashToXML.get(hash);
      if (xml == null) {
        doc=constructDocument(null,file);
      }
 else {
        doc=(LimeXMLDocument)xml;
      }
    }
    if (doc == null)     continue;
    if (!doc.isValid()) {
      doc=constructDocument(null,file);
      if (doc == null || !doc.isValid())       continue;
    }
    if (ID3Reader.isCorrupted(doc)) {
      doc=ID3Reader.fixCorruption(doc);
      addReplyWithCommit(file,fd,doc);
    }
 else {
      addReply(fd,doc);
    }
  }
  debug("String_Node_Str");
  write();
}

Fixed version (ground truth):
/** 
 * Creates a new LimeXMLReplyCollection.  The reply collection will retain only those XMLDocs that match the given schema URI.
 * @param fds The list of shared FileDescs.
 * @param URI This collection's schema URI
 * @param audio Whether this is a collection of audio files.
 */
public LimeXMLReplyCollection(FileDesc[] fds,String URI,boolean audio){
  this.schemaURI=URI;
  this.audio=audio;
  debug("String_Node_Str" + audio);
  mainMap=new HashMap();
  trieMap=new HashMap();
  MapSerializer ms=initializeMapSerializer(URI);
  Map hashToXML;
  if (ms == null)   hashToXML=new HashMap();
 else   hashToXML=ms.getMap();
  boolean requiresConversion=false;
{
    Iterator iter=hashToXML.keySet().iterator();
    if (iter.hasNext())     requiresConversion=(iter.next() instanceof String);
    debug("String_Node_Str" + requiresConversion);
  }
  for (int i=0; i < fds.length; i++) {
    FileDesc fd=fds[i];
    if (fd instanceof IncompleteFileDesc)     continue;
    File file=fd.getFile();
    URN hash=fd.getSHA1Urn();
    Object xml=null;
    LimeXMLDocument doc=null;
    if (requiresConversion) {
      String miniHash=null;
      try {
        miniHash=new String(LimeXMLUtils.hashFile(file));
      }
 catch (      IOException e) {
        continue;
      }
      xml=hashToXML.get(miniHash);
      if (xml != null && xml instanceof LimeXMLDocument) {
        doc=(LimeXMLDocument)xml;
      }
 else {
        doc=constructDocument((String)xml,file);
      }
    }
 else {
      xml=hashToXML.get(hash);
      if (xml == null) {
        doc=constructDocument(null,file);
      }
 else {
        doc=(LimeXMLDocument)xml;
      }
    }
    if (doc == null)     continue;
    if (!doc.isValid()) {
      doc=constructDocument(null,file);
      if (doc == null || !doc.isValid())       continue;
    }
    if (ID3Reader.isCorrupted(doc)) {
      doc=ID3Reader.fixCorruption(doc);
      addReplyWithCommit(file,fd,doc,false);
    }
 else {
      addReply(fd,doc);
    }
  }
  debug("String_Node_Str");
  write();
}