auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }
Source:
public synchronized void _timer_Elapsed ( ) { if ( thereAreTasksToPoll ( ) ) { pollAndUpdateAsyncTasks ( ) ; if ( ( thereAreTasksToPoll ( ) ) && ( logChangedMap ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.info ( "Finished polling Tasks, will poll again in seconds." , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AsyncTaskPollingRate ) ) ; logChangedMap = false ; } if ( ( _tasks.size ( ) ) > 0 ) { cleanZombieTasks ( ) ; } } }

Target:
public synchronized void timerElapsed ( ) { if ( thereAreTasksToPoll ( ) ) { pollAndUpdateAsyncTasks ( ) ; if ( ( thereAreTasksToPoll ( ) ) && ( logChangedMap ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.info ( "Finished polling Tasks, will poll again in seconds." , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AsyncTaskPollingRate ) ) ; logChangedMap = false ; } if ( ( _tasks.size ( ) ) > 0 ) { cleanZombieTasks ( ) ; } } }
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 ( ActionType.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.ActionReturnValue actionReturnValueurnValue = runInternalAction ( ActionType.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 ( actionReturnValueurnValue.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 com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { setEnumTitle ( diskImage.getImageStatus ( ) ) ; switch ( diskImage.getImageStatus ( ) ) { case OK : return getCommonResources ( ) . upImage ( ) ; case LOCKED : return getCommonResources ( ) . waitImage ( ) ; case ILLEGAL : return getCommonResources ( ) . logErrorImage ( ) ; default : return null ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { setEnumTitle ( diskImage.getImageStatus ( ) ) ; switch ( diskImage.getImageStatus ( ) ) { case OK : return org.ovirt.engine.ui.common.widget.table.column.DiskImageStatusColumn.resources.upImage ( ) ; case LOCKED : return org.ovirt.engine.ui.common.widget.table.column.DiskImageStatusColumn.resources.waitImage ( ) ; case ILLEGAL : return org.ovirt.engine.ui.common.widget.table.column.DiskImageStatusColumn.resources.logErrorImage ( ) ; default : return null ; } }
Source:
private void addSpmStates ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.SpmState [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_5 ) ) { org.ovirt.engine.api.model.SpmStates states = new org.ovirt.engine.api.model.SpmStates ( ) ; for ( org.ovirt.engine.api.model.SpmState state : values ) { states.getSpmStates ( ) . add ( state.value ( ) ) ; } version.setSpmStates ( states ) ; } }

Target:
private void addSpmStates ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.SpmStatus [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_5 ) ) { org.ovirt.engine.api.model.SpmStates states = new org.ovirt.engine.api.model.SpmStates ( ) ; for ( org.ovirt.engine.api.model.SpmStatus state : values ) { states.getSpmStates ( ) . add ( state.value ( ) ) ; } version.setSpmStates ( states ) ; } }
Source:
private boolean isConsoleCommandsExecutionAllowed ( ) { org.ovirt.engine.ui.uicommonweb.models.ConsoleProtocol protocol = consoleUtils.determineConnectionProtocol ( this ) ; return consoleUtils.canShowConsole ( protocol , this ) ; }

Target:
private boolean isConsoleCommandsExecutionAllowed ( ) { final java.util.List < org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel > list = getSelectedHasConsoleModels ( ) ; if ( ( list == null ) || ( list.isEmpty ( ) ) ) { return false ; } for ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel hasConsoleModel : list ) { final org.ovirt.engine.ui.uicommonweb.models.ConsoleProtocol protocol = consoleUtils.determineConnectionProtocol ( hasConsoleModel ) ; if ( consoleUtils.canShowConsole ( protocol , hasConsoleModel ) ) { return true ; } } return false ; }
Source:
public void testBuildFreeTextConditionSql ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AdGroupConditionFieldAutoCompleter ( ) ; java.lang.String sql = comp.buildFreeTextConditionSql ( "ATable" , "=" , "JarJar" , false ) ; org.junit.Assert.assertEquals ( " ( ATable.cn LIKE '%JarJar%' ) " , " ( ATable.cn LIKE '%JarJar%' ) " , sql ) ; sql = comp.buildFreeTextConditionSql ( "ATable" , "!=" , "JarJar" , false ) ; org.junit.Assert.assertEquals ( " ( ATable.cn NOT LIKE '%JarJar%' ) " , " ( ATable.cn NOT LIKE '%JarJar%' ) " , sql ) ; }

