auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void ChangePassword ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.ChangeUserPassword , new org.ovirt.engine.core.common.action.ChangeUserPasswordParameters ( ( ( java.lang.String ) ( getUserName ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getPassword ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getNewPassword ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getDomain ( ) . getSelectedItem ( ) ) ) ) ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { } }

Target:
private void ChangePassword ( ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.ChangeUserPassword , new org.ovirt.engine.core.common.action.ChangeUserPasswordParameters ( ( ( java.lang.String ) ( getUserName ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getPassword ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getNewPassword ( ) . getEntity ( ) ) ) , ( ( java.lang.String ) ( getDomain ( ) . getSelectedItem ( ) ) ) ) ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.HostValidator validator = new org.ovirt.engine.core.bll.validator.HostValidator ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) ) ; return ( ( validate ( validator.hostExists ( ) ) ) && ( validate ( validator.validateStatusForActivation ( ) ) ) ) && ( validate ( validator.validateUniqueId ( ) ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.validator.HostValidator validator = new org.ovirt.engine.core.bll.validator.HostValidator ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) ) ; return ( ( validate ( validator.hostExists ( ) ) ) && ( validate ( validator.validateStatusForActivation ( ) ) ) ) && ( validate ( validator.validateUniqueId ( ) ) ) ; }
Source:
protected void postConnect ( org.ovirt.vdsm.jsonrpc.client.utils.OneTimeCallback callback ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { this . nioEngine = new org.ovirt.vdsm.jsonrpc.client.reactors.SSLEngineNioHelper ( channel , createSSLEngine ( this . client ) , callback ) ; this . nioEngine.beginHandshake ( ) ; int interestedOps = java.nio.channels.SelectionKey.OP_READ ; reactor.wakeup ( ) ; key = this . channel.register ( selector , ( interestedOps |= java.nio.channels.SelectionKey.OP_WRITE ) , this ) ; } catch ( java.nio.channels.ClosedChannelException | javax.net.ssl.SSLException e ) { org.ovirt.vdsm.jsonrpc.client.reactors.SSLClient.log.error ( "Connection issues during ssl client creation" , e ) ; throw new org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ( e ) ; } }

Target:
protected void postConnect ( org.ovirt.vdsm.jsonrpc.client.utils.OneTimeCallback callback ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { this . nioEngine = new org.ovirt.vdsm.jsonrpc.client.reactors.SSLEngineNioHelper ( channel , createSSLEngine ( this . client ) , callback , this ) ; this . nioEngine.beginHandshake ( ) ; int interestedOps = java.nio.channels.SelectionKey.OP_READ ; reactor.wakeup ( ) ; key = this . channel.register ( selector , ( interestedOps |= java.nio.channels.SelectionKey.OP_WRITE ) , this ) ; } catch ( java.nio.channels.ClosedChannelException | javax.net.ssl.SSLException e ) { org.ovirt.vdsm.jsonrpc.client.reactors.SSLClient.log.error ( "Connection issues during ssl client creation" , e ) ; throw new org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ( e ) ; } }
Source:
protected void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpVm ( GUIDS [ 1 ] ) ) ; setUpGetConsoleExpectations ( 0 ) ; setUpGetSoundcardExpectations ( 0 ) ; super . doTestBadAdd ( valid , success , detail ) ; }

Target:
protected void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpVm ( GUIDS [ 1 ] ) ) ; setUpGetConsoleExpectations ( 1 ) ; setUpGetSoundcardExpectations ( 1 ) ; super . doTestBadAdd ( valid , success , detail ) ; }
Source:
private java.lang.String getRealKey ( java.lang.String agent , java.lang.String displayedKey ) { java.lang.String result = "" ; if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( agent ) ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( displayedKey ) ) ) { if ( fenceOptionMapping.containsKey ( agent ) ) { java.util.HashMap < java.lang.String , java.lang.String > agentOptions = fenceOptionMapping.get ( agent ) ; result = agentOptions.getOrDefault ( displayedKey , displayedKey ) ; } else { org.ovirt.engine.core.utils.pm.VdsFenceOptions.log.error ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.AGENT_ERROR , agent ) ; } } return result ; }

