auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetLocalesKeysUnSupported ( ) { org.ovirt.engine.core.utils.servlet.UnsupportedLocaleHelperTest.unvalidatedUnsupportedLocales.add ( "ko_KR" ) ; java.util.List < java.lang.String > locales = org.ovirt.engine.core.utils.servlet.UnsupportedLocaleHelper.getLocalesKeys ( ConfigValues.UnsupportedLocalesFilterOverrides ) ; org.junit.Assert.assertNotNull ( "Result should not be null" , locales ) ; org.junit.Assert.assertEquals ( "There should be 1 locales" , 1 , locales.size ( ) ) ; org.junit.Assert.assertEquals ( "Locale should be ko_KR" , "ko_KR" , locales.get ( 0 ) ) ; }

Target:
public void testGetLocalesKeysUnSupported ( ) { org.ovirt.engine.core.utils.servlet.UnsupportedLocaleHelperTest.unvalidatedUnsupportedLocales.add ( "ko_KR" ) ; java.util.List < java.lang.String > locales = org.ovirt.engine.core.utils.servlet.UnsupportedLocaleHelper.getLocalesKeys ( ConfigValues.UnsupportedLocalesFilterOverrides ) ; org.junit.jupiter.api.Assertions.assertNotNull ( locales , "Result should not be null" ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , locales.size ( ) , "There should be 1 locales" ) ; org.junit.jupiter.api.Assertions.assertEquals ( "ko_KR" , locales.get ( 0 ) , "Locale should be ko_KR" ) ; }
Source:
public void testRemoveForced ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.TRUE } , true , true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) , new org.ovirt.engine.api.model.Action ( ) { { setForce ( true ) ; } } ) ) ; }

Target:
public void testRemoveForced ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 ) ; setUpGetBallooningExpectations ( ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.TRUE } , true , true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) , new org.ovirt.engine.api.model.Action ( ) { { setForce ( true ) ; } } ) ) ; }
Source:
public void testIsNetworkInSyncWhenBootProtocolDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
private void initIpv4ConfigurationBootProtocol ( boolean sameBootProtocol ) { initIpv4Configuration ( ) ; ipv4Address.setBootProtocol ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL ) ; org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol ifaceBootProtocol = ( sameBootProtocol ) ? org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL : org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ; iface.setIpv4BootProtocol ( ifaceBootProtocol ) ; }
Source:
public static void getVmTemplatesWithPermittedAction ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesWithPermittedAction , getEntitiesWithPermittedActionParameters , aQuery ) ; }

Target:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public void template_SelectedItemChanged ( ) { super . template_SelectedItemChanged ( ) ; getModel ( ) . getName ( ) . setEntity ( "" ) ; getModel ( ) . getDescription ( ) . setEntity ( "" ) ; getModel ( ) . getProvisioning ( ) . setEntity ( true ) ; getModel ( ) . getProvisioning ( ) . setIsAvailable ( true ) ; getModel ( ) . getProvisioning ( ) . setIsChangable ( false ) ; initDisks ( ) ; initStorageDomains ( ) ; }