Target:
public void testBuildFreeTextConditionSql ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AdGroupConditionFieldAutoCompleter ( ) ; java.lang.String sql = comp.buildFreeTextConditionSql ( "ATable" , "=" , "JarJar" , false ) ; org.junit.jupiter.api.Assertions.assertEquals ( " ( ATable.cn LIKE '%JarJar%' ) " , sql , " ( ATable.cn LIKE '%JarJar%' ) " ) ; sql = comp.buildFreeTextConditionSql ( "ATable" , "!=" , "JarJar" , false ) ; org.junit.jupiter.api.Assertions.assertEquals ( " ( ATable.cn NOT LIKE '%JarJar%' ) " , sql , " ( ATable.cn NOT LIKE '%JarJar%' ) " ) ; }
Source:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommandTest.CLUSTER_ID , null ) ) ) ; setupMocks ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void canDoActionFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }
Source:
public void testGetHasNoPermission ( ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( FixturesTool.VM_NETWORK_INTERFACE_PROFILE , org.ovirt.engine.core.dao.network.VnicProfileDaoTest.UNPRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNull ( result ) ; }

Target:
public void testSave ( ) { dao.save ( vnicProfile ) ; org.ovirt.engine.core.common.businessentities.network.VnicProfile result = dao.get ( vnicProfile.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( vnicProfile.getId ( ) , result.getId ( ) ) ; org.junit.Assert.assertEquals ( false , result.isPortMirroring ( ) ) ; }
Source:
public boolean getIsQxlSupported ( ) { boolean isLinux = getIsLinuxOS ( ) ; boolean isQxl = ( getDisplayType ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ; boolean clusterSupportsSinglePci = ( ( getSelectedCluster ( ) ) != null ) && ( ( Version.v3_3.compareTo ( getSelectedCluster ( ) . getcompatibility_version ( ) ) ) <= 0 ) ; return ( isLinux && isQxl ) && clusterSupportsSinglePci ; }

Target:
private void updateNumOfMonitors ( ) { if ( ( getDisplayType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) { getNumOfMonitors ( ) . setIsChangable ( true ) ; } else { getNumOfMonitors ( ) . setSelectedItem ( 1 ) ; getNumOfMonitors ( ) . setIsChangable ( false ) ; } }
Source:
protected java.lang.Long getRawValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return ( ( long ) ( disk.getLun ( ) . getDeviceSize ( ) ) ) ; }

Target:
protected java.lang.Long getRawValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return ( ( long ) ( disk.getLun ( ) . getDeviceSize ( ) ) ) ; }
Source:
public void getSupportedCpuList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String cpuName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > cpuList = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.ServerCpu > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) ) ; return cpuList ; } return null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSupportedCpuList , new org.ovirt.engine.core.common.queries.GetSupportedCpuListParameters ( cpuName ) , aQuery ) ; }

Target:
public void getSupportedCpuList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String cpuName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > cpuList = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.ServerCpu > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) ) ; return cpuList ; } return null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSupportedCpuList , new org.ovirt.engine.core.common.queries.GetSupportedCpuListParameters ( cpuName ) , aQuery ) ; }
Source:
public void canDoActionSameSourceAndDest ( ) throws java.lang.Exception { destStorageId = srcStorageId ; initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString ( ) ) ) ; }

Target:
public void canDoActionDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }
Source:
public void validateFailsOnNullHookId ( ) { cmd.getParameters ( ) . setHookId ( null ) ; setUpMocksForUpdate ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }

