nus-yam/ex-repair huggingface dataset:
Program: 105670
Project: 105670
Buggy source:
public Map<String,String> getDetails(){
  Map<String,String> customparameterMap=new HashMap<String,String>();
  if (details != null && details.size() != 0) {
    Collection parameterCollection=details.values();
    Iterator iter=parameterCollection.iterator();
    while (iter.hasNext()) {
      HashMap<String,String> value=(HashMap<String,String>)iter.next();
      for (      Map.Entry<String,String> entry : value.entrySet()) {
        customparameterMap.put(entry.getKey(),entry.getValue());
      }
    }
  }
  if (rootdisksize != null && !customparameterMap.containsKey("String_Node_Str")) {
    customparameterMap.put("String_Node_Str",rootdisksize.toString());
  }
  return customparameterMap;
}

Fixed version (ground truth):
public Map<String,String> getDetails(){
  Map<String,String> customparameterMap=new HashMap<String,String>();
  if (details != null && details.size() != 0) {
    Collection parameterCollection=details.values();
    Iterator iter=parameterCollection.iterator();
    while (iter.hasNext()) {
      HashMap<String,String> value=(HashMap<String,String>)iter.next();
      for (      String key : value.keySet()) {
        customparameterMap.put(key,value.get(key));
      }
    }
  }
  if (rootdisksize != null && !customparameterMap.containsKey("String_Node_Str")) {
    customparameterMap.put("String_Node_Str",rootdisksize.toString());
  }
  return customparameterMap;
}
Program: 105671
Project: 105671
Buggy source:
@Override public List<VMTemplateStoragePoolVO> listByTemplateStatus(long templateId,long datacenterId,long podId,VMTemplateStoragePoolVO.Status downloadState){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  List<VMTemplateStoragePoolVO> result=new ArrayList<VMTemplateStoragePoolVO>();
  String sql=DOWNLOADS_STATE_DC_POD;
  try (PreparedStatement pstmt=txn.prepareStatement(sql)){
    pstmt.setLong(1,datacenterId);
    pstmt.setLong(2,podId);
    pstmt.setLong(3,templateId);
    pstmt.setString(4,downloadState.toString());
    try (ResultSet rs=pstmt.executeQuery()){
      while (rs.next()) {
        long id=rs.getLong(1);
        result.add(findById(id));
      }
    }
 catch (    Exception e) {
      s_logger.warn("String_Node_Str",e);
    }
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str",e);
  }
  return result;
}

Fixed version (ground truth):
@Override public List<VMTemplateStoragePoolVO> listByTemplateStatus(long templateId,long datacenterId,long podId,VMTemplateStoragePoolVO.Status downloadState){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  PreparedStatement pstmt=null;
  List<VMTemplateStoragePoolVO> result=new ArrayList<VMTemplateStoragePoolVO>();
  ResultSet rs=null;
  try {
    String sql=DOWNLOADS_STATE_DC_POD;
    pstmt=txn.prepareStatement(sql);
    pstmt.setLong(1,datacenterId);
    pstmt.setLong(2,podId);
    pstmt.setLong(3,templateId);
    pstmt.setString(4,downloadState.toString());
    rs=pstmt.executeQuery();
    while (rs.next()) {
      long id=rs.getLong(1);
      result.add(findById(id));
    }
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str",e);
  }
 finally {
    try {
      if (rs != null) {
        rs.close();
      }
      if (pstmt != null) {
        pstmt.close();
      }
    }
 catch (    SQLException e) {
    }
  }
  return result;
}
Program: 105672
Project: 105672
Buggy source:
public List<VMTemplateStoragePoolVO> listByHostTemplate(long hostId,long templateId){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  List<VMTemplateStoragePoolVO> result=new ArrayList<VMTemplateStoragePoolVO>();
  String sql=HOST_TEMPLATE_SEARCH;
  try (PreparedStatement pstmt=txn.prepareStatement(sql)){
    pstmt.setLong(1,hostId);
    pstmt.setLong(2,templateId);
    try (ResultSet rs=pstmt.executeQuery()){
      while (rs.next()) {
        long id=rs.getLong(1);
        result.add(findById(id));
      }
    }
 catch (    Exception e) {
      s_logger.warn("String_Node_Str",e);
    }
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str",e);
  }
  return result;
}

Fixed version (ground truth):
public List<VMTemplateStoragePoolVO> listByHostTemplate(long hostId,long templateId){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  PreparedStatement pstmt=null;
  List<VMTemplateStoragePoolVO> result=new ArrayList<VMTemplateStoragePoolVO>();
  ResultSet rs=null;
  try {
    String sql=HOST_TEMPLATE_SEARCH;
    pstmt=txn.prepareStatement(sql);
    pstmt.setLong(1,hostId);
    pstmt.setLong(2,templateId);
    rs=pstmt.executeQuery();
    while (rs.next()) {
      long id=rs.getLong(1);
      result.add(findById(id));
    }
  }
 catch (  Exception e) {
    s_logger.warn("String_Node_Str",e);
  }
 finally {
    try {
      if (rs != null) {
        rs.close();
      }
      if (pstmt != null) {
        pstmt.close();
      }
    }
 catch (    SQLException e) {
    }
  }
  return result;
}
Program: 105673
Project: 105673
Buggy source:
private void dropInvalidKeyFromStoragePoolTable(Connection conn){
  HashMap<String,List<String>> uniqueKeys=new HashMap<String,List<String>>();
  List<String> keys=new ArrayList<String>();
  keys.add("String_Node_Str");
  uniqueKeys.put("String_Node_Str",keys);
  s_logger.debug("String_Node_Str");
  for (  Map.Entry<String,List<String>> entry : uniqueKeys.entrySet()) {
    DbUpgradeUtils.dropKeysIfExist(conn,entry.getKey(),entry.getValue(),false);
  }
}

