Program: 176893
Project: 176893
Buggy source:
/** 
 * Gets the entity manager factory.
 * @param useLucene
 * @param property
 * @return the entity manager factory
 */
private EntityManagerFactoryImpl getEntityManagerFactory(String property){
  ClientMetadata clientMetadata=new ClientMetadata();
  Map<String,Object> props=new HashMap<String,Object>();
  props.put(Constants.PERSISTENCE_UNIT_NAME,pu);
  props.put(PersistenceProperties.KUNDERA_CLIENT_FACTORY,PelopsClientFactory.class.getName());
  props.put(PersistenceProperties.KUNDERA_NODES,"String_Node_Str");
  props.put(PersistenceProperties.KUNDERA_PORT,"String_Node_Str");
  props.put(PersistenceProperties.KUNDERA_KEYSPACE,keyspace);
  props.put(PersistenceProperties.KUNDERA_DDL_AUTO_PREPARE,property);
  if (useLucene) {
    props.put(PersistenceProperties.KUNDERA_INDEX_HOME_DIR,"String_Node_Str");
    clientMetadata.setLuceneIndexDir("String_Node_Str");
  }
 else {
    clientMetadata.setLuceneIndexDir(null);
  }
  KunderaMetadata.INSTANCE.setApplicationMetadata(null);
  ApplicationMetadata appMetadata=KunderaMetadata.INSTANCE.getApplicationMetadata();
  PersistenceUnitMetadata puMetadata=new PersistenceUnitMetadata();
  puMetadata.setPersistenceUnitName(pu);
  Properties p=new Properties();
  p.putAll(props);
  puMetadata.setProperties(p);
  Map<String,PersistenceUnitMetadata> metadata=new HashMap<String,PersistenceUnitMetadata>();
  metadata.put(pu,puMetadata);
  appMetadata.addPersistenceUnitMetadata(metadata);
  Map<String,List<String>> clazzToPu=new HashMap<String,List<String>>();
  List<String> pus=new ArrayList<String>();
  pus.add(pu);
  clazzToPu.put(Doctor.class.getName(),pus);
  appMetadata.setClazzToPuMap(clazzToPu);
  EntityMetadata m=new EntityMetadata(Doctor.class);
  TableProcessor processor=new TableProcessor();
  processor.process(Doctor.class,m);
  m.setPersistenceUnit(pu);
  MetamodelImpl metaModel=new MetamodelImpl();
  metaModel.addEntityMetadata(Doctor.class,m);
  appMetadata.getMetamodelMap().put(pu,metaModel);
  KunderaMetadata.INSTANCE.addClientMetadata(pu,clientMetadata);
  CassandraPropertyReader reader=new CassandraPropertyReader();
  reader.read(pu);
  configuration.configure();
  return null;
}

Fixed version (ground truth):
/** 
 * Gets the entity manager factory.
 * @param useLucene
 * @param property
 * @return the entity manager factory
 */
private EntityManagerFactoryImpl getEntityManagerFactory(String property){
  ClientMetadata clientMetadata=new ClientMetadata();
  Map<String,Object> props=new HashMap<String,Object>();
  props.put(Constants.PERSISTENCE_UNIT_NAME,pu);
  props.put(PersistenceProperties.KUNDERA_CLIENT_FACTORY,PelopsClientFactory.class.getName());
  props.put(PersistenceProperties.KUNDERA_NODES,"String_Node_Str");
  props.put(PersistenceProperties.KUNDERA_PORT,"String_Node_Str");
  props.put(PersistenceProperties.KUNDERA_KEYSPACE,keyspace);
  props.put(PersistenceProperties.KUNDERA_DDL_AUTO_PREPARE,property);
  props.put(PersistenceProperties.KUNDERA_CLIENT_PROPERTY,KUNDERA_CASSANDRA_PROPERTIES);
  if (useLucene) {
    props.put(PersistenceProperties.KUNDERA_INDEX_HOME_DIR,HOME_IMPADMIN_LUCENE);
    clientMetadata.setLuceneIndexDir(HOME_IMPADMIN_LUCENE);
  }
 else {
    clientMetadata.setLuceneIndexDir(null);
  }
  KunderaMetadata.INSTANCE.setApplicationMetadata(null);
  ApplicationMetadata appMetadata=KunderaMetadata.INSTANCE.getApplicationMetadata();
  PersistenceUnitMetadata puMetadata=new PersistenceUnitMetadata();
  puMetadata.setPersistenceUnitName(pu);
  Properties p=new Properties();
  p.putAll(props);
  puMetadata.setProperties(p);
  Map<String,PersistenceUnitMetadata> metadata=new HashMap<String,PersistenceUnitMetadata>();
  metadata.put(pu,puMetadata);
  appMetadata.addPersistenceUnitMetadata(metadata);
  Map<String,List<String>> clazzToPu=new HashMap<String,List<String>>();
  List<String> pus=new ArrayList<String>();
  pus.add(pu);
  clazzToPu.put(Doctor.class.getName(),pus);
  appMetadata.setClazzToPuMap(clazzToPu);
  EntityMetadata m=new EntityMetadata(Doctor.class);
  TableProcessor processor=new TableProcessor();
  processor.process(Doctor.class,m);
  m.setPersistenceUnit(pu);
  MetamodelImpl metaModel=new MetamodelImpl();
  metaModel.addEntityMetadata(Doctor.class,m);
  appMetadata.getMetamodelMap().put(pu,metaModel);
  KunderaMetadata.INSTANCE.addClientMetadata(pu,clientMetadata);
  CassandraPropertyReader reader=new CassandraPropertyReader();
  reader.read(pu);
  configuration.configure();
  return null;
}