auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected java.lang.Long getRawValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return ( ( long ) ( disk.getLun ( ) . getDeviceSize ( ) ) ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return disk.getLun ( ) . getProductId ( ) ; }
Source:
public org.ovirt.engine.sdk.decorators.Group add ( org.ovirt.engine.sdk.decorators.Group group , java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . add ( "Correlation-Id" , correlationId ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , group , org.ovirt.engine.sdk.entities.Group.class , org.ovirt.engine.sdk.decorators.Group.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Group add ( org.ovirt.engine.sdk.decorators.Group group ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , group , org.ovirt.engine.sdk.entities.Group.class , org.ovirt.engine.sdk.decorators.Group.class , headers ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VM object ) { if ( ( ( object.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) || ( ( object.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) ) return "" ; else return renderer.render ( getRawValue ( object ) ) ; }

Target:
protected UnitVmModel.GraphicsTypes getRawValue ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) ) { return null ; } java.util.Map < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.GraphicsInfo > graphicsInfos = vm.getGraphicsInfos ( ) ; return UnitVmModel.GraphicsTypes.fromGraphicsTypes ( graphicsInfos.keySet ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VDSGroup setUpVDSGroup ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = control.createMock ( org.ovirt.engine.core.common.businessentities.VDSGroup.class ) ; org.easymock.EasyMock.expect ( cluster.getId ( ) ) . andReturn ( id ) . anyTimes ( ) ; return cluster ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDSGroup setUpVDSGroup ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = control.createMock ( org.ovirt.engine.core.common.businessentities.VDSGroup.class ) ; org.easymock.EasyMock.expect ( cluster.getId ( ) ) . andReturn ( id ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( cluster.getCompatibilityVersion ( ) ) . andReturn ( org.ovirt.engine.core.compat.Version.getLast ( ) ) . anyTimes ( ) ; return cluster ; }
Source:
public void testNotExternalNetwork ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network notExternalNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; notExternalNetwork.setProvidedBy ( null ) ; org.mockito.Mockito.when ( networkDaoMock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( notExternalNetwork ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) , new org.ovirt.engine.core.common.businessentities.VDS ( ) ) . notExternalNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateGatewayWhenIpConfigurationIsNotSet ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . validateGateway ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static void GetRoleList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.roles > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.roles > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
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.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > GetNicTypeList ( org.ovirt.engine.core.common.businessentities.VmOsType osType , boolean hasDualmode ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.values ( ) ) ) ; list.remove ( VmInterfaceType.rtl8139_pv ) ; if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.IsWindowsOsType ( osType ) ) { if ( ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.WindowsXP ) ) && hasDualmode ) { list.add ( VmInterfaceType.rtl8139_pv ) ; } } return list ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > getNicTypeList ( org.ovirt.engine.core.common.businessentities.VmOsType osType , boolean hasDualmode ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > ( java.util.Arrays.asList ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.values ( ) ) ) ; list.remove ( VmInterfaceType.rtl8139_pv ) ; if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isWindowsOsType ( osType ) ) { if ( ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.WindowsXP ) ) && hasDualmode ) { list.add ( VmInterfaceType.rtl8139_pv ) ; } } return list ; }
Source:
protected org.ovirt.engine.api.model.Tag lookupTagByName ( java.lang.String name ) { for ( org.ovirt.engine.core.common.businessentities.tags tag : getBackendCollection ( org.ovirt.engine.core.common.businessentities.tags.class , VdcQueryType.GetAllTags , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ) { if ( tag.gettag_name ( ) . equals ( name ) ) { return map ( tag ) ; } } return handleError ( new org.ovirt.engine.api.restapi.resource.EntityNotFoundException ( name ) , false ) ; }

Target:
protected org.ovirt.engine.api.model.Tag lookupTagByName ( java.lang.String name ) { for ( org.ovirt.engine.core.common.businessentities.Tags tag : getBackendCollection ( org.ovirt.engine.core.common.businessentities.Tags.class , VdcQueryType.GetAllTags , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ) { if ( tag.gettag_name ( ) . equals ( name ) ) { return map ( tag ) ; } } return handleError ( new org.ovirt.engine.api.restapi.resource.EntityNotFoundException ( name ) , false ) ; }
Source:
public org.ovirt.engine.core.utils.ssh.SSHClient getSSHClient ( java.lang.String hostname ) { java.lang.Long timeout = java.util.concurrent.TimeUnit.SECONDS.toMillis ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ConnectToServerTimeoutInSeconds ) ) ; org.ovirt.engine.core.utils.ssh.SSHClient sshclient = new org.ovirt.engine.core.utils.ssh.SSHClient ( ) ; sshclient.setHardTimeout ( timeout ) ; sshclient.setSoftTimeout ( timeout ) ; sshclient.setHost ( hostname ) ; sshclient.setUser ( org.ovirt.engine.core.bll.AddVdsCommand.USER_NAME ) ; sshclient.setPassword ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getRootPassword ( ) ) ; return sshclient ; }