Target:
private java.lang.String getRealKey ( java.lang.String agent , java.lang.String displayedKey ) { java.lang.String result = "" ; if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( agent ) ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( displayedKey ) ) ) { if ( fenceOptionMapping.containsKey ( agent ) ) { java.util.Map < java.lang.String , java.lang.String > agentOptions = fenceOptionMapping.get ( agent ) ; result = agentOptions.getOrDefault ( displayedKey , displayedKey ) ; } else { org.ovirt.engine.core.utils.pm.VdsFenceOptions.log.error ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.AGENT_ERROR , agent ) ; } } return result ; }
Source:
public void testExecuteQueryCommand ( ) throws java.io.IOException { org.mockito.Mockito.when ( clusterDaoMock.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getCluster ( Version.v3_3 ) ) ; getQuery ( ) . executeQueryCommand ( ) ; java.util.Map < java.lang.String , java.lang.String > servers = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertNotNull ( servers ) ; org.junit.Assert.assertEquals ( getAddedServers ( ) , servers ) ; }

Target:
public void testExecuteQueryCommand ( ) throws java.io.IOException { getQuery ( ) . executeQueryCommand ( ) ; java.util.Map < java.lang.String , java.lang.String > servers = getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertNotNull ( servers ) ; org.junit.Assert.assertEquals ( getAddedServers ( ) , servers ) ; }
Source:
private static void InsertPassHistoryRecord ( java.lang.Integer id , org.ovirt.engine.api.extensions.ExtMap input , java.sql.Connection conn ) throws java.sql.SQLException { new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Modification ( new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Template ( Sql.ModificationTypes.INSERT , "user_password_history" ) . setInteger ( "user_id" , id ) . setString ( "password" , input.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.UserKeys.OLD_PASSWORD , java.lang.String.class ) ) . setTimestamp ( "changed" , new java.util.Date ( ) . getTime ( ) ) . asSql ( ) ) . execute ( conn , false ) ; }

Target:
private static void InsertPassHistoryRecord ( java.lang.Integer id , org.ovirt.engine.api.extensions.ExtMap input , java.sql.Connection conn ) throws java.sql.SQLException { new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Modification ( new org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Template ( Sql.ModificationTypes.INSERT , "@SCHEMA_NAME@.user_password_history" ) . setInteger ( "user_id" , id ) . setString ( "password" , input.get ( org.ovirt.engine.extension.aaa.jdbc.core.Schema.UserKeys.OLD_PASSWORD , java.lang.String.class ) ) . setTimestamp ( "changed" , new java.util.Date ( ) . getTime ( ) ) . asSql ( ) ) . execute ( conn , false ) ; }
Source:
protected boolean performImagesChecks ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , true , true , false , false , false , false , true , true , getImagesList ( ) ) ; }

Target:
protected boolean performImagesChecks ( ) { return org.ovirt.engine.core.bll.ImagesHandler.PerformImagesChecks ( org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RestoreAllSnapshotsCommand.getVm ( ) . getStoragePoolId ( ) , Guid.Empty , true , true , false , false , false , true , true , getImagesList ( ) ) ; }
Source:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
protected boolean CheckStoragePoolStatus ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus status ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ; if ( storagePool != null ) { returnValue = ( storagePool.getstatus ( ) ) == status ; if ( ( ! returnValue ) && ( ! ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL.toString ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; } } return returnValue ; }

Target:
protected boolean CheckStoragePoolStatus ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus status ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ; if ( storagePool != null ) { returnValue = ( storagePool.getStatus ( ) ) == status ; if ( ( ! returnValue ) && ( ! ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL.toString ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; } } return returnValue ; }
Source:
protected boolean canDoAction ( ) { return ( ( ( ( ( ( ( ( ( ( ( isImageExist ( ) ) && ( checkOperationIsCorrect ( ) ) ) && ( canFindVmOrTemplate ( ) ) ) && ( isImageNotLocked ( ) ) ) && ( isSourceAndDestTheSame ( ) ) ) && ( validateSourceStorageDomain ( ) ) ) && ( validateDestStorage ( ) ) ) && ( checkTemplateInDestStorageDomain ( ) ) ) && ( validateSpaceRequirements ( ) ) ) && ( checkImageConfiguration ( ) ) ) && ( checkCanBeMoveInVm ( ) ) ) && ( checkIfNeedToBeOverride ( ) ) ; }