Target:
public void validateFailsOnNullHookId ( ) { cmd.getParameters ( ) . setHookId ( null ) ; setUpMocksForUpdate ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validate ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }
Source:
protected void OnSelectedItemChanging ( java.lang.Object newValue , java.lang.Object oldValue ) { super . OnSelectedItemChanging ( newValue , oldValue ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel oldModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( oldValue ) ) ; if ( oldValue != null ) { oldModel.setIsEmpty ( false ) ; oldModel.setItems ( null ) ; org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel listWithDetails = ( ( org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ( ( oldValue instanceof org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ? oldValue : null ) ) ; if ( listWithDetails != null ) { listWithDetails.setActiveDetailModel ( null ) ; } oldModel.EnsureAsyncSearchStopped ( ) ; } }

Target:
protected void onSelectedItemChanging ( java.lang.Object newValue , java.lang.Object oldValue ) { super . onSelectedItemChanging ( newValue , oldValue ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel oldModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( oldValue ) ) ; if ( oldValue != null ) { oldModel.setIsEmpty ( false ) ; oldModel.setItems ( null ) ; org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel listWithDetails = ( ( org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ( ( oldValue instanceof org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel ) ? oldValue : null ) ) ; if ( listWithDetails != null ) { listWithDetails.setActiveDetailModel ( null ) ; } oldModel.EnsureAsyncSearchStopped ( ) ; } }
Source:
private void scanAlignment ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameterList = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( getSelectedItems ( ) ) ) ) { parameterList.add ( new org.ovirt.engine.core.common.action.GetDiskAlignmentParameters ( disk.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.GetDiskAlignment , parameterList , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , this ) ; }

Target:
private void scanAlignment ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameterList = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : getSelectedItems ( ) ) { parameterList.add ( new org.ovirt.engine.core.common.action.GetDiskAlignmentParameters ( disk.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.GetDiskAlignment , parameterList , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , this ) ; }
Source:
private void mockPassDiscardSupport ( org.ovirt.engine.core.bll.ValidationResult validationResult ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( runVmValidator ) . getVmDisks ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.injectorRule.bind ( org.ovirt.engine.core.bll.storage.disk.DiskHandler.class , diskHandler ) ; org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator multipleDiskVmElementValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator.class ) ; org.mockito.Mockito.doReturn ( multipleDiskVmElementValidator ) . when ( runVmValidator ) . createMultipleDiskVmElementValidator ( org.mockito.ArgumentMatchers.anyMap ( ) ) ; org.mockito.Mockito.when ( multipleDiskVmElementValidator.isPassDiscardSupportedForDestSds ( org.mockito.ArgumentMatchers.anyMap ( ) ) ) . thenReturn ( validationResult ) ; }

Target:
private void mockPassDiscardSupport ( org.ovirt.engine.core.bll.ValidationResult validationResult ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( runVmValidator ) . getVmDisks ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyMap ( ) ) . when ( runVmValidator ) . getVmDiskVmElementMap ( ) ; org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator multipleDiskVmElementValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.storage.MultipleDiskVmElementValidator.class ) ; org.mockito.Mockito.doReturn ( multipleDiskVmElementValidator ) . when ( runVmValidator ) . createMultipleDiskVmElementValidator ( org.mockito.ArgumentMatchers.anyMap ( ) ) ; org.mockito.Mockito.when ( multipleDiskVmElementValidator.isPassDiscardSupportedForDestSds ( org.mockito.ArgumentMatchers.anyMap ( ) ) ) . thenReturn ( validationResult ) ; }
Source:
private void setUpVlanQueryExpectations ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface hostNicModel ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlans = new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; vlan.setNetworkName ( "some network name" ) ; vlans.add ( vlan ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllChildVlanInterfaces , org.ovirt.engine.core.common.queries.GetAllChildVlanInterfacesQueryParameters.class , new java.lang.String [ ] { "Id" , "Interface" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID , hostNicModel } , vlans ) ; }