Target:
public org.ovirt.engine.core.utils.ssh.SSHClient getSSHClient ( java.lang.String hostname ) { java.lang.Long timeout = java.util.concurrent.TimeUnit.SECONDS.toMillis ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ConnectToServerTimeoutInSeconds ) ) ; org.ovirt.engine.core.utils.ssh.SSHClient sshclient = new org.ovirt.engine.core.utils.ssh.EngineSSHClient ( ) ; sshclient.setHardTimeout ( timeout ) ; sshclient.setSoftTimeout ( timeout ) ; sshclient.setHost ( hostname ) ; sshclient.setUser ( org.ovirt.engine.core.bll.AddVdsCommand.USER_NAME ) ; sshclient.setPassword ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getRootPassword ( ) ) ; return sshclient ; }
Source:
public static void getMaximalVmMemSize64OS ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String 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.lang.Integer ) ( source ) ) . intValue ( ) : - 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String 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.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void validateShareableDiskVolumeFormatSucceeds ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createShareableDiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( image ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; runAndAssertValidateSuccess ( ) ; }

Target:
public void validateShareableDiskVolumeFormatSucceeds ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createShareableDiskImage ( ) ; image.setVolumeFormat ( VolumeFormat.RAW ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( image ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; runAndAssertValidateSuccess ( ) ; }
Source:
public static org.ovirt.engine.core.bll.scheduling.SchedulingManager getInstance ( ) { if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ) == null ) { synchronized ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.class ) { if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ) == null ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance = new org.ovirt.engine.core.bll.scheduling.SchedulingManager ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.enableLoadBalancer ( ) ; } } } return org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ; }

Target:
public static org.ovirt.engine.core.bll.scheduling.SchedulingManager getInstance ( ) { if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ) == null ) { synchronized ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.class ) { if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ) == null ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance = new org.ovirt.engine.core.bll.scheduling.SchedulingManager ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.enableLoadBalancer ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.enableHaReservationCheck ( ) ; } } } return org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ; }
Source:
private void localize ( ) { bricks.setLabel ( constants.selectBrickToViewFopStats ( ) ) ; nfsServers.setLabel ( constants.selectServerToViewFopStats ( ) ) ; bricksTab.setLabel ( constants.volumeProfileBricksTab ( ) ) ; nfsTab.setLabel ( constants.volumeProfileNfsTab ( ) ) ; bricksErrorLabel.setText ( constants.brickProfileErrorMessage ( ) ) ; nfsErrorLabel.setText ( constants.nfsProfileErrorMessage ( ) ) ; }

