Program: 176247
Project: 176247
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,pu);
  props.put(PersistenceProperties.KUNDERA_CLIENT_FACTORY,"String_Node_Str");
  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(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(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(pu);
  MetamodelImpl metaModel=new MetamodelImpl();
  metaModel.addEntityMetadata(CassandraEntityPersonnelUniMToM.class,m);
  metaModel.addEntityMetadata(CassandraEntityHabitatUniMToM.class,m1);
  metaModel.assignManagedTypes(appMetadata.getMetaModelBuilder(pu).getManagedTypes());
  metaModel.assignEmbeddables(appMetadata.getMetaModelBuilder(pu).getEmbeddables());
  metaModel.assignMappedSuperClass(appMetadata.getMetaModelBuilder(pu).getMappedSuperClassTypes());
  appMetadata.getMetamodelMap().put(pu,metaModel);
  new ClientFactoryConfiguraton(null,pu).configure();
  new SchemaConfiguration(null,pu).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,pu);
  props.put(PersistenceProperties.KUNDERA_CLIENT_FACTORY,"String_Node_Str");
  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(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(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(pu);
  MetadataBuilder metadataBuilder=new MetadataBuilder(pu,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(pu).getManagedTypes());
  metaModel.assignEmbeddables(appMetadata.getMetaModelBuilder(pu).getEmbeddables());
  metaModel.assignMappedSuperClass(appMetadata.getMetaModelBuilder(pu).getMappedSuperClassTypes());
  appMetadata.getMetamodelMap().put(pu,metaModel);
  new ClientFactoryConfiguraton(null,pu).configure();
  new SchemaConfiguration(null,pu).configure();
  return null;
}