auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setupMock ( ) throws java.lang.Exception { commandMock = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.EndExternalJobCommand ( parameters , null ) ) ; org.mockito.Mockito.when ( commandMock.getParameters ( ) ) . thenReturn ( parameters ) ; org.mockito.Mockito.doReturn ( jobDaoMock ) . when ( commandMock ) . getJobDao ( ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.jobId ) ) . thenReturn ( makeExternalTestJob ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.jobId ) ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.nonExternalJobId ) ) . thenReturn ( makeNonExternalTestJob ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.nonExternalJobId ) ) ; }

Target:
private org.ovirt.engine.core.common.job.Job makeNonExternalTestJob ( ) { org.ovirt.engine.core.common.job.Job job = new org.ovirt.engine.core.common.job.Job ( ) ; job.setId ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.jobId ) ; job.setDescription ( "Sample Job" ) ; job.setExternal ( false ) ; return job ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getResetCommand ( ) ) ) { Reset ( ) ; } else if ( command == ( getExpandAllCommand ( ) ) ) { ExpandAll ( ) ; } else if ( command == ( getCollapseAllCommand ( ) ) ) { CollapseAll ( ) ; } }

Target:
private void setIsExpandedRecursively ( boolean value , org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel root ) { root.setIsExpanded ( value ) ; for ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel model : root.getChildren ( ) ) { setIsExpandedRecursively ( value , model ) ; } }
Source:
private static org.ovirt.engine.core.common.utils.Pair noneAndNone ( ) { org.ovirt.engine.core.common.businessentities.VmInit vmInit = new org.ovirt.engine.core.common.businessentities.VmInit ( ) ; org.ovirt.engine.core.common.businessentities.VmInitNetwork underTest = new org.ovirt.engine.core.common.businessentities.VmInitNetwork ( ) ; underTest.setStartOnBoot ( true ) ; vmInit.setNetworks ( java.util.Arrays.asList ( underTest ) ) ; java.lang.String expectedOutput = null ; return new org.ovirt.engine.core.common.utils.Pair ( vmInit , expectedOutput ) ; }

Target:
private static org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VmInit , java.lang.String > noneAndNone ( ) { org.ovirt.engine.core.common.businessentities.VmInit vmInit = new org.ovirt.engine.core.common.businessentities.VmInit ( ) ; org.ovirt.engine.core.common.businessentities.VmInitNetwork underTest = new org.ovirt.engine.core.common.businessentities.VmInitNetwork ( ) ; underTest.setStartOnBoot ( true ) ; vmInit.setNetworks ( java.util.Collections.singletonList ( underTest ) ) ; return new org.ovirt.engine.core.common.utils.Pair ( vmInit , null ) ; }
Source:
protected void ProcessOldImageFromDb ( ) { org.ovirt.engine.core.bll.CreateSnapshotCommand.getParameters ( ) . setOldLastModifiedValue ( org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . getlastModified ( ) ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . setlastModified ( new java.util.Date ( ) ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . setactive ( false ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.getImageDao ( ) . update ( org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . getImage ( ) ) ; }

Target:
protected void processOldImageFromDb ( ) { org.ovirt.engine.core.bll.CreateSnapshotCommand.getParameters ( ) . setOldLastModifiedValue ( org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . getlastModified ( ) ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . setlastModified ( new java.util.Date ( ) ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . setactive ( false ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.getImageDao ( ) . update ( org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . getImage ( ) ) ; }
Source:
public void getClusterFeaturesByVersionAndCategory ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.mode.ApplicationMode category ) { 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.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByVersionAndCategory , new org.ovirt.engine.core.common.queries.GetClusterFeaturesByVersionAndCategoryParameters ( version , category ) , aQuery ) ; }

Target:
public void getClusterFeaturesByVersionAndCategory ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.mode.ApplicationMode category ) { 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.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ) ( source ) ) : new java.util.HashSet < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterFeaturesByVersionAndCategory , new org.ovirt.engine.core.common.queries.GetClusterFeaturesByVersionAndCategoryParameters ( version , category ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( returnValue ) ) ; final org.ovirt.engine.ui.uicommonweb.models.hosts.HostVmListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostVmListModel ) ( target ) ) ; model.setItems ( list ) ; }