Target:
private void setUpVlanQueryExpectations ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface hostNicModel ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlans = new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; vlan.setNetworkName ( "some network name" ) ; vlans.add ( vlan ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllChildVlanInterfaces , org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters.class , new java.lang.String [ ] { "Id" , "Interface" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID , hostNicModel } , vlans ) ; }
Source:
protected boolean activateOrDeactivateNic ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.action.PlugAction plugAction , boolean newNic ) { org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters parameters = new org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters ( nic , plugAction , newNic ) ; parameters.setVmId ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( ActionType.ActivateDeactivateVmNic , parameters , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { propagateFailure ( returnValue ) ; } return returnValue.getSucceeded ( ) ; }

Target:
protected boolean activateOrDeactivateNic ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.action.PlugAction plugAction , boolean newNic ) { org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters parameters = new org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters ( nic , plugAction , newNic ) ; parameters.setVmId ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) ; org.ovirt.engine.core.common.action.ActionReturnValue returnValue = runInternalAction ( ActionType.ActivateDeactivateVmNic , parameters , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { propagateFailure ( returnValue ) ; } return returnValue.getSucceeded ( ) ; }
Source:
protected boolean migrateVm ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.bll.job.ExecutionContext parentContext ) { org.ovirt.engine.core.common.action.MigrateVmParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmParameters ( false , vm.getId ( ) ) ; parameters.setReason ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessage ( AuditLogType.MIGRATION_REASON_HOST_IN_MAINTENANCE ) ) ; return runInternalAction ( VdcActionType.MigrateVm , parameters , createMigrateVmContext ( parentContext , vm ) ) . getSucceeded ( ) ; }

Target:
protected boolean migrateVm ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.bll.job.ExecutionContext parentContext ) { org.ovirt.engine.core.common.action.MigrateVmParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmParameters ( false , vm.getId ( ) ) ; parameters.setReason ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.MessageBundler.getMessage ( AuditLogType.MIGRATION_REASON_HOST_IN_MAINTENANCE ) ) ; return runInternalAction ( VdcActionType.MigrateVm , parameters , createMigrateVmContext ( parentContext , vm ) ) . getSucceeded ( ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( ( p.getusage_cpu_percent ( ) ) <= ( p.getlow_utilization ( ) ) ) && ( ( p.getcpu_over_commit_time_stamp ( ) ) != null ) ) && ( ( ( new java.util.Date ( ) . getTime ( ) ) - ( p.getcpu_over_commit_time_stamp ( ) . getTime ( ) ) ) >= ( ( ( p.getcpu_over_commit_duration_minutes ( ) ) * 60 ) * 1000 ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( ( p.getUsageCpuPercent ( ) ) <= ( p.getLowUtilization ( ) ) ) && ( ( p.getCpuOverCommitTimestamp ( ) ) != null ) ) && ( ( ( new java.util.Date ( ) . getTime ( ) ) - ( p.getCpuOverCommitTimestamp ( ) . getTime ( ) ) ) >= ( ( ( p.getCpuOverCommitDurationMinutes ( ) ) * 60 ) * 1000 ) ) ; }
Source:
public void testRemoveById ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMapId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; for ( org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry : entries ) { org.junit.Assert.assertNotEquals ( FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , entry.getStorageDomainId ( ) ) ; } org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( entries.isEmpty ( ) ) ; }

Target:
public void testRemoveById ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMapId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; for ( org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry : entries ) { org.junit.jupiter.api.Assertions.assertNotEquals ( FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , entry.getStorageDomainId ( ) ) ; } org.junit.jupiter.api.Assertions.assertNotNull ( entries ) ; org.junit.jupiter.api.Assertions.assertTrue ( entries.isEmpty ( ) ) ; }
Source:
public static boolean shouldOverrideSoundDevice ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic , org.ovirt.engine.core.compat.Version compatibilityVersion , java.lang.Boolean soundDeviceEnabled ) { return ( ( soundDeviceEnabled == null ) && ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.osRepository.isSoundDeviceEnabled ( vmStatic.getOsId ( ) , compatibilityVersion ) ) ) && ( ( vmStatic.getVmType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) ; }