Fixed version (ground truth):
private void dropInvalidKeyFromStoragePoolTable(Connection conn){
  HashMap<String,List<String>> uniqueKeys=new HashMap<String,List<String>>();
  List<String> keys=new ArrayList<String>();
  keys.add("String_Node_Str");
  uniqueKeys.put("String_Node_Str",keys);
  s_logger.debug("String_Node_Str");
  for (  String tableName : uniqueKeys.keySet()) {
    DbUpgradeUtils.dropKeysIfExist(conn,tableName,uniqueKeys.get(tableName),false);
  }
}
Program: 105674
Project: 105674
Buggy source:
@DB protected EndPoint findEndPointInScope(Scope scope,String sqlBase,Long poolId){
  StringBuilder sbuilder=new StringBuilder();
  sbuilder.append(sqlBase);
  if (scope.getScopeType() == ScopeType.HOST) {
    sbuilder.append("String_Node_Str");
    sbuilder.append(scope.getScopeId());
  }
 else   if (scope.getScopeType() == ScopeType.CLUSTER) {
    sbuilder.append("String_Node_Str");
    sbuilder.append(scope.getScopeId());
  }
 else   if (scope.getScopeType() == ScopeType.ZONE) {
    sbuilder.append("String_Node_Str");
    sbuilder.append(scope.getScopeId());
  }
  sbuilder.append("String_Node_Str");
  String sql=sbuilder.toString();
  HostVO host=null;
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  try (PreparedStatement pstmt=txn.prepareStatement(sql)){
    pstmt.setLong(1,poolId);
    try (ResultSet rs=pstmt.executeQuery()){
      while (rs.next()) {
        long id=rs.getLong(1);
        host=hostDao.findById(id);
      }
    }
 catch (    SQLException e) {
      s_logger.warn("String_Node_Str",e);
    }
  }
 catch (  SQLException e) {
    s_logger.warn("String_Node_Str",e);
  }
  if (host == null) {
    return null;
  }
  return RemoteHostEndPoint.getHypervisorHostEndPoint(host);
}

Fixed version (ground truth):
@DB protected EndPoint findEndPointInScope(Scope scope,String sqlBase,Long poolId){
  StringBuilder sbuilder=new StringBuilder();
  sbuilder.append(sqlBase);
  if (scope.getScopeType() == ScopeType.HOST) {
    sbuilder.append("String_Node_Str");
    sbuilder.append(scope.getScopeId());
  }
 else   if (scope.getScopeType() == ScopeType.CLUSTER) {
    sbuilder.append("String_Node_Str");
    sbuilder.append(scope.getScopeId());
  }
 else   if (scope.getScopeType() == ScopeType.ZONE) {
    sbuilder.append("String_Node_Str");
    sbuilder.append(scope.getScopeId());
  }
  sbuilder.append("String_Node_Str");
  String sql=sbuilder.toString();
  PreparedStatement pstmt=null;
  ResultSet rs=null;
  HostVO host=null;
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  try {
    pstmt=txn.prepareStatement(sql);
    pstmt.setLong(1,poolId);
    rs=pstmt.executeQuery();
    while (rs.next()) {
      long id=rs.getLong(1);
      host=hostDao.findById(id);
    }
  }
 catch (  SQLException e) {
    s_logger.warn("String_Node_Str",e);
  }
 finally {
    try {
      if (rs != null) {
        rs.close();
      }
      if (pstmt != null) {
        pstmt.close();
      }
    }
 catch (    SQLException e) {
    }
  }
  if (host == null) {
    return null;
  }
  return RemoteHostEndPoint.getHypervisorHostEndPoint(host);
}
Program: 105679
Project: 105679
Buggy source:
@Override public VpcOfferingResponse createVpcOfferingResponse(VpcOffering offering){
  VpcOfferingResponse response=new VpcOfferingResponse();
  response.setId(offering.getUuid());
  response.setName(offering.getName());
  response.setDisplayText(offering.getDisplayText());
  response.setIsDefault(offering.isDefault());
  response.setState(offering.getState().name());
  response.setSupportsDistributedRouter(offering.supportsDistributedRouter());
  response.setSupportsRegionLevelVpc(offering.offersRegionLevelVPC());
  Map<Service,Set<Provider>> serviceProviderMap=ApiDBUtils.listVpcOffServices(offering.getId());
  List<ServiceResponse> serviceResponses=new ArrayList<ServiceResponse>();
  for (  Map.Entry<Service,Set<Provider>> entry : serviceProviderMap.entrySet()) {
    Service service=entry.getKey();
    Set<Provider> srvc_providers=entry.getValue();
    ServiceResponse svcRsp=new ServiceResponse();
    if (service == Service.Gateway) {
      continue;
    }
    svcRsp.setName(service.getName());
    List<ProviderResponse> providers=new ArrayList<ProviderResponse>();
    for (    Provider provider : srvc_providers) {
      if (provider != null) {
        ProviderResponse providerRsp=new ProviderResponse();
        providerRsp.setName(provider.getName());
        providers.add(providerRsp);
      }
    }
    svcRsp.setProviders(providers);
    serviceResponses.add(svcRsp);
  }
  response.setServices(serviceResponses);
  response.setObjectName("String_Node_Str");
  return response;
}

Fixed version (ground truth):
@Override public VpcOfferingResponse createVpcOfferingResponse(VpcOffering offering){
  VpcOfferingResponse response=new VpcOfferingResponse();
  response.setId(offering.getUuid());
  response.setName(offering.getName());
  response.setDisplayText(offering.getDisplayText());
  response.setIsDefault(offering.isDefault());
  response.setState(offering.getState().name());
  response.setSupportsDistributedRouter(offering.supportsDistributedRouter());
  response.setSupportsRegionLevelVpc(offering.offersRegionLevelVPC());
  Map<Service,Set<Provider>> serviceProviderMap=ApiDBUtils.listVpcOffServices(offering.getId());
  List<ServiceResponse> serviceResponses=new ArrayList<ServiceResponse>();
  for (  Service service : serviceProviderMap.keySet()) {
    ServiceResponse svcRsp=new ServiceResponse();
    if (service == Service.Gateway) {
      continue;
    }
    svcRsp.setName(service.getName());
    List<ProviderResponse> providers=new ArrayList<ProviderResponse>();
    for (    Provider provider : serviceProviderMap.get(service)) {
      if (provider != null) {
        ProviderResponse providerRsp=new ProviderResponse();
        providerRsp.setName(provider.getName());
        providers.add(providerRsp);
      }
    }
    svcRsp.setProviders(providers);
    serviceResponses.add(svcRsp);
  }
  response.setServices(serviceResponses);
  response.setObjectName("String_Node_Str");
  return response;
}
Program: 105680
Project: 105680
Buggy source:
@Override public IpForwardingRuleResponse createIpForwardingRuleResponse(StaticNatRule fwRule){
  IpForwardingRuleResponse response=new IpForwardingRuleResponse();
  response.setId(fwRule.getUuid());
  response.setProtocol(fwRule.getProtocol());
  IpAddress ip=ApiDBUtils.findIpAddressById(fwRule.getSourceIpAddressId());
  if (ip != null) {
    response.setPublicIpAddressId(ip.getId());
    response.setPublicIpAddress(ip.getAddress().addr());
    if (fwRule.getDestIpAddress() != null) {
      UserVm vm=ApiDBUtils.findUserVmById(ip.getAssociatedWithVmId());
      if (vm != null) {
        response.setVirtualMachineId(vm.getUuid());
        response.setVirtualMachineName(vm.getHostName());
        if (vm.getDisplayName() != null) {
          response.setVirtualMachineDisplayName(vm.getDisplayName());
        }
 else {
          response.setVirtualMachineDisplayName(vm.getHostName());
        }
      }
    }
  }
  FirewallRule.State state=fwRule.getState();
  String stateToSet=state.toString();
  if (state.equals(FirewallRule.State.Revoke)) {
    stateToSet="String_Node_Str";
  }
  response.setStartPort(fwRule.getSourcePortStart());
  response.setEndPort(fwRule.getSourcePortEnd());
  response.setProtocol(fwRule.getProtocol());
  response.setState(stateToSet);
  response.setObjectName("String_Node_Str");
  return response;
}

