auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void diskImagesAlreadyExistBothExist ( ) { org.mockito.Mockito.doReturn ( true ) . when ( validator ) . isDiskExists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.junit.matchers.JUnitMatchers.hasItem ( org.ovirt.engine.core.bll.validator.DiskImagesValidatorTest.createAliasReplacements ( disk1 , disk2 ) ) ) ) ) ; }

Target:
public void diskImagesAlreadyExistBothExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.junit.matchers.JUnitMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.junit.matchers.JUnitMatchers.hasItem ( org.ovirt.engine.core.bll.validator.DiskImagesValidatorTest.createAliasReplacements ( disk1 , disk2 ) ) ) ) ) ; }
Source:
private void updateAdminStatus ( org.ovirt.engine.core.common.businessentities.Permissions perm ) { org.ovirt.engine.core.common.businessentities.Role role = org.ovirt.engine.core.bll.AddPermissionCommand.getRoleDao ( ) . get ( perm.getrole_id ( ) ) ; if ( ( role.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.setIsAdminGUIFlag ( perm.getad_element_id ( ) , true ) ; } }

Target:
private void updateAdminStatus ( org.ovirt.engine.core.common.businessentities.Permissions perm ) { org.ovirt.engine.core.common.businessentities.Role role = org.ovirt.engine.core.bll.AddPermissionCommand.getRoleDao ( ) . get ( perm.getRoleId ( ) ) ; if ( ( role.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.setIsAdminGUIFlag ( perm.getAdElementId ( ) , true ) ; } }
Source:
public boolean isFileDomain ( ) { return ( ( ( ( this ) == ( org.ovirt.engine.core.common.businessentities.StorageType.NFS ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.StorageType.POSIXFS ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) ; }

Target:
public boolean isFileDomain ( ) { return ( ( ( ( ( this ) == ( org.ovirt.engine.core.common.businessentities.StorageType.NFS ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.StorageType.POSIXFS ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) ) || ( ( this ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLANCE ) ) ; }
Source:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
private void mockStoragePool ( ) { final org.ovirt.engine.core.dao.StoragePoolDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; final org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setId ( command.getParameters ( ) . getStoragePoolId ( ) ) ; org.mockito.Mockito.when ( dao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( pool ) ; org.mockito.Mockito.doReturn ( dao ) . when ( command ) . getStoragePoolDao ( ) ; }

Target:
private void mockStoragePool ( ) { final org.ovirt.engine.core.common.businessentities.StoragePool pool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; pool.setId ( command.getParameters ( ) . getStoragePoolId ( ) ) ; org.mockito.Mockito.when ( storagePoolDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( pool ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Quota quota ) { if ( ( quota.getQuotaEnforcementType ( ) ) == null ) { return getApplicationResources ( ) . iconDisable ( ) ; } setEnumTitle ( quota.getQuotaEnforcementType ( ) ) ; switch ( quota.getQuotaEnforcementType ( ) ) { case HARD_ENFORCEMENT : return getApplicationResources ( ) . iconEnforce ( ) ; case SOFT_ENFORCEMENT : return getApplicationResources ( ) . iconAudit ( ) ; case DISABLED : return getApplicationResources ( ) . iconDisable ( ) ; default : return getApplicationResources ( ) . iconDisable ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Quota quota ) { if ( ( quota.getQuotaEnforcementType ( ) ) == null ) { return org.ovirt.engine.ui.webadmin.widget.table.column.QuotaDcStatusColumn.resources.iconDisable ( ) ; } switch ( quota.getQuotaEnforcementType ( ) ) { case HARD_ENFORCEMENT : return org.ovirt.engine.ui.webadmin.widget.table.column.QuotaDcStatusColumn.resources.iconEnforce ( ) ; case SOFT_ENFORCEMENT : return org.ovirt.engine.ui.webadmin.widget.table.column.QuotaDcStatusColumn.resources.iconAudit ( ) ; case DISABLED : return org.ovirt.engine.ui.webadmin.widget.table.column.QuotaDcStatusColumn.resources.iconDisable ( ) ; default : return org.ovirt.engine.ui.webadmin.widget.table.column.QuotaDcStatusColumn.resources.iconDisable ( ) ; } }
Source:
private double getStoredStackPanelWidth ( ) { java.lang.String widthString = clientStorage.getLocalItem ( org.ovirt.engine.ui.webadmin.widget.main.TabbedSplitLayoutPanel.WEST_SPLITTER_KEY ) ; double width = org.ovirt.engine.ui.webadmin.widget.main.TabbedSplitLayoutPanel.DEFAULT_STACK_PANEL_WIDTH ; try { if ( widthString != null ) { width = java.lang.Double.valueOf ( widthString ) ; } } catch ( java.lang.NumberFormatException nfe ) { } return width ; }

Target:
private double getStoredStackPanelWidth ( java.lang.String key ) { java.lang.String widthString = clientStorage.getLocalItem ( key ) ; double width = org.ovirt.engine.ui.webadmin.widget.main.TabbedSplitLayoutPanel.DEFAULT_STACK_PANEL_WIDTH ; try { if ( widthString != null ) { width = java.lang.Double.valueOf ( widthString ) ; } } catch ( java.lang.NumberFormatException nfe ) { } return width ; }
Source:
public org.ovirt.engine.api.model.Nics list ( ) { org.ovirt.engine.api.model.Nics nics = new org.ovirt.engine.api.model.Nics ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > entities = getBackendCollection ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( instanceTypeId ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity : entities ) { org.ovirt.engine.api.model.Nic nic = populate ( map ( entity ) , entity ) ; nics.getNics ( ) . add ( addLinks ( nic ) ) ; } return nics ; }

Target:
public org.ovirt.engine.api.model.Nics list ( ) { org.ovirt.engine.api.model.Nics nics = new org.ovirt.engine.api.model.Nics ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > entities = getBackendCollection ( QueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( instanceTypeId ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity : entities ) { org.ovirt.engine.api.model.Nic nic = populate ( map ( entity ) , entity ) ; nics.getNics ( ) . add ( addLinks ( nic ) ) ; } return nics ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getAAANamespaces ( 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.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testBootProtocolSetForDisplayNetworkWhenBootProtocolIsNone ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( true , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_DISPLAY_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsDhcp ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , false , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; org.ovirt.engine.core.compat.Guid exportDomainId = findExportDomainId ( storageDomains ) ; if ( exportDomainId != null ) { getVmsFromExportDomain ( dataCenter.getId ( ) , exportDomainId ) ; } else { setErrorToFetchData ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . notAvailableWithNoActiveExportDomain ( ) ) ; stopProgress ( ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( ReturnValue ) ) ; setExportPath ( ( connection == null ? null : connection.getconnection ( ) ) ) ; getVmsFromExportDomain ( dataCenter.getId ( ) , exportDomain.getId ( ) ) ; }
Source:
protected void readBytes ( java.nio.ByteBuffer ibuff ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { int read = readBuffer ( ibuff ) ; if ( read <= 0 ) { return ; } ibuff.rewind ( ) ; byte [ ] message = new byte [ read ] ; ibuff.get ( message ) ; emitOnMessageReceived ( message ) ; this . ibuff = null ; }

Target:
public java.util.concurrent.Future < java.lang.Void > close ( ) { return disconnect ( ) ; }
Source:
public void testBuildVmOnNewTemplate ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.buildVmOnNewTemplate ( model , origVm ) ; verifyBuiltCommonVm ( vm.getStaticData ( ) ) ; verifyBuiltOrigVm ( origVm , vm ) ; org.junit.Assert.assertEquals ( origVm.getDedicatedVmForVds ( ) , vm.getDedicatedVmForVds ( ) ) ; org.junit.Assert.assertEquals ( origVm.getMigrationSupport ( ) , vm.getMigrationSupport ( ) ) ; org.junit.Assert.assertEquals ( origVm.getMigrationDowntime ( ) , vm.getMigrationDowntime ( ) ) ; }

Target:
public void testBuildVmOnNewTemplate ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.buildVmOnNewTemplate ( model , origVm ) ; verifyBuiltCommonVm ( vm.getStaticData ( ) ) ; verifyBuiltOrigVm ( origVm , vm ) ; org.junit.Assert.assertEquals ( origVm.getDedicatedVmForVdsList ( ) , vm.getDedicatedVmForVdsList ( ) ) ; org.junit.Assert.assertEquals ( origVm.getMigrationSupport ( ) , vm.getMigrationSupport ( ) ) ; org.junit.Assert.assertEquals ( origVm.getMigrationDowntime ( ) , vm.getMigrationDowntime ( ) ) ; }
Source:
public static void isMTUOverrideSupported ( 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MTUOverrideSupported ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }
Source:
public void onSuccess ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Frontend: sucessfully executed runAction, determining result!" ) ; handleActionResult ( actionType , parameters , result , ( callback != null ? callback : org.ovirt.engine.ui.frontend.Frontend.NULLABLE_ASYNC_CALLBACK ) , state , showErrorDialog ) ; org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , state ) ; org.ovirt.engine.ui.frontend.communication.RefreshActiveModelEvent.fire ( this , true ) ; }

Target:
public void onSuccess ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Frontend: sucessfully executed runAction, determining result!" ) ; handleActionResult ( actionType , parameters , result , ( callback != null ? callback : org.ovirt.engine.ui.frontend.Frontend.NULLABLE_ASYNC_CALLBACK ) , state , showErrorDialog ) ; fireAsyncActionSucceededEvent ( state ) ; }
Source:
public void testListCrash ( ) { java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpVnicProfilesQueryExpectations ( t ) ; javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) { java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpVnicProfilesQueryExpectations ( t ) ; javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; verifyFault ( org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfilesResourceTest.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; }
Source:
public void testGetVdsCapabilities ( ) throws java.lang.InterruptedException , java.util.concurrent.ExecutionException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { org.ovirt.vdsm.jsonrpc.client.JsonRpcClient client = org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createStompClient ( org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.HOST_ADDRESS , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.PORT , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , 0 , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , true , "TLSv1" , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.DEFAULT_REQUEST_QUEUE , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.DEFAULT_RESPONSE_QUEUE ) ; final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getCapabilities" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > map = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( client , request ) ; org.junit.Assert.assertTrue ( map.isEmpty ( ) ) ; }

Target:
public void testGetVdsCapabilities ( ) throws java.lang.InterruptedException , java.util.concurrent.ExecutionException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { org.ovirt.vdsm.jsonrpc.client.JsonRpcClient client = org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createStompClient ( org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.HOST_ADDRESS , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.PORT , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , 0 , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.TIMEOUT , true , "TLSv1" , java.lang.Runtime.getRuntime ( ) . availableProcessors ( ) , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.DEFAULT_REQUEST_QUEUE , org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIntegrationTest.DEFAULT_RESPONSE_QUEUE ) ; final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getCapabilities" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > map = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( client , request ) ; org.junit.Assert.assertTrue ( map.isEmpty ( ) ) ; }
Source:
protected boolean doDomainsUseConnection ( ) { return ( ( domains ) != null ) && ( ! ( domains.isEmpty ( ) ) ) ; }

Target:
protected boolean doDomainsUseConnection ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection ) { if ( ( ( domains ) == null ) || ( domains.isEmpty ( ) ) ) { domains = getStorageDomainsByConnId ( connection.getid ( ) ) ; } return ( ( domains ) != null ) && ( ! ( domains.isEmpty ( ) ) ) ; }
Source:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public void 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.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void setImagesToModel ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , java.util.List < java.lang.String > images ) { java.lang.String oldCdImage = ( ( java.lang.String ) ( model.getCdImage ( ) . getSelectedItem ( ) ) ) ; model.getCdImage ( ) . setItems ( images ) ; model.getCdImage ( ) . setSelectedItem ( ( oldCdImage != null ? oldCdImage : org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( images ) ) ) ; }

Target:
protected void setImagesToModel ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , java.util.List < java.lang.String > images ) { java.lang.String oldCdImage = ( ( java.lang.String ) ( model.getCdImage ( ) . getSelectedItem ( ) ) ) ; model.getCdImage ( ) . setItems ( images ) ; model.getCdImage ( ) . setSelectedItem ( ( oldCdImage != null ? oldCdImage : org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( images ) ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.DiskImage i = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeInBytes ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ) ) ; return i ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.DiskImage i = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeInBytes ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return i ; }
Source:
public void testVmDiskWithPassDiscardAndWadExistsSucceeds ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; createVmDiskOnSd ( false , true ) ; org.ovirt.engine.core.compat.Guid diskId = createVmDiskOnSd ( true , true ) ; storageDomainVmDisks.add ( createVmDisk ( diskId , false ) ) ; org.junit.Assert.assertTrue ( discardHelper.vmDiskWithPassDiscardAndWadExists ( storageDomainDisks , storageDomainVmDisks ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { storageDomain.setSupportsDiscard ( true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 0L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity getDistributedVolume ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getVolume ( volumeId ) ; volume.setStatus ( ( volumeId == ( volumeId1 ) ? org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeStatus.UP : org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeStatus.DOWN ) ) ; volume.setBricks ( getBricks ( volumeId , 2 ) ) ; volume.setVolumeType ( GlusterVolumeType.DISTRIBUTE ) ; return volume ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity getDistributedVolume ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getVolume ( volumeId ) ; volume.setStatus ( ( volumeId == ( volumeId1 ) ? org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeStatus.UP : org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeStatus.DOWN ) ) ; volume.setBricks ( getBricks ( volumeId , 2 ) ) ; volume.setVolumeType ( GlusterVolumeType.DISTRIBUTE ) ; volume.setClusterId ( CLUSTER_ID ) ; return volume ; }
Source:
private java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > createHotPlugDiskToVmParameters ( boolean plug ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parametersList = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.core.common.businessentities.Disk ) ( item ) ) ; disk.setPlugged ( plug ) ; parametersList.add ( new org.ovirt.engine.core.common.action.HotPlugDiskToVmParameters ( vm.getId ( ) , disk.getId ( ) ) ) ; } return parametersList ; }

Target:
public boolean isHotPlugAvailable ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; return ( vm != null ) && ( ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private java.lang.String getPublicEntity ( java.lang.String entityName ) { if ( this . entitiesMap.containsKey ( entityName.toLowerCase ( ) ) ) { return this . entitiesMap.get ( entityName.toLowerCase ( ) ) ; } throw new java.lang.RuntimeException ( ( ( "Public entity \"" + entityName ) + "\" fetch has failed." ) ) ; }

Target:
private java.lang.String getPublicEntity ( java.lang.String entityName , java.lang.String [ ] periods , int i ) { java.lang.String exception = org.ovirt.engine.sdk.codegen.rsdl.RsdlCodegen.checkNamingException ( org.ovirt.engine.sdk.codegen.rsdl.RsdlCodegen.ENTITY_NAME_EXCEPTIONS , entityName , periods , i ) ; if ( exception != null ) { return exception ; } if ( this . entitiesMap.containsKey ( entityName.toLowerCase ( ) ) ) { return this . entitiesMap.get ( entityName.toLowerCase ( ) ) ; } throw new java.lang.RuntimeException ( ( ( "Public entity \"" + entityName ) + "\" fetch has failed." ) ) ; }
Source:
public static < T extends java.lang.Enum > java.util.ArrayList < T > GetValues ( java.lang.Class < T > clazz ) { java.util.ArrayList < java.lang.String > returnValues = new java.util.ArrayList < java.lang.String > ( ) ; if ( ! ( clazz.isEnum ( ) ) ) { throw new org.ovirt.engine.core.compat.CompatException ( ( "Class is not an Enum: " + ( clazz.getName ( ) ) ) ) ; } return new java.util.ArrayList ( java.util.Arrays.asList ( clazz.getEnumConstants ( ) ) ) ; }

Target:
public static < T extends java.lang.Enum > java.lang.String [ ] GetNames ( java.lang.Class < T > clazz ) { java.util.ArrayList < java.lang.String > returnValues = new java.util.ArrayList < java.lang.String > ( ) ; if ( ! ( clazz.isEnum ( ) ) ) { throw new java.lang.RuntimeException ( ( "Class is not an Enum: " + ( clazz.getName ( ) ) ) ) ; } for ( java.lang.Enum e : clazz.getEnumConstants ( ) ) { returnValues.add ( e.name ( ) ) ; } return returnValues.toArray ( new java.lang.String [ 0 ] ) ; }
Source:
protected void endWithFailure ( ) { SetIsVmRunningStateless ( ) ; rollbackQuota ( ) ; if ( _isVmRunningStateless ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }

Target:
protected void endWithFailure ( ) { setIsVmRunningStateless ( ) ; rollbackQuota ( ) ; if ( _isVmRunningStateless ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }
Source:
protected java.util.Map < java.lang.String , java.lang.Object > convertFencingPolicy ( ) { java.util.Map < java.lang.String , java.lang.Object > map = null ; if ( ( ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getFencingPolicy ( ) ) != null ) && ( org.ovirt.engine.core.common.utils.FencingPolicyHelper.isFencingPolicySupported ( getProxyVds ( ) . getSupportedClusterVersionsSet ( ) ) ) ) { map = new java.util.HashMap < > ( ) ; if ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getFencingPolicy ( ) . isSkipFencingIfSDActive ( ) ) { map.put ( VdsProperties.STORAGE_DOMAIN_HOST_ID_MAP , createStorageDomainHostIdMap ( ) ) ; } } return map ; }

Target:
protected void alertPowerManagementStatusFailed ( java.lang.String reason ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getTargetVdsID ( ) ) ; alert.addCustomValue ( "Reason" , reason ) ; auditLogDirector.log ( alert , AuditLogType.VDS_ALERT_FENCE_TEST_FAILED ) ; }
Source:
private org.ovirt.engine.api.model.Networks mapCollection ( java.util.List < org.ovirt.engine.api.model.Network > entities ) { org.ovirt.engine.api.model.Networks collection = new org.ovirt.engine.api.model.Networks ( ) ; for ( org.ovirt.engine.api.model.Network entity : entities ) { collection.getNetworks ( ) . add ( addLinks ( map ( entity ) ) ) ; } return collection ; }

Target:
public org.ovirt.engine.api.model.Networks list ( ) { org.ovirt.engine.api.model.Networks networks ; if ( isFiltered ( ) ) { networks = mapCollection ( getBackendCollection ( queryType , getQueryParameters ( ) , SearchType.Network ) ) ; } else { networks = mapCollection ( getBackendCollection ( SearchType.Network ) ) ; } for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }
Source:
protected java.util.List < java.lang.String > getHeaderDeclarations ( java.util.List < org.ovirt.engine.sdk.entities.Header > headers ) { java.util.List < java.lang.String > paramDecls = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.sdk.entities.Header header : headers ) { java.lang.String paramName = org.ovirt.engine.sdk.codegen.utils.FormatUtils.toJava ( header.getName ( ) ) ; java.lang.String paramType = org.ovirt.engine.sdk.codegen.utils.TypeUtils.toJava ( org.ovirt.engine.sdk.codegen.templates.AbstractOverloadableTemplate.XSD_STRING_TYPE ) ; org.ovirt.engine.sdk.codegen.templates.MethodParameterTemplate paramDeclTemplate = new org.ovirt.engine.sdk.codegen.templates.MethodParameterTemplate ( ) ; java.lang.String paramDecl = paramDeclTemplate.getTemplate ( paramType , paramName ) ; paramDecls.add ( paramDecl ) ; } return paramDecls ; }

Target:
protected java.util.List < java.lang.String > getHeaderDeclarations ( java.util.List < org.ovirt.engine.sdk.entities.Header > headers ) { java.util.List < java.lang.String > paramDecls = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.sdk.entities.Header header : headers ) { java.lang.String paramName = org.ovirt.engine.sdk.codegen.utils.FormatUtils.toJava ( header.getName ( ) ) ; java.lang.String paramType = org.ovirt.engine.sdk.codegen.utils.TypeUtils.toJava ( org.ovirt.engine.sdk.codegen.templates.AbstractOverloadableTemplate.XSD_STRING_TYPE ) ; org.ovirt.engine.sdk.codegen.templates.MethodParameterTemplate paramDeclTemplate = new org.ovirt.engine.sdk.codegen.templates.MethodParameterTemplate ( ) ; java.lang.String paramDecl = paramDeclTemplate.evaluate ( paramType , paramName ) ; paramDecls.add ( paramDecl ) ; } return paramDecls ; }
Source:
protected boolean validateVM ( org.ovirt.engine.core.bll.validator.VmValidator vmValidator ) { org.ovirt.engine.core.bll.validator.LiveSnapshotValidator validator = new org.ovirt.engine.core.bll.validator.LiveSnapshotValidator ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVds ( ) ) ; return ( ( ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVm ( ) . isDown ( ) ) || ( validate ( validator.canDoSnapshot ( ) ) ) ) && ( validate ( vmValidator.vmNotSavingRestoring ( ) ) ) ) && ( validate ( vmValidator.validateVmStatusUsingMatrix ( VdcActionType.CreateAllSnapshotsFromVm ) ) ) ; }

Target:
protected boolean validateVM ( org.ovirt.engine.core.bll.validator.VmValidator vmValidator ) { org.ovirt.engine.core.bll.validator.LiveSnapshotValidator validator = new org.ovirt.engine.core.bll.validator.LiveSnapshotValidator ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVds ( ) ) ; return ( ( ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVm ( ) . isDown ( ) ) || ( validate ( validator.validateSnapshot ( ) ) ) ) && ( validate ( vmValidator.vmNotSavingRestoring ( ) ) ) ) && ( validate ( vmValidator.validateVmStatusUsingMatrix ( VdcActionType.CreateAllSnapshotsFromVm ) ) ) ; }
Source:
protected void removeVmNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > interfaces = getVmNetworkInterfaceDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : interfaces ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMac ( iface.getMacAddress ( ) ) ; } } }

Target:
protected void removeVmNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = getVmNetworkInterfaceDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : interfaces ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMac ( iface.getMacAddress ( ) ) ; } } }
Source:
public static java.util.Set < org.ovirt.engine.core.compat.Guid > getAllStorageIdsForImageIds ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { java.util.Set < org.ovirt.engine.core.compat.Guid > domainsIds = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { domainsIds.addAll ( image.getStorageIds ( ) ) ; } return domainsIds ; }

Target:
public static java.util.Set < org.ovirt.engine.core.compat.Guid > getAllStorageIdsForImageIds ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { java.util.Set < org.ovirt.engine.core.compat.Guid > domainsIds = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { domainsIds.addAll ( image.getStorageIds ( ) ) ; } return domainsIds ; }
Source:
protected void setUpEntityQueryExpectations ( int times , boolean isDisplay , boolean isMigration , boolean isRequired , boolean isDefaultRoute ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , getEntityList ( isDisplay , isMigration , isRequired , isDefaultRoute ) ) ; } }