Target:
protected boolean canDoAction ( ) { return ( ( ( ( ( ( ( ( ( ( isImageExist ( ) ) && ( checkOperationIsCorrect ( ) ) ) && ( canFindVmOrTemplate ( ) ) ) && ( isImageNotLocked ( ) ) ) && ( isSourceAndDestTheSame ( ) ) ) && ( validateSourceStorageDomain ( ) ) ) && ( validateDestStorage ( ) ) ) && ( checkTemplateInDestStorageDomain ( ) ) ) && ( validateSpaceRequirements ( ) ) ) && ( checkCanBeMoveInVm ( ) ) ) && ( checkIfNeedToBeOverride ( ) ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case AutoLogin : case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( parameters.getActionType ( ) , parameters ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( org.ovirt.engine.core.common.action.LoginUserParameters parameters ) { switch ( parameters.getActionType ( ) ) { case LoginUser : case LoginAdminUser : org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( parameters.getActionType ( ) , parameters ) ; return command.executeAction ( ) ; default : return getErrorCommandReturnValue ( VdcBllMessages.USER_NOT_AUTHORIZED_TO_PERFORM_ACTION ) ; } }
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.dal.VdcBllMessages.ACTION_TYPE_FAILED_MIGRATION_IN_PROGRESS ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void setup ( ) { initVds ( ) ; initConditions ( ) ; org.mockito.Mockito.when ( vdsManager.getRefreshStatistics ( ) ) . thenReturn ( false ) ; updater = org.mockito.Mockito.spy ( new org.ovirt.engine.core.vdsbroker.HostMonitoring ( vdsManager , vds , org.mockito.Mockito.mock ( org.ovirt.engine.core.vdsbroker.MonitoringStrategy.class ) , resourceManager , dbFacade , auditLogDirector ) ) ; }

Target:
public void setup ( ) { initVds ( ) ; initConditions ( ) ; org.mockito.Mockito.when ( vdsManager.getRefreshStatistics ( ) ) . thenReturn ( false ) ; updater = new org.ovirt.engine.core.vdsbroker.HostMonitoring ( vdsManager , vds , org.mockito.Mockito.mock ( org.ovirt.engine.core.vdsbroker.MonitoringStrategy.class ) , resourceManager , dbFacade , auditLogDirector ) ; }
Source:
public void checkExecuteCommandWithVdsId ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; org.mockito.Mockito.doNothing ( ) . when ( storageServerConnectionDao ) . remove ( NFSConnection.getid ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . disconnectStorage ( ) ; command.executeCommand ( ) ; }

Target:
public void checkExecuteCommandWithVdsId ( ) { parameters.setStorageServerConnection ( NFSConnection ) ; org.mockito.Mockito.doNothing ( ) . when ( storageServerConnectionDao ) . remove ( NFSConnection.getId ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . disconnectStorage ( ) ; command.executeCommand ( ) ; }
Source:
protected java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.String > getExclusiveLocks ( ) { if ( disk.isBoot ( ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.AttachDiskToVmCommand.getParameters ( ) . getVmId ( ) , LockingGroup.VM_DISK_BOOT.name ( ) ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , java.lang.String > getExclusiveLocks ( ) { if ( disk.isBoot ( ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.AttachDiskToVmCommand.getParameters ( ) . getVmId ( ) . toString ( ) , LockingGroup.VM_DISK_BOOT.name ( ) ) ; } return null ; }
Source:
java.util.List < org.ovirt.engine.core.common.utils.Pair < java.lang.Object , org.ovirt.engine.core.common.businessentities.VM > > filterNonNullPools ( java.util.List < org.ovirt.engine.core.common.utils.Pair < java.lang.Object , org.ovirt.engine.core.common.businessentities.VM > > poolsWithRepresentatives ) { return java.util.Collections.unmodifiableList ( new java.util.ArrayList ( org.ovirt.engine.ui.uicommonweb.Linq.where ( poolsWithRepresentatives , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.utils.Pair < java.lang.Object , org.ovirt.engine.core.common.businessentities.VM > > ( ) { @ java.lang.Override public boolean match ( Pair < java.lang.Object , org.ovirt.engine.core.common.businessentities.VM > poolAndVm ) { return ( poolAndVm.getSecond ( ) ) != null ; } } ) ) ) ; }

Target:
java.util.List < org.ovirt.engine.core.common.utils.Pair < java.lang.Object , org.ovirt.engine.core.common.businessentities.VM > > filterNonNullPools ( java.util.List < org.ovirt.engine.core.common.utils.Pair < java.lang.Object , org.ovirt.engine.core.common.businessentities.VM > > poolsWithRepresentatives ) { return java.util.Collections.unmodifiableList ( org.ovirt.engine.ui.uicommonweb.Linq.where ( poolsWithRepresentatives , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.utils.Pair < java.lang.Object , org.ovirt.engine.core.common.businessentities.VM > > ( ) { @ java.lang.Override public boolean match ( Pair < java.lang.Object , org.ovirt.engine.core.common.businessentities.VM > poolAndVm ) { return ( poolAndVm.getSecond ( ) ) != null ; } } ) ) ; }
Source:
private boolean selectedItemsContainBlankTemplate ( ) { if ( ( getSelectedItems ( ) ) != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VmTemplate > cast ( getSelectedItems ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : templates ) { if ( ( template != null ) && ( template.getId ( ) . equals ( Guid.Empty ) ) ) { return true ; } } } return false ; }

Target:
private boolean selectedItemsContainBlankTemplate ( ) { if ( ( getSelectedItems ( ) ) != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = getSelectedItems ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmTemplate template : templates ) { if ( ( template != null ) && ( template.getId ( ) . equals ( Guid.Empty ) ) ) { return true ; } } } return false ; }
Source:
public java.util.Set < org.ovirt.engine.core.common.businessentities.network.Network > getNetworksToConfigure ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > labeledNetworks ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsByNetworkName = org.ovirt.engine.core.common.businessentities.Entities.hostInterfacesByNetworkName ( nics ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.network.Network > networkToAdd = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : labeledNetworks ) { if ( ! ( nicsByNetworkName.containsKey ( network.getName ( ) ) ) ) { networkToAdd.add ( network ) ; } } return networkToAdd ; }

Target:
private java.util.Set < org.ovirt.engine.core.common.businessentities.network.Network > getNetworksToConfigure ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > labeledNetworks ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsByNetworkName = org.ovirt.engine.core.common.businessentities.Entities.hostInterfacesByNetworkName ( nics ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.network.Network > networkToAdd = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : labeledNetworks ) { if ( ! ( nicsByNetworkName.containsKey ( network.getName ( ) ) ) ) { networkToAdd.add ( network ) ; } } return networkToAdd ; }
Source:
public void UpdateVmDynamic ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic ) { if ( ( _vdsUpdater ) != null ) { org.ovirt.engine.core.common.businessentities.VM vm = _vdsUpdater.GetVmFromDictionary ( vmDynamic.getId ( ) ) ; if ( vm != null ) { vm.setDynamicData ( vmDynamic ) ; } } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vmDynamic ) ; }

Target:
public void UpdateVmDynamic ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vmDynamic ) ; }
Source:
public void migrationNotSupported ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( clusterDao , dataCenterDao , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . migrationSupportedForArch ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.MIGRATION_ON_ERROR_IS_NOT_SUPPORTED ) ) ; }

