auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void addVmNetwork ( ) { org.ovirt.engine.core.bll.network.vm.VnicProfileHelper vnicProfileHelper = new org.ovirt.engine.core.bll.network.vm.VnicProfileHelper ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVdsGroupId ( ) , getStoragePoolId ( ) , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVdsGroup ( ) . getcompatibility_version ( ) , org.ovirt.engine.core.common.AuditLogType.ADD_VM_FROM_SNAPSHOT_INVALID_INTERFACES ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : vmFromConfiguration.getInterfaces ( ) ) { vnicProfileHelper.updateNicWithVnicProfileForUser ( iface , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getCurrentUser ( ) . getId ( ) ) ; } vnicProfileHelper.auditInvalidInterfaces ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVmName ( ) ) ; super . addVmNetwork ( ) ; }

Target:
protected void addVmNetwork ( ) { org.ovirt.engine.core.bll.network.vm.VnicProfileHelper vnicProfileHelper = new org.ovirt.engine.core.bll.network.vm.VnicProfileHelper ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVdsGroupId ( ) , getStoragePoolId ( ) , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVdsGroup ( ) . getcompatibility_version ( ) , org.ovirt.engine.core.common.AuditLogType.ADD_VM_FROM_SNAPSHOT_INVALID_INTERFACES ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : vmFromConfiguration.getInterfaces ( ) ) { vnicProfileHelper.updateNicWithVnicProfileForUser ( iface , org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getCurrentUser ( ) ) ; } vnicProfileHelper.auditInvalidInterfaces ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommand.getVmName ( ) ) ; super . addVmNetwork ( ) ; }
Source:
private void edit ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getSelectedItem ( ) ; if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.templates.AsyncQuery getVmInitQuery = new org.ovirt.engine.ui.uicommonweb.models.templates.AsyncQuery ( ) ; getVmInitQuery.asyncCallback = new org.ovirt.engine.ui.frontend.AsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object result ) { vmInitLoaded ( ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( result ) ) ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getTemplateById ( getVmInitQuery , template.getId ( ) ) ; }

Target:
private void edit ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getSelectedItem ( ) ; if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getTemplateById ( new org.ovirt.engine.ui.uicommonweb.models.templates.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.businessentities.VmTemplate result ) { vmInitLoaded ( result ) ; } } ) , template.getId ( ) ) ; }
Source:
public void testAddOperationAction ( ) { org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > testOperation = new org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > ( org.ovirt.engine.core.common.action.VdcActionType.AddNetworkOnProvider , new org.ovirt.engine.core.common.action.VdcActionParametersBase ( ) , null ) ; testManager.addOperation ( testOperation ) ; org.mockito.Mockito.verify ( mockOperationProcessor ) . processOperation ( testManager ) ; org.mockito.Mockito.verify ( mockEventBus ) . fireEvent ( org.mockito.Matchers.any ( org.ovirt.engine.ui.frontend.communication.EngineSessionRefreshedEvent.class ) ) ; org.junit.Assert.assertEquals ( "Operations must match" , testOperation , testManager.pollOperation ( ) ) ; }

