Program: 160647
Project: 160647
Buggy source:
/** 
 * Create a new BIMserver
 * @param homeDir A directory where the user can store instance specific configuration files
 * @param resourceFetcher A resource fetcher
 */
public BimServer(BimServerConfig config){
  this.config=config;
  try {
    if (config.getHomeDir() != null) {
      initHomeDir();
    }
    fixLogging();
    LOGGER=LoggerFactory.getLogger(BimServer.class);
    LOGGER.info("String_Node_Str");
    if (config.getHomeDir() != null) {
      LOGGER.info("String_Node_Str" + config.getHomeDir().getAbsolutePath() + "String_Node_Str");
    }
 else {
      LOGGER.info("String_Node_Str");
    }
    serverInfoManager=new ServerInfoManager();
    UncaughtExceptionHandler uncaughtExceptionHandler=new UncaughtExceptionHandler(){
      @Override public void uncaughtException(      Thread t,      Throwable e){
        if (e instanceof OutOfMemoryError) {
          serverInfoManager.setOutOfMemory();
          LOGGER.error("String_Node_Str",e);
        }
 else         if (e instanceof Error) {
          serverInfoManager.setErrorMessage(e.getMessage());
          LOGGER.error("String_Node_Str",e);
        }
      }
    }
;
    Thread.setDefaultUncaughtExceptionHandler(uncaughtExceptionHandler);
    versionChecker=new VersionChecker(config.getResourceFetcher());
    SVersion localVersion=versionChecker.getLocalVersion();
    if (localVersion != null) {
      LOGGER.info("String_Node_Str" + localVersion.getMajor() + "String_Node_Str"+ localVersion.getMinor()+ "String_Node_Str"+ localVersion.getRevision()+ "String_Node_Str"+ localVersion.getDate());
    }
 else {
      LOGGER.info("String_Node_Str");
    }
    try {
      pluginManager=new PluginManager(config.getHomeDir(),config.getClassPath());
      pluginManager.addPluginChangeListener(new PluginChangeListener(){
        @Override public void pluginStateChanged(        PluginContext pluginContext,        boolean enabled){
          Condition pluginCondition=new AttributeCondition(StorePackage.eINSTANCE.getPlugin_Name(),new StringLiteral(pluginContext.getPlugin().getClass().getName()));
          BimDatabaseSession session=bimDatabase.createSession(true);
          try {
            Map<Long,org.bimserver.models.store.Plugin> pluginsFound=session.query(pluginCondition,org.bimserver.models.store.Plugin.class,false,null);
            if (pluginsFound.size() == 0) {
              LOGGER.error("String_Node_Str" + pluginContext.getPlugin().getClass().getName() + "String_Node_Str");
            }
 else             if (pluginsFound.size() == 1) {
              org.bimserver.models.store.Plugin pluginFound=pluginsFound.values().iterator().next();
              pluginFound.setEnabled(pluginContext.isEnabled());
              session.store(pluginFound);
            }
 else {
              LOGGER.error("String_Node_Str" + pluginContext.getPlugin().getClass().getName());
            }
            session.commit();
          }
 catch (          BimDatabaseException e) {
            e.printStackTrace();
          }
catch (          BimDeadlockException e) {
            e.printStackTrace();
          }
 finally {
            session.close();
          }
        }
      }
);
      pluginManager.loadPlugin(ObjectIDMPlugin.class,"String_Node_Str","String_Node_Str",new SchemaFieldObjectIDMPlugin());
    }
 catch (    Exception e) {
      e.printStackTrace();
      LOGGER.error("String_Node_Str",e);
    }
    clashDetectionCache=new ClashDetectionCache();
    compareCache=new CompareCache();
    if (config.isStartEmbeddedWebServer()) {
      embeddedWebServer=new EmbeddedWebServer(this);
    }
  }
 catch (  Throwable e) {
    if (LOGGER == null) {
      e.printStackTrace();
    }
    LOGGER.error("String_Node_Str",e);
    serverInfoManager.setErrorMessage(e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Create a new BIMserver
 * @param homeDir A directory where the user can store instance specific configuration files
 * @param resourceFetcher A resource fetcher
 */
public BimServer(BimServerConfig config){
  this.config=config;
  try {
    if (config.getHomeDir() != null) {
      initHomeDir();
    }
    fixLogging();
    LOGGER=LoggerFactory.getLogger(BimServer.class);
    LOGGER.info("String_Node_Str");
    if (config.getHomeDir() != null) {
      LOGGER.info("String_Node_Str" + config.getHomeDir().getAbsolutePath() + "String_Node_Str");
    }
 else {
      LOGGER.info("String_Node_Str");
    }
    serverInfoManager=new ServerInfoManager();
    UncaughtExceptionHandler uncaughtExceptionHandler=new UncaughtExceptionHandler(){
      @Override public void uncaughtException(      Thread t,      Throwable e){
        if (e instanceof OutOfMemoryError) {
          serverInfoManager.setOutOfMemory();
          LOGGER.error("String_Node_Str",e);
        }
 else         if (e instanceof Error) {
          serverInfoManager.setErrorMessage(e.getMessage());
          LOGGER.error("String_Node_Str",e);
        }
      }
    }
;
    Thread.setDefaultUncaughtExceptionHandler(uncaughtExceptionHandler);
    versionChecker=new VersionChecker(config.getResourceFetcher());
    try {
      pluginManager=new PluginManager(config.getHomeDir(),config.getClassPath());
      pluginManager.addPluginChangeListener(new PluginChangeListener(){
        @Override public void pluginStateChanged(        PluginContext pluginContext,        boolean enabled){
          Condition pluginCondition=new AttributeCondition(StorePackage.eINSTANCE.getPlugin_Name(),new StringLiteral(pluginContext.getPlugin().getClass().getName()));
          BimDatabaseSession session=bimDatabase.createSession(true);
          try {
            Map<Long,org.bimserver.models.store.Plugin> pluginsFound=session.query(pluginCondition,org.bimserver.models.store.Plugin.class,false,null);
            if (pluginsFound.size() == 0) {
              LOGGER.error("String_Node_Str" + pluginContext.getPlugin().getClass().getName() + "String_Node_Str");
            }
 else             if (pluginsFound.size() == 1) {
              org.bimserver.models.store.Plugin pluginFound=pluginsFound.values().iterator().next();
              pluginFound.setEnabled(pluginContext.isEnabled());
              session.store(pluginFound);
            }
 else {
              LOGGER.error("String_Node_Str" + pluginContext.getPlugin().getClass().getName());
            }
            session.commit();
          }
 catch (          BimDatabaseException e) {
            e.printStackTrace();
          }
catch (          BimDeadlockException e) {
            e.printStackTrace();
          }
 finally {
            session.close();
          }
        }
      }
);
      pluginManager.loadPlugin(ObjectIDMPlugin.class,"String_Node_Str","String_Node_Str",new SchemaFieldObjectIDMPlugin());
    }
 catch (    Exception e) {
      e.printStackTrace();
      LOGGER.error("String_Node_Str",e);
    }
    clashDetectionCache=new ClashDetectionCache();
    compareCache=new CompareCache();
    if (config.isStartEmbeddedWebServer()) {
      embeddedWebServer=new EmbeddedWebServer(this);
    }
  }
 catch (  Throwable e) {
    if (LOGGER == null) {
      e.printStackTrace();
    }
    LOGGER.error("String_Node_Str",e);
    serverInfoManager.setErrorMessage(e.getMessage());
  }
}