auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void refuseSoundDeviceOnPPC ( ) { final org.ovirt.engine.core.bll.exportimport.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > cmd = setupCanImportPpcTest ( ) ; addSoundDeviceToVm ( cmd.getVmFromExportDomain ( null ) ) ; org.mockito.Mockito.when ( osRepository.isSoundDeviceEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getCluster ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.SOUND_DEVICE_REQUESTED_ON_NOT_SUPPORTED_ARCH.toString ( ) ) ) ; }

Target:
public void refuseBalloonOnPPC ( ) { setupCanImportPpcTest ( ) ; addBalloonToVm ( cmd.getVmFromExportDomain ( null ) ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.exportimport.ImportVmCommandTest.osRepository.isBalloonEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getCluster ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH.toString ( ) ) ) ; }
Source:
public void testMapHostId ( ) { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; entity.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.model.VM model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.VM ) ( null ) ) ) ; assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }

Target:
public void testMapHostId ( ) { org.ovirt.engine.api.restapi.types.VM entity = new org.ovirt.engine.api.restapi.types.VM ( ) ; entity.setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; entity.setRunOnVds ( guid ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; assertEquals ( guid.toString ( ) , model.getHost ( ) . getId ( ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ! ( getGlusterUtil ( ) . isGlusterSnapshotSupported ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getId ( ) ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ! ( getGlusterUtil ( ) . isGlusterSnapshotSupported ( org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.gluster.GlusterSnapshotCommandBase.getVdsGroup ( ) . getId ( ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED ) ; } return true ; }
Source:
private java.util.Set < org.ovirt.engine.core.compat.Guid > getPoolIdsTasks ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > poolsOfActiveTasks = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.bll.tasks.SPMAsyncTask task : _tasks.values ( ) ) { if ( task.getShouldPoll ( ) ) { poolsOfActiveTasks.add ( task.getStoragePoolID ( ) ) ; } } return poolsOfActiveTasks ; }

Target:
private java.util.Set < org.ovirt.engine.core.compat.Guid > getPoolIdsTasks ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > poolsOfActiveTasks = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task : _tasks.values ( ) ) { if ( task.getShouldPoll ( ) ) { poolsOfActiveTasks.add ( task.getStoragePoolID ( ) ) ; } } return poolsOfActiveTasks ; }
Source:
public void testGetAllDiskImageSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Disk" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( diskImageResultList , searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testGetAllMultiDiskImageSearch ( ) throws java.lang.Exception { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "Disks" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.Disk ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( diskImageResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
public java.lang.Object runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage di : org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) ) ) { org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( di.getImageId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getSourceStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( di.getImageId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getTargetStorageDomainId ( ) ) ) ; } return null ; }

Target:
public java.lang.Object runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage di : org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) ) ) { org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( di.getImageId ( ) , sourceStorageDomainId ) ) ; org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( di.getImageId ( ) , targetStorageDomainId ) ) ; } return null ; }
Source:
private void internalEndSuccessfully ( ) { log.infoFormat ( "Ending command successfully: {0}" , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { getCurrentTaskHandler ( ) . endSuccessfully ( ) ; getParameters ( ) . incrementExecutionIndex ( ) ; if ( ( getExecutionIndex ( ) ) < ( getTaskHandlers ( ) . size ( ) ) ) { _actionState = CommandActionState.EXECUTE ; execute ( ) ; } } else { endSuccessfully ( ) ; } }

Target:
protected void logExceptionAndCompensate ( java.lang.Exception e ) { log.error ( "Exception while wrapping-up compensation in endAction" , e ) ; compensate ( ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Group group ) { validateParameters ( group , "name" ) ; org.ovirt.engine.core.common.action.AddUserParameters newGroup = new org.ovirt.engine.core.common.action.AddUserParameters ( ) ; newGroup.setAdGroup ( getAdGroup ( group ) ) ; return performCreation ( VdcActionType.AddUser , newGroup , new org.ovirt.engine.api.restapi.resource.GroupIdResolver ( newGroup.getAdGroup ( ) . getid ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Group group ) { validateParameters ( group , "name" ) ; org.ovirt.engine.core.common.action.AddUserParameters newGroup = new org.ovirt.engine.core.common.action.AddUserParameters ( ) ; newGroup.setAdGroup ( getAdGroup ( group ) ) ; return performCreate ( VdcActionType.AddUser , newGroup , new org.ovirt.engine.api.restapi.resource.GroupIdResolver ( newGroup.getAdGroup ( ) . getid ( ) ) ) ; }
Source:
public void validateDiskIsOvfStore ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; command.getImage ( ) . setContentType ( DiskContentType.OVF_STORE ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_OVF_DISK_NOT_SUPPORTED ) ; }

Target:
public void validateSourceDomainValid ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; initializeCommand ( disk , VmEntityType.VM ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; disk.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SOURCE_STORAGE_DOMAIN_DOES_CONTAINS_THE_DISK ) ; }
Source:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT , bond.getName ( ) ) ; }