Target:
public void migrationNotSupported ( ) { org.mockito.Mockito.doReturn ( false ) . when ( validator ) . migrationSupportedForArch ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.MIGRATION_ON_ERROR_IS_NOT_SUPPORTED ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( target ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > vmDisks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( model , vmDisks , VmModelHelper.WarningType.VM_EXPORT ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( target ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > vmDisks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( model , vmDisks , VmModelHelper.WarningType.VM_EXPORT ) ; }
Source:
public void testVmTagLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Tag tag = new org.ovirt.engine.api.model.Tag ( ) ; tag.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.TAG_ID ) ; tag.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; tag.getVm ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , tag ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_TAG_HREF , tag.getHref ( ) ) ; }

Target:
public void testVmTagLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Tag tag = new org.ovirt.engine.api.model.Tag ( ) ; tag.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.TAG_ID ) ; tag.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; tag.getVm ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( tag ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_TAG_HREF , tag.getHref ( ) ) ; }
Source:
protected java.lang.String cdPathWindowsToLinux ( java.lang.String windowsPath , java.lang.String isoPrefix ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( windowsPath ) ) { return windowsPath ; } java.lang.String fileName = new java.io.File ( windowsPath ) . getName ( ) ; return java.lang.String.format ( "%1$s/%2$s" , isoPrefix , fileName ) ; }