Target:
public boolean shouldOverrideSoundDevice ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic , org.ovirt.engine.core.compat.Version compatibilityVersion , java.lang.Boolean soundDeviceEnabled ) { return ( ( soundDeviceEnabled == null ) && ( osRepository.isSoundDeviceEnabled ( vmStatic.getOsId ( ) , compatibilityVersion ) ) ) && ( ( vmStatic.getVmType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmType.Desktop ) ) ; }
Source:
protected java.lang.String getSizeString ( java.lang.Double size , org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit inUnit ) { if ( size == null ) { return constants.notAvailableLabel ( ) ; } else { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit , java.lang.Double > sizeWithUnits = org.ovirt.engine.core.common.utils.SizeConverter.autoConvert ( size.longValue ( ) , inUnit ) ; return ( ( formatSize ( sizeWithUnits.getSecond ( ) ) ) + " " ) + ( sizeWithUnits.getFirst ( ) . toString ( ) ) ; } }

Target:
protected java.lang.String getSizeString ( java.lang.Double size , org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit inUnit ) { if ( size == null ) { return constants.notAvailableLabel ( ) ; } else { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit , java.lang.Double > sizeWithUnits = org.ovirt.engine.core.common.utils.SizeConverter.autoConvert ( size.longValue ( ) , inUnit ) ; return org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . sizeUnitString ( formatSize ( sizeWithUnits.getSecond ( ) ) , sizeWithUnits.getFirst ( ) ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.aaa.RemoveUserCommand.getParameters ( ) . getId ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . getAllDirectPermissionsForAdElement ( id ) ) { org.ovirt.engine.core.common.action.PermissionsOperationsParameters tempVar = new org.ovirt.engine.core.common.action.PermissionsOperationsParameters ( permission ) ; tempVar.setShouldBeLogged ( false ) ; runInternalActionWithTasksContext ( VdcActionType.RemovePermission , tempVar ) ; } org.ovirt.engine.core.bll.aaa.RemoveUserCommand.getDbUserDAO ( ) . remove ( id ) ; org.ovirt.engine.core.bll.aaa.RemoveUserCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.aaa.RemoveUserCommand.getParameters ( ) . getId ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getPermissionDao ( ) . getAllDirectPermissionsForAdElement ( id ) ) { org.ovirt.engine.core.common.action.PermissionsOperationsParameters tempVar = new org.ovirt.engine.core.common.action.PermissionsOperationsParameters ( permission ) ; tempVar.setShouldBeLogged ( false ) ; runInternalActionWithTasksContext ( VdcActionType.RemovePermission , tempVar ) ; } org.ovirt.engine.core.bll.aaa.RemoveUserCommand.getDbUserDao ( ) . remove ( id ) ; org.ovirt.engine.core.bll.aaa.RemoveUserCommand.setSucceeded ( true ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.GetVmsFromExternalProviderParameters buildGetRemoteVmsInfoParameters ( ) { return new org.ovirt.engine.core.common.vdscommands.GetVmsFromExternalProviderParameters ( getProxyHostId ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getUrl ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getUsername ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getPassword ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getOriginType ( ) ) ; }

Target:
private org.ovirt.engine.core.common.vdscommands.GetVmsFromExternalProviderParameters buildGetRemoteVmsInfoParameters ( ) { return new org.ovirt.engine.core.common.vdscommands.GetVmsFromExternalProviderParameters ( getProxyHostId ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getUrl ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getUsername ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getPassword ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getOriginType ( ) , org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getNamesOfVms ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneMapReturn get_image_transfer_session_stats ( java.lang.String ticketId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.get_image_transfer_session_stats" ) . withParameter ( "ticketUUID" , ticketId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "statsMap" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneMapReturn ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterWebhookUpdate ( java.lang.String url , java.lang.String bearerToken ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterEvent.webhookUpdate" ) . withParameter ( "url" , url ) . withParameter ( "bearerToken" , bearerToken ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public java.lang.String renderNullSafe ( java.lang.Object object ) { return ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( object ) ) . getName ( ) ; }

Target:
private void initListBoxEditors ( ) { destClusterEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ) ; destClusterQuotaEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.Quota > ( ) ) ; destStorageEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.StorageDomainFreeSpaceRenderer ( ) ) ; cpuProfileEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor ( new org.ovirt.engine.ui.common.widget.renderer.NameRenderer < org.ovirt.engine.core.common.businessentities.profiles.CpuProfile > ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > getAllImagesAsRepoImages ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > repoImages = new java.util.ArrayList < > ( ) ; long currentTime = java.lang.System.currentTimeMillis ( ) ; for ( com.woorea.openstack.glance.model.Image glanceImage : getGlanceClient ( ) . images ( ) . list ( true ) . execute ( ) ) { org.ovirt.engine.core.common.businessentities.RepoImage repoImage = org.ovirt.engine.core.bll.provider.OpenstackImageProviderProxy.imageToRepoImage ( glanceImage ) ; repoImage.setLastRefreshed ( currentTime ) ; repoImages.add ( repoImage ) ; } return repoImages ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.RepoImage > getAllImagesAsRepoImages ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoImage > repoImages = new java.util.ArrayList < > ( ) ; long currentTime = java.lang.System.currentTimeMillis ( ) ; for ( com.woorea.openstack.glance.model.Image glanceImage : getClient ( ) . images ( ) . list ( true ) . execute ( ) ) { org.ovirt.engine.core.common.businessentities.RepoImage repoImage = org.ovirt.engine.core.bll.provider.OpenstackImageProviderProxy.imageToRepoImage ( glanceImage ) ; repoImage.setLastRefreshed ( currentTime ) ; repoImages.add ( repoImage ) ; } return repoImages ; }
Source:
private void buildExclusiveLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsDiskPluggedTo ) { if ( newDisk.isBoot ( ) ) { exclusiveLockMap = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsDiskPluggedTo ) { exclusiveLockMap.put ( vm.getId ( ) . toString ( ) , LockingGroup.VM_DISK_BOOT.name ( ) ) ; } } }