Target:
public void testAddOperationAction ( ) { org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > testOperation = new org.ovirt.engine.ui.frontend.communication.VdcOperation ( org.ovirt.engine.core.common.action.VdcActionType.AddNetworkOnProvider , new org.ovirt.engine.core.common.action.VdcActionParametersBase ( ) , null ) ; testManager.addOperation ( testOperation ) ; org.mockito.Mockito.verify ( mockOperationProcessor ) . processOperation ( testManager ) ; org.mockito.Mockito.verify ( mockEventBus ) . fireEvent ( org.mockito.Matchers.any ( org.ovirt.engine.ui.frontend.communication.EngineSessionRefreshedEvent.class ) ) ; org.junit.Assert.assertEquals ( "Operations must match" , testOperation , testManager.pollOperation ( ) ) ; }
Source:
public void validateFailsForDifferentStorageDevice ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice1 = getStorageDevice ( "sda" , null ) ; org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice2 = getStorageDevice ( "sdb" , null ) ; storageDevice2.setDevType ( "SDA" ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( storageDevice1 , storageDevice2 ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForDifferentStorageDevice ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice1 = getStorageDevice ( "sda" , null ) ; org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice2 = getStorageDevice ( "sdb" , null ) ; storageDevice2.setDevType ( "SDA" ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( storageDevice1 , storageDevice2 ) ) , null ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void onBrowserEvent ( com.google.gwt.cell.client.Cell.Context context , final com.google.gwt.dom.client.Element elem , T object , com.google.gwt.dom.client.NativeEvent event ) { super . onBrowserEvent ( context , elem , object , event ) ; if ( BrowserEvents.MOUSEOVER.equals ( event.getType ( ) ) ) { com.google.gwt.safehtml.shared.SafeHtml tooltipHtml = getTooltip ( object ) ; if ( ! ( "" . equals ( tooltipHtml.asString ( ) ) ) ) { tooltipPanel.setText ( getTooltip ( object ) ) ; } } tooltipPanel.handleNativeBrowserEvent ( elem , event ) ; }

Target:
public void onBrowserEvent ( com.google.gwt.cell.client.Cell.Context context , final com.google.gwt.dom.client.Element elem , T object , com.google.gwt.dom.client.NativeEvent event ) { super . onBrowserEvent ( context , elem , object , event ) ; if ( BrowserEvents.MOUSEOVER.equals ( event.getType ( ) ) ) { com.google.gwt.safehtml.shared.SafeHtml tooltipHtml = getTooltip ( object ) ; if ( ( tooltipHtml != null ) && ( ! ( tooltipHtml.asString ( ) . isEmpty ( ) ) ) ) { tooltipPanel.setText ( getTooltip ( object ) ) ; } } tooltipPanel.handleNativeBrowserEvent ( elem , event ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalDiscoveredHostsListModel = getExternalDiscoveredHosts ( ) ; externalDiscoveredHostsListModel.setItems ( hosts ) ; externalDiscoveredHostsListModel.setIsChangeable ( true ) ; }

Target:
public void onSuccess ( java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalDiscoveredHostsListModel = getExternalDiscoveredHosts ( ) ; externalDiscoveredHostsListModel.setItems ( hosts ) ; externalDiscoveredHostsListModel.setIsChangeable ( true ) ; }
Source:
private void movePoolToProblematicInDB ( org.ovirt.engine.core.common.businessentities.storage_pool storagePool , boolean resetSpmInDB ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolStatusChange ( storagePool.getId ( ) , StoragePoolStatus.Problematic , AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC , VdcBllErrors.ENGINE ) ; if ( resetSpmInDB ) { storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; } }

Target:
private void movePoolToProblematicInDB ( org.ovirt.engine.core.common.businessentities.storage_pool storagePool ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolStatusChange ( storagePool.getId ( ) , StoragePoolStatus.Problematic , AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC , VdcBllErrors.ENGINE ) ; storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( ( ( p.getUsageCpuPercent ( ) ) + ( calcSpmCpuConsumption ( p ) ) ) < lowUtilization ) && ( ( p.getVmCount ( ) ) >= minVmCount ) ) && ( ( ( p.getCpuOverCommitTimestamp ( ) ) == null ) || ( ( ( getTime ( ) . getTime ( ) ) - ( p.getCpuOverCommitTimestamp ( ) . getTime ( ) ) ) < ( java.util.concurrent.TimeUnit.MINUTES.toMillis ( cpuOverCommitDurationMinutes ) ) ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( ( ( p.getUsageCpuPercent ( ) ) + ( calcSpmCpuConsumption ( p ) ) ) < lowUtilization ) && ( ( p.getVmCount ( ) ) >= minVmCount ) ) && ( ( ( p.getCpuOverCommitTimestamp ( ) ) == null ) || ( ( ( getTime ( ) . getTime ( ) ) - ( p.getCpuOverCommitTimestamp ( ) . getTime ( ) ) ) >= ( java.util.concurrent.TimeUnit.MINUTES.toMillis ( cpuOverCommitDurationMinutes ) ) ) ) ; }
Source:
public void testNonExistingQuota ( ) { org.mockito.Mockito.doReturn ( quotaDao ) . when ( cmd ) . getQuotaDao ( ) ; org.ovirt.engine.core.compat.Guid quotaId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; cmd.getParameters ( ) . getVm ( ) . setQuotaId ( quotaId ) ; org.junit.Assert.assertFalse ( cmd.validateQuota ( quotaId ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST ) ; }

Target:
public void testNonExistingQuota ( ) { org.ovirt.engine.core.compat.Guid quotaId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; cmd.getParameters ( ) . getVm ( ) . setQuotaId ( quotaId ) ; org.junit.Assert.assertFalse ( cmd.validateQuota ( quotaId ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST ) ; }
Source:
public void init ( ) { broker = org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapFactory.getInstance ( getProfileName ( ) ) ; context.put ( ExtensionProperties.AUTHOR , "The oVirt Project" ) ; context.put ( ExtensionProperties.EXTENSION_NAME , "Internal Kerberos/LDAP authorization (Built-in)" ) ; context.put ( ExtensionProperties.LICENSE , "ASL 2.0" ) ; context.put ( ExtensionProperties.HOME , "http://www.ovirt.org" ) ; context.put ( ExtensionProperties.VERSION , "N/A" ) ; }

Target:
public void init ( ) { broker = org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapFactory.getInstance ( getName ( ) ) ; context.put ( ExtensionProperties.AUTHOR , "The oVirt Project" ) ; context.put ( ExtensionProperties.EXTENSION_NAME , "Internal Kerberos/LDAP authorization (Built-in)" ) ; context.put ( ExtensionProperties.LICENSE , "ASL 2.0" ) ; context.put ( ExtensionProperties.HOME , "http://www.ovirt.org" ) ; context.put ( ExtensionProperties.VERSION , "N/A" ) ; }
Source:
public void testNonExistingQuota ( ) { prepareVmToPassValidate ( ) ; vmStatic.setQuotaId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.doReturn ( quotaDao ) . when ( command ) . getQuotaDao ( ) ; org.junit.Assert.assertFalse ( command.validateQuota ( vmStatic.getQuotaId ( ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "" , command , EngineMessage.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST ) ; }

Target:
public void testNonExistingQuota ( ) { prepareVmToPassValidate ( ) ; vmStatic.setQuotaId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( command.validateQuota ( vmStatic.getQuotaId ( ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "" , command , EngineMessage.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST ) ; }
Source:
private void mockStorageDomainDao ( ) { org.ovirt.engine.core.common.businessentities.storage_domains storageDomains = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; storageDomains.setstatus ( StorageDomainStatus.Active ) ; storageDomains.setavailable_disk_size ( 10000000 ) ; storageDomains.setused_disk_size ( 10 ) ; org.mockito.Mockito.doReturn ( storageDomainDAO ) . when ( spyCommand ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.when ( storageDomainDAO.getForStoragePool ( storageDomainId , Guid.Empty ) ) . thenReturn ( storageDomains ) ; org.mockito.Mockito.when ( storageDomainDAO.get ( storageDomainId ) ) . thenReturn ( storageDomains ) ; }

Target:
private void mockStorageDomainDao ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomains.setstatus ( StorageDomainStatus.Active ) ; storageDomains.setavailable_disk_size ( 10000000 ) ; storageDomains.setused_disk_size ( 10 ) ; org.mockito.Mockito.doReturn ( storageDomainDAO ) . when ( spyCommand ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.when ( storageDomainDAO.getForStoragePool ( storageDomainId , Guid.Empty ) ) . thenReturn ( storageDomains ) ; org.mockito.Mockito.when ( storageDomainDAO.get ( storageDomainId ) ) . thenReturn ( storageDomains ) ; }
Source:
private void setSelectedVncImpl ( ) { java.lang.Object defConsoleModel = model.getModel ( ) . getDefaultConsoleModel ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel vncConsoleModel = ( defConsoleModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel ) ? ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel ) ( defConsoleModel ) ) : null ; if ( noVncImplRadioButton.asRadioButton ( ) . getValue ( ) ) { vncConsoleModel.setVncImplementation ( VncConsoleModel.ClientConsoleMode.NoVnc ) ; } else { vncConsoleModel.setVncImplementation ( VncConsoleModel.ClientConsoleMode.Native ) ; } }

Target:
private void setSelectedVncImpl ( ) { java.lang.Object defConsoleModel = model.getModel ( ) . getDefaultConsoleModel ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel vncConsoleModel = ( defConsoleModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel ) ? ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel ) ( defConsoleModel ) ) : null ; if ( vncConsoleModel == null ) { return ; } if ( noVncImplRadioButton.asRadioButton ( ) . getValue ( ) ) { vncConsoleModel.setVncImplementation ( VncConsoleModel.ClientConsoleMode.NoVnc ) ; } else { vncConsoleModel.setVncImplementation ( VncConsoleModel.ClientConsoleMode.Native ) ; } }
Source:
private void loadIconsToDatabase ( ) { final java.util.Map < java.lang.Integer , java.lang.String > osIdToOsNameMap = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) ; for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > entry : osIdToOsNameMap.entrySet ( ) ) { final org.ovirt.engine.core.common.queries.VmIconIdSizePair iconIdPair = org.ovirt.engine.core.bll.IconLoader.ensureIconsInDatabase ( entry.getValue ( ) ) ; if ( iconIdPair != null ) { osIdToIconIdMap.put ( entry.getKey ( ) , iconIdPair ) ; } } }

Target:
private void loadIconsToDatabase ( ) { final java.util.Map < java.lang.Integer , java.lang.String > osIdToOsNameMap = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) ; for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > entry : osIdToOsNameMap.entrySet ( ) ) { final org.ovirt.engine.core.common.queries.VmIconIdSizePair iconIdPair = ensureIconsInDatabase ( entry.getValue ( ) ) ; if ( iconIdPair != null ) { osIdToIconIdMap.put ( entry.getKey ( ) , iconIdPair ) ; } } }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; }
Source:
public void validateFailsForNoStorageDevice ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.emptyList ( ) ) , null ) ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForNoStorageDevice ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.emptyList ( ) ) ) . when ( cmd ) . getParameters ( ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isOsSupportedForVirtIoScsi ( org.ovirt.engine.core.common.businessentities.VM vm ) { final java.util.List < java.lang.String > unsupportedOSs = org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > GetValue ( ConfigValues.VirtIoScsiUnsupportedOsList ) ; java.lang.String vmOs = org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) . get ( vm.getVmOsId ( ) ) ; for ( java.lang.String os : unsupportedOSs ) { if ( os.equalsIgnoreCase ( vmOs ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isOsSupportedForVirtIoScsi ( org.ovirt.engine.core.common.businessentities.VM vm ) { final java.util.List < java.lang.String > unsupportedOSs = org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > getValue ( ConfigValues.VirtIoScsiUnsupportedOsList ) ; java.lang.String vmOs = org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) . get ( vm.getVmOsId ( ) ) ; for ( java.lang.String os : unsupportedOSs ) { if ( os.equalsIgnoreCase ( vmOs ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private void mockVmDevice ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { org.mockito.Mockito.when ( vmDeviceDao.getVmDeviceByVmIdAndType ( vm.getId ( ) , vmDevice.getType ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( vmDevice ) ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( dbFacade ) . getVmDeviceDao ( ) ; }

Target:
private void mockVmDevice ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { org.mockito.Mockito.when ( vmDeviceDao.getVmDeviceByVmIdAndType ( vm.getId ( ) , vmDevice.getType ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( vmDevice ) ) ; }
Source:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > bootModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getIsBootable ( ) ; return ( bootModel.getIsChangable ( ) ) || ( ( bootModel.getEntity ( ) ) == true ) ; }

Target:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.Boolean > bootModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getIsBootable ( ) ; return ( bootModel.getIsChangable ( ) ) || ( bootModel.getEntity ( ) ) ; }
Source:
public void vmNameNullVm ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; b.setVmName ( null ) ; final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; v.setName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVm ( v ) ; final java.lang.String n = b.getVmName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }

Target:
public void vmNameNullVm ( ) { b.setVmName ( null ) ; final org.ovirt.engine.core.common.businessentities.VM v = new org.ovirt.engine.core.common.businessentities.VM ( ) ; v.setName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVm ( v ) ; final java.lang.String n = b.getVmName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }
Source:
protected < B extends org.ovirt.engine.api.model.BaseResource > void removeIfExist ( B model , java.lang.String relation ) { java.util.List < org.ovirt.engine.api.model.Link > linksCopy = new java.util.ArrayList < org.ovirt.engine.api.model.Link > ( model.getLinks ( ) ) ; for ( org.ovirt.engine.api.model.Link link : model.getLinks ( ) ) { if ( link.getRel ( ) . equals ( relation ) ) { linksCopy.remove ( link ) ; break ; } } model.getLinks ( ) . retainAll ( linksCopy ) ; }

Target:
protected < B extends org.ovirt.engine.api.model.BaseResource > void removeIfExist ( B model , java.lang.String relation ) { java.util.List < org.ovirt.engine.api.model.Link > linksCopy = new java.util.ArrayList ( model.getLinks ( ) ) ; for ( org.ovirt.engine.api.model.Link link : model.getLinks ( ) ) { if ( link.getRel ( ) . equals ( relation ) ) { linksCopy.remove ( link ) ; break ; } } model.getLinks ( ) . retainAll ( linksCopy ) ; }
Source:
public void setValue ( final T value ) { if ( value != null ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { org.ovirt.engine.ui.common.widget.editor.GroupedListModelListBox.super . setValue ( value , true ) ; } } ) ; } }

Target:
public void setValue ( T value ) { if ( value != null ) { super . setValue ( value , true ) ; } }
Source:
public void validateVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToAnyNonDownVm ( org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }

Target:
public void validateVmHavingDeviceSnapshotsPluggedToOtherVmsThatAreNotDown ( ) { initStorageDomain ( srcStorageId ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ) . when ( diskValidator ) . isDiskPluggedToAnyNonDownVm ( org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; }
Source:
public void testInstall ( ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { NAMES [ 2 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setRootPassword ( NAMES [ 2 ] ) ; verifyActionResponse ( resource.install ( action ) ) ; }

Target:
public void testInstall ( ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { NAMES [ 2 ] } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setRootPassword ( NAMES [ 2 ] ) ; verifyActionResponse ( resource.install ( action ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > storagePools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = ( ( storagePools.size ( ) ) > 0 ) ? storagePools.get ( 0 ) : null ; vmListModel.postGetTemplatesNotPresentOnExportDomain ( storagePool ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > storagePools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( storagePools.size ( ) ) > 0 ) ? storagePools.get ( 0 ) : null ; vmListModel.postGetTemplatesNotPresentOnExportDomain ( storagePool ) ; }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( "FORMAT" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.VolumeFormat.class ) ; } else if ( "STATUS" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ImageStatus.class ) ; } else if ( "DISK_TYPE" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.class ) ; } return null ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( "STATUS" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ImageStatus.class ) ; } else if ( "DISK_TYPE" . equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.class ) ; } return null ; }
Source:
protected void onExportChanged ( ) { if ( getExport ( ) . getEntity ( ) ) { getHasVLanTag ( ) . setIsChangable ( false ) ; getVLanTag ( ) . setIsChangable ( false ) ; getIsVmNetwork ( ) . setIsChangable ( false ) ; getHasMtu ( ) . setIsChangable ( false ) ; getMtu ( ) . setIsChangable ( false ) ; getNetworkLabel ( ) . setIsChangable ( false ) ; } super . onExportChanged ( ) ; }

Target:
protected void onExportChanged ( ) { if ( getExport ( ) . getEntity ( ) ) { getHasVLanTag ( ) . setIsChangable ( false ) ; getVLanTag ( ) . setIsChangable ( false ) ; getIsVmNetwork ( ) . setIsChangable ( false ) ; getNetworkLabel ( ) . setIsChangable ( false ) ; } super . onExportChanged ( ) ; }
Source:
public void testGetCascadingResource_missingResourcesProperty ( ) throws java.net.URISyntaxException { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "05-test5.brand" ) ; org.ovirt.engine.core.branding.BrandingTheme theme5 = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 1 ) ; org.junit.Assert.assertTrue ( "Theme 5 should load" , theme5.load ( ) ) ; org.junit.Assert.assertNull ( "getCascadingResource not handling missing resources key gracefully" , theme5.getCascadingResource ( "this_file_is_missing_anyway" ) ) ; }

Target:
public void testGetCascadingResource_missingResourcesProperty ( ) throws java.net.URISyntaxException { java.io.File testThemeRootPath = new java.io.File ( this . getClass ( ) . getClassLoader ( ) . getResource ( "./org/ovirt/engine/core/branding" ) . toURI ( ) . getPath ( ) ) ; java.io.File testThemePath = new java.io.File ( testThemeRootPath.getAbsoluteFile ( ) , "05-test5.brand" ) ; org.ovirt.engine.core.branding.BrandingTheme theme5 = new org.ovirt.engine.core.branding.BrandingTheme ( testThemePath.getAbsolutePath ( ) , testThemeRootPath , 2 ) ; org.junit.Assert.assertTrue ( "Theme 5 should load" , theme5.load ( ) ) ; org.junit.Assert.assertNull ( "getCascadingResource not handling missing resources key gracefully" , theme5.getCascadingResource ( "this_file_is_missing_anyway" ) ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ParseLUNList ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct [ ] lunList ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > result = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( lunList.length ) ; for ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct xlun : lunList ) { result.add ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLunFromXmlRpc ( xlun ) ) ; } return result ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ParseLUNList ( java.util.Map < java.lang.String , java.lang.Object > [ ] lunList ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > result = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( lunList.length ) ; for ( java.util.Map < java.lang.String , java.lang.Object > xlun : lunList ) { result.add ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.ParseLunFromXmlRpc ( xlun ) ) ; } return result ; }
Source:
protected void executeCommand ( ) { int missingDiskCount = getMissingDiskCount ( ) ; if ( missingDiskCount <= 0 ) { setOvfUpdateStep ( OvfUpdateStep.OVF_UPLOAD ) ; updateOvfStoreContent ( ) ; org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.setSucceeded ( true ) ; } else { setOvfUpdateStep ( OvfUpdateStep.OVF_STORES_CREATION ) ; org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.setSucceeded ( createOvfStoreDisks ( getMissingDiskCount ( ) ) ) ; } }

Target:
protected void executeCommand ( ) { int missingDiskCount = getMissingDiskCount ( ) ; if ( missingDiskCount <= 0 ) { setOvfUpdateStep ( OvfUpdateStep.OVF_UPLOAD ) ; org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.setSucceeded ( updateOvfStoreContent ( ) ) ; } else { setOvfUpdateStep ( OvfUpdateStep.OVF_STORES_CREATION ) ; org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.setSucceeded ( createOvfStoreDisks ( getMissingDiskCount ( ) ) ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < java.lang.String > domains = ( ( java.util.List < java.lang.String > ) ( returnValue ) ) ; getSysprepDomain ( ) . setItems ( domains ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( currentDomain ) ) ) { if ( ! ( domains.contains ( currentDomain ) ) ) { domains.add ( currentDomain ) ; } getSysprepDomain ( ) . setSelectedItem ( currentDomain ) ; } }

Target:
public void onSuccess ( java.util.List < java.lang.String > domains ) { getSysprepDomain ( ) . setItems ( domains ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( currentDomain ) ) ) { if ( ! ( domains.contains ( currentDomain ) ) ) { domains.add ( currentDomain ) ; } getSysprepDomain ( ) . setSelectedItem ( currentDomain ) ; } }
Source:
protected boolean performImagesChecks ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , true , true , false , false , false , true , true , getImagesList ( ) ) ; }