Fixed version (ground truth):
@Override public IpForwardingRuleResponse createIpForwardingRuleResponse(StaticNatRule fwRule){
  IpForwardingRuleResponse response=new IpForwardingRuleResponse();
  response.setId(fwRule.getUuid());
  response.setProtocol(fwRule.getProtocol());
  IpAddress ip=ApiDBUtils.findIpAddressById(fwRule.getSourceIpAddressId());
  response.setPublicIpAddressId(ip.getId());
  response.setPublicIpAddress(ip.getAddress().addr());
  if (ip != null && fwRule.getDestIpAddress() != null) {
    UserVm vm=ApiDBUtils.findUserVmById(ip.getAssociatedWithVmId());
    if (vm != null) {
      response.setVirtualMachineId(vm.getUuid());
      response.setVirtualMachineName(vm.getHostName());
      if (vm.getDisplayName() != null) {
        response.setVirtualMachineDisplayName(vm.getDisplayName());
      }
 else {
        response.setVirtualMachineDisplayName(vm.getHostName());
      }
    }
  }
  FirewallRule.State state=fwRule.getState();
  String stateToSet=state.toString();
  if (state.equals(FirewallRule.State.Revoke)) {
    stateToSet="String_Node_Str";
  }
  response.setStartPort(fwRule.getSourcePortStart());
  response.setEndPort(fwRule.getSourcePortEnd());
  response.setProtocol(fwRule.getProtocol());
  response.setState(stateToSet);
  response.setObjectName("String_Node_Str");
  return response;
}
Program: 105685
Project: 105685
Buggy source:
private static void enableSslFeature(nitro_service ns) throws ExecutionException {
  try {
    base_response result=ns.enable_features(new String[]{"String_Node_Str"});
    if (result.errorcode != 0)     throw new ExecutionException("String_Node_Str");
  }
 catch (  nitro_exception e) {
    throw new ExecutionException("String_Node_Str" + e.getMessage());
  }
catch (  Exception e) {
    throw new ExecutionException("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
private static void enableSslFeature(nitro_service ns,boolean isSdx) throws ExecutionException {
  if (isSdx) {
    return;
  }
  try {
    base_response result=ns.enable_features(new String[]{"String_Node_Str"});
    if (result.errorcode != 0)     throw new ExecutionException("String_Node_Str");
  }
 catch (  nitro_exception e) {
    throw new ExecutionException("String_Node_Str" + e.getMessage());
  }
catch (  Exception e) {
    throw new ExecutionException("String_Node_Str" + e.getMessage());
  }
}
Program: 105687
Project: 105687
Buggy source:
@Override public void removeCustomOfferingDetails(long vmId){
  Map<String,String> details=_uservmDetailsDao.listDetailsKeyPairs(vmId);
  details.remove(UsageEventVO.DynamicParameters.cpuNumber.name());
  details.remove(UsageEventVO.DynamicParameters.cpuSpeed.name());
  details.remove(UsageEventVO.DynamicParameters.memory.name());
  List<UserVmDetailVO> detailList=new ArrayList<UserVmDetailVO>();
  for (  String key : details.keySet()) {
    UserVmDetailVO detailVO=new UserVmDetailVO(vmId,key,details.get(key),true);
    detailList.add(detailVO);
  }
  _uservmDetailsDao.saveDetails(detailList);
}

Fixed version (ground truth):
@Override public void removeCustomOfferingDetails(long vmId){
  Map<String,String> details=_uservmDetailsDao.listDetailsKeyPairs(vmId);
  details.remove(UsageEventVO.DynamicParameters.cpuNumber.name());
  details.remove(UsageEventVO.DynamicParameters.cpuSpeed.name());
  details.remove(UsageEventVO.DynamicParameters.memory.name());
  List<UserVmDetailVO> detailList=new ArrayList<UserVmDetailVO>();
  for (  Map.Entry<String,String> entry : details.entrySet()) {
    UserVmDetailVO detailVO=new UserVmDetailVO(vmId,entry.getKey(),entry.getValue(),true);
    detailList.add(detailVO);
  }
  _uservmDetailsDao.saveDetails(detailList);
}
Program: 105688
Project: 105688
Buggy source:
@Override public HashMap<Long,List<VmDiskStatsEntry>> getVmDiskStatistics(long hostId,String hostName,List<Long> vmIds) throws CloudRuntimeException {
  HashMap<Long,List<VmDiskStatsEntry>> vmDiskStatsById=new HashMap<Long,List<VmDiskStatsEntry>>();
  if (vmIds.isEmpty()) {
    return vmDiskStatsById;
  }
  List<String> vmNames=new ArrayList<String>();
  for (  Long vmId : vmIds) {
    UserVmVO vm=_vmDao.findById(vmId);
    vmNames.add(vm.getInstanceName());
  }
  Answer answer=_agentMgr.easySend(hostId,new GetVmDiskStatsCommand(vmNames,_hostDao.findById(hostId).getGuid(),hostName));
  if (answer == null || !answer.getResult()) {
    s_logger.warn("String_Node_Str");
    return null;
  }
 else {
    HashMap<String,List<VmDiskStatsEntry>> vmDiskStatsByName=((GetVmDiskStatsAnswer)answer).getVmDiskStatsMap();
    if (vmDiskStatsByName == null) {
      s_logger.warn("String_Node_Str");
      return null;
    }
    for (    String vmName : vmDiskStatsByName.keySet()) {
      vmDiskStatsById.put(vmIds.get(vmNames.indexOf(vmName)),vmDiskStatsByName.get(vmName));
    }
  }
  return vmDiskStatsById;
}

Fixed version (ground truth):
@Override public HashMap<Long,List<VmDiskStatsEntry>> getVmDiskStatistics(long hostId,String hostName,List<Long> vmIds) throws CloudRuntimeException {
  HashMap<Long,List<VmDiskStatsEntry>> vmDiskStatsById=new HashMap<Long,List<VmDiskStatsEntry>>();
  if (vmIds.isEmpty()) {
    return vmDiskStatsById;
  }
  List<String> vmNames=new ArrayList<String>();
  for (  Long vmId : vmIds) {
    UserVmVO vm=_vmDao.findById(vmId);
    vmNames.add(vm.getInstanceName());
  }
  Answer answer=_agentMgr.easySend(hostId,new GetVmDiskStatsCommand(vmNames,_hostDao.findById(hostId).getGuid(),hostName));
  if (answer == null || !answer.getResult()) {
    s_logger.warn("String_Node_Str");
    return null;
  }
 else {
    HashMap<String,List<VmDiskStatsEntry>> vmDiskStatsByName=((GetVmDiskStatsAnswer)answer).getVmDiskStatsMap();
    if (vmDiskStatsByName == null) {
      s_logger.warn("String_Node_Str");
      return null;
    }
    for (    Map.Entry<String,List<VmDiskStatsEntry>> entry : vmDiskStatsByName.entrySet()) {
      vmDiskStatsById.put(vmIds.get(vmNames.indexOf(entry.getKey())),entry.getValue());
    }
  }
  return vmDiskStatsById;
}
Program: 105689
Project: 105689
Buggy source:
@Override @ActionEvent(eventType=EventTypes.EVENT_VM_REBOOT,eventDescription="String_Node_Str",async=true) public UserVm rebootVirtualMachine(RebootVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException {
  Account caller=CallContext.current().getCallingAccount();
  Long vmId=cmd.getId();
  UserVmVO vmInstance=_vmDao.findById(vmId.longValue());
  if (vmInstance == null) {
    throw new InvalidParameterValueException("String_Node_Str" + vmId);
  }
  _accountMgr.checkAccess(caller,null,true,vmInstance);
  long serviceOfferingId=vmInstance.getServiceOfferingId();
  ServiceOfferingVO offering=_serviceOfferingDao.findById(vmInstance.getId(),serviceOfferingId);
  if (offering != null && offering.getRemoved() == null) {
    if (offering.getVolatileVm()) {
      return restoreVMInternal(caller,vmInstance,null);
    }
  }
 else {
    throw new InvalidParameterValueException("String_Node_Str" + serviceOfferingId + "String_Node_Str");
  }
  return rebootVirtualMachine(CallContext.current().getCallingUserId(),vmId);
}

Fixed version (ground truth):
@Override @ActionEvent(eventType=EventTypes.EVENT_VM_REBOOT,eventDescription="String_Node_Str",async=true) public UserVm rebootVirtualMachine(RebootVMCmd cmd) throws InsufficientCapacityException, ResourceUnavailableException {
  Account caller=CallContext.current().getCallingAccount();
  Long vmId=cmd.getId();
  UserVmVO vmInstance=_vmDao.findById(vmId);
  if (vmInstance == null) {
    throw new InvalidParameterValueException("String_Node_Str" + vmId);
  }
  _accountMgr.checkAccess(caller,null,true,vmInstance);
  long serviceOfferingId=vmInstance.getServiceOfferingId();
  ServiceOfferingVO offering=_serviceOfferingDao.findById(vmInstance.getId(),serviceOfferingId);
  if (offering != null && offering.getRemoved() == null) {
    if (offering.getVolatileVm()) {
      return restoreVMInternal(caller,vmInstance,null);
    }
  }
 else {
    throw new InvalidParameterValueException("String_Node_Str" + serviceOfferingId + "String_Node_Str");
  }
  return rebootVirtualMachine(CallContext.current().getCallingUserId(),vmId);
}
Program: 105690
Project: 105690
Buggy source:
@Override public void saveCustomOfferingDetails(long vmId,ServiceOffering serviceOffering){
  Map<String,String> details=_uservmDetailsDao.listDetailsKeyPairs(vmId);
  details.put(UsageEventVO.DynamicParameters.cpuNumber.name(),serviceOffering.getCpu().toString());
  details.put(UsageEventVO.DynamicParameters.cpuSpeed.name(),serviceOffering.getSpeed().toString());
  details.put(UsageEventVO.DynamicParameters.memory.name(),serviceOffering.getRamSize().toString());
  List<UserVmDetailVO> detailList=new ArrayList<UserVmDetailVO>();
  for (  String key : details.keySet()) {
    UserVmDetailVO detailVO=new UserVmDetailVO(vmId,key,details.get(key),true);
    detailList.add(detailVO);
  }
  _uservmDetailsDao.saveDetails(detailList);
}

Fixed version (ground truth):
@Override public void saveCustomOfferingDetails(long vmId,ServiceOffering serviceOffering){
  Map<String,String> details=_uservmDetailsDao.listDetailsKeyPairs(vmId);
  details.put(UsageEventVO.DynamicParameters.cpuNumber.name(),serviceOffering.getCpu().toString());
  details.put(UsageEventVO.DynamicParameters.cpuSpeed.name(),serviceOffering.getSpeed().toString());
  details.put(UsageEventVO.DynamicParameters.memory.name(),serviceOffering.getRamSize().toString());
  List<UserVmDetailVO> detailList=new ArrayList<UserVmDetailVO>();
  for (  Map.Entry<String,String> entry : details.entrySet()) {
    UserVmDetailVO detailVO=new UserVmDetailVO(vmId,entry.getKey(),entry.getValue(),true);
    detailList.add(detailVO);
  }
  _uservmDetailsDao.saveDetails(detailList);
}
Program: 105692
Project: 105692
Buggy source:
@Override public HashMap<Long,VmStatsEntry> getVirtualMachineStatistics(long hostId,String hostName,List<Long> vmIds) throws CloudRuntimeException {
  HashMap<Long,VmStatsEntry> vmStatsById=new HashMap<Long,VmStatsEntry>();
  if (vmIds.isEmpty()) {
    return vmStatsById;
  }
  List<String> vmNames=new ArrayList<String>();
  for (  Long vmId : vmIds) {
    UserVmVO vm=_vmDao.findById(vmId);
    vmNames.add(vm.getInstanceName());
  }
  Answer answer=_agentMgr.easySend(hostId,new GetVmStatsCommand(vmNames,_hostDao.findById(hostId).getGuid(),hostName));
  if (answer == null || !answer.getResult()) {
    s_logger.warn("String_Node_Str");
    return null;
  }
 else {
    HashMap<String,VmStatsEntry> vmStatsByName=((GetVmStatsAnswer)answer).getVmStatsMap();
    if (vmStatsByName == null) {
      s_logger.warn("String_Node_Str");
      return null;
    }
    for (    String vmName : vmStatsByName.keySet()) {
      vmStatsById.put(vmIds.get(vmNames.indexOf(vmName)),vmStatsByName.get(vmName));
    }
  }
  return vmStatsById;
}

Fixed version (ground truth):
@Override public HashMap<Long,VmStatsEntry> getVirtualMachineStatistics(long hostId,String hostName,List<Long> vmIds) throws CloudRuntimeException {
  HashMap<Long,VmStatsEntry> vmStatsById=new HashMap<Long,VmStatsEntry>();
  if (vmIds.isEmpty()) {
    return vmStatsById;
  }
  List<String> vmNames=new ArrayList<String>();
  for (  Long vmId : vmIds) {
    UserVmVO vm=_vmDao.findById(vmId);
    vmNames.add(vm.getInstanceName());
  }
  Answer answer=_agentMgr.easySend(hostId,new GetVmStatsCommand(vmNames,_hostDao.findById(hostId).getGuid(),hostName));
  if (answer == null || !answer.getResult()) {
    s_logger.warn("String_Node_Str");
    return null;
  }
 else {
    HashMap<String,VmStatsEntry> vmStatsByName=((GetVmStatsAnswer)answer).getVmStatsMap();
    if (vmStatsByName == null) {
      s_logger.warn("String_Node_Str");
      return null;
    }
    for (    Map.Entry<String,VmStatsEntry> entry : vmStatsByName.entrySet()) {
      vmStatsById.put(vmIds.get(vmNames.indexOf(entry.getKey())),entry.getValue());
    }
  }
  return vmStatsById;
}
Program: 105693
Project: 105693
Buggy source:
@Override public boolean expunge(UserVmVO vm,long callerUserId,Account caller){
  try {
    List<VolumeVO> rootVol=_volsDao.findByInstanceAndType(vm.getId(),Volume.Type.ROOT);
    _itMgr.advanceExpunge(vm.getUuid());
    if (vm.getAccountId() != Account.ACCOUNT_ID_SYSTEM && !rootVol.isEmpty()) {
      _resourceLimitMgr.decrementResourceCount(vm.getAccountId(),ResourceType.volume);
      _resourceLimitMgr.recalculateResourceCount(vm.getAccountId(),vm.getDomainId(),ResourceType.primary_storage.getOrdinal());
    }
    if (vm != null && vm.getRemoved() == null) {
      s_logger.debug("String_Node_Str" + vm + "String_Node_Str");
      if (cleanupVmResources(vm.getId())) {
        s_logger.debug("String_Node_Str" + vm + "String_Node_Str");
      }
 else {
        s_logger.warn("String_Node_Str" + vm + "String_Node_Str");
        return false;
      }
      _vmDao.remove(vm.getId());
    }
    return true;
  }
 catch (  ResourceUnavailableException e) {
    s_logger.warn("String_Node_Str" + vm,e);
    return false;
  }
catch (  OperationTimedoutException e) {
    s_logger.warn("String_Node_Str" + vm,e);
    return false;
  }
catch (  ConcurrentOperationException e) {
    s_logger.warn("String_Node_Str" + vm,e);
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean expunge(UserVmVO vm,long callerUserId,Account caller){
  try {
    List<VolumeVO> rootVol=_volsDao.findByInstanceAndType(vm.getId(),Volume.Type.ROOT);
    _itMgr.advanceExpunge(vm.getUuid());
    if (vm.getAccountId() != Account.ACCOUNT_ID_SYSTEM && !rootVol.isEmpty()) {
      _resourceLimitMgr.decrementResourceCount(vm.getAccountId(),ResourceType.volume);
      _resourceLimitMgr.recalculateResourceCount(vm.getAccountId(),vm.getDomainId(),ResourceType.primary_storage.getOrdinal());
    }
    if (vm.getRemoved() == null) {
      s_logger.debug("String_Node_Str" + vm + "String_Node_Str");
      if (cleanupVmResources(vm.getId())) {
        s_logger.debug("String_Node_Str" + vm + "String_Node_Str");
      }
 else {
        s_logger.warn("String_Node_Str" + vm + "String_Node_Str");
        return false;
      }
      _vmDao.remove(vm.getId());
    }
    return true;
  }
 catch (  ResourceUnavailableException e) {
    s_logger.warn("String_Node_Str" + vm,e);
    return false;
  }
catch (  OperationTimedoutException e) {
    s_logger.warn("String_Node_Str" + vm,e);
    return false;
  }
catch (  ConcurrentOperationException e) {
    s_logger.warn("String_Node_Str" + vm,e);
    return false;
  }
}
Program: 105696
Project: 105696
Buggy source:
private void validateUserData(String userData,HTTPMethod httpmethod){
  byte[] decodedUserData=null;
  if (userData != null) {
    if (!Base64.isBase64(userData)) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    if (httpmethod.equals(HTTPMethod.GET)) {
      if (userData.length() >= MAX_HTTP_GET_LENGTH) {
        throw new InvalidParameterValueException("String_Node_Str");
      }
      decodedUserData=Base64.decodeBase64(userData.getBytes());
      if (decodedUserData.length > MAX_HTTP_GET_LENGTH) {
        throw new InvalidParameterValueException("String_Node_Str");
      }
    }
 else     if (httpmethod.equals(HTTPMethod.POST)) {
      if (userData.length() >= MAX_HTTP_POST_LENGTH) {
        throw new InvalidParameterValueException("String_Node_Str");
      }
      decodedUserData=Base64.decodeBase64(userData.getBytes());
      if (decodedUserData.length > MAX_HTTP_POST_LENGTH) {
        throw new InvalidParameterValueException("String_Node_Str");
      }
    }
    if (decodedUserData.length < 1) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void validateUserData(String userData,HTTPMethod httpmethod){
  byte[] decodedUserData=null;
  if (userData != null) {
    if (!Base64.isBase64(userData)) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
    if (httpmethod.equals(HTTPMethod.GET)) {
      if (userData.length() >= MAX_HTTP_GET_LENGTH) {
        throw new InvalidParameterValueException("String_Node_Str");
      }
      decodedUserData=Base64.decodeBase64(userData.getBytes());
      if (decodedUserData.length > MAX_HTTP_GET_LENGTH) {
        throw new InvalidParameterValueException("String_Node_Str");
      }
    }
 else     if (httpmethod.equals(HTTPMethod.POST)) {
      if (userData.length() >= MAX_HTTP_POST_LENGTH) {
        throw new InvalidParameterValueException("String_Node_Str");
      }
      decodedUserData=Base64.decodeBase64(userData.getBytes());
      if (decodedUserData.length > MAX_HTTP_POST_LENGTH) {
        throw new InvalidParameterValueException("String_Node_Str");
      }
    }
    if (decodedUserData == null || decodedUserData.length < 1) {
      throw new InvalidParameterValueException("String_Node_Str");
    }
  }
}
Program: 105701
Project: 105701
Buggy source:
@Override @ActionEvent(eventType=EventTypes.EVENT_VM_RESETPASSWORD,eventDescription="String_Node_Str",async=true) public UserVm resetVMPassword(ResetVMPasswordCmd cmd,String password) throws ResourceUnavailableException, InsufficientCapacityException {
  Account caller=CallContext.current().getCallingAccount();
  Long vmId=cmd.getId();
  UserVmVO userVm=_vmDao.findById(cmd.getId());
  _vmDao.loadDetails(userVm);
  if (userVm == null) {
    throw new InvalidParameterValueException("String_Node_Str" + cmd.getId());
  }
  VMTemplateVO template=_templateDao.findByIdIncludingRemoved(userVm.getTemplateId());
  if (template == null || !template.getEnablePassword()) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if (userVm.getState() == State.Error || userVm.getState() == State.Expunging) {
    s_logger.error("String_Node_Str" + vmId);
    throw new InvalidParameterValueException("String_Node_Str" + vmId + "String_Node_Str");
  }
  _accountMgr.checkAccess(caller,null,true,userVm);
  boolean result=resetVMPasswordInternal(vmId,password);
  if (result) {
    userVm.setPassword(password);
    encryptAndStorePassword(userVm,password);
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
  return userVm;
}

Fixed version (ground truth):
@Override @ActionEvent(eventType=EventTypes.EVENT_VM_RESETPASSWORD,eventDescription="String_Node_Str",async=true) public UserVm resetVMPassword(ResetVMPasswordCmd cmd,String password) throws ResourceUnavailableException, InsufficientCapacityException {
  Account caller=CallContext.current().getCallingAccount();
  Long vmId=cmd.getId();
  UserVmVO userVm=_vmDao.findById(cmd.getId());
  if (userVm == null) {
    throw new InvalidParameterValueException("String_Node_Str" + cmd.getId());
  }
  _vmDao.loadDetails(userVm);
  VMTemplateVO template=_templateDao.findByIdIncludingRemoved(userVm.getTemplateId());
  if (template == null || !template.getEnablePassword()) {
    throw new InvalidParameterValueException("String_Node_Str");
  }
  if (userVm.getState() == State.Error || userVm.getState() == State.Expunging) {
    s_logger.error("String_Node_Str" + vmId);
    throw new InvalidParameterValueException("String_Node_Str" + vmId + "String_Node_Str");
  }
  _accountMgr.checkAccess(caller,null,true,userVm);
  boolean result=resetVMPasswordInternal(vmId,password);
  if (result) {
    userVm.setPassword(password);
    encryptAndStorePassword(userVm,password);
  }
 else {
    throw new CloudRuntimeException("String_Node_Str");
  }
  return userVm;
}
Program: 105704
Project: 105704
Buggy source:
@Override public void setUuid(String uuid){
  this.uuid=uuid;
}

Fixed version (ground truth):
@Override public void setUuid(String uuid){
  this.nicUuid=uuid;
}
Program: 105705
Project: 105705
Buggy source:
@Override public String getUuid(){
  return uuid;
}

Fixed version (ground truth):
@Override public String getUuid(){
  return nicUuid;
}
Program: 105707
Project: 105707
Buggy source:
@Override public void update(UsageVolumeVO usage){
  TransactionLegacy txn=TransactionLegacy.open(TransactionLegacy.USAGE_DB);
  PreparedStatement pstmt=null;
  try {
    txn.start();
    if (usage.getDeleted() != null) {
      pstmt=txn.prepareAutoCloseStatement(UPDATE_DELETED);
      pstmt.setString(1,DateUtil.getDateDisplayString(TimeZone.getTimeZone("String_Node_Str"),usage.getDeleted()));
      pstmt.setLong(2,usage.getAccountId());
      pstmt.setLong(3,usage.getId());
    }
    pstmt.executeUpdate();
    txn.commit();
  }
 catch (  Exception e) {
    txn.rollback();
    s_logger.warn("String_Node_Str",e);
  }
 finally {
    txn.close();
  }
}

Fixed version (ground truth):
@Override public void update(UsageVolumeVO usage){
  TransactionLegacy txn=TransactionLegacy.open(TransactionLegacy.USAGE_DB);
  PreparedStatement pstmt=null;
  try {
    txn.start();
    if (usage.getDeleted() != null) {
      pstmt=txn.prepareAutoCloseStatement(UPDATE_DELETED);
      pstmt.setString(1,DateUtil.getDateDisplayString(TimeZone.getTimeZone("String_Node_Str"),usage.getDeleted()));
      pstmt.setLong(2,usage.getAccountId());
      pstmt.setLong(3,usage.getId());
      pstmt.executeUpdate();
    }
    txn.commit();
  }
 catch (  Exception e) {
    txn.rollback();
    s_logger.warn("String_Node_Str",e);
  }
 finally {
    txn.close();
  }
}
Program: 105708
Project: 105708
Buggy source:
@Override public void invalidateRunSession(long id,long runid){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  PreparedStatement pstmt=null;
  try {
    pstmt=txn.prepareAutoCloseStatement("String_Node_Str");
    pstmt.setLong(1,id);
    pstmt.setLong(2,runid);
    pstmt.executeUpdate();
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + pstmt.toString(),e);
  }
}

Fixed version (ground truth):
@Override public void invalidateRunSession(long id,long runid){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  PreparedStatement pstmt=null;
  try {
    pstmt=txn.prepareAutoCloseStatement("String_Node_Str");
    pstmt.setLong(1,id);
    pstmt.setLong(2,runid);
    pstmt.executeUpdate();
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str",e);
  }
}
Program: 105709
Project: 105709
Buggy source:
@Override public List<Long> listOrphanMsids(){
  List<Long> orphanList=new ArrayList<Long>();
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  PreparedStatement pstmt=null;
  try {
    pstmt=txn.prepareAutoCloseStatement("String_Node_Str");
    ResultSet rs=pstmt.executeQuery();
    while (rs.next()) {
      orphanList.add(rs.getLong(1));
    }
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + pstmt.toString(),e);
  }
  return orphanList;
}

Fixed version (ground truth):
@Override public List<Long> listOrphanMsids(){
  List<Long> orphanList=new ArrayList<Long>();
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  PreparedStatement pstmt=null;
  try {
    pstmt=txn.prepareAutoCloseStatement("String_Node_Str");
    ResultSet rs=pstmt.executeQuery();
    while (rs.next()) {
      orphanList.add(rs.getLong(1));
    }
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str",e);
  }
  return orphanList;
}
Program: 105710
Project: 105710
Buggy source:
@Override public void update(long id,long runId,State state,Date lastUpdate){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  PreparedStatement pstmt=null;
  try {
    pstmt=txn.prepareAutoCloseStatement("String_Node_Str");
    pstmt.setString(1,state.toString());
    pstmt.setString(2,DateUtil.getDateDisplayString(TimeZone.getTimeZone("String_Node_Str"),lastUpdate));
    pstmt.setLong(3,id);
    pstmt.setLong(4,runId);
    int count=pstmt.executeUpdate();
    if (count < 1) {
      s_logger.info("String_Node_Str" + runId + "String_Node_Str");
      throw new CloudRuntimeException("String_Node_Str" + runId + "String_Node_Str",new ClusterInvalidSessionException("String_Node_Str" + runId + "String_Node_Str"));
    }
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str" + pstmt.toString(),e);
  }
}

Fixed version (ground truth):
@Override public void update(long id,long runId,State state,Date lastUpdate){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  PreparedStatement pstmt=null;
  try {
    pstmt=txn.prepareAutoCloseStatement("String_Node_Str");
    pstmt.setString(1,state.toString());
    pstmt.setString(2,DateUtil.getDateDisplayString(TimeZone.getTimeZone("String_Node_Str"),lastUpdate));
    pstmt.setLong(3,id);
    pstmt.setLong(4,runId);
    int count=pstmt.executeUpdate();
    if (count < 1) {
      s_logger.info("String_Node_Str" + runId + "String_Node_Str");
      throw new CloudRuntimeException("String_Node_Str" + runId + "String_Node_Str",new ClusterInvalidSessionException("String_Node_Str" + runId + "String_Node_Str"));
    }
  }
 catch (  SQLException e) {
    throw new CloudRuntimeException("String_Node_Str",e);
  }
}
Program: 105711
Project: 105711
Buggy source:
/** 
 * Converts a string of the format 'yy-MM-dd'T'HH:mm:ss.SSS" into ms.
 * @param str containing the interval.
 * @param defaultValue value to return if str doesn't parse.  If -1, throws VmopsRuntimeException
 * @return interval in ms
 */
public static long parseInterval(String str,long defaultValue){
  SimpleDateFormat sdf=null;
  if (str.contains("String_Node_Str")) {
    sdf=new SimpleDateFormat("String_Node_Str");
  }
 else   if (str.contains("String_Node_Str")) {
    sdf=new SimpleDateFormat("String_Node_Str");
  }
 else   if (str.contains("String_Node_Str")) {
    sdf=new SimpleDateFormat("String_Node_Str");
  }
 else   if (str.contains("String_Node_Str")) {
    sdf=new SimpleDateFormat("String_Node_Str");
  }
 else   if (str.contains("String_Node_Str")) {
    sdf=new SimpleDateFormat("String_Node_Str");
  }
  Date date;
  try {
    if (str == null || sdf == null) {
      throw new ParseException("String_Node_Str",0);
    }
    date=sdf.parse(str);
    return date.getTime();
  }
 catch (  ParseException e) {
    if (defaultValue != -1) {
      return defaultValue;
    }
 else {
      throw new CloudRuntimeException("String_Node_Str" + str,e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Converts a string of the format 'yy-MM-dd'T'HH:mm:ss.SSS" into ms.
 * @param str containing the interval.
 * @param defaultValue value to return if str doesn't parse.  If -1, throws VmopsRuntimeException
 * @return interval in ms
 */
public static long parseInterval(String str,long defaultValue){
  try {
    if (str == null) {
      throw new ParseException("String_Node_Str",0);
    }
    SimpleDateFormat sdf=null;
    if (str.contains("String_Node_Str")) {
      sdf=new SimpleDateFormat("String_Node_Str");
    }
 else     if (str.contains("String_Node_Str")) {
      sdf=new SimpleDateFormat("String_Node_Str");
    }
 else     if (str.contains("String_Node_Str")) {
      sdf=new SimpleDateFormat("String_Node_Str");
    }
 else     if (str.contains("String_Node_Str")) {
      sdf=new SimpleDateFormat("String_Node_Str");
    }
 else     if (str.contains("String_Node_Str")) {
      sdf=new SimpleDateFormat("String_Node_Str");
    }
    if (sdf == null) {
      throw new ParseException("String_Node_Str",0);
    }
    Date date=sdf.parse(str);
    return date.getTime();
  }
 catch (  ParseException e) {
    if (defaultValue != -1) {
      return defaultValue;
    }
 else {
      throw new CloudRuntimeException("String_Node_Str" + str,e);
    }
  }
}
Program: 105713
Project: 105713
Buggy source:
public static Long getRemoteSize(String url){
  Long remoteSize=(long)0;
  HttpURLConnection httpConn=null;
  HttpsURLConnection httpsConn=null;
  try {
    URI uri=new URI(url);
    if (uri.getScheme().equalsIgnoreCase("String_Node_Str")) {
      httpConn=(HttpURLConnection)uri.toURL().openConnection();
      httpConn.setConnectTimeout(2000);
      httpConn.setReadTimeout(5000);
      if (httpConn != null) {
        String contentLength=httpConn.getHeaderField("String_Node_Str");
        if (contentLength != null) {
          remoteSize=Long.parseLong(contentLength);
        }
        httpConn.disconnect();
      }
    }
 else     if (uri.getScheme().equalsIgnoreCase("String_Node_Str")) {
      httpsConn=(HttpsURLConnection)uri.toURL().openConnection();
      if (httpsConn != null) {
        String contentLength=httpsConn.getHeaderField("String_Node_Str");
        if (contentLength != null) {
          remoteSize=Long.parseLong(contentLength);
        }
        httpsConn.disconnect();
      }
    }
  }
 catch (  URISyntaxException e) {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
catch (  IOException e) {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
  return remoteSize;
}

Fixed version (ground truth):
public static Long getRemoteSize(String url){
  Long remoteSize=(long)0;
  HttpURLConnection httpConn=null;
  HttpsURLConnection httpsConn=null;
  try {
    URI uri=new URI(url);
    if (uri.getScheme().equalsIgnoreCase("String_Node_Str")) {
      httpConn=(HttpURLConnection)uri.toURL().openConnection();
      if (httpConn != null) {
        httpConn.setConnectTimeout(2000);
        httpConn.setReadTimeout(5000);
        String contentLength=httpConn.getHeaderField("String_Node_Str");
        if (contentLength != null) {
          remoteSize=Long.parseLong(contentLength);
        }
        httpConn.disconnect();
      }
    }
 else     if (uri.getScheme().equalsIgnoreCase("String_Node_Str")) {
      httpsConn=(HttpsURLConnection)uri.toURL().openConnection();
      if (httpsConn != null) {
        String contentLength=httpsConn.getHeaderField("String_Node_Str");
        if (contentLength != null) {
          remoteSize=Long.parseLong(contentLength);
        }
        httpsConn.disconnect();
      }
    }
  }
 catch (  URISyntaxException e) {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
catch (  IOException e) {
    throw new IllegalArgumentException("String_Node_Str" + url);
  }
  return remoteSize;
}
Program: 105714
Project: 105714
Buggy source:
public static boolean isSameIsolationId(String one,String other){
  if ((one == null || one.equals("String_Node_Str")) && (other == null || other.equals("String_Node_Str"))) {
    return true;
  }
  if ((one == null || other == null) && !(one == null && other == null)) {
    return false;
  }
  if (one.contains(VLAN_UNTAGGED) && other.contains(VLAN_UNTAGGED)) {
    return true;
  }
  if (one.startsWith(VLAN_PREFIX)) {
    one=one.substring(VLAN_PREFIX_LENGTH);
  }
  if (other.startsWith(VLAN_PREFIX)) {
    other=other.substring(VLAN_PREFIX_LENGTH);
  }
  if (one.equalsIgnoreCase(other)) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
public static boolean isSameIsolationId(String one,String other){
  if ((one == null || one.isEmpty()) && (other == null || other.isEmpty())) {
    return true;
  }
  if (one == null || other == null) {
    return false;
  }
  if (one.contains(VLAN_UNTAGGED) && other.contains(VLAN_UNTAGGED)) {
    return true;
  }
  if (one.startsWith(VLAN_PREFIX)) {
    one=one.substring(VLAN_PREFIX_LENGTH);
  }
  if (other.startsWith(VLAN_PREFIX)) {
    other=other.substring(VLAN_PREFIX_LENGTH);
  }
  if (one.equalsIgnoreCase(other)) {
    return true;
  }
  return false;
}
Program: 105715
Project: 105715
Buggy source:
public static String getPublicKeyFingerprint(String publicKey){
  String key[]=publicKey.split("String_Node_Str");
  if (key.length < 2) {
    throw new RuntimeException("String_Node_Str");
  }
  byte[] keyBytes=Base64.decodeBase64(key[1]);
  MessageDigest md5=null;
  try {
    md5=MessageDigest.getInstance("String_Node_Str");
  }
 catch (  NoSuchAlgorithmException e) {
    e.printStackTrace();
  }
  String sumString=toHexString(md5.digest(keyBytes));
  String rString="String_Node_Str";
  for (int i=2; i <= sumString.length(); i+=2) {
    rString+=sumString.substring(i - 2,i);
    if (i != sumString.length())     rString+="String_Node_Str";
  }
  return rString;
}

Fixed version (ground truth):
public static String getPublicKeyFingerprint(String publicKey){
  String key[]=publicKey.split("String_Node_Str");
  if (key.length < 2) {
    throw new RuntimeException("String_Node_Str");
  }
  byte[] keyBytes=Base64.decodeBase64(key[1]);
  MessageDigest md5=null;
  try {
    md5=MessageDigest.getInstance("String_Node_Str");
  }
 catch (  NoSuchAlgorithmException e) {
    e.printStackTrace();
  }
  String rString="String_Node_Str";
  String sumString="String_Node_Str";
  if (md5 != null) {
    sumString=toHexString(md5.digest(keyBytes));
  }
  for (int i=2; i <= sumString.length(); i+=2) {
    rString+=sumString.substring(i - 2,i);
    if (i != sumString.length())     rString+="String_Node_Str";
  }
  return rString;
}
Program: 105716
Project: 105716
Buggy source:
public DecodedDataObject(String objType,Long size,String name,String path,DecodedDataStore store){
  this.objType=objType;
  this.size=size;
  this.path=path;
  this.store=store;
}

Fixed version (ground truth):
public DecodedDataObject(String objType,Long size,String name,String path,DecodedDataStore store){
  this.objType=objType;
  this.size=size;
  this.name=name;
  this.path=path;
  this.store=store;
}
Program: 105717
Project: 105717
Buggy source:
@Override @DB public int increaseAlertCount(long id){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  int changedRows=0;
  try {
    txn.start();
    try (PreparedStatement pstmt=txn.prepareStatement("String_Node_Str")){
      pstmt.setLong(1,id);
      changedRows=pstmt.executeUpdate();
    }
 catch (    SQLException e) {
      throw new CloudRuntimeException("String_Node_Str" + e.getMessage(),e);
    }
    txn.commit();
  }
 catch (  RuntimeException e) {
    txn.rollback();
    s_logger.warn("String_Node_Str" + e.getMessage(),e);
    throw new CloudRuntimeException("String_Node_Str" + e.getMessage(),e);
  }
 finally {
    txn.close();
  }
  return changedRows;
}

Fixed version (ground truth):
@Override @DB public int increaseAlertCount(long id){
  TransactionLegacy txn=TransactionLegacy.currentTxn();
  int changedRows=0;
  try {
    txn.start();
    try (PreparedStatement pstmt=txn.prepareStatement("String_Node_Str")){
      if (pstmt != null) {
        pstmt.setLong(1,id);
        changedRows=pstmt.executeUpdate();
      }
    }
 catch (    SQLException e) {
      throw new CloudRuntimeException("String_Node_Str" + e.getMessage(),e);
    }
    txn.commit();
  }
 catch (  RuntimeException e) {
    txn.rollback();
    s_logger.warn("String_Node_Str" + e.getMessage(),e);
    throw new CloudRuntimeException("String_Node_Str" + e.getMessage(),e);
  }
 finally {
    txn.close();
  }
  return changedRows;
}
Program: 105718
Project: 105718
Buggy source:
@Override public void execute(){
  PortableIpRange portableIpRange=_entityMgr.findById(PortableIpRange.class,getEntityId());
  PortableIpRangeResponse response=null;
  if (portableIpRange != null) {
    response=_responseGenerator.createPortableIPRangeResponse(portableIpRange);
  }
  response.setResponseName(getCommandName());
  this.setResponseObject(response);
}

Fixed version (ground truth):
@Override public void execute(){
  PortableIpRange portableIpRange=_entityMgr.findById(PortableIpRange.class,getEntityId());
  if (portableIpRange != null) {
    PortableIpRangeResponse response=_responseGenerator.createPortableIPRangeResponse(portableIpRange);
    response.setResponseName(getCommandName());
    this.setResponseObject(response);
  }
}