Program: 176388
Project: 176388
Buggy source:
/** 
 * Load client metadata.
 * @param puProperties
 */
protected void loadClientMetadata(Map<String,Object> puProperties){
  ClientMetadata clientMetadata=new ClientMetadata();
  String luceneDirectoryPath=puProperties != null ? (String)puProperties.get(PersistenceProperties.KUNDERA_INDEX_HOME_DIR) : null;
  String indexerClass=KunderaMetadata.INSTANCE.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit).getProperties().getProperty(PersistenceProperties.KUNDERA_INDEXER_CLASS);
  if (luceneDirectoryPath == null) {
    luceneDirectoryPath=KunderaMetadata.INSTANCE.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit).getProperty(PersistenceProperties.KUNDERA_INDEX_HOME_DIR);
  }
  if (luceneDirectoryPath != null) {
    clientMetadata.setLuceneIndexDir(luceneDirectoryPath);
    indexManager=new IndexManager(LuceneIndexer.getInstance(new StandardAnalyzer(Version.LUCENE_34),luceneDirectoryPath));
  }
 else   if (indexerClass != null) {
    try {
      Class<?> indexerClazz=Class.forName(indexerClass);
      Indexer indexer=(Indexer)indexerClazz.newInstance();
      indexManager=new IndexManager(indexer);
      clientMetadata.setIndexImplementor(indexerClass);
    }
 catch (    Exception cnfex) {
      logger.error("String_Node_Str" + indexerClass,cnfex);
      throw new KunderaException(cnfex);
    }
  }
 else {
    indexManager=new IndexManager(null);
  }
  if (KunderaMetadata.INSTANCE.getClientMetadata(persistenceUnit) == null) {
    KunderaMetadata.INSTANCE.addClientMetadata(persistenceUnit,clientMetadata);
  }
}

Fixed version (ground truth):
/** 
 * Load client metadata.
 * @param puProperties
 */
protected void loadClientMetadata(Map<String,Object> puProperties){
  ClientMetadata clientMetadata=new ClientMetadata();
  String luceneDirectoryPath=puProperties != null ? (String)puProperties.get(PersistenceProperties.KUNDERA_INDEX_HOME_DIR) : null;
  String indexerClass=puProperties != null ? (String)puProperties.get(PersistenceProperties.KUNDERA_INDEXER_CLASS) : null;
  if (indexerClass == null) {
    indexerClass=KunderaMetadata.INSTANCE.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit).getProperties().getProperty(PersistenceProperties.KUNDERA_INDEXER_CLASS);
  }
  if (luceneDirectoryPath == null) {
    luceneDirectoryPath=KunderaMetadata.INSTANCE.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit).getProperty(PersistenceProperties.KUNDERA_INDEX_HOME_DIR);
  }
  if (luceneDirectoryPath != null && !StringUtils.isEmpty(luceneDirectoryPath)) {
    clientMetadata.setLuceneIndexDir(luceneDirectoryPath);
    indexManager=new IndexManager(LuceneIndexer.getInstance(new StandardAnalyzer(Version.LUCENE_34),luceneDirectoryPath));
  }
 else   if (indexerClass != null) {
    try {
      Class<?> indexerClazz=Class.forName(indexerClass);
      Indexer indexer=(Indexer)indexerClazz.newInstance();
      indexManager=new IndexManager(indexer);
      clientMetadata.setIndexImplementor(indexerClass);
    }
 catch (    Exception cnfex) {
      logger.error("String_Node_Str" + indexerClass,cnfex);
      throw new KunderaException(cnfex);
    }
  }
 else {
    indexManager=new IndexManager(null);
  }
  if (KunderaMetadata.INSTANCE.getClientMetadata(persistenceUnit) == null) {
    KunderaMetadata.INSTANCE.addClientMetadata(persistenceUnit,clientMetadata);
  }
}