Target:
protected boolean performImagesChecks ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , true , true , false , false , true , true , getImagesList ( ) ) ; }
Source:
public static void fillImagesMapBasedOnTemplate ( org.ovirt.engine.core.common.businessentities.VmTemplate template , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > diskInfoDestinationMap , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > destStorages , boolean notCheckSize ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStoragePool ( template.getstorage_pool_id ( ) . getValue ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.fillImagesMapBasedOnTemplate ( template , domains , diskInfoDestinationMap , destStorages , notCheckSize ) ; }

Target:
public static void fillImagesMapBasedOnTemplate ( org.ovirt.engine.core.common.businessentities.VmTemplate template , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > diskInfoDestinationMap , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > destStorages , boolean notCheckSize ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStoragePool ( template.getStoragePoolId ( ) . getValue ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.fillImagesMapBasedOnTemplate ( template , domains , diskInfoDestinationMap , destStorages , notCheckSize ) ; }
Source:
private void spice_Disconnected ( java.lang.Object sender , org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs e ) { getspice ( ) . getDisconnectedEvent ( ) . removeListener ( this ) ; getspice ( ) . getMenuItemSelectedEvent ( ) . removeListener ( this ) ; setIsConnected ( false ) ; if ( ( e.getErrorCode ( ) ) > 100 ) { getErrorEvent ( ) . raise ( this , e ) ; } }

Target:
private void spice_Disconnected ( java.lang.Object sender , org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs e ) { getspice ( ) . getDisconnectedEvent ( ) . removeListener ( this ) ; setIsConnected ( false ) ; if ( ( e.getErrorCode ( ) ) > 100 ) { getErrorEvent ( ) . raise ( this , e ) ; } }
Source:
protected void onReset ( ) { super . onReset ( ) ; if ( ! ( hasReportsModelRefreshEvent ( ) ) ) { org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.reportsWebappDeployed = false ; getModel ( ) . getReportsAvailabilityEvent ( ) . addListener ( new org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.ReportsModelRefreshEvent ( ) ) ; } setSubTabPanelVisible ( false ) ; getModel ( ) . refreshReportModel ( ) ; }

Target:
protected void onReset ( ) { super . onReset ( ) ; if ( ! ( hasReportsModelRefreshEvent ( ) ) ) { getModel ( ) . getReportsAvailabilityEvent ( ) . addListener ( new org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.ReportsModelRefreshEvent ( ) ) ; } setSubTabPanelVisible ( false ) ; getModel ( ) . refreshReportModel ( ) ; }
Source:
public void getCustomValuesLeaksInternalStructure ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; b.addCustomValue ( key , value ) ; final java.lang.String v = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , v ) ; final java.util.Map < java.lang.String , java.lang.String > m = b.getCustomValues ( ) ; m.clear ( ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( "" , s ) ; }

Target:
public void getCustomValuesLeaksInternalStructure ( ) { final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; b.addCustomValue ( key , value ) ; final java.lang.String v = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , v ) ; final java.util.Map < java.lang.String , java.lang.String > m = b.getCustomValues ( ) ; m.clear ( ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( "" , s ) ; }
Source:
private void addExternallyManagedVm ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.AddVmFromScratch , new org.ovirt.engine.core.common.action.AddVmParameters ( vmStatic ) , createAddExternalVmContext ( vmStatic ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { log.debug ( "Failed adding Externally managed VM '{}'" , vmStatic.getName ( ) ) ; } }

Target:
protected void addExternallyManagedVm ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.AddVmFromScratch , new org.ovirt.engine.core.common.action.AddVmParameters ( vmStatic ) , createAddExternalVmContext ( vmStatic ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { log.debug ( "Failed adding Externally managed VM '{}'" , vmStatic.getName ( ) ) ; } }
Source:
protected void build ( org.ovirt.engine.core.common.businessentities.VmBase vm , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { if ( supported ( ConfigurationValues.SerialNumberPolicySupported , model ) ) { model.getSerialNumberPolicy ( ) . setSelectedSerialNumberPolicy ( vm.getSerialNumberPolicy ( ) ) ; model.getSerialNumberPolicy ( ) . getCustomSerialNumber ( ) . setEntity ( vm.getCustomSerialNumber ( ) ) ; } }

Target:
protected void build ( org.ovirt.engine.core.common.businessentities.VmBase vm , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { model.getSerialNumberPolicy ( ) . setSelectedSerialNumberPolicy ( vm.getSerialNumberPolicy ( ) ) ; model.getSerialNumberPolicy ( ) . getCustomSerialNumber ( ) . setEntity ( vm.getCustomSerialNumber ( ) ) ; }
Source:
private void hostName_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.VDS host = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getExternalHostName ( ) . getSelectedItem ( ) ) ) ; if ( host == null ) { host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; } updateModelFromVds ( host , null , false , null , true ) ; }