Target:
public void template_SelectedItemChanged ( ) { super . template_SelectedItemChanged ( ) ; getModel ( ) . getName ( ) . setEntity ( "" ) ; getModel ( ) . getDescription ( ) . setEntity ( "" ) ; getModel ( ) . getComment ( ) . setEntity ( "" ) ; getModel ( ) . getProvisioning ( ) . setEntity ( true ) ; getModel ( ) . getProvisioning ( ) . setIsAvailable ( true ) ; getModel ( ) . getProvisioning ( ) . setIsChangable ( false ) ; initDisks ( ) ; initStorageDomains ( ) ; }
Source:
public 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public void getAAAProfilesEntriesList ( 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.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getVlanDevice ( final org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseNic , final java.lang.Integer vlanId ) { if ( vlanId == null ) { return null ; } return org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( getNics ( ) , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface t ) { return ( baseNic.getName ( ) . equals ( t.getBaseInterface ( ) ) ) && ( java.util.Objects.equals ( t.getVlanId ( ) , vlanId ) ) ; } } ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getNics ( org.ovirt.engine.core.compat.Guid hostId ) { if ( ! ( hostIdToNics.containsKey ( hostId ) ) ) { org.ovirt.engine.core.common.businessentities.VDS host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( hostId ) ; org.ovirt.engine.core.bll.network.NetworkConfigurator configurator = new org.ovirt.engine.core.bll.network.NetworkConfigurator ( host , null ) ; hostIdToNics.put ( hostId , configurator.filterBondsWithoutSlaves ( interfaceDao.getAllInterfacesForVds ( hostId ) ) ) ; } return hostIdToNics.get ( hostId ) ; }
Source:
public void getHostById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getHostById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }
Source:
private void processHeartbeat ( ) { if ( ( ( ! ( this . isInInit ( ) ) ) && ( this . policy.isHeartbeat ( ) ) ) && ( ( ( this . lastHeartbeat ) + ( this . policy.getHeartbeat ( ) ) ) < ( java.lang.System.currentTimeMillis ( ) ) ) ) { org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.log.debug ( "Heartbeat exeeded. Closing channel" ) ; this . disconnect ( "Heartbeat exeeded" ) ; } }

Target:
private boolean isIncomingHeartbeatExeeded ( ) { return ( ( this . lastIncomingHeartbeat ) + ( this . policy.getIncomingHeartbeat ( ) ) ) < ( java.lang.System.currentTimeMillis ( ) ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.Host host ) { if ( host.isSetCluster ( ) ) { org.ovirt.engine.api.model.Cluster cluster = host.getCluster ( ) ; if ( cluster.isSetId ( ) ) { return new org.ovirt.engine.core.compat.Guid ( cluster.getId ( ) ) ; } if ( cluster.isSetName ( ) ) { return getClusterIdByName ( cluster.getName ( ) ) ; } } return getClusterIdByName ( org.ovirt.engine.api.restapi.resource.BackendHostsResource.DEFAULT_NAME ) ; }

Target:
private org.ovirt.engine.core.compat.Guid getClusterId ( org.ovirt.engine.api.model.Host host ) { if ( host.isSetCluster ( ) ) { org.ovirt.engine.api.model.Cluster cluster = host.getCluster ( ) ; if ( cluster.isSetId ( ) ) { return asGuid ( cluster.getId ( ) ) ; } if ( cluster.isSetName ( ) ) { return getClusterIdByName ( cluster.getName ( ) ) ; } } return getClusterIdByName ( org.ovirt.engine.api.restapi.resource.BackendHostsResource.DEFAULT_NAME ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public static java.lang.String getJsonDiskDescription ( java.lang.String diskAlias , java.lang.String diskDescription ) throws java.io.IOException { java.util.Map < java.lang.String , java.lang.Object > description = new java.util.TreeMap < > ( ) ; description.put ( org.ovirt.engine.core.bll.ImagesHandler.DISK_ALIAS , diskAlias ) ; description.put ( org.ovirt.engine.core.bll.ImagesHandler.DISK_DESCRIPTION , ( diskDescription != null ? diskDescription : "" ) ) ; return org.ovirt.engine.core.utils.JsonHelper.mapToJson ( description , false ) ; }

Target:
public static java.lang.String getJsonDiskDescription ( org.ovirt.engine.core.common.businessentities.Disk disk ) throws java.io.IOException { java.util.Map < java.lang.String , java.lang.Object > description = new java.util.TreeMap < > ( ) ; description.put ( org.ovirt.engine.core.bll.ImagesHandler.DISK_ALIAS , disk.getDiskAlias ( ) ) ; description.put ( org.ovirt.engine.core.bll.ImagesHandler.DISK_DESCRIPTION , ( ( disk.getDiskDescription ( ) ) != null ? disk.getDiskDescription ( ) : "" ) ) ; return org.ovirt.engine.core.utils.JsonHelper.mapToJson ( description , false ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getNetwork ( ) ) ) ) { network_SelectedItemChanged ( null ) ; } else if ( sender == ( getQosOverridden ( ) ) ) { getQosModel ( ) . setIsChangable ( getQosOverridden ( ) . getEntity ( ) ) ; } }

Target:
private void updateQosChangeability ( ) { getQosModel ( ) . setIsChangable ( ( ( getQosOverridden ( ) . getEntity ( ) ) && ( getQosOverridden ( ) . getIsChangable ( ) ) ) ) ; }
Source:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) ; org.ovirt.engine.core.common.businessentities.Disk disk = diskModel.getDisk ( ) ; boolean isScsiPassthrough = disk.isScsiPassthrough ( ) ; boolean ideLimitation = ( disk.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.IDE ) ; return ( ! isScsiPassthrough ) && ( ! ideLimitation ) ; }