Target:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = java.util.Collections.singletonList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , bond.getName ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.IpConfiguration createIpConfigurationFromVdsNetworkInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; ipConfiguration.setBootProtocol ( nic.getBootProtocol ( ) ) ; ipConfiguration.setAddress ( nic.getAddress ( ) ) ; ipConfiguration.setNetmask ( nic.getSubnet ( ) ) ; ipConfiguration.setGateway ( nic.getGateway ( ) ) ; return ipConfiguration ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.IpConfiguration createIpConfigurationFromVdsNetworkInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address iPv4Address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; iPv4Address.setAddress ( nic.getAddress ( ) ) ; iPv4Address.setNetmask ( nic.getSubnet ( ) ) ; iPv4Address.setGateway ( nic.getGateway ( ) ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; ipConfiguration.setBootProtocol ( nic.getBootProtocol ( ) ) ; ipConfiguration.setIPv4Addresses ( java.util.Collections.singletonList ( iPv4Address ) ) ; return ipConfiguration ; }
Source:
public void customPropertiesNetworkRemoved ( ) { mockExistingNetworks ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNic ( "eth0" , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; mockExistingIfaces ( iface ) ; iface.setNetworkName ( null ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndAssertNetworkRemoved ( helper , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createManagementNetworkNic ( java.lang.String nicName ) { org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( org.mockito.Matchers.eq ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; return createNic ( nicName , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
Source:
public void updateId ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = dao.get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertNotNull ( snapshot ) ; org.ovirt.engine.core.compat.Guid oldId = snapshot.getId ( ) ; snapshot.setId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; dao.updateId ( oldId , snapshot.getId ( ) ) ; org.junit.Assert.assertEquals ( snapshot , dao.get ( snapshot.getId ( ) ) ) ; }

Target:
public void updateId ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = dao.get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertNotNull ( snapshot ) ; org.ovirt.engine.core.compat.Guid oldId = snapshot.getId ( ) ; snapshot.setId ( Guid.Empty ) ; dao.updateId ( oldId , snapshot.getId ( ) ) ; org.junit.Assert.assertEquals ( snapshot , dao.get ( snapshot.getId ( ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc list ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getVMList" ) . withOptionalParameterAsList ( "vmList" , new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( new java.lang.String [ ] { } ) ) ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc list ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getVMList" ) . withOptionalParameterAsList ( "vmList" , new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( new java.lang.String [ ] { } ) ) ) . withParameter ( "onlyUUID" , false ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( response ) ; }
Source:
private static java.util.Properties loadProperties ( java.io.InputStream resource ) { try ( java.io.Reader is = new java.io.InputStreamReader ( resource , java.nio.charset.Charset.forName ( "UTF-8" ) ) ) { java.util.Properties prop = new java.util.Properties ( ) ; prop.load ( is ) ; return prop ; } catch ( java.io.IOException ioe ) { throw new java.lang.RuntimeException ( ioe ) ; } }

Target:
private static java.util.Properties loadProperties ( java.io.InputStream resource ) { try ( java.io.Reader is = new java.io.InputStreamReader ( resource , java.nio.charset.StandardCharsets.UTF_8 ) ) { java.util.Properties prop = new java.util.Properties ( ) ; prop.load ( is ) ; return prop ; } catch ( java.io.IOException ioe ) { throw new java.lang.RuntimeException ( ioe ) ; } }
Source:
public static boolean isNetworkInCluster ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.compat.Guid clusterId ) { if ( clusterId == null ) { return false ; } java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForCluster ( clusterId ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network clusterNetwork : networks ) { if ( clusterNetwork.getId ( ) . equals ( network.getId ( ) ) ) { return true ; } } return false ; }

Target:
public boolean isNetworkInCluster ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.compat.Guid clusterId ) { if ( clusterId == null ) { return false ; } java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = networkDao.getAllForCluster ( clusterId ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network clusterNetwork : networks ) { if ( clusterNetwork.getId ( ) . equals ( network.getId ( ) ) ) { return true ; } } return false ; }
Source:
protected void executeVdsBrokerCommand ( ) { result = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getBroker ( ) . getStorageDomainInfo ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.StorageDomainStatic , org.ovirt.engine.core.compat.Guid > pairSdStatic = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.BuildStorageStaticFromXmlRpcStruct ( result.storageInfo ) ; pairSdStatic.getFirst ( ) . setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( pairSdStatic ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { result = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getBroker ( ) . getStorageDomainInfo ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.StorageDomainStatic , org.ovirt.engine.core.compat.Guid > pairSdStatic = org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.buildStorageStaticFromXmlRpcStruct ( result.storageInfo ) ; pairSdStatic.getFirst ( ) . setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMGetStorageDomainInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( pairSdStatic ) ; }
Source:
public void testValidateGatewayWhenGatewayIsNotSpecified ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; attachment.getIpConfiguration ( ) . getPrimaryAddress ( ) . setGateway ( "" ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . validateGateway ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateGatewayWhenGatewayIsNull ( ) throws java.lang.Exception { doTestValidateGateway ( null , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void handleTasksOfCommandWithEmptyVdsmId ( final java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTask > tasks ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.SuppressWarnings ( value = "synthetic-access" ) @ java.lang.Override public void run ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Object > ( ) { @ java.lang.Override public java.lang.Object runInTransaction ( ) { try { boolean isPartiallySubmittedCommand = isPartiallySubmittedCommand ( tasks ) ; for ( org.ovirt.engine.core.common.businessentities.AsyncTask task : tasks ) { handleTaskOfCommandWithEmptyVdsmId ( isPartiallySubmittedCommand , task ) ; } return null ; } finally { irsBrokerLatch.countDown ( ) ; } } } ) ; } } ) ; }

Target:
public void handlePartiallyExecuteTasksOfCommand ( final java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTask > tasks ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.SuppressWarnings ( value = "synthetic-access" ) @ java.lang.Override public void run ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Object > ( ) { @ java.lang.Override public java.lang.Object runInTransaction ( ) { try { for ( org.ovirt.engine.core.common.businessentities.AsyncTask task : tasks ) { handlePartiallyExecutedTaskOfCommand ( task ) ; } return null ; } finally { irsBrokerLatch.countDown ( ) ; } } } ) ; } } ) ; }
Source:
public java.lang.Object getKey ( T item ) { if ( item instanceof org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel itemModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) ( item ) ) ; return itemModel.getIsPool ( ) ? ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( itemModel.getEntity ( ) ) ) . getvm_pool_id ( ) : ( ( org.ovirt.engine.core.common.businessentities.VM ) ( itemModel.getEntity ( ) ) ) . getId ( ) ; } return super . getKey ( item ) ; }

