Program: 107443
Project: 107443
Buggy source:
@Override @SuppressWarnings("String_Node_Str") public UserVmResponse getResponse(){
  UserVm vm=(UserVm)getResponseObject();
  UserVmResponse response=new UserVmResponse();
  response.setId(vm.getId());
  response.setName(vm.getName());
  response.setCreated(vm.getCreated());
  response.setZoneId(vm.getDataCenterId());
  response.setZoneName(ApiDBUtils.findZoneById(vm.getDataCenterId()).getName());
  response.setIpAddress(vm.getPrivateIpAddress());
  response.setServiceOfferingId(vm.getServiceOfferingId());
  response.setHaEnable(vm.isHaEnabled());
  if (vm.getDisplayName() == null || vm.getDisplayName().length() == 0) {
    response.setDisplayName(vm.getName());
  }
 else {
    response.setDisplayName(vm.getDisplayName());
  }
  InstanceGroupVO group=ApiDBUtils.findInstanceGroupForVM(vm.getId());
  if (group != null) {
    response.setGroup(group.getName());
    response.setGroupId(group.getId());
  }
  if (vm.getState() != null) {
    response.setState(vm.getState().toString());
  }
  Account acct=ApiDBUtils.findAccountById(vm.getAccountId());
  if (acct != null) {
    response.setAccountName(acct.getAccountName());
    response.setDomainId(acct.getDomainId());
    response.setDomainName(ApiDBUtils.findDomainById(acct.getDomainId()).getName());
  }
  if (BaseCmd.isAdmin(acct.getType()) && (vm.getHostId() != null)) {
    response.setHostName(ApiDBUtils.findHostById(vm.getHostId()).getName());
    response.setHostId(vm.getHostId());
  }
  String templateName="String_Node_Str";
  boolean templatePasswordEnabled=false;
  String templateDisplayText="String_Node_Str";
  VMTemplateVO template=ApiDBUtils.findTemplateById(vm.getTemplateId());
  if (template != null) {
    templateName=template.getName();
    templatePasswordEnabled=template.getEnablePassword();
    templateDisplayText=template.getDisplayText();
    if (templateDisplayText == null) {
      templateDisplayText=templateName;
    }
  }
  response.setTemplateId(vm.getTemplateId());
  response.setTemplateName(templateName);
  response.setTemplateDisplayText(templateDisplayText);
  response.setPasswordEnabled(templatePasswordEnabled);
  if (templatePasswordEnabled) {
    response.setPassword(null);
  }
 else {
    response.setPassword("String_Node_Str");
  }
  String isoName=null;
  if (vm.getIsoId() != null) {
    VMTemplateVO iso=ApiDBUtils.findTemplateById(vm.getIsoId().longValue());
    if (iso != null) {
      isoName=iso.getName();
    }
  }
  response.setIsoId(vm.getIsoId());
  response.setIsoName(isoName);
  ServiceOffering offering=ApiDBUtils.findServiceOfferingById(vm.getServiceOfferingId());
  response.setServiceOfferingId(vm.getServiceOfferingId());
  response.setServiceOfferingName(offering.getName());
  response.setCpuNumber(offering.getCpu());
  response.setCpuSpeed(offering.getSpeed());
  response.setMemory(offering.getRamSize());
  response.setNetworkGroupList(ApiDBUtils.getNetworkGroupsNamesForVm(vm.getId()));
  response.setResponseName(getResultObjectName());
  return response;
}

Fixed version (ground truth):
@Override @SuppressWarnings("String_Node_Str") public UserVmResponse getResponse(){
  UserVm vm=(UserVm)getResponseObject();
  UserVmResponse response=new UserVmResponse();
  response.setId(vm.getId());
  response.setName(vm.getName());
  response.setCreated(vm.getCreated());
  response.setZoneId(vm.getDataCenterId());
  response.setZoneName(ApiDBUtils.findZoneById(vm.getDataCenterId()).getName());
  response.setIpAddress(vm.getPrivateIpAddress());
  response.setServiceOfferingId(vm.getServiceOfferingId());
  response.setHaEnable(vm.isHaEnabled());
  if (vm.getDisplayName() == null || vm.getDisplayName().length() == 0) {
    response.setDisplayName(vm.getName());
  }
 else {
    response.setDisplayName(vm.getDisplayName());
  }
  InstanceGroupVO group=ApiDBUtils.findInstanceGroupForVM(vm.getId());
  if (group != null) {
    response.setGroup(group.getName());
    response.setGroupId(group.getId());
  }
  if (vm.getState() != null) {
    response.setState(vm.getState().toString());
  }
  Account acct=ApiDBUtils.findAccountById(vm.getAccountId());
  if (acct != null) {
    response.setAccountName(acct.getAccountName());
    response.setDomainId(acct.getDomainId());
    response.setDomainName(ApiDBUtils.findDomainById(acct.getDomainId()).getName());
  }
  if (BaseCmd.isAdmin(acct.getType()) && (vm.getHostId() != null)) {
    response.setHostName(ApiDBUtils.findHostById(vm.getHostId()).getName());
    response.setHostId(vm.getHostId());
  }
  String templateName="String_Node_Str";
  boolean templatePasswordEnabled=false;
  String templateDisplayText="String_Node_Str";
  VMTemplateVO template=ApiDBUtils.findTemplateById(vm.getTemplateId());
  if (template != null) {
    templateName=template.getName();
    templatePasswordEnabled=template.getEnablePassword();
    templateDisplayText=template.getDisplayText();
    if (templateDisplayText == null) {
      templateDisplayText=templateName;
    }
  }
  response.setTemplateId(vm.getTemplateId());
  response.setTemplateName(templateName);
  response.setTemplateDisplayText(templateDisplayText);
  response.setPasswordEnabled(templatePasswordEnabled);
  if (templatePasswordEnabled) {
    response.setPassword(null);
  }
 else {
    response.setPassword("String_Node_Str");
  }
  String isoName=null;
  if (vm.getIsoId() != null) {
    VMTemplateVO iso=ApiDBUtils.findTemplateById(vm.getIsoId().longValue());
    if (iso != null) {
      isoName=iso.getName();
    }
  }
  response.setIsoId(vm.getIsoId());
  response.setIsoName(isoName);
  ServiceOffering offering=ApiDBUtils.findServiceOfferingById(vm.getServiceOfferingId());
  response.setServiceOfferingId(vm.getServiceOfferingId());
  response.setServiceOfferingName(offering.getName());
  response.setCpuNumber(offering.getCpu());
  response.setCpuSpeed(offering.getSpeed());
  response.setMemory(offering.getRamSize());
  VolumeVO rootVolume=ApiDBUtils.findRootVolume(vm.getId());
  if (rootVolume != null) {
    response.setRootDeviceId(rootVolume.getDeviceId());
    StoragePoolVO storagePool=ApiDBUtils.findStoragePoolById(rootVolume.getPoolId());
    response.setRootDeviceType(storagePool.getPoolType().toString());
  }
  response.setGuestOsId(vm.getGuestOSId());
  response.setNetworkGroupList(ApiDBUtils.getNetworkGroupsNamesForVm(vm.getId()));
  response.setResponseName(getResultObjectName());
  return response;
}