Target:
private org.ovirt.engine.core.common.businessentities.Cluster getCluster ( int index ) { org.ovirt.engine.api.restapi.resource.Cluster entity = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; return entity ; }
Source:
protected void processIncoming ( ) throws java.io.IOException , org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { if ( ( this . ibuff ) == null ) { this . ibuff = java.nio.ByteBuffer.allocate ( 16384 ) ; readBytes ( this . ibuff ) ; } else { readBytes ( this . ibuff ) ; } }

Target:
private void closeChannel ( ) { try { if ( ( this . channel ) != null ) { this . channel.close ( ) ; } } catch ( java.io.IOException e ) { } finally { this . channel = null ; } }
Source:
private void externalHostGroups_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.ExternalHostGroup dhg = ( ( org.ovirt.engine.core.common.businessentities.ExternalHostGroup ) ( getExternalHostGroups ( ) . getSelectedItem ( ) ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; if ( dhg != null ) { vds.setVdsName ( getName ( ) . getEntity ( ) ) ; vds.setHostName ( ( ( ( getName ( ) . getEntity ( ) ) + "." ) + ( dhg.getDomainName ( ) ) ) ) ; } updateModelFromVds ( vds , null , false , null ) ; }

Target:
private void externalHostGroups_SelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.ExternalHostGroup dhg = ( ( org.ovirt.engine.core.common.businessentities.ExternalHostGroup ) ( getExternalHostGroups ( ) . getSelectedItem ( ) ) ) ; if ( dhg != null ) { getHost ( ) . setEntity ( ( ( ( getName ( ) . getEntity ( ) ) + "." ) + ( dhg.getDomainName ( ) ) ) ) ; } }
Source:
protected void setUpGetHostByNameExpectations ( int idx ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.setUpEntityExpectations ( control.createMock ( org.ovirt.engine.core.common.businessentities.VDS.class ) , idx ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ idx ] } , host ) ; }

Target:
protected void setUpGetHostByNameExpectations ( int idx ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.setUpEntityExpectations ( org.mockito.Mockito.spy ( new org.ovirt.engine.core.common.businessentities.VDS ( ) ) , idx ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ idx ] } , host ) ; }
Source:
public org.ovirt.engine.api.model.Configuration adapt ( org.ovirt.engine.api.v3.types.V3Configuration from ) { org.ovirt.engine.api.model.Configuration to = new org.ovirt.engine.api.model.Configuration ( ) ; if ( from.isSetData ( ) ) { to.setData ( from.getData ( ) ) ; } if ( from.isSetType ( ) ) { to.setType ( from.getType ( ) ) ; } return to ; }

Target:
public org.ovirt.engine.api.model.Configuration adapt ( org.ovirt.engine.api.v3.types.V3Configuration from ) { org.ovirt.engine.api.model.Configuration to = new org.ovirt.engine.api.model.Configuration ( ) ; if ( from.isSetData ( ) ) { to.setData ( from.getData ( ) ) ; } if ( from.isSetType ( ) ) { to.setType ( org.ovirt.engine.api.model.ConfigurationType.valueOf ( from.getType ( ) ) ) ; } return to ; }