Program: 20652
Project: 20652
Buggy source:
public IndexingContext createIndexContext(ManagedRepository repository) throws RepositoryAdminException {
  IndexingContext context=indexer.getIndexingContexts().get(repository.getId());
  if (context != null) {
    log.debug("String_Node_Str",repository.getId());
    return context;
  }
  File repositoryDirectory=new File(repository.getLocation());
  if (!repositoryDirectory.isAbsolute()) {
    repositoryDirectory=new File(getRegistry().getString("String_Node_Str") + File.separatorChar + "String_Node_Str"+ File.separatorChar+ "String_Node_Str",repository.getLocation());
  }
  if (!repositoryDirectory.exists()) {
    repositoryDirectory.mkdirs();
  }
  try {
    String indexDir=repository.getIndexDirectory();
    File managedRepository=new File(repository.getLocation());
    File indexDirectory=null;
    if (StringUtils.isNotBlank(indexDir)) {
      indexDirectory=new File(repository.getIndexDirectory());
      if (!indexDirectory.isAbsolute()) {
        indexDirectory=new File(managedRepository,repository.getIndexDirectory());
        repository.setIndexDirectory(indexDirectory.getAbsolutePath());
      }
    }
 else {
      indexDirectory=new File(managedRepository,"String_Node_Str");
      if (!managedRepository.isAbsolute()) {
        indexDirectory=new File(repositoryDirectory,"String_Node_Str");
        repository.setIndexDirectory(indexDirectory.getAbsolutePath());
      }
    }
    if (!indexDirectory.exists()) {
      indexDirectory.mkdirs();
    }
    context=indexer.getIndexingContexts().get(repository.getId());
    if (context == null) {
      context=indexer.addIndexingContext(repository.getId(),repository.getId(),managedRepository,indexDirectory,managedRepository.toURI().toURL().toExternalForm(),indexDirectory.toURI().toURL().toString(),indexCreators);
      context.setSearchable(repository.isScanned());
    }
    return context;
  }
 catch (  MalformedURLException e) {
    throw new RepositoryAdminException(e.getMessage(),e);
  }
catch (  IOException e) {
    throw new RepositoryAdminException(e.getMessage(),e);
  }
catch (  UnsupportedExistingLuceneIndexException e) {
    throw new RepositoryAdminException(e.getMessage(),e);
  }
}

Fixed version (ground truth):
public IndexingContext createIndexContext(ManagedRepository repository) throws RepositoryAdminException {
  IndexingContext context=indexer.getIndexingContexts().get(repository.getId());
  if (context != null) {
    log.debug("String_Node_Str",repository.getId());
    return context;
  }
  File repositoryDirectory=new File(repository.getLocation());
  if (!repositoryDirectory.isAbsolute()) {
    repositoryDirectory=new File(getRegistry().getString("String_Node_Str") + File.separatorChar + "String_Node_Str"+ File.separatorChar+ "String_Node_Str",repository.getLocation());
  }
  if (!repositoryDirectory.exists()) {
    repositoryDirectory.mkdirs();
  }
  try {
    String indexDir=repository.getIndexDirectory();
    File indexDirectory=null;
    if (StringUtils.isNotBlank(indexDir)) {
      indexDirectory=new File(repository.getIndexDirectory());
      if (!indexDirectory.isAbsolute()) {
        indexDirectory=new File(repositoryDirectory,repository.getIndexDirectory());
        repository.setIndexDirectory(indexDirectory.getAbsolutePath());
      }
    }
 else {
      indexDirectory=new File(repositoryDirectory,"String_Node_Str");
      if (!repositoryDirectory.isAbsolute()) {
        indexDirectory=new File(repositoryDirectory,"String_Node_Str");
        repository.setIndexDirectory(indexDirectory.getAbsolutePath());
      }
    }
    if (!indexDirectory.exists()) {
      indexDirectory.mkdirs();
    }
    context=indexer.getIndexingContexts().get(repository.getId());
    if (context == null) {
      context=indexer.addIndexingContext(repository.getId(),repository.getId(),repositoryDirectory,indexDirectory,repositoryDirectory.toURI().toURL().toExternalForm(),indexDirectory.toURI().toURL().toString(),indexCreators);
      context.setSearchable(repository.isScanned());
    }
    return context;
  }
 catch (  MalformedURLException e) {
    throw new RepositoryAdminException(e.getMessage(),e);
  }
catch (  IOException e) {
    throw new RepositoryAdminException(e.getMessage(),e);
  }
catch (  UnsupportedExistingLuceneIndexException e) {
    throw new RepositoryAdminException(e.getMessage(),e);
  }
}