Target:
public void search ( ) { if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getVmsRunningOnOrMigratingToVds ( new org.ovirt.engine.ui.uicommonweb.models.hosts.SetRawItemsAsyncQuery ( ) , getEntity ( ) . getId ( ) ) ; } else { setItems ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ) ; } startGridTimer ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult notRenamingManagementNetwork ( org.ovirt.engine.core.common.businessentities.network.Network newNetwork ) { java.lang.String managementNetwork = org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) ; return ( network.getName ( ) . equals ( managementNetwork ) ) && ( ! ( newNetwork.getName ( ) . equals ( managementNetwork ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_CAN_NOT_REMOVE_DEFAULT_NETWORK ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult notRenamingManagementNetwork ( org.ovirt.engine.core.common.businessentities.network.Network newNetwork ) { java.lang.String managementNetwork = org.ovirt.engine.core.utils.NetworkUtils.getDefaultManagementNetworkName ( ) ; return ( network.getName ( ) . equals ( managementNetwork ) ) && ( ! ( newNetwork.getName ( ) . equals ( managementNetwork ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_CAN_NOT_REMOVE_DEFAULT_NETWORK ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void refuseBalloonOnPPC ( ) { final org.ovirt.engine.core.bll.exportimport.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > cmd = setupCanImportPpcTest ( ) ; addBalloonToVm ( cmd.getVmFromExportDomain ( null ) ) ; org.mockito.Mockito.when ( 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 ( ) ) ) ; }

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 testGetVmNumaNodeInfoByBdsGroupId ( ) { org.ovirt.engine.core.compat.Guid vdsGroupId = FixturesTool.CLUSTER ; org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.createGuidFromString ( "77296e00-0cad-4e5a-9299-008a7b6f4354" ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > > result = vmNumaNodeDao.getVmNumaNodeInfoByClusterId ( vdsGroupId ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( 2 , result.get ( vmId ) . size ( ) ) ; }

Target:
public void testGetVmNumaNodeInfoByBdsGroupId ( ) { org.ovirt.engine.core.compat.Guid vdsGroupId = FixturesTool.CLUSTER ; org.ovirt.engine.core.compat.Guid vmId = FixturesTool.VM_RHEL5_POOL_50 ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.VmNumaNode > > result = vmNumaNodeDao.getVmNumaNodeInfoByClusterId ( vdsGroupId ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( 2 , result.get ( vmId ) . size ( ) ) ; }
Source:
public void testListFailure ( ) { setUpCpuProfilesQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendCpuProfilesResourceTest.setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; try { org.ovirt.engine.api.restapi.resource.AbstractBackendCpuProfilesResourceTest.getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendCpuProfilesResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae ) ; } }

Target:
public void testListFailure ( ) { setUpCpuProfilesQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendCpuProfilesResourceTest.setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; verifyFault ( org.ovirt.engine.api.restapi.resource.AbstractBackendCpuProfilesResourceTest.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , parentParameters , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , parentParameters.getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }

Target:
public org.ovirt.engine.core.bll.tasks.SPMAsyncTask concreteCreateTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return org.ovirt.engine.core.bll.tasks.TaskManagerUtil.concreteCreateTask ( taskId , this , asyncTaskCreationInfo , parentCommand ) ; }
Source:
public void onPowerringUp ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = org.ovirt.engine.core.bll.RunVmCommandBase.getVmStaticDAO ( ) . get ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; decreasePendingVms ( getCurrentVdsId ( ) , vmStatic.getNumOfCpus ( ) , vmStatic.getMinAllocatedMem ( ) , vmStatic.getName ( ) ) ; }

Target:
public void onPowerringUp ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = org.ovirt.engine.core.bll.RunVmCommandBase.getVmStaticDAO ( ) . get ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVms ( getCurrentVdsId ( ) , vmStatic.getNumOfCpus ( ) , vmStatic.getMinAllocatedMem ( ) , vmStatic.getName ( ) ) ; }
Source:
public void handleQuotaColumnVisibility ( ) { isQuotaVisible = false ; org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel treeItem = ( ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel ) ( org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.instance ( ) . getSystemTree ( ) . getSelectedItem ( ) ) ) ; if ( ( treeItem != null ) && ( ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.DataCenter ) == ( treeItem.getType ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( treeItem.getEntity ( ) ) ) ; if ( ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) != ( storagePool.getQuotaEnforcementType ( ) ) ) { isQuotaVisible = true ; } } onDiskViewTypeChanged ( ) ; }

Target:
public void handleQuotaColumnVisibility ( ) { isQuotaVisible = false ; org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel treeItem = commonModelProvider.get ( ) . getSystemTree ( ) . getSelectedItem ( ) ; if ( ( treeItem != null ) && ( ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.DataCenter ) == ( treeItem.getType ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( treeItem.getEntity ( ) ) ) ; if ( ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) != ( storagePool.getQuotaEnforcementType ( ) ) ) { isQuotaVisible = true ; } } onDiskViewTypeChanged ( ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( userProfileDao.getByUserId ( org.ovirt.engine.core.bll.AddUserProfileCommand.getUserId ( ) ) ) != null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_PROFILE_ALREADY_EXISTS ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( userProfileDao.getByUserId ( org.ovirt.engine.core.bll.AddUserProfileCommand.getUserId ( ) ) ) != null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_PROFILE_ALREADY_EXISTS ) ; } return true ; }
Source:
public static void getAAAProfilesList ( 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getAAAProfilesEntriesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private void sendTicket ( ) { final org.ovirt.engine.core.common.businessentities.DbUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; final boolean sent = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVmTicket , new org.ovirt.engine.core.common.vdscommands.SetVmTicketVDSCommandParameters ( org.ovirt.engine.core.bll.SetVmTicketCommand.getVdsId ( ) , org.ovirt.engine.core.bll.SetVmTicketCommand.getVmId ( ) , mTicket , mValidTime , user.getLoginName ( ) , user.getId ( ) ) ) . getSucceeded ( ) ; if ( sent ) { org.ovirt.engine.core.bll.SetVmTicketCommand.setActionReturnValue ( mTicket ) ; } org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( sent ) ; }

Target:
private void sendTicket ( ) { final org.ovirt.engine.core.common.businessentities.DbUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; final boolean sent = runVdsCommand ( VDSCommandType.SetVmTicket , new org.ovirt.engine.core.common.vdscommands.SetVmTicketVDSCommandParameters ( org.ovirt.engine.core.bll.SetVmTicketCommand.getVdsId ( ) , org.ovirt.engine.core.bll.SetVmTicketCommand.getVmId ( ) , mTicket , mValidTime , user.getLoginName ( ) , user.getId ( ) ) ) . getSucceeded ( ) ; if ( sent ) { org.ovirt.engine.core.bll.SetVmTicketCommand.setActionReturnValue ( mTicket ) ; } org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( sent ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation ( getMovedDiskIds ( ) , ImageStatus.LOCKED , ImageStatus.OK , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCompensationContext ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = runInternalAction ( VdcActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getContext ( ) ) ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . setAutoGeneratedSnapshotId ( vdcReturnValue.getActionReturnValue ( ) ) ; persistCommand ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getParentCommand ( ) , ( ( getCallback ( ) ) != null ) ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { imagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation ( getMovedDiskIds ( ) , ImageStatus.LOCKED , ImageStatus.OK , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCompensationContext ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = runInternalAction ( VdcActionType.CreateAllSnapshotsFromVm , getCreateSnapshotParameters ( ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getContext ( ) ) ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . setAutoGeneratedSnapshotId ( vdcReturnValue.getActionReturnValue ( ) ) ; persistCommand ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getParentCommand ( ) , ( ( getCallback ( ) ) != null ) ) ; org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.setSucceeded ( true ) ; }
Source:
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 ) ; }

Target:
public java.lang.Boolean convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; }
Source:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface createNewViewableInterface ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; iface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; iface.setMacAddress ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; return iface ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface createNewViewableInterface ( boolean plugged ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ( ) ; iface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; iface.setMacAddress ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; iface.setPlugged ( plugged ) ; return iface ; }
Source:
private void logDeviceInformation ( org.ovirt.engine.core.compat.Guid vmId , java.util.Map device ) { java.lang.String message = "Received a {0} Device without an address when processing VM {1} devices, skipping device" ; java.lang.String deviceType = ( ( java.lang.String ) ( device.get ( VdsProperties.Device ) ) ) ; if ( shouldLogDeviceDetails ( deviceType ) ) { java.util.Map < java.lang.String , java.lang.Object > deviceInfo = device ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( ( message + ": {2}" ) , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId , deviceInfo ) ; } else { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( message , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId ) ; } }

Target:
private void logDeviceInformation ( org.ovirt.engine.core.compat.Guid vmId , java.util.Map device ) { java.lang.String message = "Received a '{}' Device without an address when processing VM '{}' devices, skipping device" ; java.lang.String deviceType = ( ( java.lang.String ) ( device.get ( VdsProperties.Device ) ) ) ; if ( shouldLogDeviceDetails ( deviceType ) ) { java.util.Map < java.lang.String , java.lang.Object > deviceInfo = device ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.info ( ( message + ": '{}'" ) , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId , deviceInfo ) ; } else { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.info ( message , org.apache.commons.lang.StringUtils.defaultString ( deviceType ) , vmId ) ; } }
Source:
public void canDoActionPreallocatedSpaceCheckSucceeds ( ) { final int availableSize = 12 ; final int usedSize = 8 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionSpaceValidationFails ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }
Source:
public void oSType_SelectedItemChanged ( ) { java.lang.Integer osType = getModel ( ) . getOSType ( ) . getSelectedItem ( ) ; if ( osType != null ) { updateVirtioScsiEnabled ( vm.getId ( ) , osType ) ; } }

Target:
public void oSType_SelectedItemChanged ( ) { java.lang.Integer osType = getModel ( ) . getOSType ( ) . getSelectedItem ( ) ; if ( osType != null ) { org.ovirt.engine.core.compat.Guid id = ( basedOnCustomInstanceType ( ) ) ? vm.getId ( ) : getModel ( ) . getInstanceTypes ( ) . getSelectedItem ( ) . getId ( ) ; updateVirtioScsiEnabledWithoutDetach ( id , osType ) ; } }
Source:
private void addNonDefaultClusterToPool ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup defaultCluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; defaultCluster.setcompatibility_version ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.VERSION_1_1 ) ; defaultCluster.setId ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.NON_DEFAULT_VDS_GROUP_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; clusters.add ( defaultCluster ) ; org.mockito.Mockito.when ( vdsGroupDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( clusters ) ; }

Target:
private void addNonDefaultClusterToPool ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup defaultCluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; defaultCluster.setCompatibilityVersion ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.VERSION_1_1 ) ; defaultCluster.setId ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.NON_DEFAULT_VDS_GROUP_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = new java.util.ArrayList < > ( ) ; clusters.add ( defaultCluster ) ; org.mockito.Mockito.when ( vdsGroupDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( clusters ) ; }
Source:
public void testRefreshUserSession ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER ) ; container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , true ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return null since the session wasn't refresh" , container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , false ) ) ; clearSession ( ) ; }