Target:
public java.lang.Object getKey ( T item ) { if ( item instanceof org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) { org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel itemModel = ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel ) ( item ) ) ; return itemModel.getIsPool ( ) ? ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( itemModel.getEntity ( ) ) ) . getVmPoolId ( ) : ( ( org.ovirt.engine.core.common.businessentities.VM ) ( itemModel.getEntity ( ) ) ) . getId ( ) ; } return super . getKey ( item ) ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void mapAction ( ) { for ( org.ovirt.engine.api.model.WatchdogAction action : org.ovirt.engine.api.model.WatchdogAction.values ( ) ) { org.ovirt.engine.core.common.businessentities.VmWatchdogAction backendAction = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( action ) ; org.junit.Assert.assertNotNull ( backendAction ) ; org.junit.Assert.assertEquals ( backendAction.name ( ) . toLowerCase ( ) , action.name ( ) . toLowerCase ( ) ) ; } }

Target:
public void mapAction ( ) { for ( org.ovirt.engine.api.model.WatchdogAction action : org.ovirt.engine.api.model.WatchdogAction.values ( ) ) { org.ovirt.engine.core.common.businessentities.VmWatchdogAction backendAction = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( action ) ; org.junit.jupiter.api.Assertions.assertNotNull ( backendAction ) ; org.junit.jupiter.api.Assertions.assertEquals ( backendAction.name ( ) . toLowerCase ( ) , action.name ( ) . toLowerCase ( ) ) ; } }
Source:
public void testImportWithStorageDomainName ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetStorageDomainByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ 2 ] } , getStorageDomainStatic ( 2 ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setName ( NAMES [ 2 ] ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; doTestImport ( storageDomain , cluster , false ) ; }

Target:
public void testImportWithStorageDomainName ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetStorageDomainByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ 2 ] } , getStorageDomainStatic ( 2 ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainTemplateResourceTest.STORAGE_DOMAIN_ID ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setName ( NAMES [ 2 ] ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; doTestImport ( storageDomain , cluster , false ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > pmOptions = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; if ( pmOptions != null ) { getPmPort ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmPortKey ) ) ; getPmSlot ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSlotKey ) ) ; getPmSecure ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSecureKey ) ) ; getPmEncryptOptions ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmEncryptOptions ) ) ; } }