Target:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) ; org.ovirt.engine.core.common.businessentities.storage.Disk disk = diskModel.getDisk ( ) ; boolean isScsiPassthrough = disk.isScsiPassthrough ( ) ; boolean ideLimitation = ( disk.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.IDE ) ; return ( ! isScsiPassthrough ) && ( ! ideLimitation ) ; }
Source:
protected boolean isNotLocalData ( final boolean isInternal ) { boolean returnValue = true ; if ( ( ( ( this . getStoragePool ( ) . getstorage_pool_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) && ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) ) && ( ! isInternal ) ) { returnValue = false ; addCanDoActionMessage ( VdcBllMessages.VDS_GROUP_CANNOT_DETACH_DATA_DOMAIN_FROM_LOCAL_STORAGE ) ; } return returnValue ; }

Target:
protected boolean isNotLocalData ( final boolean isInternal ) { boolean returnValue = true ; if ( ( ( ( this . getStoragePool ( ) . getstorage_pool_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) && ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) ) && ( ! isInternal ) ) { returnValue = false ; addCanDoActionMessage ( VdcBllMessages.VDS_GROUP_CANNOT_DETACH_DATA_DOMAIN_FROM_LOCAL_STORAGE ) ; } return returnValue ; }
Source:
private void addVmRngDevice ( ) { org.ovirt.engine.core.common.businessentities.VmRngDevice rngDev = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getRngDevice ( ) ; if ( rngDev != null ) { rngDev.setVmId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.common.action.RngDeviceParameters params = new org.ovirt.engine.core.common.action.RngDeviceParameters ( rngDev , true ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.AddVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.AddRngDevice , params ) ; if ( ! ( result.getSucceeded ( ) ) ) { log.error ( "Couldn't add RNG device for new VM." ) ; throw new java.lang.IllegalArgumentException ( "Couldn't add RNG device for new VM." ) ; } } }

Target:
private void addGraphicsDevice ( ) { for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice graphicsDevice : org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getGraphicsDevices ( ) . values ( ) ) { if ( graphicsDevice == null ) { continue ; } graphicsDevice.setVmId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.AddVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.AddGraphicsDevice , new org.ovirt.engine.core.bll.GraphicsParameters ( graphicsDevice ) ) ; } }
Source:
private static int getFirstImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( curr.getParentId ( ) . equals ( images.get ( i ) . getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
private static int getFirstImage ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , org.ovirt.engine.core.common.businessentities.storage.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( curr.getParentId ( ) . equals ( images.get ( i ) . getImageId ( ) ) ) { return i ; } } return - 1 ; }
Source:
public void testMoveBySdId ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , getEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.MoveDisks , org.ovirt.engine.core.common.action.MoveDisksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } ) ) ; verifyActionResponse ( ( ( org.ovirt.engine.api.resource.VmDiskResource ) ( resource ) ) . move ( setUpMoveParams ( false ) ) ) ; }

Target:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; } }
Source:
protected void executeCommand ( ) { if ( shouldSkipCommandExecutionCached ( ) ) { org.ovirt.engine.core.bll.VmCommand.setSucceeded ( true ) ; return ; } executeVmCommand ( ) ; }