Target:
public void setUpContainer ( ) { org.mockito.Mockito.when ( engineSessionDao.remove ( org.mockito.Matchers.any ( java.lang.Long.class ) ) ) . thenReturn ( 1 ) ; org.mockito.Mockito.when ( ssoSessionValidator.isSessionValid ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( true ) ; org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.aaa.DbUser.class ) ; container.setSSOSessionValidaor ( ssoSessionValidator ) ; container.setUser ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , user ) ; }
Source:
public static void initUniqueOsNames ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames = ( ( java.util.HashMap < java.lang.Integer , java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.uniqueOsNames ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetUniqueOsNames ) , callback ) ; }

Target:
public void initUniqueOsNames ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { uniqueOsNames = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( new org.ovirt.engine.core.searchbackend.OsValueAutoCompleter ( uniqueOsNames ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetUniqueOsNames ) , callback ) ; }
Source:
public org.ovirt.engine.sdk.decorators.VMWatchDog update ( java.lang.String correlationId ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; if ( correlationId != null ) { headersBuilder.add ( "Correlation-Id" , correlationId ) ; } java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.WatchDog.class , org.ovirt.engine.sdk.decorators.VMWatchDog.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.HostNetworkAttachment update ( java.lang.Boolean async ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; if ( async != null ) { urlBuilder.add ( "async" , async , UrlParameterType.MATRIX ) ; } url = urlBuilder.build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.NetworkAttachment.class , org.ovirt.engine.sdk.decorators.HostNetworkAttachment.class , headers ) ; }
Source:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_BASIC_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.userportal.section.DefaultMainSectionExtendedPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_EXTENDED_PLACE ) ; bindResourceConfiguration ( org.ovirt.engine.ui.userportal.ApplicationConstants.class , org.ovirt.engine.ui.userportal.ApplicationMessages.class , org.ovirt.engine.ui.userportal.ApplicationResources.class , org.ovirt.engine.ui.userportal.ApplicationTemplates.class ) ; bind ( org.ovirt.engine.ui.userportal.ApplicationResourcesWithLookup.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_BASIC_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.userportal.section.DefaultMainSectionExtendedPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_EXTENDED_PLACE ) ; bindResourceConfiguration ( org.ovirt.engine.ui.userportal.ApplicationConstants.class , org.ovirt.engine.ui.userportal.ApplicationMessages.class , org.ovirt.engine.ui.userportal.ApplicationResources.class , org.ovirt.engine.ui.userportal.ApplicationTemplates.class , org.ovirt.engine.ui.userportal.ApplicationDynamicConstants.class ) ; bind ( org.ovirt.engine.ui.userportal.ApplicationResourcesWithLookup.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult validateVdsStatus ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ( vm.getRunOnVds ( ) ) != null ) ) { if ( ( getVds ( vm.getRunOnVds ( ) ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , VdcBllMessages.VAR__HOST_STATUS__UP.toString ( ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult validateVdsStatus ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ( vm.getRunOnVds ( ) ) != null ) ) && ( ( getVdsDynamic ( vm.getRunOnVds ( ) ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , VdcBllMessages.VAR__HOST_STATUS__UP.toString ( ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > GetDiskInterfaceList ( ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.DiskInterface [ ] { org.ovirt.engine.core.common.businessentities.DiskInterface.IDE , org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO } ) ) ; }

Target:
public static void GetProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.network.dc.GetNetworkByIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.network.dc.GetNetworkByIdQuery.getDbFacade ( ) . getNetworkDao ( ) . get ( org.ovirt.engine.core.bll.network.dc.GetNetworkByIdQuery.getParameters ( ) . getId ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.network.dc.GetNetworkByIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.network.dc.GetNetworkByIdQuery.getDbFacade ( ) . getNetworkDao ( ) . get ( org.ovirt.engine.core.bll.network.dc.GetNetworkByIdQuery.getParameters ( ) . getId ( ) , org.ovirt.engine.core.bll.network.dc.GetNetworkByIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.network.dc.GetNetworkByIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.VdsIdParametersBase parameters = new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDevices , parameters , aQuery ) ; }

Target:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.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.VdsIdParametersBase parameters = new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
public void testConnectionWithValidMountOptionsSucceeds ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.NFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( command ) . validateMountOptions ( ) ; org.mockito.Mockito.when ( command.getStorageConnDao ( ) . get ( newPosixConnection.getId ( ) ) ) . thenReturn ( newPosixConnection ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void testConnectionWithValidMountOptionsSucceeds ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newPosixConnection = createPosixConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data1" , StorageType.NFS , "nfs" , "timeo=30" ) ; parameters.setStorageServerConnection ( newPosixConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( command ) . validateMountOptions ( ) ; org.mockito.Mockito.when ( storageConnDao.get ( newPosixConnection.getId ( ) ) ) . thenReturn ( newPosixConnection ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissions.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.ForceSelectSPMCommand.getParameters ( ) . getPreferredSPMId ( ) , org.ovirt.engine.core.common.VdcObjectType.VDS , org.ovirt.engine.core.common.businessentities.ActionGroup.MANIPUTLATE_HOST ) ) ; return permissions ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissions.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.ForceSelectSPMCommand.getParameters ( ) . getPreferredSPMId ( ) , org.ovirt.engine.core.common.VdcObjectType.VDS , org.ovirt.engine.core.common.businessentities.ActionGroup.MANIPULATE_HOST ) ) ; return permissions ; }
Source:
public void testMoveNamedParent ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetTagByTagName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] } , getEntity ( org.ovirt.engine.api.restapi.resource.BackendTagResourceTest.NEW_PARENT_IDX ) ) ; org.ovirt.engine.api.model.Tag model = org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 ) ; model.getParent ( ) . setId ( null ) ; model.getParent ( ) . setName ( NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] ) ; doTestMove ( model , 0 ) ; }