Target:
public void run ( ) { getKernelCmdline ( ) . setEntity ( "" ) ; }
Source:
public void updateRepository_MIGRATION_FROM ( org.ovirt.engine.core.vdsbroker.VmTestPairs data ) { initMocks ( data , true ) ; org.junit.Assume.assumeNotNull ( data.dbVm ( ) , data.vdsmVm ( ) ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) . getVmDynamic ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) ) ; junit.framework.Assert.assertTrue ( vmAnalyzer.isClientIpChanged ( ) ) ; org.mockito.Mockito.verify ( vmsMonitoring.getResourceManager ( ) , org.mockito.Mockito.never ( ) ) . internalSetVmStatus ( data.dbVm ( ) , VMStatus.MigratingTo ) ; }

Target:
public void updateRepository_MIGRATION_FROM ( org.ovirt.engine.core.vdsbroker.VmTestPairs data ) { initMocks ( data , true ) ; org.junit.Assume.assumeNotNull ( data.dbVm ( ) , data.vdsmVm ( ) ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) . getVmDynamic ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) ) ; org.junit.Assert.assertTrue ( vmAnalyzer.isClientIpChanged ( ) ) ; org.mockito.Mockito.verify ( vmsMonitoring.getResourceManager ( ) , org.mockito.Mockito.never ( ) ) . internalSetVmStatus ( data.dbVm ( ) , VMStatus.MigratingTo ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = super . hashCode ( ) ; result = ( prime * result ) + ( ( storageDomainId ) == null ? 0 : storageDomainId.hashCode ( ) ) ; return result ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.profiles.DiskProfile ) ) { return false ; } org.ovirt.engine.core.common.businessentities.profiles.DiskProfile other = ( ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile ) ( obj ) ) ; return ( super . equals ( obj ) ) && ( java.util.Objects.equals ( storageDomainId , other.storageDomainId ) ) ; }
Source:
public void setRequired ( boolean required ) { getEntity ( ) . getCluster ( ) . setRequired ( required ) ; }