Target:
private void buildExclusiveLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsDiskPluggedTo ) { if ( newDisk.isBoot ( ) ) { exclusiveLockMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsDiskPluggedTo ) { exclusiveLockMap.put ( vm.getId ( ) . toString ( ) , LockMessagesMatchUtil.VM_DISK_BOOT ) ; } } }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType cinderVolumeType = control.createMock ( org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType.class ) ; org.easymock.EasyMock.expect ( cinderVolumeType.getId ( ) ) . andReturn ( GUIDS [ index ] . toString ( ) ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( cinderVolumeType.getName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; return cinderVolumeType ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType cinderVolumeType = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.storage.CinderVolumeType.class ) ; org.mockito.Mockito.when ( cinderVolumeType.getId ( ) ) . thenReturn ( GUIDS [ index ] . toString ( ) ) ; org.mockito.Mockito.when ( cinderVolumeType.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; return cinderVolumeType ; }
Source:
private void externalNetworkPortMirroringTest ( boolean externalNetwork , boolean portMirroring , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.mockito.Mockito.when ( networkDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( network ) ; org.mockito.Mockito.when ( network.isExternal ( ) ) . thenReturn ( externalNetwork ) ; org.mockito.Mockito.when ( vnicProfile.isPortMirroring ( ) ) . thenReturn ( portMirroring ) ; org.junit.Assert.assertThat ( validator.portMirroringNotSetIfExternalNetwork ( ) , matcher ) ; }

Target:
private void externalNetworkPortMirroringTest ( boolean externalNetwork , boolean portMirroring , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.mockito.Mockito.when ( networkDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( network ) ; org.mockito.Mockito.when ( network.isExternal ( ) ) . thenReturn ( externalNetwork ) ; org.mockito.Mockito.when ( vnicProfile.isPortMirroring ( ) ) . thenReturn ( portMirroring ) ; org.hamcrest.MatcherAssert.assertThat ( validator.portMirroringNotSetIfExternalNetwork ( ) , matcher ) ; }
Source:
private static boolean isVlanOverBondNetwork ( java.lang.String bondName , java.lang.String networkName , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : interfaces ) { java.lang.String name = org.ovirt.engine.core.utils.NetworkUtils.getVlanInterfaceName ( iface.getName ( ) ) ; if ( name == null ) { continue ; } else if ( ( name.equals ( bondName ) ) && ( networkName.equals ( iface.getNetworkName ( ) ) ) ) { return true ; } } return false ; }

Target:
private static boolean isVlanOverBondNetwork ( java.lang.String bondName , java.lang.String networkName , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : interfaces ) { if ( ( ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( iface ) ) && ( org.ovirt.engine.core.utils.NetworkUtils.interfaceBasedOn ( iface , bondName ) ) ) && ( networkName.equals ( iface.getNetworkName ( ) ) ) ) { return true ; } } return false ; }
Source:
protected void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( getCommandId ( ) , ( ( getParameters ( ) . getParentParameters ( ) ) == null ? org.ovirt.engine.core.compat.Guid.Empty : getParameters ( ) . getParentParameters ( ) . getCommandId ( ) ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus ) ; }

