auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void removeMemoryVolumesOfSnapshot ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( snapshot.getMemoryVolume ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { log.errorFormat ( "Failed to remove memory volumes of snapshot {0} ({1})" , snapshot.getDescription ( ) , snapshot.getId ( ) ) ; } }

Target:
private void removeMemoryVolumesOfSnapshot ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( snapshot.getMemoryVolume ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { log.error ( "Failed to remove memory volumes of snapshot '{}' ({})" , snapshot.getDescription ( ) , snapshot.getId ( ) ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; org.mockito.Mockito.when ( storageDomainDaoMock.getHostedEngineStorageDomainIds ( ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.mockito.Mockito.doReturn ( java.lang.Boolean.TRUE ) . when ( getQuery ( ) ) . connectStorageDomain ( org.mockito.Matchers.eq ( storageDomain ) ) ; org.mockito.Mockito.doReturn ( java.lang.Boolean.TRUE ) . when ( getQuery ( ) ) . disconnectStorageDomain ( org.mockito.Matchers.eq ( storageDomain ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; org.mockito.Mockito.when ( storageDomainDaoMock.getHostedEngineStorageDomainIds ( ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.mockito.Mockito.doReturn ( java.lang.Boolean.TRUE ) . when ( getQuery ( ) ) . connectStorageDomain ( org.mockito.ArgumentMatchers.eq ( storageDomain ) ) ; org.mockito.Mockito.doReturn ( java.lang.Boolean.TRUE ) . when ( getQuery ( ) ) . disconnectStorageDomain ( org.mockito.ArgumentMatchers.eq ( storageDomain ) ) ; }
Source:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
protected boolean isMemoryStateRemovable ( java.lang.String memoryVolume ) { if ( memoryVolume.isEmpty ( ) ) { return false ; } int numOfSnapshotsUsingThisMemory = getSnapshotDao ( ) . getNumOfSnapshotsByMemory ( memoryVolume ) ; return numOfSnapshotsUsingThisMemory == ( removeOnlyIfNotUsedAtAll ? 0 : 1 ) ; }

Target:
protected boolean isMemoryStateRemovable ( java.lang.String memoryVolume ) { if ( memoryVolume.isEmpty ( ) ) { return false ; } if ( forceRemove ) { return true ; } int numOfSnapshotsUsingThisMemory = getSnapshotDao ( ) . getNumOfSnapshotsByMemory ( memoryVolume ) ; return numOfSnapshotsUsingThisMemory == ( removeOnlyIfNotUsedAtAll ? 0 : 1 ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( ! ( bondDialogModel.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; setBondOptions ( entity , bondDialogModel ) ; org.ovirt.engine.core.common.businessentities.network.Bond bond = ( ( org.ovirt.engine.core.common.businessentities.network.Bond ) ( entity ) ) ; onBondEditUpdateParams ( bond ) ; }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( ! ( bondDialogModel.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; setBondOptions ( createOrUpdateBondParameter , bondDialogModel ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { ifaceQos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; networkQos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; iface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; iface.setBridged ( true ) ; iface.setQos ( ifaceQos ) ; iface.setSwitchType ( SwitchType.LEGACY ) ; network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; testedNetworkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; testedNetworkAttachment.setSwitchType ( SwitchType.LEGACY ) ; testedNetworkAttachment.setIpConfiguration ( new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { ifaceQos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; networkQos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; iface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; iface.setBridged ( true ) ; iface.setQos ( ifaceQos ) ; iface.setReportedSwitchType ( SwitchType.LEGACY ) ; network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; testedNetworkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; testedNetworkAttachment.setIpConfiguration ( new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ) ; cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setRequiredSwitchTypeForCluster ( SwitchType.LEGACY ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.quota.QuotaModel object ) { this . model = object ; if ( ! ( firstTime ) ) { registerHandlers ( ) ; firstTime = true ; updateSliders ( ) ; } quotaClusterTable.edit ( object.getQuotaClusters ( ) ) ; quotaStorageTable.edit ( object.getQuotaStorages ( ) ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.QuotaPopupView.Driver.driver.edit ( object ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.quota.QuotaModel object ) { this . model = object ; if ( ! ( firstTime ) ) { registerHandlers ( ) ; firstTime = true ; updateSliders ( ) ; } quotaClusterTable.edit ( object.getQuotaClusters ( ) ) ; quotaStorageTable.edit ( object.getQuotaStorages ( ) ) ; driver.edit ( object ) ; }
Source:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public java.lang.Boolean isMemoryHotUnplugSupportedByArchitecture ( org.ovirt.engine.core.common.businessentities.ArchitectureType architecture , org.ovirt.engine.core.compat.Version version ) { return memoryHotUnplugSupport.get ( architecture ) . get ( version ) ; }
Source:
public static void GetGlusterVolumeBrickDetails ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volume , java.lang.String brick ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , volume , brick , true ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void GetClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , "" , "" , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; vds.setVdsName ( "gfs1" ) ; vds.setVdsGroupId ( CLUSTER_ID ) ; vds.setStatus ( status ) ; return vds ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; vds.setVdsName ( "gfs1" ) ; vds.setVdsGroupId ( org.ovirt.engine.core.bll.gluster.GetAddedGlusterServersQueryTest.CLUSTER_ID ) ; vds.setStatus ( status ) ; return vds ; }
Source:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onSucceeded ( cmdId , childCmdIds ) ; getCommand ( ) . performDiskUpdate ( ) ; log.error ( "Disk has been successfully extended. ID: {}" , getDiskId ( ) ) ; updateAuditLog ( AuditLogType.USER_EXTEND_DISK_SIZE_SUCCESS , getCommand ( ) . getNewDiskSizeInGB ( ) ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { org.ovirt.engine.core.bll.storage.disk.cinder.ExtendCinderDiskCommand command = getCommand ( cmdId ) ; command.performDiskUpdate ( ) ; log.error ( "Disk has been successfully extended. ID: {}" , getDiskId ( command ) ) ; updateAuditLog ( command , AuditLogType.USER_EXTEND_DISK_SIZE_SUCCESS , command.getNewDiskSizeInGB ( ) ) ; super . onSucceeded ( cmdId , childCmdIds ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void findNoneOfActiveVmsUsingNetworks ( ) { mockDaos ( ) ; java.util.List < java.lang.String > vmNames = vmInterfaceManager.findActiveVmsUsingNetworks ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , java.util.Collections.singletonList ( ( ( NETWORK_NAME ) + "1" ) ) ) ; org.junit.Assert.assertTrue ( vmNames.isEmpty ( ) ) ; }

Target:
public void findActiveVmsUsingNetworksOnUnpluggedVnic ( ) { mockDaos ( false ) ; java.util.List < java.lang.String > vmNames = vmInterfaceManager.findActiveVmsUsingNetworks ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , java.util.Collections.singletonList ( NETWORK_NAME ) ) ; org.junit.Assert.assertFalse ( vmNames.contains ( VM_NAME ) ) ; }
Source:
protected void executeQueryCommand ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > consoleDevices = getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.GetConsoleDevicesQuery.getParameters ( ) . getId ( ) , VmDeviceGeneralType.CONSOLE ) ; java.util.List < java.lang.String > result = new java.util.ArrayList ( consoleDevices.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice v : consoleDevices ) { result.add ( v.getDevice ( ) ) ; } org.ovirt.engine.core.bll.GetConsoleDevicesQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > consoleDevices = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.GetConsoleDevicesQuery.getParameters ( ) . getId ( ) , VmDeviceGeneralType.CONSOLE ) ; java.util.List < java.lang.String > result = new java.util.ArrayList ( consoleDevices.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice v : consoleDevices ) { result.add ( v.getDevice ( ) ) ; } org.ovirt.engine.core.bll.GetConsoleDevicesQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
protected void setAllowChangeHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallFailed ) ) { getHost ( ) . setIsChangable ( false ) ; } else { getHost ( ) . setIsChangable ( true ) ; } }

Target:
protected void setAllowChangeHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallFailed ) ) { getHost ( ) . setIsChangable ( false ) ; getPort ( ) . setIsChangable ( false ) ; } else { getHost ( ) . setIsChangable ( true ) ; getPort ( ) . setIsChangable ( true ) ; } }
Source:
public static void removeUsbSlots ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.removeVmDevices ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.getUsbSlots ( vmId ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmDevice addDiskDevice ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid deviceId , java.lang.Boolean isPlugged , java.lang.Boolean isReadOnly , java.lang.String address , boolean isUsingScsiReservation ) { return addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vmId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , org.ovirt.engine.core.bll.utils.VmDeviceUtils.EMPTY_SPEC_PARAMS , isPlugged , isReadOnly , address , null , isUsingScsiReservation ) ; }
Source:
public void testZeroLatency ( ) { java.lang.String doubleValue = "0" ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = getVmDynamic ( ) ; java.util.Map < java.lang.String , java.lang.Object > diskData = setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_write_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = setMockForTesting ( diskData ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xml ) ; org.junit.Assert.assertEquals ( vmDynamic.getDisks ( ) . get ( 0 ) . getWriteLatency ( ) , new java.lang.Double ( "0" ) ) ; }

Target:
public void testZeroLatency ( ) { java.lang.String doubleValue = "0" ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVmDynamic ( ) ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_write_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setMockForTesting ( diskData ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xml ) ; org.junit.Assert.assertEquals ( vmDynamic.getDisks ( ) . get ( 0 ) . getWriteLatency ( ) , new java.lang.Double ( "0" ) ) ; }
Source:
private void Override_EntityChanged ( org.ovirt.engine.ui.uicompat.EventArgs e ) { if ( ! ( getIsEditMode ( ) ) ) { boolean isChangable = ( ( java.lang.Boolean ) ( getOverride ( ) . getEntity ( ) ) ) ; getVersion ( ) . setIsChangable ( isChangable ) ; getRetransmissions ( ) . setIsChangable ( isChangable ) ; getTimeout ( ) . setIsChangable ( isChangable ) ; } }

Target:
private void Override_EntityChanged ( org.ovirt.engine.ui.uicompat.EventArgs e ) { boolean isChangeable = ( ( java.lang.Boolean ) ( getOverride ( ) . getEntity ( ) ) ) ; getVersion ( ) . setIsChangable ( isChangeable ) ; getRetransmissions ( ) . setIsChangable ( isChangeable ) ; getTimeout ( ) . setIsChangable ( isChangeable ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid clusterId = org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getDbFacade ( ) . getNetworkDao ( ) . getAllForCluster ( clusterId , org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid clusterId = org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getQueryReturnValue ( ) . setReturnValue ( networkDao.getAllForCluster ( clusterId , org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public void setEnabled ( boolean enabled ) { super . setEnabled ( enabled ) ; isEnabled = enabled ; if ( enabled ) { header.removeStyleName ( OvirtCss.LABEL_DISABLED ) ; } else { header.addStyleName ( OvirtCss.LABEL_DISABLED ) ; } updateButtonState ( ) ; }

Target:
public void setEnabled ( boolean enabled ) { super . setEnabled ( enabled ) ; isEnabled = enabled ; if ( enabled ) { header.removeStyleName ( OvirtCss.LABEL_DISABLED ) ; newProxyLabel.removeStyleName ( OvirtCss.LABEL_DISABLED ) ; } else { header.addStyleName ( OvirtCss.LABEL_DISABLED ) ; newProxyLabel.addStyleName ( OvirtCss.LABEL_DISABLED ) ; } newProxyButton.setEnabled ( enabled ) ; updateButtonState ( ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateLibvirtSecret , org.ovirt.engine.core.common.action.LibvirtSecretParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( getModel ( 1 ) ) , 1 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateLibvirtSecret , org.ovirt.engine.core.common.action.LibvirtSecretParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( getModel ( 1 ) ) , 1 ) ; }
Source:
public void testAddLunDisk_MissingId ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setId ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddLunDisk_MissingId" , "id" ) ; } }

Target:
public void testAddLunDiskMissingId ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setId ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddLunDiskMissingId" , "id" ) ; } }
Source:
public static void GetCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static void GetDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
protected boolean buildAndCheckDestStorageDomains ( ) { boolean retValue = true ; if ( diskInfoDestinationMap.isEmpty ( ) ) { retValue = fillDestMap ( ) ; } else { retValue = validateProvidedDestinations ( ) ; } if ( retValue && ( ( getImagesToCheckDestinationStorageDomains ( ) . size ( ) ) != ( diskInfoDestinationMap.size ( ) ) ) ) { log.errorFormat ( "Can not find any default active domain for one of the disks of template with id : {0}" , vmDisksSource.getId ( ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_MISSED_STORAGES_FOR_SOME_DISKS ) ; retValue = false ; } return retValue && ( validateIsImagesOnDomains ( ) ) ; }

Target:
protected boolean buildAndCheckDestStorageDomains ( ) { boolean retValue = true ; if ( diskInfoDestinationMap.isEmpty ( ) ) { retValue = fillDestMap ( ) ; } else { retValue = validateProvidedDestinations ( ) ; } if ( retValue && ( ( getImagesToCheckDestinationStorageDomains ( ) . size ( ) ) != ( diskInfoDestinationMap.size ( ) ) ) ) { log.error ( "Can not find any default active domain for one of the disks of template with id '{}'" , vmDisksSource.getId ( ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_MISSED_STORAGES_FOR_SOME_DISKS ) ; retValue = false ; } return retValue && ( validateIsImagesOnDomains ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.NetworkAttachment getNetworkAttachmentForNetwork ( org.ovirt.engine.core.compat.Guid networkId ) { if ( networkId == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment updatedAttachment = new org.ovirt.engine.core.common.utils.MapNetworkAttachments ( hostSetupNetworksParametersData.newOrModifiedNetworkAttachments ) . byNetworkId ( ) . get ( networkId ) ; if ( updatedAttachment != null ) { return updatedAttachment ; } org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment = getExistingAttachmentByNetworkId ( networkId ) ; if ( ( existingAttachment != null ) && ( ! ( shouldBeRemoved ( existingAttachment.getId ( ) ) ) ) ) { return existingAttachment ; } return null ; }

Target:
private void attachNetworks ( java.lang.String bondName , java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > networks ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel bondModel = nicModelByName.get ( bondName ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.attachNetworks ( bondModel , new java.util.ArrayList ( networks ) , hostSetupNetworksParametersData ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.RepoImage getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.RepoImage entity = new org.ovirt.engine.core.common.businessentities.RepoImage ( ) ; entity.setRepoImageId ( GUIDS [ index ] . toString ( ) ) ; entity.setFileType ( ImageFileType.Disk ) ; entity.setRepoImageName ( ( "RepoImage " + ( entity.getRepoImageId ( ) ) ) ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.RepoImage getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.storage.RepoImage entity = new org.ovirt.engine.core.common.businessentities.storage.RepoImage ( ) ; entity.setRepoImageId ( GUIDS [ index ] . toString ( ) ) ; entity.setFileType ( ImageFileType.Disk ) ; entity.setRepoImageName ( ( "RepoImage " + ( entity.getRepoImageId ( ) ) ) ) ; return entity ; }
Source:
protected void RunCommands ( ) { SortCommands ( ) ; for ( final org.ovirt.engine.core.bll.CommandBase < ? > command : getCommands ( ) ) { if ( command.getReturnValue ( ) . getCanDoAction ( ) ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { executeValidatedCommand ( command ) ; } } ) ; } } }

Target:
protected void RunCommands ( ) { sortCommands ( ) ; for ( final org.ovirt.engine.core.bll.CommandBase < ? > command : getCommands ( ) ) { if ( command.getReturnValue ( ) . getCanDoAction ( ) ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { executeValidatedCommand ( command ) ; } } ) ; } } }
Source:
private void updateCurrentCd ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = org.ovirt.engine.core.bll.ChangeDiskCommand.getVm ( ) . getDynamicData ( ) ; vmDynamic.setCurrentCd ( org.ovirt.engine.core.bll.ChangeDiskCommand.getParameters ( ) . getCdImagePath ( ) ) ; org.ovirt.engine.core.bll.ChangeDiskCommand.getVmDynamicDao ( ) . update ( vmDynamic ) ; }

Target:
protected void perform ( ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ChangeDisk , new org.ovirt.engine.core.common.vdscommands.ChangeDiskVDSCommandParameters ( org.ovirt.engine.core.bll.ChangeDiskCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ChangeDiskCommand.getVm ( ) . getId ( ) , cdImagePath ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateCurrentCd ( org.ovirt.engine.core.bll.ChangeDiskCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ChangeDiskCommand.getVm ( ) , org.ovirt.engine.core.bll.ChangeDiskCommand.getParameters ( ) . getCdImagePath ( ) ) ; org.ovirt.engine.core.bll.ChangeDiskCommand.setSucceeded ( true ) ; }
Source:
public void getForExistingVds ( ) { org.ovirt.engine.core.common.businessentities.VdsKdumpStatus expected = new org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ( ) ; expected.setVdsId ( FixturesTool.HOST_ID ) ; expected.setStatus ( KdumpFlowStatus.DUMPING ) ; expected.setAddress ( "[\"192.168.122.18\", 2222]" ) ; org.ovirt.engine.core.common.businessentities.VdsKdumpStatus found = dao.get ( expected.getVdsId ( ) ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( expected , found ) ; }

Target:
public void getForExistingVds ( ) { org.ovirt.engine.core.common.businessentities.VdsKdumpStatus expected = new org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ( ) ; expected.setVdsId ( FixturesTool.HOST_ID ) ; expected.setStatus ( KdumpFlowStatus.DUMPING ) ; expected.setAddress ( "[\"192.168.122.18\", 2222]" ) ; org.ovirt.engine.core.common.businessentities.VdsKdumpStatus found = dao.get ( expected.getVdsId ( ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( found ) ; org.junit.jupiter.api.Assertions.assertEquals ( expected , found ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; newImage = new org.ovirt.engine.core.common.businessentities.storage.Image ( ) ; newImage.setActive ( true ) ; newImage.setTemplateImageId ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_DISK_TEMPLATE_ID ) ; newImage.setSnapshotId ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_SNAPSHOT_ID ) ; newImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newImage.setVolumeFormat ( VolumeFormat.COW ) ; newImage.setVolumeType ( VolumeType.Sparse ) ; newImage.setDiskId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; newImage = new org.ovirt.engine.core.common.businessentities.storage.Image ( ) ; newImage.setActive ( true ) ; newImage.setVolumeClassification ( VolumeClassification.Volume ) ; newImage.setTemplateImageId ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_DISK_TEMPLATE_ID ) ; newImage.setSnapshotId ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_SNAPSHOT_ID ) ; newImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newImage.setVolumeFormat ( VolumeFormat.COW ) ; newImage.setVolumeType ( VolumeType.Sparse ) ; newImage.setDiskId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; }
Source:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
private void setupVdsGroupDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > expectedNetworkCluster = java.util.Collections.singletonList ( networkCluster ) ; org.ovirt.engine.core.dao.NetworkClusterDAO networkClusterDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.NetworkClusterDAO.class ) ; org.mockito.Mockito.when ( networkClusterDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedNetworkCluster ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getNetworkClusterDao ( ) ) . thenReturn ( networkClusterDaoMock ) ; }

Target:
private void setupVdsGroupDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > expectedNetworkCluster = java.util.Collections.singletonList ( networkCluster ) ; org.ovirt.engine.core.dao.NetworkClusterDao networkClusterDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.NetworkClusterDao.class ) ; org.mockito.Mockito.when ( networkClusterDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedNetworkCluster ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getNetworkClusterDao ( ) ) . thenReturn ( networkClusterDaoMock ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionList" ) . withParameter ( "volName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolName" , slaveVolumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionList" ) . withParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }
Source:
private boolean isLimitExceeded ( com.woorea.openstack.cinder.model.Limits limits , org.ovirt.engine.core.bll.validator.storage.CinderDisksValidator.CinderVolumeType cinderType , int diskCount ) { if ( cinderType == ( org.ovirt.engine.core.bll.validator.storage.CinderDisksValidator.CinderVolumeType.Snapshot ) ) { return ( ( limits.getAbsolute ( ) . getTotalSnapshotsUsed ( ) ) + diskCount ) >= ( limits.getAbsolute ( ) . getMaxTotalSnapshots ( ) ) ; } if ( cinderType == ( org.ovirt.engine.core.bll.validator.storage.CinderDisksValidator.CinderVolumeType.Volume ) ) { return ( ( limits.getAbsolute ( ) . getTotalVolumesUsed ( ) ) + diskCount ) >= ( limits.getAbsolute ( ) . getMaxTotalVolumes ( ) ) ; } return false ; }

Target:
private boolean isLimitExceeded ( com.woorea.openstack.cinder.model.Limits limits , org.ovirt.engine.core.common.businessentities.storage.VolumeClassification cinderType , int diskCount ) { if ( cinderType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeClassification.Snapshot ) ) { return ( ( limits.getAbsolute ( ) . getTotalSnapshotsUsed ( ) ) + diskCount ) >= ( limits.getAbsolute ( ) . getMaxTotalSnapshots ( ) ) ; } if ( cinderType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeClassification.Volume ) ) { return ( ( limits.getAbsolute ( ) . getTotalVolumesUsed ( ) ) + diskCount ) >= ( limits.getAbsolute ( ) . getMaxTotalVolumes ( ) ) ; } return false ; }
Source:
private org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; disk.setId ( diskImageGuid ) ; disk.setSize ( 100000L ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singleton ( sdId ) ) ) ; disk.setStoragePoolId ( spId ) ; disk.setDescription ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; return disk ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; disk.setId ( diskImageGuid ) ; disk.setSize ( 100000L ) ; disk.setDiskInterface ( DiskInterface.VirtIO ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singleton ( sdId ) ) ) ; disk.setStoragePoolId ( spId ) ; disk.setDescription ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; return disk ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.HibernateVmCommand.getActionState ( ) ) { case EXECUTE : return org.ovirt.engine.core.bll.HibernateVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_SUSPEND_VM : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_SUSPEND_VM ; case END_SUCCESS : case END_FAILURE : default : return isHibernateVdsProblematic ? org.ovirt.engine.core.common.AuditLogType.USER_SUSPEND_VM_FINISH_FAILURE_WILL_TRY_AGAIN : org.ovirt.engine.core.common.AuditLogType.USER_SUSPEND_VM_FINISH_FAILURE ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.HibernateVmCommand.getActionState ( ) ) { case EXECUTE : return org.ovirt.engine.core.bll.HibernateVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_SUSPEND_VM : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_SUSPEND_VM ; case END_SUCCESS : if ( org.ovirt.engine.core.bll.HibernateVmCommand.getSucceeded ( ) ) { return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; } case END_FAILURE : default : return isHibernateVdsProblematic ? org.ovirt.engine.core.common.AuditLogType.USER_SUSPEND_VM_FINISH_FAILURE_WILL_TRY_AGAIN : org.ovirt.engine.core.common.AuditLogType.USER_SUSPEND_VM_FINISH_FAILURE ; } }
Source:
public void testIpConfiguredForStaticBootProtocolWhenIpConfigurationIsNotNullAndBootProtocolIsStaticAndAddressAndNetmaskIsNotNull ( ) throws java.lang.Exception { doTestIpConfiguredForStaticBootProtocol ( "192.168.1.1" , "255.255.255.0" , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsDhcp ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , false , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }
Source:
protected void endWithFailure ( ) { super . EndActionOnDisks ( ) ; rollbackQuota ( ) ; if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) ) != null ) { RemoveVmInSpm ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) . getstorage_pool_id ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; } removeVmRelatedEntitiesFromDb ( ) ; org.ovirt.engine.core.bll.AddVmCommand.setSucceeded ( true ) ; }

Target:
protected void endWithFailure ( ) { super . endActionOnDisks ( ) ; rollbackQuota ( ) ; if ( ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) ) != null ) { removeVmInSpm ( org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) . getstorage_pool_id ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; } removeVmRelatedEntitiesFromDb ( ) ; org.ovirt.engine.core.bll.AddVmCommand.setSucceeded ( true ) ; }
Source:
protected < S extends org.ovirt.engine.api.restapi.resource.AbstractBackendResource < ? , ? > > S inject ( S resource ) { resource.setBackend ( backend ) ; resource.setMappingLocator ( mappingLocator ) ; resource.setSessionHelper ( sessionHelper ) ; resource.setMessageBundle ( messageBundle ) ; resource.setUriInfo ( uriInfo ) ; resource.setHttpHeaders ( httpHeaders ) ; return resource ; }

Target:
protected < S extends org.ovirt.engine.api.restapi.resource.AbstractBackendResource < ? , ? > > S inject ( S resource ) { resource.setBackend ( backend ) ; resource.setMappingLocator ( mappingLocator ) ; resource.setValidatorLocator ( validatorLocator ) ; resource.setSessionHelper ( sessionHelper ) ; resource.setMessageBundle ( messageBundle ) ; resource.setUriInfo ( uriInfo ) ; resource.setHttpHeaders ( httpHeaders ) ; return resource ; }
Source:
public static java.lang.String GetRpmVersionViaPublic ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return ( ( java.lang.String ) ( returnValue.getReturnValue ( ) ) ) ; } return "" ; }

Target:
public static java.lang.String GetRpmVersionViaPublic ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { return ( ( java.lang.String ) ( returnValue.getReturnValue ( ) ) ) ; } return "" ; }
Source:
private static void updateTimeoutLogableObject ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { int duplicateEventsIntrvalValue = ( auditLogable.isExternal ( ) ) ? java.lang.Math.max ( auditLogable.getEventFloodInSec ( ) , 30 ) : logType.getDuplicateEventsIntervalValue ( ) ; if ( duplicateEventsIntrvalValue > 0 ) { auditLogable.setEndTime ( org.ovirt.engine.core.compat.DateTime.getNow ( ) . AddSeconds ( logType.getDuplicateEventsIntervalValue ( ) ) ) ; auditLogable.setTimeoutObjectId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.ComposeObjectId ( auditLogable , logType ) ) ; } }

Target:
private static void updateTimeoutLogableObject ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { int duplicateEventsIntrvalValue = ( auditLogable.isExternal ( ) ) ? java.lang.Math.max ( auditLogable.getEventFloodInSec ( ) , 30 ) : logType.getDuplicateEventsIntervalValue ( ) ; if ( duplicateEventsIntrvalValue > 0 ) { auditLogable.setEndTime ( ( ( java.lang.System.currentTimeMillis ( ) ) + ( java.util.concurrent.TimeUnit.SECONDS.toMillis ( duplicateEventsIntrvalValue ) ) ) ) ; auditLogable.setTimeoutObjectId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.composeObjectId ( auditLogable , logType ) ) ; } }