Target:
public void testMoveNamedParent ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetTagByTagName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] } , getEntity ( org.ovirt.engine.api.restapi.resource.BackendTagResourceTest.NEW_PARENT_IDX ) ) ; org.ovirt.engine.api.model.Tag model = org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 ) ; model.getParent ( ) . setId ( null ) ; model.getParent ( ) . setName ( NAMES [ org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.PARENT_IDX ] ) ; doTestMove ( model , 0 ) ; }
Source:
public void refuseSoundDeviceOnPPC ( ) { final org.ovirt.engine.core.bll.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.getVdsGroup ( ) . 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 refuseSoundDeviceOnPPC ( ) { final org.ovirt.engine.core.bll.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 ( ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult vmNotDuringMigration ( ) { if ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingTo ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult vmNotDuringMigration ( ) { if ( ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) || ( ( vm.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingTo ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static < TSource > TSource firstOrDefault ( java.lang.Iterable < TSource > source ) { if ( source != null ) { for ( TSource item : source ) { return item ; } } return null ; }

Target:
public static < TSource > TSource firstOrDefault ( java.lang.Iterable < TSource > source , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < ? super TSource > predicate ) { if ( source != null ) { for ( TSource item : source ) { if ( predicate.match ( item ) ) { return item ; } } } return null ; }