Target:
private java.lang.String cdPathWindowsToLinux ( java.lang.String windowsPath , java.lang.String isoPrefix ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( windowsPath ) ) { return windowsPath ; } java.lang.String fileName = new java.io.File ( windowsPath ) . getName ( ) ; return java.lang.String.format ( "%1$s/%2$s" , isoPrefix , fileName ) ; }
Source:
protected void EndVmCommand ( ) { try { if ( org.ovirt.engine.core.bll.RemoveVmCommand.acquireLock ( ) ) { setVm ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDAO ( ) . get ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ; if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ; RemoveVmFromDb ( ) ; } } org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( true ) ; } finally { org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; } }

Target:
protected void EndVmCommand ( ) { try { if ( org.ovirt.engine.core.bll.RemoveVmCommand.acquireLock ( ) ) { setVm ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDAO ( ) . get ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ; if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) != null ) { RemoveVmFromDb ( ) ; } } org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( true ) ; } finally { org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; } }
Source:
protected void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetInstanceType , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; } }

Target:
private void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetInstanceType , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; } }
Source:
public void moveUnpluggedDiskVmDown ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Down , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId , false ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( command.getMoveDiskParametersList ( ) . size ( ) , 1 ) ; }

Target:
public void moveUnpluggedDiskVmDown ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Down , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId , false ) ; command.updateParameters ( ) ; org.junit.Assert.assertEquals ( 1 , command.getMoveDiskParametersList ( ) . size ( ) ) ; }
Source:
private void setupMock ( ) throws java.lang.Exception { commandMock = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.ClearExternalJobCommand ( parameters ) ) ; 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.ClearExternalJobCommandTest.jobId ) ) . thenReturn ( makeTestJob ( org.ovirt.engine.core.bll.ClearExternalJobCommandTest.jobId ) ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.ClearExternalJobCommandTest.nonExistingJobId ) ) . thenReturn ( null ) ; }

Target:
private void setupMock ( ) throws java.lang.Exception { commandMock = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.ClearExternalJobCommand ( 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.ClearExternalJobCommandTest.jobId ) ) . thenReturn ( makeTestJob ( org.ovirt.engine.core.bll.ClearExternalJobCommandTest.jobId ) ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.ClearExternalJobCommandTest.nonExistingJobId ) ) . thenReturn ( null ) ; }
Source:
public void getSpecParams ( ) { org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setAction ( VmWatchdogAction.RESET ) ; params.setModel ( vmWatchdogType ) ; org.ovirt.engine.core.bll.UpdateWatchdogCommand command = new org.ovirt.engine.core.bll.UpdateWatchdogCommand ( params ) ; java.util.HashMap < java.lang.String , java.lang.Object > specParams = command.getSpecParams ( ) ; org.junit.Assert.assertNotNull ( specParams ) ; org.junit.Assert.assertEquals ( "i6300esb" , specParams.get ( "model" ) ) ; org.junit.Assert.assertEquals ( "reset" , specParams.get ( "action" ) ) ; }

