Program: 176248
Project: 176248
Buggy source:
/** 
 * Gets the entity manager factory.
 * @param useLucene
 * @param property
 * @return the entity manager factory
 */
private EntityManagerFactoryImpl getEntityManagerFactory(String property){
  Map<String,Object> props=new HashMap<String,Object>();
  props.put(Constants.PERSISTENCE_UNIT_NAME,_persistenceUnit);
  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");
  }
  KunderaMetadata.INSTANCE.setApplicationMetadata(null);
  ApplicationMetadata appMetadata=KunderaMetadata.INSTANCE.getApplicationMetadata();
  PersistenceUnitMetadata puMetadata=new PersistenceUnitMetadata();
  puMetadata.setPersistenceUnitName(_persistenceUnit);
  Properties p=new Properties();
  p.putAll(props);
  puMetadata.setProperties(p);
  Map<String,PersistenceUnitMetadata> metadata=new HashMap<String,PersistenceUnitMetadata>();
  metadata.put(_persistenceUnit,puMetadata);
  appMetadata.addPersistenceUnitMetadata(metadata);
  Map<String,List<String>> clazzToPu=new HashMap<String,List<String>>();
  List<String> pus=new ArrayList<String>();
  pus.add(_persistenceUnit);
  clazzToPu.put(CassandraEntityPersonnelUniMToM.class.getName(),pus);
  clazzToPu.put(CassandraEntityHabitatUniMToM.class.getName(),pus);
  appMetadata.setClazzToPuMap(clazzToPu);
  EntityMetadata m=new EntityMetadata(CassandraEntityPersonnelUniMToM.class);
  EntityMetadata m1=new EntityMetadata(CassandraEntityHabitatUniMToM.class);
  TableProcessor processor=new TableProcessor(null);
  processor.process(CassandraEntityPersonnelUniMToM.class,m);
  processor.process(CassandraEntityHabitatUniMToM.class,m1);
  m.setPersistenceUnit(_persistenceUnit);
  MetamodelImpl metaModel=new MetamodelImpl();
  metaModel.addEntityMetadata(CassandraEntityPersonnelUniMToM.class,m);
  metaModel.addEntityMetadata(CassandraEntityHabitatUniMToM.class,m1);
  metaModel.assignManagedTypes(appMetadata.getMetaModelBuilder(_persistenceUnit).getManagedTypes());
  metaModel.assignEmbeddables(appMetadata.getMetaModelBuilder(_persistenceUnit).getEmbeddables());
  metaModel.assignMappedSuperClass(appMetadata.getMetaModelBuilder(_persistenceUnit).getMappedSuperClassTypes());
  appMetadata.getMetamodelMap().put(_persistenceUnit,metaModel);
  new ClientFactoryConfiguraton(null,_persistenceUnit).configure();
  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){
  Map<String,Object> props=new HashMap<String,Object>();
  props.put(Constants.PERSISTENCE_UNIT_NAME,_persistenceUnit);
  props.put(PersistenceProperties.KUNDERA_CLIENT_FACTORY,ThriftClientFactory.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");
  }
  KunderaMetadata.INSTANCE.setApplicationMetadata(null);
  ApplicationMetadata appMetadata=KunderaMetadata.INSTANCE.getApplicationMetadata();
  PersistenceUnitMetadata puMetadata=new PersistenceUnitMetadata();
  puMetadata.setPersistenceUnitName(_persistenceUnit);
  Properties p=new Properties();
  p.putAll(props);
  puMetadata.setProperties(p);
  Map<String,PersistenceUnitMetadata> metadata=new HashMap<String,PersistenceUnitMetadata>();
  metadata.put(_persistenceUnit,puMetadata);
  appMetadata.addPersistenceUnitMetadata(metadata);
  Map<String,List<String>> clazzToPu=new HashMap<String,List<String>>();
  List<String> pus=new ArrayList<String>();
  pus.add(_persistenceUnit);
  clazzToPu.put(CassandraEntityPersonnelUniMToM.class.getName(),pus);
  clazzToPu.put(CassandraEntityHabitatUniMToM.class.getName(),pus);
  appMetadata.setClazzToPuMap(clazzToPu);
  MetadataBuilder metadataBuilder=new MetadataBuilder(_persistenceUnit,ThriftClientFactory.class.getSimpleName(),null);
  MetamodelImpl metaModel=new MetamodelImpl();
  metaModel.addEntityMetadata(CassandraEntityPersonnelUniMToM.class,metadataBuilder.buildEntityMetadata(CassandraEntityPersonnelUniMToM.class));
  metaModel.addEntityMetadata(CassandraEntityHabitatUniMToM.class,metadataBuilder.buildEntityMetadata(CassandraEntityHabitatUniMToM.class));
  metaModel.assignManagedTypes(appMetadata.getMetaModelBuilder(_persistenceUnit).getManagedTypes());
  metaModel.assignEmbeddables(appMetadata.getMetaModelBuilder(_persistenceUnit).getEmbeddables());
  metaModel.assignMappedSuperClass(appMetadata.getMetaModelBuilder(_persistenceUnit).getMappedSuperClassTypes());
  appMetadata.getMetamodelMap().put(_persistenceUnit,metaModel);
  new ClientFactoryConfiguraton(null,_persistenceUnit).configure();
  configuration.configure();
  return null;
}