Program: 154777
Project: 154777
Buggy source:
/** 
 * Constructs this data source.
 * @param params XA parameters.
 * @throws InstantiationException if the data source couldn't beinstantiated
 */
public LuceneDataSource(Map<Object,Object> params) throws InstantiationException {
  super(params);
  caching=new Cache();
  String storeDir=(String)params.get("String_Node_Str");
  this.baseStorePath=getStoreDir(storeDir);
  cleanWriteLocks(baseStorePath);
  this.indexStore=new IndexStore(storeDir);
  this.store=newIndexStore(storeDir);
  this.typeCache=new IndexTypeCache();
  boolean isReadOnly=params.containsKey("String_Node_Str") ? (Boolean)params.get("String_Node_Str") : false;
  if (!isReadOnly) {
    XaCommandFactory cf=new LuceneCommandFactory();
    XaTransactionFactory tf=new LuceneTransactionFactory(store);
    xaContainer=XaContainer.create(this.baseStorePath + "String_Node_Str",cf,tf,params);
    try {
      xaContainer.openLogicalLog();
    }
 catch (    IOException e) {
      throw new RuntimeException("String_Node_Str" + this.baseStorePath,e);
    }
    xaContainer.getLogicalLog().setKeepLogs(shouldKeepLog((String)params.get(Config.KEEP_LOGICAL_LOGS),DEFAULT_NAME));
    setLogicalLogAtCreationTime(xaContainer.getLogicalLog());
  }
 else {
    xaContainer=null;
  }
  nodeEntityType=new EntityType(){
    public Document newDocument(    Object entityId){
      return IndexType.newBaseDocument((Long)entityId);
    }
    public Class<?> getType(){
      return Node.class;
    }
  }
;
  relationshipEntityType=new EntityType(){
    public Document newDocument(    Object entityId){
      RelationshipId relId=(RelationshipId)entityId;
      Document doc=IndexType.newBaseDocument(relId.id);
      doc.add(new Field(LuceneIndex.KEY_START_NODE_ID,"String_Node_Str" + relId.startNode,Store.YES,org.apache.lucene.document.Field.Index.NOT_ANALYZED));
      doc.add(new Field(LuceneIndex.KEY_END_NODE_ID,"String_Node_Str" + relId.endNode,Store.YES,org.apache.lucene.document.Field.Index.NOT_ANALYZED));
      return doc;
    }
    public Class<?> getType(){
      return Relationship.class;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Constructs this data source.
 * @param params XA parameters.
 * @throws InstantiationException if the data source couldn't beinstantiated
 */
public LuceneDataSource(Map<Object,Object> params) throws InstantiationException {
  super(params);
  caching=new Cache();
  String storeDir=(String)params.get("String_Node_Str");
  this.baseStorePath=getStoreDir(storeDir);
  cleanWriteLocks(baseStorePath);
  this.indexStore=new IndexStore(storeDir);
  this.store=newIndexStore(storeDir);
  this.typeCache=new IndexTypeCache();
  boolean isReadOnly=params.containsKey("String_Node_Str") ? (Boolean)params.get("String_Node_Str") : false;
  nodeEntityType=new EntityType(){
    public Document newDocument(    Object entityId){
      return IndexType.newBaseDocument((Long)entityId);
    }
    public Class<?> getType(){
      return Node.class;
    }
  }
;
  relationshipEntityType=new EntityType(){
    public Document newDocument(    Object entityId){
      RelationshipId relId=(RelationshipId)entityId;
      Document doc=IndexType.newBaseDocument(relId.id);
      doc.add(new Field(LuceneIndex.KEY_START_NODE_ID,"String_Node_Str" + relId.startNode,Store.YES,org.apache.lucene.document.Field.Index.NOT_ANALYZED));
      doc.add(new Field(LuceneIndex.KEY_END_NODE_ID,"String_Node_Str" + relId.endNode,Store.YES,org.apache.lucene.document.Field.Index.NOT_ANALYZED));
      return doc;
    }
    public Class<?> getType(){
      return Relationship.class;
    }
  }
;
  if (!isReadOnly) {
    XaCommandFactory cf=new LuceneCommandFactory();
    XaTransactionFactory tf=new LuceneTransactionFactory(store);
    xaContainer=XaContainer.create(this.baseStorePath + "String_Node_Str",cf,tf,params);
    try {
      xaContainer.openLogicalLog();
    }
 catch (    IOException e) {
      throw new RuntimeException("String_Node_Str" + this.baseStorePath,e);
    }
    xaContainer.getLogicalLog().setKeepLogs(shouldKeepLog((String)params.get(Config.KEEP_LOGICAL_LOGS),DEFAULT_NAME));
    setLogicalLogAtCreationTime(xaContainer.getLogicalLog());
  }
 else {
    xaContainer=null;
  }
}