Target:
protected void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , boolean enableCallBack ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus , enableCallBack ) ; }
Source:
private void createCluster ( org.ovirt.engine.core.compat.Version version ) { existingCluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; existingCluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.CLUSTER_ID ) ; existingCluster.setname ( "cluster" ) ; existingCluster.setGlusterService ( true ) ; existingCluster.setVirtService ( false ) ; existingCluster.setcompatibility_version ( version ) ; }

Target:
private void createCluster ( org.ovirt.engine.core.compat.Version version ) { existingCluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; existingCluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.CLUSTER_ID ) ; existingCluster.setName ( "cluster" ) ; existingCluster.setGlusterService ( true ) ; existingCluster.setVirtService ( false ) ; existingCluster.setcompatibility_version ( version ) ; }
Source:
protected void addVmPayload ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmPayload ( ) ; if ( payload != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmId ( ) ) , VmDeviceType.DISK , payload.getType ( ) , payload.getSpecParams ( ) , true , true ) ; } }

Target:
protected void addVmPayload ( ) { org.ovirt.engine.core.common.businessentities.VmPayload payload = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmPayload ( ) ; if ( payload != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmId ( ) ) , VmDeviceGeneralType.DISK , payload.getType ( ) , payload.getSpecParams ( ) , true , true , null ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Disk > getAllAttachableDisksByPoolId ( org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.compat.Guid userId , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , poolId ) . addValue ( "user_id" , userId ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetAllAttachableDisksByPoolId" , org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.DiskRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Disk > getAllAttachableDisksByPoolId ( org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid userId , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , poolId ) . addValue ( "vm_id" , vmId ) . addValue ( "user_id" , userId ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetAllAttachableDisksByPoolId" , org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.DiskRowMapper.instance , parameterSource ) ; }
Source:
public void attachBackup ( ) { attachInternal ( StorageDomainType.ImportExport , org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . attachExportDomainTitle ( ) , "attach_export_domain" ) ; }

Target:
public void attachStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.ListModel listModel = new org.ovirt.engine.ui.uicommonweb.models.ListModel ( ) ; listModel.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . attachStorageTitle ( ) ) ; listModel.setHelpTag ( HelpTag.attach_storage ) ; listModel.setHashName ( "attach_storage" ) ; attachInternal ( listModel , StorageDomainType.Data ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > getHostLuns ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > ) ( runVdsCommand ( VDSCommandType.GetDeviceList , new org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) . getstorage_type ( ) ) ) . getReturnValue ( ) ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > getHostLuns ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > ) ( runVdsCommand ( VDSCommandType.GetDeviceList , new org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters ( vds.getId ( ) , org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getStorageDomain ( ) . getstorage_type ( ) ) ) . getReturnValue ( ) ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { ( ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.ConnectAllHostsToLunCommandReturnValue ) ( org.ovirt.engine.core.bll.storage.ConnectAllHostsToLunCommand.getReturnValue ( ) ) ) . setFailedVds ( vds ) ; throw e ; } }
Source:
public void getGlusterSwiftServices ( 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.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getVolumeSnapshotSchedule ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotScheduleByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }