Program: 105987
Project: 105987
Buggy source:
@Override public boolean start(){
  Integer apiPort=null;
  SearchCriteria<ConfigurationVO> sc=_configDao.createSearchCriteria();
  sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,Config.IntegrationAPIPort.key());
  List<ConfigurationVO> values=_configDao.search(sc,null);
  if ((values != null) && (values.size() > 0)) {
    ConfigurationVO apiPortConfig=values.get(0);
    if (apiPortConfig.getValue() != null) {
      apiPort=Integer.parseInt(apiPortConfig.getValue());
    }
  }
  Map<String,String> configs=_configDao.getConfiguration();
  String strSnapshotLimit=configs.get(Config.ConcurrentSnapshotsThresholdPerHost.key());
  if (strSnapshotLimit != null) {
    Long snapshotLimit=NumbersUtil.parseLong(strSnapshotLimit,1L);
    if (snapshotLimit.longValue() <= 0) {
      s_logger.debug("String_Node_Str" + Config.ConcurrentSnapshotsThresholdPerHost.toString() + "String_Node_Str");
    }
 else {
      _dispatcher.setCreateSnapshotQueueSizeLimit(snapshotLimit);
    }
  }
  Set<Class<?>> cmdClasses=new HashSet<Class<?>>();
  for (  PluggableService pluggableService : _pluggableServices) {
    cmdClasses.addAll(pluggableService.getCommands());
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + pluggableService.getClass().getSimpleName());
    }
  }
  for (  Class<?> cmdClass : cmdClasses) {
    APICommand at=cmdClass.getAnnotation(APICommand.class);
    if (at == null) {
      throw new CloudRuntimeException(String.format("String_Node_Str",cmdClass.getName()));
    }
    String apiName=at.name();
    if (s_apiNameCmdClassMap.containsKey(apiName)) {
      s_logger.error("String_Node_Str" + cmdClass.getName() + "String_Node_Str"+ apiName);
      continue;
    }
    s_apiNameCmdClassMap.put(apiName,cmdClass);
  }
  encodeApiResponse=Boolean.valueOf(_configDao.getValue(Config.EncodeApiResponse.key()));
  String jsonType=_configDao.getValue(Config.JavaScriptDefaultContentType.key());
  if (jsonType != null) {
    jsonContentType=jsonType;
  }
  if (apiPort != null) {
    ListenerThread listenerThread=new ListenerThread(this,apiPort);
    listenerThread.start();
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean start(){
  Integer apiPort=null;
  SearchCriteria<ConfigurationVO> sc=_configDao.createSearchCriteria();
  sc.addAnd("String_Node_Str",SearchCriteria.Op.EQ,Config.IntegrationAPIPort.key());
  List<ConfigurationVO> values=_configDao.search(sc,null);
  if ((values != null) && (values.size() > 0)) {
    ConfigurationVO apiPortConfig=values.get(0);
    if (apiPortConfig.getValue() != null) {
      apiPort=Integer.parseInt(apiPortConfig.getValue());
    }
  }
  Map<String,String> configs=_configDao.getConfiguration();
  String strSnapshotLimit=configs.get(Config.ConcurrentSnapshotsThresholdPerHost.key());
  if (strSnapshotLimit != null) {
    Long snapshotLimit=NumbersUtil.parseLong(strSnapshotLimit,1L);
    if (snapshotLimit.longValue() <= 0) {
      s_logger.debug("String_Node_Str" + Config.ConcurrentSnapshotsThresholdPerHost.toString() + "String_Node_Str");
    }
 else {
      _dispatcher.setCreateSnapshotQueueSizeLimit(snapshotLimit);
    }
  }
  Set<Class<?>> cmdClasses=new HashSet<Class<?>>();
  for (  PluggableService pluggableService : _pluggableServices) {
    cmdClasses.addAll(pluggableService.getCommands());
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + pluggableService.getClass().getSimpleName());
    }
  }
  for (  Class<?> cmdClass : cmdClasses) {
    APICommand at=cmdClass.getAnnotation(APICommand.class);
    if (at == null) {
      throw new CloudRuntimeException(String.format("String_Node_Str",cmdClass.getName()));
    }
    String apiName=at.name();
    if (s_apiNameCmdClassMap.containsKey(apiName)) {
      s_logger.error("String_Node_Str" + cmdClass.getName() + "String_Node_Str"+ apiName);
      continue;
    }
    s_apiNameCmdClassMap.put(apiName,cmdClass);
  }
  setEncodeApiResponse(Boolean.valueOf(_configDao.getValue(Config.EncodeApiResponse.key())));
  String jsonType=_configDao.getValue(Config.JavaScriptDefaultContentType.key());
  if (jsonType != null) {
    jsonContentType=jsonType;
  }
  if (apiPort != null) {
    ListenerThread listenerThread=new ListenerThread(this,apiPort);
    listenerThread.start();
  }
  return true;
}