Program: 154515
Project: 154515
Buggy source:
/** 
 * A non-standard way of creating an embedded   {@link GraphDatabaseService}with a set of configuration parameters. Will most likely be removed in future releases.
 * @param storeDir the store directory for the db files
 * @param fileSystem 
 * @param config configuration parameters
 */
public EmbeddedGraphDbImpl(String storeDir,StoreId storeId,Map<String,String> inputParams,GraphDatabaseService graphDbService,LockManagerFactory lockManagerFactory,IdGeneratorFactory idGeneratorFactory,RelationshipTypeCreator relTypeCreator,TxIdGeneratorFactory txIdFactory,TxFinishHook finishHook,LastCommittedTxIdSetter lastCommittedTxIdSetter,FileSystemAbstraction fileSystem){
  this.storeDir=storeDir;
  TxModule txModule=newTxModule(inputParams,finishHook);
  LockManager lockManager=lockManagerFactory.create(txModule);
  LockReleaser lockReleaser=new LockReleaser(lockManager,txModule.getTxManager());
  final Config config=new Config(graphDbService,storeDir,storeId,inputParams,kernelPanicEventGenerator,txModule,lockManager,lockReleaser,idGeneratorFactory,new SyncHookFactory(),relTypeCreator,txIdFactory.create(txModule.getTxManager()),lastCommittedTxIdSetter,fileSystem,CommonFactories.defaultLogBufferFactory(inputParams));
  graphDbInstance=new GraphDbInstance(storeDir,true,config);
  this.msgLog=StringLogger.getLogger(storeDir);
  this.graphDbService=graphDbService;
  IndexStore indexStore=graphDbInstance.getConfig().getIndexStore();
  this.indexManager=new IndexManagerImpl(this,indexStore);
  extensions=new KernelData(){
    @Override public Version version(){
      return Version.getKernel();
    }
    @Override public Config getConfig(){
      return config;
    }
    @Override public Map<Object,Object> getConfigParams(){
      return config.getParams();
    }
    @Override public GraphDatabaseService graphDatabase(){
      return EmbeddedGraphDbImpl.this.graphDbService;
    }
  }
;
  boolean started=false;
  try {
    final KernelExtensionLoader extensionLoader;
    if ("String_Node_Str".equalsIgnoreCase(inputParams.get(Config.LOAD_EXTENSIONS))) {
      extensionLoader=KernelExtensionLoader.DONT_LOAD;
    }
 else {
      extensionLoader=new KernelExtensionLoader(){
        private Collection<KernelExtension<?>> loaded;
        public void configureKernelExtensions(){
          loaded=extensions.loadExtensionConfigurations(msgLog);
        }
        public void initializeIndexProviders(){
          extensions.loadIndexImplementations(indexManager,msgLog);
        }
        public void load(){
          extensions.loadExtensions(loaded,msgLog);
        }
      }
;
    }
    graphDbInstance.start(graphDbService,extensionLoader);
    nodeManager=config.getGraphDbModule().getNodeManager();
    extensionLoader.load();
    started=true;
  }
 catch (  Error cause) {
    msgLog.logMessage("String_Node_Str",cause);
    throw cause;
  }
catch (  RuntimeException cause) {
    msgLog.logMessage("String_Node_Str",cause);
    throw cause;
  }
 finally {
    if (!started)     extensions.shutdown(msgLog);
  }
}

Fixed version (ground truth):
/** 
 * A non-standard way of creating an embedded   {@link GraphDatabaseService}with a set of configuration parameters. Will most likely be removed in future releases.
 * @param storeDir the store directory for the db files
 * @param fileSystem 
 * @param config configuration parameters
 */
public EmbeddedGraphDbImpl(String storeDir,StoreId storeId,Map<String,String> inputParams,GraphDatabaseService graphDbService,LockManagerFactory lockManagerFactory,IdGeneratorFactory idGeneratorFactory,RelationshipTypeCreator relTypeCreator,TxIdGeneratorFactory txIdFactory,TxFinishHook finishHook,LastCommittedTxIdSetter lastCommittedTxIdSetter,FileSystemAbstraction fileSystem){
  this.storeDir=storeDir;
  TxModule txModule=newTxModule(inputParams,finishHook);
  LockManager lockManager=lockManagerFactory.create(txModule);
  LockReleaser lockReleaser=new LockReleaser(lockManager,txModule.getTxManager());
  final Config config=new Config(graphDbService,storeDir,storeId,inputParams,kernelPanicEventGenerator,txModule,lockManager,lockReleaser,idGeneratorFactory,new SyncHookFactory(),relTypeCreator,txIdFactory.create(txModule.getTxManager()),lastCommittedTxIdSetter,fileSystem);
  config.getParams().put(LogBufferFactory.class,CommonFactories.defaultLogBufferFactory(config.getParams()));
  graphDbInstance=new GraphDbInstance(storeDir,true,config);
  this.msgLog=StringLogger.getLogger(storeDir);
  this.graphDbService=graphDbService;
  IndexStore indexStore=graphDbInstance.getConfig().getIndexStore();
  this.indexManager=new IndexManagerImpl(this,indexStore);
  extensions=new KernelData(){
    @Override public Version version(){
      return Version.getKernel();
    }
    @Override public Config getConfig(){
      return config;
    }
    @Override public Map<Object,Object> getConfigParams(){
      return config.getParams();
    }
    @Override public GraphDatabaseService graphDatabase(){
      return EmbeddedGraphDbImpl.this.graphDbService;
    }
  }
;
  boolean started=false;
  try {
    final KernelExtensionLoader extensionLoader;
    if ("String_Node_Str".equalsIgnoreCase(inputParams.get(Config.LOAD_EXTENSIONS))) {
      extensionLoader=KernelExtensionLoader.DONT_LOAD;
    }
 else {
      extensionLoader=new KernelExtensionLoader(){
        private Collection<KernelExtension<?>> loaded;
        @Override public void configureKernelExtensions(){
          loaded=extensions.loadExtensionConfigurations(msgLog);
        }
        @Override public void initializeIndexProviders(){
          extensions.loadIndexImplementations(indexManager,msgLog);
        }
        @Override public void load(){
          extensions.loadExtensions(loaded,msgLog);
        }
      }
;
    }
    graphDbInstance.start(graphDbService,extensionLoader);
    nodeManager=config.getGraphDbModule().getNodeManager();
    extensionLoader.load();
    started=true;
  }
 catch (  Error cause) {
    msgLog.logMessage("String_Node_Str",cause);
    throw cause;
  }
catch (  RuntimeException cause) {
    msgLog.logMessage("String_Node_Str",cause);
    throw cause;
  }
 finally {
    if (!started)     extensions.shutdown(msgLog);
  }
}