Target:
public void setDisplayNetwork ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel model , boolean value ) { if ( ! ( isMultiDisplay ( ) ) ) { if ( ( getDisplayNetwork ( ) ) != null ) { getDisplayNetwork ( ) . setDisplayNetwork ( ( ! value ) ) ; } } model.setDisplayNetwork ( value ) ; }
Source:
private void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.LabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.nicId , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.LABELS [ 0 ] } , valid , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.LabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.nicId , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelsResourceTest.LABELS [ 0 ] } , valid , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void notifyAsyncTasks ( ) { final java.util.List < org.ovirt.engine.core.compat.Guid > asyncTasks = org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getDbFacade ( ) . getAsyncTaskDao ( ) . getAsyncTaskIdsByEntity ( org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ! ( asyncTasks.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLogableBase.setStorageDomain ( org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getStorageDomain ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( auditLogableBase , AuditLogType.STORAGE_DOMAIN_TASKS_ERROR ) ; } }

Target:
private void notifyAsyncTasks ( ) { final java.util.List < org.ovirt.engine.core.compat.Guid > asyncTasks = org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getDbFacade ( ) . getAsyncTaskDao ( ) . getAsyncTaskIdsByEntity ( org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ! ( asyncTasks.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; auditLogableBase.setStorageDomain ( org.ovirt.engine.core.bll.storage.DeactivateStorageDomainCommand.getStorageDomain ( ) ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( auditLogableBase , AuditLogType.STORAGE_DOMAIN_TASKS_ERROR ) ; } }
Source:
public boolean performNextOperation ( int completedChildren ) { if ( completedChildren == ( org.ovirt.engine.core.bll.storage.disk.image.CloneImageGroupVolumesStructureCommand.getParameters ( ) . getImageIds ( ) . size ( ) ) ) { return false ; } org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.bll.storage.disk.image.CloneImageGroupVolumesStructureCommand.getParameters ( ) . getImageIds ( ) . get ( completedChildren ) ; log.info ( "Starting child command of {}, image '{}'" , ( completedChildren + 1 ) , org.ovirt.engine.core.bll.storage.disk.image.CloneImageGroupVolumesStructureCommand.getParameters ( ) . getImageIds ( ) . size ( ) , imageId ) ; createImage ( org.ovirt.engine.core.bll.storage.disk.image.CloneImageGroupVolumesStructureCommand.getDiskImageDao ( ) . getSnapshotById ( imageId ) ) ; return true ; }

Target:
public boolean performNextOperation ( int completedChildren ) { if ( completedChildren == ( org.ovirt.engine.core.bll.storage.disk.image.CloneImageGroupVolumesStructureCommand.getParameters ( ) . getImageIds ( ) . size ( ) ) ) { return false ; } org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.bll.storage.disk.image.CloneImageGroupVolumesStructureCommand.getParameters ( ) . getImageIds ( ) . get ( completedChildren ) ; log.info ( "Starting child command of {}, image '{}'" , ( completedChildren + 1 ) , org.ovirt.engine.core.bll.storage.disk.image.CloneImageGroupVolumesStructureCommand.getParameters ( ) . getImageIds ( ) . size ( ) , imageId ) ; createImage ( diskImageDao.getSnapshotById ( imageId ) ) ; return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.AuditLog create ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { if ( auditLogable.isExternal ( ) ) { return auditLogable.createAuditLog ( logType , loggerString ) ; } final java.lang.String messageByType = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessageOrNull ( logType ) ; if ( messageByType == null ) { return null ; } else { java.lang.String resolvedMessage = org.ovirt.engine.core.dal.dbbroker.auditloghandling.MessageResolver.resolveMessage ( messageByType , auditLogable ) ; return auditLogable.createAuditLog ( logType , resolvedMessage ) ; } }

Target:
private org.ovirt.engine.core.common.businessentities.AuditLog create ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable auditLogable , org.ovirt.engine.core.common.AuditLogType logType , java.lang.String loggerString ) { if ( auditLogable.isExternal ( ) ) { return auditLogable.createAuditLog ( logType , loggerString ) ; } final java.lang.String messageByType = org.ovirt.engine.core.dal.dbbroker.auditloghandling.MessageBundler.getMessageOrNull ( logType ) ; if ( messageByType == null ) { return null ; } else { java.lang.String resolvedMessage = org.ovirt.engine.core.dal.dbbroker.auditloghandling.MessageResolver.resolveMessage ( messageByType , auditLogable ) ; return auditLogable.createAuditLog ( logType , resolvedMessage ) ; } }
Source:
public static void updateSmartcardDevice ( org.ovirt.engine.core.compat.Guid vmId , boolean smartcardEnabled ) { if ( ! smartcardEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceType.SMARTCARD.getName ( ) , VmDeviceType.SMARTCARD.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : vmDevices ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } else { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addSmartcardDevice ( vmId ) ; } }

Target:
public static void updateSmartcardDevice ( org.ovirt.engine.core.compat.Guid vmId , boolean smartcardEnabled ) { if ( ! smartcardEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.SMARTCARD , VmDeviceType.SMARTCARD.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : vmDevices ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } else { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addSmartcardDevice ( vmId ) ; } }
Source:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
protected void AsyncSearch ( ) { super . AsyncSearch ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetAllDisksByVmId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vm.getId ( ) ) ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; super . syncSearch ( VdcQueryType.GetAllDisksByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vm.getId ( ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS createHost ( org.ovirt.engine.core.common.businessentities.VDSStatus status , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid dcId ) { org.ovirt.engine.core.common.businessentities.VDS host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; host.setClusterId ( clusterId ) ; host.setStoragePoolId ( dcId ) ; host.setClusterCompatibilityVersion ( Version.v3_5 ) ; host.setStatus ( status ) ; host.setHostName ( ( "host-" + ( host.getId ( ) ) ) ) ; return host ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS createHost ( org.ovirt.engine.core.common.businessentities.VDSStatus status , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid dcId ) { org.ovirt.engine.core.common.businessentities.VDS host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; host.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; host.setClusterId ( clusterId ) ; host.setStoragePoolId ( dcId ) ; host.setClusterCompatibilityVersion ( Version.v3_6 ) ; host.setStatus ( status ) ; host.setHostName ( ( "host-" + ( host.getId ( ) ) ) ) ; return host ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkDAO ( ) . update ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterAttachment : org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getClusterAttachments ( ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( clusterAttachment.getClusterId ( ) , org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; } org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkDAO ( ) . update ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterAttachment : org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkClusterDAO ( ) . getAllForNetwork ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) . getId ( ) ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( clusterAttachment.getClusterId ( ) , org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; } org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.setSucceeded ( true ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getAddParameters ( network , entity ) ; return performCreate ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , "name" , "dataCenter.name|id" ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; if ( namedDataCenter ( network ) ) { entity.setDataCenterId ( getDataCenterId ( network ) ) ; } org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters parameters = new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , entity ) ; if ( network.isSetProfileRequired ( ) ) { parameters.setVnicProfileRequired ( network.isProfileRequired ( ) ) ; } return performCreate ( VdcActionType.AddNetwork , parameters , new org.ovirt.engine.api.restapi.resource.BackendNetworksResource.AddedNetworkResolver ( ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { testServlet = new org.ovirt.engine.core.WelcomeServlet ( ) ; testServlet.setBackend ( mockBackend ) ; testServlet.init ( mockBrandingManager ) ; mockBackendQuery ( VdcQueryType.GetConfigurationValue , "oVirtVersion" ) ; org.mockito.Mockito.when ( mockBrandingManager.getBrandingThemes ( ) ) . thenReturn ( new java.util.ArrayList < org.ovirt.engine.core.branding.BrandingTheme > ( ) ) ; org.mockito.Mockito.when ( mockBrandingManager.getWelcomeSections ( org.mockito.Matchers.any ( java.util.Locale.class ) ) ) . thenReturn ( "Welcome Section HTML" ) ; }

Target:
public boolean isSessionValid ( javax.servlet.http.HttpServletRequest request , java.lang.String token ) { return true ; }
Source:
protected void EndImportCommand ( ) { setVm ( null ) ; EndActionOnAllImageGroups ( ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) . getId ( ) ) ; UpdateVmImSpm ( ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } setSucceeded ( true ) ; }

Target:
private void endVmRelatedOps ( ) { setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) ) ; updateVmInSpm ( ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } }
Source:
public void setupMock ( org.ovirt.engine.core.bll.utils.GlusterGeoRepUtil geoRepUtil , org.ovirt.engine.core.dao.gluster.GlusterGeoRepDao geoRepDao , org.ovirt.engine.core.dao.VdsGroupDao vdsGroupDao ) { org.mockito.Mockito.doReturn ( geoRepDao ) . when ( geoRepUtil ) . getGeoRepDao ( ) ; org.mockito.Mockito.doReturn ( getGeoRepSessions ( ) ) . when ( geoRepDao ) . getAllSessions ( ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( geoRepUtil ) . getVdsGroupDao ( ) ; org.mockito.Mockito.doReturn ( getVdsGroup ( MASTER_CLUSTER_ID , CLUSTER_COMPATIBILITY_VERSION ) ) . when ( vdsGroupDao ) . get ( MASTER_CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getVdsGroup ( SLAVE_CLUSTER_ID , CLUSTER_COMPATIBILITY_VERSION ) ) . when ( vdsGroupDao ) . get ( SLAVE_CLUSTER_ID ) ; }

Target:
public void setupMock ( org.ovirt.engine.core.bll.utils.GlusterGeoRepUtil geoRepUtil , org.ovirt.engine.core.dao.gluster.GlusterGeoRepDao geoRepDao , org.ovirt.engine.core.dao.ClusterDao clusterDao ) { org.mockito.Mockito.doReturn ( geoRepDao ) . when ( geoRepUtil ) . getGeoRepDao ( ) ; org.mockito.Mockito.doReturn ( getGeoRepSessions ( ) ) . when ( geoRepDao ) . getAllSessions ( ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( geoRepUtil ) . getClusterDao ( ) ; org.mockito.Mockito.doReturn ( getCluster ( MASTER_CLUSTER_ID , CLUSTER_COMPATIBILITY_VERSION ) ) . when ( clusterDao ) . get ( MASTER_CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getCluster ( SLAVE_CLUSTER_ID , CLUSTER_COMPATIBILITY_VERSION ) ) . when ( clusterDao ) . get ( SLAVE_CLUSTER_ID ) ; }
Source:
public java.lang.Integer getMaxVmNameLengthNonWin ( ) { java.lang.Integer maxVmNameLengthNonWindows = ( ( java.lang.Integer ) ( getConfigValuePreConverted ( ConfigurationValues.MaxVmNameLengthNonWindows ) ) ) ; if ( maxVmNameLengthNonWindows == null ) { return 64 ; } return maxVmNameLengthNonWindows ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Quota > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotaList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Quota > ) ( returnValue ) ) ; if ( ( quotaList != null ) && ( ! ( quotaList.isEmpty ( ) ) ) ) { java.util.Comparator < org.ovirt.engine.core.common.businessentities.Quota > comparator = ( ( topId ) == null ) ? org.ovirt.engine.ui.uicommonweb.comparators.QuotaComparator.NAME : org.ovirt.engine.ui.uicommonweb.comparators.QuotaComparator.withTopId ( topId , QuotaComparator.NAME ) ; java.util.Collections.sort ( quotaList , comparator ) ; } return quotaList ; }