Target:
public void getSpecParams ( ) { org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setAction ( VmWatchdogAction.RESET ) ; params.setModel ( vmWatchdogType ) ; org.ovirt.engine.core.bll.UpdateWatchdogCommand command = new org.ovirt.engine.core.bll.UpdateWatchdogCommand ( params , null ) ; java.util.HashMap < java.lang.String , java.lang.Object > specParams = command.getSpecParams ( ) ; org.junit.Assert.assertNotNull ( specParams ) ; org.junit.Assert.assertEquals ( "i6300esb" , specParams.get ( "model" ) ) ; org.junit.Assert.assertEquals ( "reset" , specParams.get ( "action" ) ) ; }
Source:
public static java.lang.String getJsonDiskDescription ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) throws java.io.IOException { java.util.Map < java.lang.String , java.lang.Object > description = new java.util.TreeMap < > ( ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_ALIAS , disk.getDiskAlias ( ) ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_DESCRIPTION , ( ( disk.getDiskDescription ( ) ) != null ? disk.getDiskDescription ( ) : "" ) ) ; return org.ovirt.engine.core.utils.JsonHelper.mapToJson ( description , false ) ; }

Target:
public java.lang.String getJsonDiskDescription ( org.ovirt.engine.core.common.businessentities.storage.Disk disk ) throws java.io.IOException { java.util.Map < java.lang.String , java.lang.Object > description = new java.util.TreeMap < > ( ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_ALIAS , disk.getDiskAlias ( ) ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_DESCRIPTION , ( ( disk.getDiskDescription ( ) ) != null ? disk.getDiskDescription ( ) : "" ) ) ; return org.ovirt.engine.core.utils.JsonHelper.mapToJson ( description , false ) ; }
Source:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel ) { java.lang.Boolean migrationNetworkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MigrationNetworkEnabled , clusterNetworkModel.getCluster ( ) . getcompatibility_version ( ) . toString ( ) ) ) ) ; return ( migrationNetworkEnabled && ( clusterNetworkModel.isAttached ( ) ) ) && ( ! ( clusterNetworkModel.isExternal ( ) ) ) ; }

Target:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel ) { java.lang.Boolean migrationNetworkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.MigrationNetworkEnabled , clusterNetworkModel.getCluster ( ) . getcompatibility_version ( ) . toString ( ) ) ) ) ; return ( migrationNetworkEnabled && ( clusterNetworkModel.isAttached ( ) ) ) && ( ! ( clusterNetworkModel.isExternal ( ) ) ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnRemove" ) ) { onRemove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnRestore" ) ) { onRestore ( ) ; } else { super . executeCommand ( command ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( "OnRemove" . equals ( command.getName ( ) ) ) { onRemove ( ) ; } else if ( "OnRestore" . equals ( command.getName ( ) ) ) { onRestore ( ) ; } else { super . executeCommand ( command ) ; } }
Source:
private void attachDetachDisk ( org.ovirt.engine.core.common.businessentities.storage.Disk disk , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement oldDve = disk.getDiskVmElementForVm ( oldVmId ) ; runInternalAction ( actionType , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( disk.getId ( ) , org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) ) , oldDve.isPlugged ( ) , oldDve.isReadOnly ( ) ) ) ; }

Target:
private void attachDetachDisk ( org.ovirt.engine.core.common.businessentities.storage.Disk disk , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement oldDve = disk.getDiskVmElementForVm ( oldVmId ) ; runInternalAction ( actionType , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( disk.getId ( ) , org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) ) , oldDve.isPlugged ( ) ) ) ; }
Source:
protected void buildVmVideoCards ( ) { createInfo.add ( VdsProperties.display , vm.getDisplayType ( ) . toString ( ) ) ; if ( ( vm.getDisplayType ( ) ) != ( vm.getDefaultDisplayType ( ) ) ) { addVideoCardByDisplayType ( vm.getDisplayType ( ) ) ; } else { addVideoCardsDefinedForVmInDB ( vm.getId ( ) ) ; } }

