Program: 106073
Project: 106073
Buggy source:
@Override public ImageStore createSecondaryStagingStore(CreateSecondaryStagingStoreCmd cmd){
  String providerName=cmd.getProviderName();
  DataStoreProvider storeProvider=_dataStoreProviderMgr.getDataStoreProvider(providerName);
  if (storeProvider == null) {
    storeProvider=_dataStoreProviderMgr.getDefaultCacheDataStoreProvider();
    if (storeProvider == null) {
      throw new InvalidParameterValueException("String_Node_Str" + providerName);
    }
  }
  Long dcId=cmd.getZoneId();
  ScopeType scopeType=null;
  String scope=cmd.getScope();
  if (scope != null) {
    try {
      scopeType=Enum.valueOf(ScopeType.class,scope.toUpperCase());
    }
 catch (    Exception e) {
      throw new InvalidParameterValueException("String_Node_Str" + scope);
    }
    if (scopeType != ScopeType.ZONE) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
  }
  if (scopeType == ScopeType.ZONE && dcId == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  DataCenterVO zone=_dcDao.findById(dcId);
  if (zone == null) {
    throw new InvalidParameterValueException("String_Node_Str" + dcId);
  }
  Account account=CallContext.current().getCallingAccount();
  if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(account.getType())) {
    PermissionDeniedException ex=new PermissionDeniedException("String_Node_Str");
    ex.addProxyObject(zone.getUuid(),"String_Node_Str");
    throw ex;
  }
  Map<String,Object> params=new HashMap<String,Object>();
  params.put("String_Node_Str",dcId);
  params.put("String_Node_Str",cmd.getUrl());
  params.put("String_Node_Str",cmd.getUrl());
  params.put("String_Node_Str",cmd.getDetails());
  params.put("String_Node_Str",scopeType);
  params.put("String_Node_Str",storeProvider.getName());
  params.put("String_Node_Str",DataStoreRole.ImageCache);
  DataStoreLifeCycle lifeCycle=storeProvider.getDataStoreLifeCycle();
  DataStore store=null;
  try {
    store=lifeCycle.initialize(params);
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str",e);
    throw new CloudRuntimeException("String_Node_Str",e);
  }
  return (ImageStore)_dataStoreMgr.getDataStore(store.getId(),DataStoreRole.ImageCache);
}

Fixed version (ground truth):
@Override public ImageStore createSecondaryStagingStore(CreateSecondaryStagingStoreCmd cmd){
  String providerName=cmd.getProviderName();
  DataStoreProvider storeProvider=_dataStoreProviderMgr.getDataStoreProvider(providerName);
  if (storeProvider == null) {
    storeProvider=_dataStoreProviderMgr.getDefaultCacheDataStoreProvider();
    if (storeProvider == null) {
      throw new InvalidParameterValueException("String_Node_Str" + providerName);
    }
  }
  Long dcId=cmd.getZoneId();
  ScopeType scopeType=null;
  String scope=cmd.getScope();
  if (scope != null) {
    try {
      scopeType=Enum.valueOf(ScopeType.class,scope.toUpperCase());
    }
 catch (    Exception e) {
      throw new InvalidParameterValueException("String_Node_Str" + scope);
    }
    if (scopeType != ScopeType.ZONE) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
  }
  if (scopeType == ScopeType.ZONE && dcId == null) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  DataCenterVO zone=_dcDao.findById(dcId);
  if (zone == null) {
    throw new InvalidParameterValueException("String_Node_Str" + dcId);
  }
  Account account=CallContext.current().getCallingAccount();
  if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(account.getType())) {
    PermissionDeniedException ex=new PermissionDeniedException("String_Node_Str");
    ex.addProxyObject(zone.getUuid(),"String_Node_Str");
    throw ex;
  }
  Map<String,Object> params=new HashMap<String,Object>();
  params.put("String_Node_Str",dcId);
  params.put("String_Node_Str",cmd.getUrl());
  params.put("String_Node_Str",cmd.getUrl());
  params.put("String_Node_Str",cmd.getDetails());
  params.put("String_Node_Str",scopeType);
  params.put("String_Node_Str",storeProvider.getName());
  params.put("String_Node_Str",DataStoreRole.ImageCache);
  DataStoreLifeCycle lifeCycle=storeProvider.getDataStoreLifeCycle();
  DataStore store=null;
  try {
    store=lifeCycle.initialize(params);
  }
 catch (  Exception e) {
    s_logger.debug("String_Node_Str" + e.getMessage(),e);
    throw new CloudRuntimeException("String_Node_Str" + e.getMessage(),e);
  }
  return (ImageStore)_dataStoreMgr.getDataStore(store.getId(),DataStoreRole.ImageCache);
}