Program: 176246
Project: 176246
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);
  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(null);
  processor.process(Doctor.class,m);
  m.setPersistenceUnit(pu);
  MetamodelImpl metaModel=new MetamodelImpl();
  metaModel.addEntityMetadata(Doctor.class,m);
  appMetadata.getMetamodelMap().put(pu,metaModel);
  metaModel.assignManagedTypes(appMetadata.getMetaModelBuilder(pu).getManagedTypes());
  metaModel.assignEmbeddables(appMetadata.getMetaModelBuilder(pu).getEmbeddables());
  metaModel.assignMappedSuperClass(appMetadata.getMetaModelBuilder(pu).getMappedSuperClassTypes());
  try {
    configuration.configure();
  }
 catch (  Exception e) {
    log.info("String_Node_Str");
  }
  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);
  MetamodelImpl metaModel=new MetamodelImpl();
  MetadataBuilder metadataBuilder=new MetadataBuilder(pu,ThriftClientFactory.class.getSimpleName(),null);
  metaModel.addEntityMetadata(Doctor.class,metadataBuilder.buildEntityMetadata(Doctor.class));
  appMetadata.getMetamodelMap().put(pu,metaModel);
  metaModel.assignManagedTypes(appMetadata.getMetaModelBuilder(pu).getManagedTypes());
  metaModel.assignEmbeddables(appMetadata.getMetaModelBuilder(pu).getEmbeddables());
  metaModel.assignMappedSuperClass(appMetadata.getMetaModelBuilder(pu).getMappedSuperClassTypes());
  try {
    configuration.configure();
  }
 catch (  Exception e) {
    log.info("String_Node_Str");
  }
  return null;
}