Program: 20772
Project: 20772
Buggy source:
/** 
 * Creates a Lucene Document from an artifact; used for index additions
 * @param artifact
 * @return
 * @throws RepositoryIndexException
 */
private Document createDocument(Artifact artifact) throws RepositoryIndexException {
  Document doc=null;
  File artifactFile=artifact.getFile();
  if (artifactFile != null && artifactFile.getName().endsWith("String_Node_Str") && artifactFile.exists()) {
    String md5;
    try {
      md5=digester.createChecksum(artifactFile,"String_Node_Str");
    }
 catch (    DigesterException e) {
      throw new RepositoryIndexException("String_Node_Str",e);
    }
    StringBuffer classes;
    try {
      classes=new StringBuffer();
      if ("String_Node_Str".equals(artifact.getType())) {
        ZipFile jar=new ZipFile(artifact.getFile());
        for (Enumeration entries=jar.entries(); entries.hasMoreElements(); ) {
          ZipEntry entry=(ZipEntry)entries.nextElement();
          addIfClassEntry(entry,classes);
        }
      }
    }
 catch (    ZipException e) {
      throw new RepositoryIndexException("String_Node_Str" + artifact.getFile(),e);
    }
catch (    IOException e) {
      throw new RepositoryIndexException("String_Node_Str",e);
    }
    doc=new Document();
    doc.add(new Field(MD5,md5,Field.Store.YES,Field.Index.UN_TOKENIZED));
    doc.add(new Field(JAR_NAME,artifactFile.getName(),Field.Store.YES,Field.Index.TOKENIZED));
    doc.add(new Field(JAR_DATE,DateField.timeToString(artifactFile.lastModified()),Field.Store.YES,Field.Index.UN_TOKENIZED));
    doc.add(new Field(JAR_SIZE,Long.toString(artifactFile.length()),Field.Store.YES,Field.Index.UN_TOKENIZED));
    doc.add(new Field(NAMES,classes.toString(),Field.Store.YES,Field.Index.TOKENIZED));
  }
  return doc;
}

Fixed version (ground truth):
/** 
 * Creates a Lucene Document from an artifact; used for index additions
 * @param artifact
 * @return
 * @throws RepositoryIndexException
 */
private Document createDocument(Artifact artifact) throws RepositoryIndexException {
  Document doc=null;
  File artifactFile=artifact.getFile();
  if (artifactFile != null && artifactFile.getName().endsWith("String_Node_Str") && artifactFile.exists()) {
    String md5;
    try {
      md5=digester.createChecksum(artifactFile,"String_Node_Str");
    }
 catch (    DigesterException e) {
      throw new RepositoryIndexException("String_Node_Str",e);
    }
    StringBuffer classes;
    try {
      classes=new StringBuffer();
      if ("String_Node_Str".equals(artifact.getType())) {
        ZipFile jar=new ZipFile(artifact.getFile());
        for (Enumeration entries=jar.entries(); entries.hasMoreElements(); ) {
          ZipEntry entry=(ZipEntry)entries.nextElement();
          addIfClassEntry(entry,classes);
        }
      }
    }
 catch (    ZipException e) {
      throw new RepositoryIndexException("String_Node_Str" + artifact.getFile(),e);
    }
catch (    IOException e) {
      throw new RepositoryIndexException("String_Node_Str",e);
    }
    doc=new Document();
    doc.add(new Field(MD5,md5,Field.Store.YES,Field.Index.UN_TOKENIZED));
    doc.add(new Field(JAR_NAME,artifactFile.getName(),Field.Store.YES,Field.Index.TOKENIZED));
    doc.add(new Field(JAR_DATE,DateTools.timeToString(artifactFile.lastModified(),DateTools.Resolution.SECOND),Field.Store.YES,Field.Index.UN_TOKENIZED));
    doc.add(new Field(JAR_SIZE,Long.toString(artifactFile.length()),Field.Store.YES,Field.Index.UN_TOKENIZED));
    doc.add(new Field(NAMES,classes.toString(),Field.Store.YES,Field.Index.TOKENIZED));
  }
  return doc;
}