Target:
private void localize ( ) { bricks.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.VolumeProfileStatisticsPopupView.constants.selectBrickToViewFopStats ( ) ) ; nfsServers.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.VolumeProfileStatisticsPopupView.constants.selectServerToViewFopStats ( ) ) ; bricksTab.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.VolumeProfileStatisticsPopupView.constants.volumeProfileBricksTab ( ) ) ; nfsTab.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.VolumeProfileStatisticsPopupView.constants.volumeProfileNfsTab ( ) ) ; bricksErrorLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.VolumeProfileStatisticsPopupView.constants.brickProfileErrorMessage ( ) ) ; nfsErrorLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.gluster.VolumeProfileStatisticsPopupView.constants.nfsProfileErrorMessage ( ) ) ; }
Source:
private void handleNonMigratableVms ( java.util.List < java.lang.String > hostsWithNonMigratableVms , java.util.List < java.lang.String > nonMigratableVms ) { if ( ! ( nonMigratableVms.isEmpty ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_CANNOT_MAINTENANCE_IT_INCLUDES_NON_MIGRATABLE_VM ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$VmsList %1$s" , org.apache.commons.lang.StringUtils.join ( nonMigratableVms , " , " ) ) ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$HostsList %1$s" , org.apache.commons.lang.StringUtils.join ( hostsWithNonMigratableVms , " , " ) ) ) ; } }

Target:
private void handleNonMigratableVms ( java.util.List < java.lang.String > hostsWithNonMigratableVms , java.util.List < java.lang.String > nonMigratableVms ) { if ( ! ( nonMigratableVms.isEmpty ( ) ) ) { addCanDoActionMessage ( EngineMessage.VDS_CANNOT_MAINTENANCE_IT_INCLUDES_NON_MIGRATABLE_VM ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$VmsList %1$s" , org.apache.commons.lang.StringUtils.join ( nonMigratableVms , " , " ) ) ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$HostsList %1$s" , org.apache.commons.lang.StringUtils.join ( hostsWithNonMigratableVms , " , " ) ) ) ; } }
Source:
private void New ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.NewTemplateInterfaceModel.createInstance ( getEntityStronglyTyped ( ) , cluster.getcompatibility_version ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , this ) ; setWindow ( model ) ; }