Target:
protected void buildVmVideoCards ( ) { createInfo.put ( VdsProperties.display , vm.getDisplayType ( ) . toString ( ) ) ; if ( ( vm.getDisplayType ( ) ) != ( vm.getDefaultDisplayType ( ) ) ) { addVideoCardByDisplayType ( vm.getDisplayType ( ) ) ; } else { addVideoCardsDefinedForVmInDB ( vm.getId ( ) ) ; } }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; filteredStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( org.ovirt.engine.ui.uicommonweb.Linq.IsDataActiveStorageDomain ( domain ) ) { filteredStorageDomains.add ( domain ) ; } } getStorage ( ) . setItems ( filteredStorageDomains ) ; if ( hasQuota ) { initQuotaForStorageDomains ( ) ; } else { initDisksStorageDomainsList ( ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; filteredStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( org.ovirt.engine.ui.uicommonweb.Linq.IsDataActiveStorageDomain ( domain ) ) { filteredStorageDomains.add ( domain ) ; } } getStorage ( ) . setItems ( filteredStorageDomains ) ; if ( hasQuota ) { initQuotaForStorageDomains ( ) ; } else { initDisksStorageDomainsList ( ) ; } }
Source:
private void deleteObsoleteHistoryData ( ) throws java.sql.SQLException { if ( ( prop.getInteger ( NotificationProperties.DAYS_TO_KEEP_HISTORY ) ) > 0 ) { final int deletedRecords = eventsManager.deleteObsoleteHistoryData ( prop.getInteger ( NotificationProperties.DAYS_TO_KEEP_HISTORY ) ) ; if ( deletedRecords > 0 ) { org.ovirt.engine.core.notifier.NotificationService.log.debug ( ( deletedRecords + " records were deleted from \"event_notification_hist\" table." ) ) ; } } }

Target:
private void deleteObsoleteHistoryData ( ) throws java.sql.SQLException { eventsManager.deleteObsoleteHistoryData ( prop.getInteger ( NotificationProperties.DAYS_TO_KEEP_HISTORY ) ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) ) ) ; setUpMocksForUpdate ( ) ; mockBackend ( false , EngineError.GlusterHookUpdateFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_UPDATE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.UpdateGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookManageParameters ( HOOK_ID ) , null ) ) ; setUpMocksForUpdate ( ) ; mockBackend ( false , EngineError.GlusterHookUpdateFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_UPDATE_FAILED ) ; }
Source:
public static void getDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.TimeZoneType timeZoneType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return "" ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setTimeZoneType ( timeZoneType ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDefaultTimeZone , params , aQuery ) ; }

Target:
public static void getDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.TimeZoneType timeZoneType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return "" ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setTimeZoneType ( timeZoneType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDefaultTimeZone , params , aQuery ) ; }
Source:
private void AddVdsDynamicToDb ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; vdsDynamic.setId ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) . getId ( ) ) ; if ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getAddPending ( ) ) { vdsDynamic.setStatus ( VDSStatus.PendingApproval ) ; } else if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.InstallVds ) ) { vdsDynamic.setStatus ( VDSStatus.Installing ) ; } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . save ( vdsDynamic ) ; org.ovirt.engine.core.bll.AddVdsCommand.getCompensationContext ( ) . snapshotNewEntity ( vdsDynamic ) ; }

Target:
private void AddVdsDynamicToDb ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; vdsDynamic.setId ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getVdsStaticData ( ) . getId ( ) ) ; if ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getAddPending ( ) ) { vdsDynamic.setStatus ( VDSStatus.PendingApproval ) ; } else if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.InstallVds ) ) { vdsDynamic.setStatus ( VDSStatus.Installing ) ; } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . save ( vdsDynamic ) ; org.ovirt.engine.core.bll.AddVdsCommand.getCompensationContext ( ) . snapshotNewEntity ( vdsDynamic ) ; }
Source:
private void updateWANDisableEffects ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getWANDisableEffects ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spice.setWANDisableEffects ( ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.WANDisableEffects > ) ( returnValue ) ) ) ; } } ) ) ; }