Target:
protected void executeCommand ( ) { if ( shouldSkipCommandExecutionCached ( ) ) { org.ovirt.engine.core.bll.VmCommand.setSucceeded ( true ) ; return ; } executeVmCommand ( ) ; if ( ( ( ( shouldUpdateHostedEngineOvf ( ) ) && ( ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) ) != null ) ) && ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . isHostedEngine ( ) ) ) && ( org.ovirt.engine.core.bll.VmCommand.getSucceeded ( ) ) ) { updateHeOvf ( ) ; } }
Source:
protected boolean connectToStorage ( ) { org.ovirt.engine.core.common.vdscommands.ConnectStorageServerVDSCommandParameters newConnectionParametersForVdsm = createParametersForVdsm ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) . getstorage_type ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStorageServerConnection ( ) ) ; return runVdsCommand ( VDSCommandType.ConnectStorageServer , newConnectionParametersForVdsm ) . getSucceeded ( ) ; }

Target:
protected void disconnectFromStorage ( ) { org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters connectionParametersForVdsm = createParametersForVdsm ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) . getstorage_type ( ) , org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) ) ; boolean isDisconnectSucceeded = runVdsCommand ( VDSCommandType.DisconnectStorageServer , connectionParametersForVdsm ) . getSucceeded ( ) ; if ( ! isDisconnectSucceeded ) { log.warn ( ( "Failed to disconnect storage connection " + ( org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand.getConnection ( ) ) ) ) ; } }
Source:
public void canDoActionTemplateImageIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initTemplateDiskImage ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.VM_TEMPLATE_IMAGE_IS_LOCKED.toString ( ) ) ) ; }

Target:
public void canDoActionTemplateImageIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initTemplateDiskImage ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.VM_TEMPLATE_IMAGE_IS_LOCKED.toString ( ) ) ) ; }
Source:
public boolean handle ( java.util.List < org.ovirt.engine.api.extensions.ExtMap > queryResults ) { boolean result = true ; for ( org.ovirt.engine.api.extensions.ExtMap queryResult : queryResults ) { if ( ( groups.size ( ) ) < ( org.ovirt.engine.core.aaa.AuthzUtils.QUERIES_RESULTS_LIMIT ) ) { groups.add ( queryResult ) ; } else { result = false ; } } return result ; }

Target:
public boolean handle ( java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > queryResults ) { boolean result = true ; for ( org.ovirt.engine.api.extensions.ExtMap queryResult : queryResults ) { if ( ( principalRecords.size ( ) ) < ( org.ovirt.engine.core.aaa.AuthzUtils.QUERIES_RESULTS_LIMIT ) ) { principalRecords.add ( queryResult ) ; } else { result = false ; break ; } } return result ; }
Source:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public void getExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters params = new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( ) ; params.setFilterOutExistingHosts ( filterOutExistingHosts ) ; params.setProviderId ( providerId ) ; params.setSearchFilter ( searchFilter ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostListFromExternalProvider , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator build ( ) { return new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , params , existingInterfaces , existingAttachments , new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networks ) , networkClusterDaoMock , networkDaoMock , vdsDaoMock , findActiveVmsUsingNetwork , new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorHelper ( ) , vmDao , mockNetworkExclusivenessValidatorResolver , mockNetworkAttachmentIpConfigurationValidator , new org.ovirt.engine.core.bll.network.host.UnmanagedNetworkValidator ( ) ) ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator build ( ) { return new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , params , existingInterfaces , existingAttachments , new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networks ) , networkClusterDaoMock , networkDaoMock , vdsDaoMock , findActiveVmsUsingNetwork , new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorHelper ( ) , vmDao , mockNetworkExclusivenessValidatorResolver , mockNetworkAttachmentIpConfigurationValidator , new org.ovirt.engine.core.bll.network.host.UnmanagedNetworkValidator ( ) , backendInternal ) ; }
Source:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookStatusChangeParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.UserProfile profile = org.ovirt.engine.core.bll.UpdateUserProfileCommand.getUserProfile ( ) ; profile.setSshPublicKeyId ( org.ovirt.engine.core.bll.UpdateUserProfileCommand.getParameters ( ) . getUserProfile ( ) . getSshPublicKeyId ( ) ) ; profile.setSshPublicKey ( org.ovirt.engine.core.bll.UpdateUserProfileCommand.getParameters ( ) . getUserProfile ( ) . getSshPublicKey ( ) ) ; profile.setUserPortalVmLoginAutomatically ( org.ovirt.engine.core.bll.UpdateUserProfileCommand.getParameters ( ) . getUserProfile ( ) . isUserPortalVmLoginAutomatically ( ) ) ; userProfileDao.update ( profile ) ; org.ovirt.engine.core.bll.UpdateUserProfileCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.UserProfile profile = org.ovirt.engine.core.bll.UpdateUserProfileCommand.getUserProfile ( ) ; profile.setUserPortalVmLoginAutomatically ( org.ovirt.engine.core.bll.UpdateUserProfileCommand.getParameters ( ) . getUserProfile ( ) . isUserPortalVmLoginAutomatically ( ) ) ; executeCommandUpdateSSHPublicKey ( profile ) ; }
Source:
public org.ovirt.engine.core.compat.Guid createAsyncTask ( org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return createAsyncTask ( parentCommand , null , org.ovirt.engine.core.bll.CommandBase.EMPTY_GUID_ARRAY ) ; }

