Program: 107236
Project: 107236
Buggy source:
private void migrateServiceOfferings(){
  System.out.println("String_Node_Str");
  long seq=getServiceOfferingStartSequence();
  List<ServiceOffering20VO> oldServiceOfferings=_serviceOffering20Dao.listAllIncludingRemoved();
  for (  ServiceOffering20VO so20 : oldServiceOfferings) {
    ServiceOffering21VO so21=new ServiceOffering21VO(so20.getName(),so20.getCpu(),so20.getRamSize(),so20.getSpeed(),so20.getRateMbps(),so20.getMulticastRateMbps(),so20.getOfferHA(),so20.getDisplayText(),so20.getGuestIpType(),so20.getUseLocalStorage(),false,null);
    so21.setId(seq++);
    so21.setDiskSize(0);
    so21=_serviceOffering21Dao.persist(so21);
    if (so20.getId().longValue() != so21.getId()) {
      updateServiceOfferingReferences(so20.getId().longValue(),so21.getId());
    }
  }
  boolean useLocalStorage=Boolean.parseBoolean(_configDao.getValue(Config.SystemVMUseLocalStorage.key()));
  int proxyRamSize=NumbersUtil.parseInt(_configDao.getValue(Config.ConsoleProxyRamSize.key()),ConsoleProxyManager.DEFAULT_PROXY_VM_RAMSIZE);
  ServiceOffering21VO soConsoleProxy=new ServiceOffering21VO("String_Node_Str",1,proxyRamSize,0,0,0,false,null,NetworkOffering.GuestIpType.Virtual,useLocalStorage,true,null);
  soConsoleProxy.setId(seq++);
  soConsoleProxy.setUniqueName("String_Node_Str");
  soConsoleProxy=_serviceOffering21Dao.persist(soConsoleProxy);
  _consoleProxyServiceOfferingId=soConsoleProxy.getId();
  int secStorageVmRamSize=NumbersUtil.parseInt(_configDao.getValue(Config.SecStorageVmRamSize.key()),SecondaryStorageVmManager.DEFAULT_SS_VM_RAMSIZE);
  ServiceOffering21VO soSecondaryVm=new ServiceOffering21VO("String_Node_Str",1,secStorageVmRamSize,0,0,0,false,null,NetworkOffering.GuestIpType.Virtual,useLocalStorage,true,null);
  soSecondaryVm.setId(seq++);
  soSecondaryVm.setUniqueName("String_Node_Str");
  soSecondaryVm=_serviceOffering21Dao.persist(soSecondaryVm);
  _secStorageServiceOfferingId=soSecondaryVm.getId();
  int routerRamSize=NumbersUtil.parseInt(_configDao.getValue("String_Node_Str"),128);
  ServiceOffering21VO soDomainRouter=new ServiceOffering21VO("String_Node_Str",1,routerRamSize,0,0,0,false,null,NetworkOffering.GuestIpType.Virtual,useLocalStorage,true,null);
  soDomainRouter.setId(seq++);
  soDomainRouter.setUniqueName("String_Node_Str");
  soDomainRouter=_serviceOffering21Dao.persist(soDomainRouter);
  _domRServiceOfferingId=soDomainRouter.getId();
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
private void migrateServiceOfferings(){
  System.out.println("String_Node_Str");
  long seq=getServiceOfferingStartSequence();
  List<ServiceOffering20VO> oldServiceOfferings=_serviceOffering20Dao.listAllIncludingRemoved();
  for (  ServiceOffering20VO so20 : oldServiceOfferings) {
    ServiceOffering21VO so21=new ServiceOffering21VO(so20.getName(),so20.getCpu(),so20.getRamSize(),so20.getSpeed(),so20.getRateMbps(),so20.getMulticastRateMbps(),so20.getOfferHA(),so20.getDisplayText(),so20.getGuestIpType(),so20.getUseLocalStorage(),false,null);
    so21.setId(seq++);
    so21.setDiskSize(0);
    so21=_serviceOffering21Dao.persist(so21);
    if (so20.getId().longValue() != so21.getId()) {
      updateServiceOfferingReferences(so20.getId().longValue(),so21.getId());
    }
  }
  boolean useLocalStorage=Boolean.parseBoolean(_configDao.getValue(Config.SystemVMUseLocalStorage.key()));
  int proxyRamSize=NumbersUtil.parseInt(_configDao.getValue(Config.ConsoleProxyRamSize.key()),ConsoleProxyManager.DEFAULT_PROXY_VM_RAMSIZE);
  ServiceOffering21VO soConsoleProxy=new ServiceOffering21VO("String_Node_Str",1,proxyRamSize,0,0,0,false,null,Network.GuestIpType.Virtual,useLocalStorage,true,null);
  soConsoleProxy.setId(seq++);
  soConsoleProxy.setUniqueName("String_Node_Str");
  soConsoleProxy=_serviceOffering21Dao.persist(soConsoleProxy);
  _consoleProxyServiceOfferingId=soConsoleProxy.getId();
  int secStorageVmRamSize=NumbersUtil.parseInt(_configDao.getValue(Config.SecStorageVmRamSize.key()),SecondaryStorageVmManager.DEFAULT_SS_VM_RAMSIZE);
  ServiceOffering21VO soSecondaryVm=new ServiceOffering21VO("String_Node_Str",1,secStorageVmRamSize,0,0,0,false,null,Network.GuestIpType.Virtual,useLocalStorage,true,null);
  soSecondaryVm.setId(seq++);
  soSecondaryVm.setUniqueName("String_Node_Str");
  soSecondaryVm=_serviceOffering21Dao.persist(soSecondaryVm);
  _secStorageServiceOfferingId=soSecondaryVm.getId();
  int routerRamSize=NumbersUtil.parseInt(_configDao.getValue("String_Node_Str"),128);
  ServiceOffering21VO soDomainRouter=new ServiceOffering21VO("String_Node_Str",1,routerRamSize,0,0,0,false,null,Network.GuestIpType.Virtual,useLocalStorage,true,null);
  soDomainRouter.setId(seq++);
  soDomainRouter.setUniqueName("String_Node_Str");
  soDomainRouter=_serviceOffering21Dao.persist(soDomainRouter);
  _domRServiceOfferingId=soDomainRouter.getId();
  System.out.println("String_Node_Str");
}