Target:
private void newEntity ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.NewTemplateInterfaceModel.createInstance ( getEntityStronglyTyped ( ) , cluster.getcompatibility_version ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , this ) ; setWindow ( model ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosBondSpeedSetup ( java.lang.Integer slaveSpeed , java.lang.Integer bondSpeed ) { return setupCompositeQosConfiguration ( true , createQos ( ) , slaveSpeed , bondSpeed , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_MODE_4 ) ; }

Target:
public void syncNetworkQosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; org.ovirt.engine.core.compat.Guid qosId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = createQos ( ) ; org.mockito.Mockito.when ( qosDao.get ( qosId ) ) . thenReturn ( qos ) ; network.setQosId ( qosId ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( iface ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; log.error ( "Failed deleting volume/snapshot from Cinder. ID: {}" , getDiskId ( ) ) ; 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 ) { super . onSucceeded ( cmdId , childCmdIds ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.log.info ( "Volume/Snapshot has been successfully deleted from Cinder. ID: {}" , getDiskId ( ) ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > getEntityList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > entities = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } return entities ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > getEntityList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > entities = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } return entities ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
public void testNoDuplicateCustomMacs ( ) { org.ovirt.engine.core.bll.network.macpool.MacsStorage macsStorage = new org.ovirt.engine.core.bll.network.macpool.MacsStorage ( false ) ; org.junit.Assert.assertThat ( macsStorage.containsDuplicates ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; macsStorage.useMac ( 1L ) ; org.junit.Assert.assertThat ( macsStorage.containsDuplicates ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; macsStorage.useMac ( 1L ) ; org.junit.Assert.assertThat ( macsStorage.containsDuplicates ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testNoDuplicateCustomMacs ( ) { org.ovirt.engine.core.bll.network.macpool.MacsStorage macsStorage = new org.ovirt.engine.core.bll.network.macpool.MacsStorage ( false ) ; org.hamcrest.MatcherAssert.assertThat ( macsStorage.containsDuplicates ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; macsStorage.useMac ( 1L ) ; org.hamcrest.MatcherAssert.assertThat ( macsStorage.containsDuplicates ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; macsStorage.useMac ( 1L ) ; org.hamcrest.MatcherAssert.assertThat ( macsStorage.containsDuplicates ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.FencingPolicy getFencingPolicy ( ) { return fencingPolicy ; }

Target:
protected boolean isFencingPolicySupported ( org.ovirt.engine.core.common.businessentities.VDS proxyCandidate , org.ovirt.engine.core.compat.Version minimalSupportedVersion ) { boolean supported = ( ( fencingPolicy ) == null ) || ( proxyCandidate.getSupportedClusterVersionsSet ( ) . contains ( minimalSupportedVersion ) ) ; org.ovirt.engine.core.bll.pm.FenceProxyLocator.log.debug ( "Proxy candidate '{}' supports fencing policy '{}': {}" , proxyCandidate.getHostName ( ) , fencingPolicy , supported ) ; return supported ; }
Source:
public void fillReportedConfigurations ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allInterfacesForHost , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap , java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > networkNameToNicMap = nicsByNetworkId ( allInterfacesForHost ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment : networkAttachments ) { fillReportedConfigurations ( networkNameToNicMap , networkMap , networkAttachment ) ; } }

Target:
public void fillReportedConfigurations ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allInterfacesForHost , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap , java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = clusterDao.get ( clusterId ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > networkNameToNicMap = nicsByNetworkId ( allInterfacesForHost ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment : networkAttachments ) { fillReportedConfigurations ( networkNameToNicMap , networkMap , networkAttachment , cluster ) ; } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; model.setDataCentersAndClusters ( model , dataCenters , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , null ) ; initCdImage ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusterList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredClusterList = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.filterClustersWithoutArchitecture ( clusterList ) ; model.setDataCentersAndClusters ( model , dataCenters , filteredClusterList , null ) ; initCdImage ( ) ; }
Source:
public void updateVmTag ( ) { existingVmTag.setDefaultDisplayType ( ( ( existingVmTag.getDefaultDisplayType ( ) ) + 1 ) ) ; dao.updateDefaultDisplayForVmTag ( existingVmTag ) ; org.ovirt.engine.core.common.businessentities.TagsVmMap result = dao.getTagVmByTagIdAndByVmId ( existingVmTag.gettag_id ( ) , existingVmTag.getvm_id ( ) ) ; assertNotNull ( result ) ; assertEqualsTagsVmMap ( existingVmTag , result ) ; }

Target:
public void updateVmTag ( ) { existingVmTag.setDefaultDisplayType ( ( ( existingVmTag.getDefaultDisplayType ( ) ) + 1 ) ) ; dao.updateDefaultDisplayForVmTag ( existingVmTag ) ; org.ovirt.engine.core.common.businessentities.TagsVmMap result = dao.getTagVmByTagIdAndByVmId ( existingVmTag.gettag_id ( ) , existingVmTag.getvm_id ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; assertEqualsTagsVmMap ( existingVmTag , result ) ; }
Source:
public void testNetworkNotChanged ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid networkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; oldAttachment.setNetworkId ( networkId ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( networkId ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( attachment , null ) . networkNotChanged ( oldAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
private void doTestNetworkIpAddressWasSameAsHostnameAndChangedForBootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol bootProtocol ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( bootProtocol , null , null ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( attachment ) ; org.ovirt.engine.core.bll.ValidationResult actual = validator.networkIpAddressWasSameAsHostnameAndChanged ( null ) ; org.junit.Assert.assertThat ( actual , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected org.ovirt.engine.core.dao.VdsDynamicDAO getDao ( ) { return dao ; }

Target:
public void testRemove ( ) { dao.remove ( existingVds.getId ( ) ) ; statisticsDao.remove ( existingVds.getId ( ) ) ; staticDao.remove ( existingVds.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VdsStatic resultStatic = staticDao.get ( existingVds.getId ( ) ) ; org.junit.Assert.assertNull ( resultStatic ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic resultDynamic = dao.get ( existingVds.getId ( ) ) ; org.junit.Assert.assertNull ( resultDynamic ) ; }
Source:
public void init ( javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; type = config.getInitParameter ( org.ovirt.engine.core.FileServlet.TYPE ) ; final java.lang.String name = config.getInitParameter ( org.ovirt.engine.core.FileServlet.FILE ) ; if ( name == null ) { final java.lang.String message = ( "Can\'t get base name from parameter \"" + ( org.ovirt.engine.core.FileServlet.FILE ) ) + "\"." ; org.ovirt.engine.core.FileServlet.log.error ( message ) ; throw new javax.servlet.ServletException ( message ) ; } base = new java.io.File ( name ) ; }

Target:
public void init ( javax.servlet.ServletConfig config ) throws javax.servlet.ServletException { super . init ( config ) ; type = config.getInitParameter ( org.ovirt.engine.core.FileServlet.TYPE ) ; final java.lang.String name = config.getInitParameter ( org.ovirt.engine.core.FileServlet.FILE ) ; if ( name == null ) { final java.lang.String message = ( "Can\'t get base name from parameter \"" + ( org.ovirt.engine.core.FileServlet.FILE ) ) + "\"." ; org.ovirt.engine.core.FileServlet.log.error ( message ) ; throw new javax.servlet.ServletException ( message ) ; } base = new java.io.File ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . expandString ( name.replaceAll ( "%\\{" , "\\${" ) ) ) ; }
Source:
protected java.lang.Long getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) . getsize ( ) : ( ( long ) ( ( ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( object ) ) . getLun ( ) . getDeviceSize ( ) ) * ( java.lang.Math.pow ( 1024 , 3 ) ) ) ) ; }

Target:
protected java.lang.Long getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) . getSize ( ) : ( ( long ) ( ( ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( object ) ) . getLun ( ) . getDeviceSize ( ) ) * ( java.lang.Math.pow ( 1024 , 3 ) ) ) ) ; }
Source:
protected boolean activateOrDeactivateNic ( org.ovirt.engine.core.compat.Guid nicId , org.ovirt.engine.core.common.action.PlugAction plugAction , java.lang.String oldMacAddress ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getBackend ( ) . runInternalAction ( VdcActionType.ActivateDeactivateVmNic , createActivateDeactivateParameters ( nicId , plugAction , oldMacAddress ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { propagateFailure ( returnValue ) ; } return returnValue.getSucceeded ( ) ; }

Target:
protected boolean activateOrDeactivateNic ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic , org.ovirt.engine.core.common.action.PlugAction plugAction ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getBackend ( ) . runInternalAction ( VdcActionType.ActivateDeactivateVmNic , createActivateDeactivateParameters ( nic , plugAction ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { propagateFailure ( returnValue ) ; } return returnValue.getSucceeded ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator ( provider ) ) ; org.mockito.Mockito.doReturn ( networkDao ) . when ( validator ) . getNetworkDao ( ) ; org.mockito.Mockito.when ( networkDao.getAllForProvider ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( networks ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator ( vmDao , provider ) ) ; org.mockito.Mockito.doReturn ( networkDao ) . when ( validator ) . getNetworkDao ( ) ; org.mockito.Mockito.when ( networkDao.getAllForProvider ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( networks ) ; }
Source:
private static org.ovirt.vdsm.jsonrpc.client.JsonRpcClient getJsonClient ( org.ovirt.vdsm.jsonrpc.client.reactors.Reactor reactor , java.lang.String hostName , int port , org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy connectionPolicy , org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy clientPolicy ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = reactor.createClient ( hostName , port ) ; client.setClientPolicy ( connectionPolicy ) ; org.ovirt.vdsm.jsonrpc.client.internal.ResponseWorker worker = org.ovirt.vdsm.jsonrpc.client.reactors.ReactorFactory.getWorker ( ) ; org.ovirt.vdsm.jsonrpc.client.JsonRpcClient jsonClient = worker.register ( client ) ; jsonClient.setRetryPolicy ( clientPolicy ) ; return jsonClient ; }

Target:
private static org.ovirt.vdsm.jsonrpc.client.JsonRpcClient getJsonClient ( org.ovirt.vdsm.jsonrpc.client.reactors.Reactor reactor , java.lang.String hostName , int port , org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy connectionPolicy , org.ovirt.vdsm.jsonrpc.client.internal.ClientPolicy clientPolicy , int parallelism ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = reactor.createClient ( hostName , port ) ; client.setClientPolicy ( connectionPolicy ) ; org.ovirt.vdsm.jsonrpc.client.internal.ResponseWorker worker = org.ovirt.vdsm.jsonrpc.client.reactors.ReactorFactory.getWorker ( parallelism ) ; org.ovirt.vdsm.jsonrpc.client.JsonRpcClient jsonClient = worker.register ( client ) ; jsonClient.setRetryPolicy ( clientPolicy ) ; return jsonClient ; }
Source:
private org.ovirt.engine.core.compat.Guid getClusterIdOfSelectedVms ( ) { org.ovirt.engine.core.compat.Guid clusterId = null ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; if ( clusterId == null ) { clusterId = a.getVdsGroupId ( ) ; } else if ( ! ( clusterId.equals ( a.getVdsGroupId ( ) ) ) ) { clusterId = null ; break ; } } return clusterId ; }

Target:
private org.ovirt.engine.core.compat.Guid getClusterIdOfSelectedVms ( ) { org.ovirt.engine.core.compat.Guid clusterId = null ; for ( java.lang.Object item : org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; if ( clusterId == null ) { clusterId = a.getVdsGroupId ( ) ; } else if ( ! ( clusterId.equals ( a.getVdsGroupId ( ) ) ) ) { clusterId = null ; break ; } } return clusterId ; }
Source:
private static java.lang.String serializeParameters ( org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParams = params.getParentParameters ( ) ; params.setParentParemeters ( null ) ; java.lang.String jsonStr = new org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer ( ) . serialize ( params ) ; params.setParentParemeters ( parentParams ) ; return jsonStr ; }

Target:
private static java.lang.String serializeParameters ( org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParams = params.getParentParameters ( ) ; params.setParentParameters ( null ) ; java.lang.String jsonStr = new org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer ( ) . serialize ( params ) ; params.setParentParameters ( parentParams ) ; return jsonStr ; }
Source:
private boolean hostChanged ( com.woorea.openstack.quantum.model.Port port , java.lang.String hostId ) { return ( ( port.getBinding ( ) ) == null ) || ( ! ( org.apache.commons.lang.StringUtils.equals ( port.getBinding ( ) . getHostId ( ) , hostId ) ) ) ; }

Target:
protected com.woorea.openstack.quantum.model.Port createNewPortForAllocate ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , java.util.List < java.lang.String > securityGroups , java.lang.String hostId , org.ovirt.engine.core.common.businessentities.network.Network externalNetwork ) { com.woorea.openstack.quantum.model.Port portForCreate = super . createNewPortForAllocate ( nic , securityGroups , hostId , externalNetwork ) ; portForCreate.setTenantId ( externalNetwork.getTenantId ( ) ) ; return portForCreate ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , java.lang.Object taskReturn ) { return setUpActionExpectations ( task , clz , names , values , true , true , taskReturn , null , true ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.ActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , java.lang.Object taskReturn ) { return setUpActionExpectations ( task , clz , names , values , true , true , taskReturn , null , true ) ; }
Source:
public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DbUser > getUsers ( ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DbUser > users = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DbUser > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DbUser user : lookupUsers ( ) ) { users.put ( user.getId ( ) , user ) ; } return users ; }

Target:
public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.aaa.DbUser > getUsers ( ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.aaa.DbUser > users = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.aaa.DbUser > ( ) ; for ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user : lookupUsers ( ) ) { users.put ( user.getId ( ) , user ) ; } return users ; }
Source:
private void addVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( getVmId ( ) ) ; tempVar.setStatus ( VMStatus.ImageLocked ) ; tempVar.setVmHost ( "" ) ; tempVar.setVmIp ( "" ) ; tempVar.setAppList ( getParameters ( ) . getVm ( ) . getDynamicData ( ) . getAppList ( ) ) ; getVmDynamicDAO ( ) . save ( tempVar ) ; getCompensationContext ( ) . snapshotNewEntity ( tempVar ) ; }

Target:
private java.lang.String getMemoryVolumeForNewActiveSnapshot ( ) { return getParameters ( ) . isImportAsNewEntity ( ) ? org.apache.commons.lang.StringUtils.EMPTY : getMemoryVolumeFromActiveSnapshotInExportDomain ( ) ; }
Source:
public static void getMaxVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean is64 ) { 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 source ; } return 262144 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( ( is64 ? org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB : org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB ) , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
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 ) ) ; addBondToUpdateList ( bond ) ; }

Target:
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 ) ; }
Source:
public org.ovirt.engine.core.config.entity.helper.ValidationResult validate ( org.ovirt.engine.core.config.entity.ConfigKey key , java.lang.String value ) { boolean result = true ; java.lang.String errMsg = null ; if ( org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.getInstance ( ) . syntaxErrorInProperties ( value ) ) { result = false ; errMsg = "Invalid syntax, user defined VM properties specification should conform to " + ( org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.getInstance ( ) . getVmPropSpec ( ) ) ; } return new org.ovirt.engine.core.config.entity.helper.ValidationResult ( result , errMsg ) ; }

Target:
public org.ovirt.engine.core.config.entity.helper.ValidationResult validate ( org.ovirt.engine.core.config.entity.ConfigKey key , java.lang.String value ) { boolean result = true ; java.lang.String errMsg = null ; if ( org.ovirt.engine.core.common.utils.customprop.VmPropertiesUtils.getInstance ( ) . syntaxErrorInProperties ( value ) ) { result = false ; errMsg = "Invalid syntax, user defined VM properties specification should conform to " + ( org.ovirt.engine.core.common.utils.customprop.VmPropertiesUtils.getInstance ( ) . getVmPropSpec ( ) ) ; } return new org.ovirt.engine.core.config.entity.helper.ValidationResult ( result , errMsg ) ; }
Source:
public void insufficientDiskSpace ( ) { final int lotsOfSpaceRequired = 1073741824 ; final org.ovirt.engine.core.bll.ImportVmTemplateCommand c = setupDiskSpaceTest ( lotsOfSpaceRequired ) ; org.junit.Assert.assertFalse ( c.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( c.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
public void insufficientDiskSpace ( ) { final org.ovirt.engine.core.bll.ImportVmTemplateCommand command = setupVolumeFormatAndTypeTest ( VolumeFormat.RAW , VolumeType.Preallocated , StorageType.NFS ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . validateSpaceRequirements ( org.mockito.Matchers.anyList ( ) ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; }
Source:
public static java.lang.String toPlural ( java.lang.String candidate ) { if ( ( ( candidate.length ( ) ) >= 1 ) && ( ! ( candidate.endsWith ( "s" ) ) ) ) { return candidate + "s" ; } return candidate ; }

Target:
public static java.lang.String toPlural ( java.lang.String singular ) { java.lang.String plural = org.ovirt.engine.sdk.codegen.utils.StringUtils.PLURAL_EXCEPTIONS.get ( singular ) ; if ( plural == null ) { if ( ( ( singular.length ( ) ) >= 1 ) && ( ! ( singular.endsWith ( "s" ) ) ) ) { plural = singular + "s" ; } else { plural = singular ; } } return plural ; }