Program: 20776
Project: 20776
Buggy source:
/** 
 * Creates a Lucene Document from a RepositoryMetadata; used for index additions
 * @param repoMetadata
 * @return Lucene Document
 */
private Document createDocument(RepositoryMetadata repoMetadata){
  Document doc=new Document();
  doc.add(Field.Keyword(FLD_ID,(String)repoMetadata.getKey()));
  Metadata metadata=repoMetadata.getMetadata();
  doc.add(Field.Text(FLD_NAME,repository.pathOfRemoteRepositoryMetadata(repoMetadata)));
  Versioning versioning=metadata.getVersioning();
  if (versioning != null) {
    doc.add(Field.Text(FLD_LASTUPDATE,versioning.getLastUpdated()));
  }
 else {
    doc.add(Field.Text(FLD_LASTUPDATE,"String_Node_Str"));
  }
  List plugins=metadata.getPlugins();
  String pluginAppended="String_Node_Str";
  for (Iterator iter=plugins.iterator(); iter.hasNext(); ) {
    Plugin plugin=(Plugin)iter.next();
    if (plugin.getPrefix() != null && !"String_Node_Str".equals(plugin.getPrefix())) {
      pluginAppended=plugin.getPrefix() + "String_Node_Str";
    }
  }
  doc.add(Field.Text(FLD_PLUGINPREFIX,pluginAppended));
  doc.add(Field.Text(FLD_GROUPID,metadata.getGroupId()));
  if (metadata.getArtifactId() != null && !"String_Node_Str".equals(metadata.getArtifactId())) {
    doc.add(Field.Text(FLD_ARTIFACTID,metadata.getArtifactId()));
  }
 else {
    doc.add(Field.Text(FLD_ARTIFACTID,"String_Node_Str"));
  }
  if (metadata.getVersion() != null && !"String_Node_Str".equals(metadata.getVersion())) {
    doc.add(Field.Text(FLD_VERSION,metadata.getVersion()));
  }
 else {
    doc.add(Field.Text(FLD_VERSION,"String_Node_Str"));
  }
  doc.add(Field.Text(FLD_DOCTYPE,METADATA));
  doc.add(Field.Keyword(FLD_PACKAGING,"String_Node_Str"));
  doc.add(Field.Text(FLD_SHA1,"String_Node_Str"));
  doc.add(Field.Text(FLD_MD5,"String_Node_Str"));
  doc.add(Field.Text(FLD_CLASSES,"String_Node_Str"));
  doc.add(Field.Text(FLD_PACKAGES,"String_Node_Str"));
  doc.add(Field.Text(FLD_FILES,"String_Node_Str"));
  doc.add(Field.Keyword(FLD_LICENSE_URLS,"String_Node_Str"));
  doc.add(Field.Keyword(FLD_DEPENDENCIES,"String_Node_Str"));
  doc.add(Field.Keyword(FLD_PLUGINS_BUILD,"String_Node_Str"));
  doc.add(Field.Keyword(FLD_PLUGINS_REPORT,"String_Node_Str"));
  doc.add(Field.Keyword(FLD_PLUGINS_ALL,"String_Node_Str"));
  return doc;
}

Fixed version (ground truth):
/** 
 * Creates a Lucene Document from a RepositoryMetadata; used for index additions
 * @param repoMetadata
 * @return Lucene Document
 */
private Document createDocument(RepositoryMetadata repoMetadata){
  Document doc=new Document();
  doc.add(Field.Keyword(FLD_ID,(String)repoMetadata.getKey()));
  Metadata metadata=repoMetadata.getMetadata();
  doc.add(Field.Text(FLD_NAME,repository.pathOfRemoteRepositoryMetadata(repoMetadata)));
  Versioning versioning=metadata.getVersioning();
  if (versioning != null) {
    doc.add(Field.Text(FLD_LASTUPDATE,versioning.getLastUpdated()));
  }
 else {
    doc.add(Field.Text(FLD_LASTUPDATE,"String_Node_Str"));
  }
  List plugins=metadata.getPlugins();
  String pluginAppended="String_Node_Str";
  for (Iterator iter=plugins.iterator(); iter.hasNext(); ) {
    Plugin plugin=(Plugin)iter.next();
    if (plugin.getPrefix() != null && !"String_Node_Str".equals(plugin.getPrefix())) {
      pluginAppended=plugin.getPrefix() + "String_Node_Str";
    }
  }
  doc.add(Field.Text(FLD_PLUGINPREFIX,pluginAppended));
  if (metadata.getGroupId() != null) {
    doc.add(Field.Text(FLD_GROUPID,metadata.getGroupId()));
  }
 else {
    doc.add(Field.Text(FLD_GROUPID,"String_Node_Str"));
  }
  if (metadata.getArtifactId() != null) {
    doc.add(Field.Text(FLD_ARTIFACTID,metadata.getArtifactId()));
  }
 else {
    doc.add(Field.Text(FLD_ARTIFACTID,"String_Node_Str"));
  }
  if (metadata.getVersion() != null) {
    doc.add(Field.Text(FLD_VERSION,metadata.getVersion()));
  }
 else {
    doc.add(Field.Text(FLD_VERSION,"String_Node_Str"));
  }
  doc.add(Field.Text(FLD_DOCTYPE,METADATA));
  doc.add(Field.Keyword(FLD_PACKAGING,"String_Node_Str"));
  doc.add(Field.Text(FLD_SHA1,"String_Node_Str"));
  doc.add(Field.Text(FLD_MD5,"String_Node_Str"));
  doc.add(Field.Text(FLD_CLASSES,"String_Node_Str"));
  doc.add(Field.Text(FLD_PACKAGES,"String_Node_Str"));
  doc.add(Field.Text(FLD_FILES,"String_Node_Str"));
  doc.add(Field.Keyword(FLD_LICENSE_URLS,"String_Node_Str"));
  doc.add(Field.Keyword(FLD_DEPENDENCIES,"String_Node_Str"));
  doc.add(Field.Keyword(FLD_PLUGINS_BUILD,"String_Node_Str"));
  doc.add(Field.Keyword(FLD_PLUGINS_REPORT,"String_Node_Str"));
  doc.add(Field.Keyword(FLD_PLUGINS_ALL,"String_Node_Str"));
  return doc;
}