Target:
private void updateWANDisableEffects ( final org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getWANDisableEffects ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { spice.setWANDisableEffects ( ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.WANDisableEffects > ) ( returnValue ) ) ) ; } } ) ) ; }
Source:
private void markVfsAsUsedByVm ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.compat.Guid vmId , java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.String > passthroughVnicToVfMap ) { org.ovirt.engine.core.bll.network.host.HostNicVfsConfigHelper hostNicVfsConfigHelper = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.network.host.HostNicVfsConfigHelper.class ) ; hostNicVfsConfigHelper.setVmIdOnVfs ( hostId , vmId , new java.util.HashSet < java.lang.String > ( passthroughVnicToVfMap.values ( ) ) ) ; }

Target:
private void markVfsAsUsedByVm ( org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.compat.Guid vmId , java.util.Map < org.ovirt.engine.core.compat.Guid , java.lang.String > passthroughVnicToVfMap ) { org.ovirt.engine.core.bll.network.host.HostNicVfsConfigHelper hostNicVfsConfigHelper = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.network.host.HostNicVfsConfigHelper.class ) ; hostNicVfsConfigHelper.setVmIdOnVfs ( hostId , vmId , new java.util.HashSet ( passthroughVnicToVfMap.values ( ) ) ) ; }
Source:
protected boolean canRunVm ( ) { return getVmRunHandler ( ) . canRunVm ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) , org.ovirt.engine.core.bll.RunVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVdsSelector ( ) , org.ovirt.engine.core.bll.RunVmCommand.getSnapshotsValidator ( ) , getVmPropertiesUtils ( ) ) ; }

Target:
protected boolean canRunVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { return getVmRunHandler ( ) . canRunVm ( vm , org.ovirt.engine.core.bll.RunVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVdsSelector ( ) , org.ovirt.engine.core.bll.RunVmCommand.getSnapshotsValidator ( ) , getVmPropertiesUtils ( ) ) ; }
Source:
public void setup ( ) throws java.lang.Exception { validator = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) ; org.ovirt.engine.core.common.config.IConfigUtilsInterface confUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ; org.mockito.Mockito.when ( confUtils.getValue ( ConfigValues.MaxMTU , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( org.ovirt.engine.core.common.utils.MTUValidatorTest.TEST_MAX_MTU ) ; org.mockito.Mockito.when ( confUtils.getValue ( ConfigValues.ManagementNetwork , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( org.ovirt.engine.core.common.utils.MTUValidatorTest.TEST_MANAGEMENT_NETWORK ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( confUtils ) ; }

Target:
public void setup ( ) throws java.lang.Exception { validator = org.ovirt.engine.core.common.utils.ValidationUtils.getValidator ( ) ; org.ovirt.engine.core.common.config.IConfigUtilsInterface confUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ; org.mockito.Mockito.when ( confUtils.getValue ( ConfigValues.ManagementNetwork , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( org.ovirt.engine.core.common.utils.MTUValidatorTest.TEST_MANAGEMENT_NETWORK ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( confUtils ) ; }
Source:
public void setPosition ( int offsetWidth , int offsetHeight ) { int left = target.getAbsoluteLeft ( ) ; int top = ( ( target.getAbsoluteTop ( ) ) + ( target.getOffsetHeight ( ) ) ) + ( org.ovirt.engine.ui.common.widget.ElementAwareDecoratedPopupPanel.TOOLTIP_HEIGHT_OFFSET ) ; setPopupPosition ( left , top ) ; }

Target:
public void setPosition ( int offsetWidth , int offsetHeight ) { int left = target.getAbsoluteLeft ( ) ; int top = ( target.getAbsoluteTop ( ) ) + ( target.getOffsetHeight ( ) ) ; setPopupPosition ( left , top ) ; }