Target:
private void hostName_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.VDS host = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getExternalHostName ( ) . getSelectedItem ( ) ) ) ; if ( host == null ) { host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; } updateModelFromVds ( host , null , false , null ) ; }
Source:
private void prepare2 ( ) { org.ovirt.engine.ui.uicompat.PreparingEnlistment enlistment = ( ( org.ovirt.engine.ui.uicompat.PreparingEnlistment ) ( context.enlistment ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext enlistmentContext = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext ) ( enlistment.getContext ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = context.activateVdsReturnValue ; if ( ( returnValue == null ) || ( ! ( returnValue.getSucceeded ( ) ) ) ) { context.enlistment = null ; enlistment.ForceRollback ( ) ; } else { prepare3 ( ) ; } }

Target:
private void prepare2 ( ) { org.ovirt.engine.ui.uicompat.PreparingEnlistment enlistment = ( ( org.ovirt.engine.ui.uicompat.PreparingEnlistment ) ( context.enlistment ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = context.activateVdsReturnValue ; if ( ( returnValue == null ) || ( ! ( returnValue.getSucceeded ( ) ) ) ) { context.enlistment = null ; enlistment.ForceRollback ( ) ; } else { prepare3 ( ) ; } }
Source:
private void rollback5 ( ) { org.ovirt.engine.ui.uicompat.Enlistment enlistment = context.enlistment ; org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext enlistmentContext = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext ) ( enlistment.getContext ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = context.changeVDSClusterReturnValue ; if ( ( enlistmentContext.getDataCenterId ( ) ) != null ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveStoragePool , new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( enlistmentContext.getDataCenterId ( ) ) ) ; } context.enlistment = null ; enlistment.Done ( ) ; }

Target:
private void rollback5 ( ) { org.ovirt.engine.ui.uicompat.Enlistment enlistment = context.enlistment ; org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext enlistmentContext = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext ) ( enlistment.getContext ( ) ) ) ; if ( ( enlistmentContext.getDataCenterId ( ) ) != null ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveStoragePool , new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( enlistmentContext.getDataCenterId ( ) ) ) ; } context.enlistment = null ; enlistment.Done ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.Empty , vm.getId ( ) ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , "device" , "address" , 1 , new java.util.HashMap < > ( ) , true , true , true , "alias" , new java.util.HashMap < > ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , "logical" ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmDevice createVmDevice ( ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.Empty , vm.getId ( ) ) , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.DISK , "device" , "address" , new java.util.HashMap < > ( ) , true , true , true , "alias" , new java.util.HashMap < > ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , "logical" ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVmNetworkStatisticsDao ( ) ) ; newVmStatistics = new org.ovirt.engine.core.common.businessentities.network.VmNetworkStatistics ( ) ; newVmStatistics.setId ( org.ovirt.engine.core.dao.network.VmNetworkStatisticsDaoTest.NEW_INTERFACE_ID ) ; newVmStatistics.setVmId ( org.ovirt.engine.core.dao.network.VmNetworkStatisticsDaoTest.VM_ID ) ; newVmStatistics.setStatus ( InterfaceStatus.DOWN ) ; newVmStatistics.setReceiveDropRate ( 0.0 ) ; newVmStatistics.setReceiveRate ( 0.0 ) ; newVmStatistics.setTransmitDropRate ( 0.0 ) ; newVmStatistics.setTransmitRate ( 0.0 ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVmNetworkStatisticsDao ( ) ; newVmStatistics = new org.ovirt.engine.core.common.businessentities.network.VmNetworkStatistics ( ) ; newVmStatistics.setId ( org.ovirt.engine.core.dao.network.VmNetworkStatisticsDaoTest.NEW_INTERFACE_ID ) ; newVmStatistics.setVmId ( org.ovirt.engine.core.dao.network.VmNetworkStatisticsDaoTest.VM_ID ) ; newVmStatistics.setStatus ( InterfaceStatus.DOWN ) ; newVmStatistics.setReceiveDropRate ( 0.0 ) ; newVmStatistics.setReceiveRate ( 0.0 ) ; newVmStatistics.setTransmitDropRate ( 0.0 ) ; newVmStatistics.setTransmitRate ( 0.0 ) ; }