Program: 89278
Project: 89278
Buggy source:
@Override @ActionEvent(eventType=EventTypes.EVENT_SERVICE_PROVIDER_UPDATE,eventDescription="String_Node_Str",async=true) public PhysicalNetworkServiceProvider updateNetworkServiceProvider(Long id,String stateStr,List<String> enabledServices){
  PhysicalNetworkServiceProviderVO provider=_pNSPDao.findById(id);
  if (provider == null) {
    throw new InvalidParameterValueException("String_Node_Str" + id + "String_Node_Str");
  }
  NetworkElement element=getElementImplementingProvider(provider.getProviderName());
  if (element == null) {
    throw new InvalidParameterValueException("String_Node_Str" + provider.getProviderName() + "String_Node_Str");
  }
  PhysicalNetworkServiceProvider.State state=null;
  if (stateStr != null && !stateStr.isEmpty()) {
    try {
      state=PhysicalNetworkServiceProvider.State.valueOf(stateStr);
    }
 catch (    IllegalArgumentException ex) {
      throw new InvalidParameterValueException("String_Node_Str" + stateStr + "String_Node_Str");
    }
  }
  boolean update=false;
  if (state != null) {
    if (state == PhysicalNetworkServiceProvider.State.Shutdown) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + id + "String_Node_Str"+ provider.getPhysicalNetworkId()+ "String_Node_Str"+ stateStr);
    }
switch (state) {
case Enabled:
      if (element != null && element.isReady(provider)) {
        provider.setState(PhysicalNetworkServiceProvider.State.Enabled);
        update=true;
      }
    break;
case Disabled:
  provider.setState(PhysicalNetworkServiceProvider.State.Disabled);
update=true;
break;
}
}
if (enabledServices != null) {
if (!element.canEnableIndividualServices()) {
throw new InvalidParameterValueException("String_Node_Str" + provider.getProviderName() + "String_Node_Str");
}
List<Service> services=new ArrayList<Service>();
for (String serviceName : enabledServices) {
Network.Service service=Network.Service.getService(serviceName);
if (service == null) {
throw new InvalidParameterValueException("String_Node_Str" + serviceName);
}
services.add(service);
}
provider.setEnabledServices(services);
update=true;
}
if (update) {
_pNSPDao.update(id,provider);
}
return provider;
}

Fixed version (ground truth):
@Override @ActionEvent(eventType=EventTypes.EVENT_SERVICE_PROVIDER_UPDATE,eventDescription="String_Node_Str",async=true) public PhysicalNetworkServiceProvider updateNetworkServiceProvider(Long id,String stateStr,List<String> enabledServices){
  PhysicalNetworkServiceProviderVO provider=_pNSPDao.findById(id);
  if (provider == null) {
    throw new InvalidParameterValueException("String_Node_Str" + id + "String_Node_Str");
  }
  NetworkElement element=getElementImplementingProvider(provider.getProviderName());
  if (element == null) {
    throw new InvalidParameterValueException("String_Node_Str" + provider.getProviderName() + "String_Node_Str");
  }
  PhysicalNetworkServiceProvider.State state=null;
  if (stateStr != null && !stateStr.isEmpty()) {
    try {
      state=PhysicalNetworkServiceProvider.State.valueOf(stateStr);
    }
 catch (    IllegalArgumentException ex) {
      throw new InvalidParameterValueException("String_Node_Str" + stateStr + "String_Node_Str");
    }
  }
  boolean update=false;
  if (state != null) {
    if (state == PhysicalNetworkServiceProvider.State.Shutdown) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    if (s_logger.isDebugEnabled()) {
      s_logger.debug("String_Node_Str" + id + "String_Node_Str"+ provider.getPhysicalNetworkId()+ "String_Node_Str"+ stateStr);
    }
switch (state) {
case Enabled:
      if (element != null && element.isReady(provider)) {
        provider.setState(PhysicalNetworkServiceProvider.State.Enabled);
        update=true;
      }
 else {
        throw new CloudRuntimeException("String_Node_Str");
      }
    break;
case Disabled:
  provider.setState(PhysicalNetworkServiceProvider.State.Disabled);
update=true;
break;
}
}
if (enabledServices != null) {
if (!element.canEnableIndividualServices()) {
throw new InvalidParameterValueException("String_Node_Str" + provider.getProviderName() + "String_Node_Str");
}
List<Service> services=new ArrayList<Service>();
for (String serviceName : enabledServices) {
Network.Service service=Network.Service.getService(serviceName);
if (service == null) {
throw new InvalidParameterValueException("String_Node_Str" + serviceName);
}
services.add(service);
}
provider.setEnabledServices(services);
update=true;
}
if (update) {
_pNSPDao.update(id,provider);
}
return provider;
}