Target:
public org.ovirt.engine.core.compat.Guid persistAsyncTaskPlaceHolder ( org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.compat.Guid taskId = org.ovirt.engine.core.compat.Guid.Empty ; try { org.ovirt.engine.core.common.businessentities.AsyncTasks task = createAsyncTask ( new org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo ( ) , parentCommand ) ; taskId = task.getTaskId ( ) ; org.ovirt.engine.core.bll.tasks.AsyncTaskUtils.addOrUpdateTaskInDB ( task , null , org.ovirt.engine.core.bll.CommandBase.EMPTY_GUID_ARRAY ) ; addToReturnValueTaskPlaceHolderIdList ( taskId ) ; } catch ( java.lang.RuntimeException ex ) { log.errorFormat ( "Error during persistAsyncTaskPlaceHolders for command: {0}. Exception {1}" , getClass ( ) . getName ( ) , ex ) ; } return taskId ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > getClusters ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > list = new java.util.ArrayList < > ( ) ; list.add ( createCluster ( Version.v3_4 ) ) ; list.add ( createCluster ( Version.v3_5 ) ) ; return list ; }

Target:
public void testRefreshStatus ( ) { org.mockito.Mockito.doReturn ( getSessionDetailsVDSReturnVal ( true ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepStatusDetail ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.refreshGeoRepSessionStatus ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . saveOrUpdateDetailsInBatch ( org.mockito.Matchers.any ( java.util.List.class ) ) ; }
Source:
public static void getVmSnapshotList ( 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 ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getoVirtISOsList ( 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 ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > getCommandsWithCallBackEnabled ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > cmdEntities = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ; for ( org.ovirt.engine.core.compat.Guid cmdId : commandsCache.keySet ( ) ) { cmdEntity = commandsCache.get ( cmdId ) ; if ( commandsCache.get ( cmdId ) . isCallbackEnabled ( ) ) { cmdEntities.add ( cmdEntity ) ; } } return cmdEntities ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > getCommandsWithCallbackEnabled ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > cmdEntities = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ; for ( org.ovirt.engine.core.compat.Guid cmdId : commandsCache.keySet ( ) ) { cmdEntity = commandsCache.get ( cmdId ) ; if ( commandsCache.get ( cmdId ) . isCallbackEnabled ( ) ) { cmdEntities.add ( cmdEntity ) ; } } return cmdEntities ; }
Source:
public static void GetProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.RunQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
public static 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 ) , aQuery ) ; }
Source:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . putOne ( logicalNetworksEditorPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( templateEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( resourceAllocationTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . putOne ( logicalNetworksEditorPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( templateEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( instanceTypesEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( resourceAllocationTab , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; }
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 , boolean canDo , boolean success , java.lang.Object taskReturn , boolean replay ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , taskReturn , null , replay , org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.CANT_DO ) ; }

Target:
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 , boolean valid , boolean success , java.lang.Object taskReturn , boolean replay ) { return setUpActionExpectations ( task , clz , names , values , valid , success , taskReturn , null , replay , org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.CANT_DO ) ; }
Source:
public void shouldValidateSingleNodePinning ( ) { vm.setvNumaNodeList ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 0 , java.util.Collections.singletonList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; org.junit.Assert.assertTrue ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }

Target:
public void shouldValidateSingleNodePinning ( ) { vm.setvNumaNodeList ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 0 , java.util.Collections.singletonList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; org.junit.jupiter.api.Assertions.assertTrue ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getFilteredDisksForSnapshot ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > filteredDisksForSnapshot = getDiskImagesForVm ( ) ; return filteredDisksForSnapshot ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDisksList ( ) { if ( ( cachedSelectedActiveDisks ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesAndCinderForVm = getDiskImagesForVm ( ) ; if ( ( getParameters ( ) . getDisks ( ) ) == null ) { cachedSelectedActiveDisks = imagesAndCinderForVm ; } else { cachedSelectedActiveDisks = org.ovirt.engine.core.bll.ImagesHandler.imagesIntersection ( imagesAndCinderForVm , getParameters ( ) . getDisks ( ) ) ; } } return cachedSelectedActiveDisks ; }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.VM paramT1 , org.ovirt.engine.core.common.businessentities.VM paramT2 ) { return paramT1.getName ( ) . compareTo ( paramT2.getName ( ) ) ; }

Target:
public void setItems ( java.lang.Iterable value ) { if ( value != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > itemList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( value ) ) ; java.util.Collections.sort ( itemList , new org.ovirt.engine.ui.uicommonweb.Linq.VmComparator ( ) ) ; } super . setItems ( value ) ; }
Source:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > setupCanAddVmTests ( final int domainSizeGB , final int sizeRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > cmd = createCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; return cmd ; }

Target:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > setupCanAddVmTests ( final int domainSizeGB , final int sizeRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > cmd = createCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; org.mockito.Mockito.doReturn ( createStoragePool ( ) ) . when ( cmd ) . getStoragePool ( ) ; return cmd ; }
Source:
public boolean ShouldEndAction ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.EntityAsyncTask > CurrentActionTypeTasks = GetCurrentActionTypeTasks ( ) ; for ( org.ovirt.engine.core.bll.EntityAsyncTask task : CurrentActionTypeTasks ) { if ( ( task.getState ( ) ) != ( AsyncTaskState.Ended ) ) { return false ; } } } return true ; }

Target:
public void MarkAllWithAttemptingEndAction ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.EntityAsyncTask > CurrentActionTypeTasks = getCurrentTasks ( ) ; for ( org.ovirt.engine.core.bll.EntityAsyncTask task : CurrentActionTypeTasks ) { task.setState ( AsyncTaskState.AttemptingEndAction ) ; } } }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > getInterfaceColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn < org.ovirt.engine.core.common.businessentities.storage.Disk , org.ovirt.engine.core.common.businessentities.storage.DiskInterface > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.storage.DiskInterface getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return object.getDiskInterface ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > getInterfaceColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn < org.ovirt.engine.core.common.businessentities.storage.Disk , org.ovirt.engine.core.common.businessentities.storage.DiskInterface > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.storage.DiskInterface getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( ( object.getDiskVmElements ( ) . size ( ) ) == 1 ) { return object.getDiskVmElements ( ) . iterator ( ) . next ( ) . getDiskInterface ( ) ; } return null ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
private int getTotalMemoryStatesSizeGb ( ) { long sizeInBytes = 0 ; for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : snapshotsWithMemory ) { org.ovirt.engine.core.common.businessentities.VM vm = getVmFromSnapshot ( snapshot ) ; sizeInBytes += ( vm.getTotalMemorySizeInBytes ( ) ) + ( org.ovirt.engine.core.bll.memory.MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; } return ( ( int ) ( java.lang.Math.ceil ( ( ( 1.0 * sizeInBytes ) / ( BYTES_IN_GB ) ) ) ) ) ; }

Target:
protected boolean handleDestStorageDomain ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { ensureDomainMap ( disksList , org.ovirt.engine.core.bll.ExportVmCommand.getStorageDomainId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > dummiesDisksList = createDiskDummiesForSpaceValidations ( disksList ) ; dummiesDisksList.addAll ( getMemoryVolumes ( ) ) ; return validateSpaceRequirements ( dummiesDisksList ) ; }
Source:
public static void getHostById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getHostById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }