auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { callback.asyncCallback.OnSuccess ( callback.getModel ( ) , null ) ; } }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { callback.asyncCallback.OnSuccess ( callback.getModel ( ) , null ) ; } }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.Integer > result = Connect ( org.ovirt.engine.core.bll.storage.ConnectStorageToVdsCommand.getVds ( ) . getId ( ) ) ; setSucceeded ( result.getFirst ( ) ) ; if ( ! ( result.getFirst ( ) ) ) { setErrorMessageAtReturn ( result ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.Integer > result = connect ( org.ovirt.engine.core.bll.storage.ConnectStorageToVdsCommand.getVds ( ) . getId ( ) ) ; setSucceeded ( result.getFirst ( ) ) ; if ( ! ( result.getFirst ( ) ) ) { setErrorMessageAtReturn ( result ) ; } }
Source:
public void updateVmTag ( ) { existingVmTag.setDefaultDisplayType ( ( ( existingVmTag.getDefaultDisplayType ( ) ) + 1 ) ) ; dao.updateDefaultDisplayForVmTag ( existingVmTag ) ; org.ovirt.engine.core.common.businessentities.TagsVmMap result = dao.getTagVmByTagIdAndByVmId ( existingVmTag.gettag_id ( ) , existingVmTag.getvm_id ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; assertEqualsTagsVmMap ( existingVmTag , result ) ; }

Target:
public void updateVmTag ( ) { existingVmTag.setDefaultDisplayType ( ( ( existingVmTag.getDefaultDisplayType ( ) ) + 1 ) ) ; dao.updateDefaultDisplayForVmTag ( existingVmTag ) ; org.ovirt.engine.core.common.businessentities.TagsVmMap result = dao.getTagVmByTagIdAndByVmId ( existingVmTag.getTagId ( ) , existingVmTag.getVmId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; assertEqualsTagsVmMap ( existingVmTag , result ) ; }
Source:
public void testChangeClusterForbidden ( ) { prepareVmToPassCanDoAction ( ) ; vmStatic.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with can't change cluster." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }

Target:
public void testChangeClusterForbidden ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDSGroup newGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setCompatibilityVersion ( Version.v3_0 ) ; vmStatic.setVdsGroupId ( newGroup.getId ( ) ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( command ) . getVdsGroupDao ( ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with can't change cluster." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }
Source:
protected boolean canDoAction ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.VDS_INVALID_SERVER_ID ) ; result = false ; } else if ( ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Connecting ) ) || ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_CANNOT_CHECK_VERSION_HOST_NON_RESPONSIVE ) ; result = false ; } return result ; }

Target:
protected boolean canDoAction ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) ) == null ) { addCanDoActionMessage ( EngineMessage.VDS_INVALID_SERVER_ID ) ; result = false ; } else if ( ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Connecting ) ) || ( ( org.ovirt.engine.core.bll.HandleVdsVersionCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonResponsive ) ) ) { addCanDoActionMessage ( EngineMessage.VDS_CANNOT_CHECK_VERSION_HOST_NON_RESPONSIVE ) ; result = false ; } return result ; }
Source:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
private void buildFaultResult ( ) { org.ovirt.engine.core.common.errors.EngineFault fault = new org.ovirt.engine.core.common.errors.EngineFault ( ) ; fault.setError ( EngineError.ReachedMaxNumberOfHostsInDC ) ; fault.setMessage ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getVdsErrorsTranslator ( ) . TranslateErrorTextSingle ( fault.getError ( ) . toString ( ) ) ) ; org.ovirt.engine.core.bll.AddVdsSpmIdCommand.getReturnValue ( ) . setFault ( fault ) ; }

Target:
private void buildFaultResult ( ) { org.ovirt.engine.core.common.errors.EngineFault fault = new org.ovirt.engine.core.common.errors.EngineFault ( ) ; fault.setError ( EngineError.ReachedMaxNumberOfHostsInDC ) ; fault.setMessage ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getVdsErrorsTranslator ( ) . translateErrorTextSingle ( fault.getError ( ) . toString ( ) ) ) ; org.ovirt.engine.core.bll.AddVdsSpmIdCommand.getReturnValue ( ) . setFault ( fault ) ; }
Source:
public void calculateNetworkImplementationDetailsNetworkMtuOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , iface.isBridged ( ) , ( ( iface.getMtu ( ) ) + 1 ) , iface.getVlanId ( ) ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkMtuOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , iface.isBridged ( ) , ( ( iface.getMtu ( ) ) + 1 ) , iface.getVlanId ( ) , createQos ( ) ) ; }
Source:
private void onRemove ( ) { cancel ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > params = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.MacPool macPool : getSelectedItems ( ) ) { params.add ( new org.ovirt.engine.core.common.action.RemoveMacPoolByIdParameters ( macPool.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RemoveMacPool , params ) ; }

Target:
private void onRemove ( ) { cancel ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > params = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.MacPool macPool : getSelectedItems ( ) ) { params.add ( new org.ovirt.engine.core.common.action.RemoveMacPoolByIdParameters ( macPool.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( ActionType.RemoveMacPool , params ) ; }
Source:
public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from Logoff." ) ; callback.asyncCallback.onSuccess ( callback.getModel ( ) , result ) ; if ( ( org.ovirt.engine.ui.frontend.Frontend.getLoginHandler ( ) ) != null ) { org.ovirt.engine.ui.frontend.Frontend.getLoginHandler ( ) . onLogout ( ) ; } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( null ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; } }
Source:
public org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel findNetworkClusterModel ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { for ( java.lang.Object item : getNetworkClusterList ( ) . getItems ( ) ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel ncm = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel ) ( item ) ) ; if ( cluster.getname ( ) . equals ( ncm.getName ( ) ) ) { return ncm ; } } return null ; }

Target:
protected void postSaveAction ( org.ovirt.engine.core.compat.Guid networkGuid , boolean succeeded ) { if ( succeeded ) { cancel ( ) ; } StopProgress ( ) ; }
Source:
public void testNoActiveImagesReturned ( ) { org.ovirt.engine.core.common.queries.IdQueryParameters params = getQueryParameters ( ) ; org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( storageDoaminId ) ; org.ovirt.engine.core.bll.snapshots.GetAllDiskSnapshotsByStorageDomainIdQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = getQuery ( ) ; query.executeQueryCommand ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = query.getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertTrue ( "Active images shouldn't be returned" , diskImages.stream ( ) . noneMatch ( DiskImage :: getActive ) ) ; }

Target:
public void testNoActiveImagesReturned ( ) { org.ovirt.engine.core.common.queries.IdQueryParameters params = getQueryParameters ( ) ; org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( storageDoaminId ) ; org.ovirt.engine.core.bll.snapshots.GetAllDiskSnapshotsByStorageDomainIdQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = getQuery ( ) ; query.executeQueryCommand ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = query.getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( diskImages.stream ( ) . noneMatch ( DiskImage :: getActive ) , "Active images shouldn't be returned" ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , getCluster ( 0 ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.DATA_CENTER_ID } , getNetworks ( ) , failure ) ; }
Source:
public void testExceptionWhileLocking ( ) { org.mockito.Mockito.doThrow ( new java.lang.RuntimeException ( ) ) . when ( lock ) . lock ( ) ; try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock l = new org.ovirt.engine.core.utils.lock.AutoCloseableLock ( lock ) ) { org.junit.Assert.fail ( "Lock wasn't acquired, this code shouldn't happen." ) ; } catch ( java.lang.RuntimeException e ) { } org.mockito.Mockito.verify ( lock , org.mockito.Mockito.never ( ) ) . unlock ( ) ; }

Target:
public void testExceptionWhileLocking ( ) { org.mockito.Mockito.doThrow ( new java.lang.RuntimeException ( ) ) . when ( lock ) . lock ( ) ; try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock l = new org.ovirt.engine.core.utils.lock.AutoCloseableLock ( lock ) ) { org.junit.jupiter.api.Assertions.fail ( "Lock wasn't acquired, this code shouldn't happen." ) ; } catch ( java.lang.RuntimeException e ) { } org.mockito.Mockito.verify ( lock , org.mockito.Mockito.never ( ) ) . unlock ( ) ; }
Source:
public void close ( ) throws java.io.IOException { try { if ( ( session ) != null ) { session.close ( true ) ; session = null ; } if ( ( client ) != null ) { client.stop ( ) ; client = null ; } } catch ( java.lang.Exception e ) { org.ovirt.engine.core.uutils.ssh.SSHClient.log.error ( "Failed to close session" , e ) ; throw new java.io.IOException ( e ) ; } }

Target:
public void close ( ) throws java.io.IOException { try { if ( ( session ) != null ) { session.close ( true ) ; session = null ; } if ( ( client ) != null ) { client.stop ( ) ; client = null ; } } catch ( java.lang.Exception e ) { org.ovirt.engine.core.uutils.ssh.SSHClient.log.error ( "Failed to close session" , org.apache.commons.lang.exception.ExceptionUtils.getRootCauseMessage ( e ) ) ; org.ovirt.engine.core.uutils.ssh.SSHClient.log.debug ( "Exception" , e ) ; throw new java.io.IOException ( e ) ; } }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( taskButton.getValue ( ) ) { alertButton.setValue ( false ) ; eventButton.setValue ( false ) ; tablePanel.clear ( ) ; tablePanel.add ( tasksTree ) ; firstRowTablePanel.clear ( ) ; firstRowTablePanel.add ( _tasksTable ) ; message.setText ( constants.lastTaskEventFooter ( ) ) ; collapseButton.setVisible ( true ) ; } else { taskButton.setValue ( true ) ; } }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( taskButton.getValue ( ) ) { alertButton.setValue ( false ) ; eventButton.setValue ( false ) ; tablePanel.clear ( ) ; tablePanel.add ( tasksTree ) ; firstRowTablePanel.clear ( ) ; firstRowTablePanel.add ( _tasksTable ) ; message.setText ( org.ovirt.engine.ui.webadmin.widget.footer.AlertsEventsFooterView.constants.lastTaskEventFooter ( ) ) ; collapseButton.setVisible ( true ) ; } else { taskButton.setValue ( true ) ; } }
Source:
public void getAuthzGroupsByUserId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAuthzGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void vlanBondNameMismatch ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifacesToBond = createNics ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; java.lang.String ifaceName = ( bond.getName ( ) ) + "1" ; parameters.getInterfaces ( ) . add ( createVlan ( ifaceName , 100 , "net" ) ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_INTERFACES_DONT_EXIST , ifaceName ) ; }

Target:
public void vlanBondNameMismatch ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface anotherBond = createBond ( ( ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME ) + "1" ) , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifacesToBond = createNics ( null ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = createParametersForBond ( bond , ifacesToBond ) ; parameters.getInterfaces ( ) . add ( createVlan ( anotherBond , 100 , "net" ) ) ; mockExistingIfacesWithBond ( bond , ifacesToBond ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_INTERFACES_DONT_EXIST , anotherBond.getName ( ) ) ; }
Source:
protected boolean verifyAddVM ( ) { return org.ovirt.engine.core.bll.VmHandler.verifyAddVm ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , ( ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ) , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ) ; }

Target:
protected boolean verifyAddVM ( ) { final java.util.List < java.lang.String > reasons = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ; final int nicsCount = ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ; final int priority = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getPriority ( ) ; return org.ovirt.engine.core.bll.VmHandler.verifyAddVm ( reasons , nicsCount , priority , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getMacPool ( ) ) ; }
Source:
private org.ovirt.engine.ui.frontend.AsyncQuery createProviderReadOnlyCallback ( final java.util.Set < org.ovirt.engine.core.compat.Guid > externalProviderIds ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; boolean isReadOnly = checkForRemoveExternalNetworkAvailability ( providers , externalProviderIds ) ; makeRemoveExternalNetworkCheckboxAvailable ( isReadOnly ) ; } } ; return asyncQuery ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.datacenters.AsyncQuery < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > createProviderReadOnlyCallback ( final java.util.Set < org.ovirt.engine.core.compat.Guid > externalProviderIds ) { return new org.ovirt.engine.ui.uicommonweb.models.datacenters.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = returnValue.getReturnValue ( ) ; boolean isReadOnly = checkForRemoveExternalNetworkAvailability ( providers , externalProviderIds ) ; makeRemoveExternalNetworkCheckboxAvailable ( isReadOnly ) ; } } ) ; }
Source:
public void setProviderCallback ( ovirt_engine_dwh.historyetl_3_3.ESBProviderCallback callback ) { }

Target:
public void setDataSources ( java.util.Map < java.lang.String , javax.sql.DataSource > dataSources ) { java.util.Map < java.lang.String , ovirt_engine_dwh.historyetl_3_3.TalendDataSource > talendDataSources = new java.util.HashMap < java.lang.String , ovirt_engine_dwh.historyetl_3_3.TalendDataSource > ( ) ; for ( java.util.Map.Entry < java.lang.String , javax.sql.DataSource > dataSourceEntry : dataSources.entrySet ( ) ) { talendDataSources.put ( dataSourceEntry.getKey ( ) , new ovirt_engine_dwh.historyetl_3_3.TalendDataSource ( dataSourceEntry.getValue ( ) ) ) ; } globalMap.put ( ovirt_engine_dwh.historyetl_3_3.HistoryETL.KEY_DB_DATASOURCES , talendDataSources ) ; }
Source:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMRevertTaskVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case UnknownTask : log.error ( java.lang.String.format ( "Trying to revert unknown task: %1$s" , org.ovirt.engine.core.vdsbroker.vdsbroker.HSMRevertTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; return ; } super . proceedProxyReturnValue ( ) ; }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMRevertTaskVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case UnknownTask : log.error ( "Trying to revert unknown task '{}'" , org.ovirt.engine.core.vdsbroker.vdsbroker.HSMRevertTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ; return ; } super . proceedProxyReturnValue ( ) ; }
Source:
private org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > setupCanAddVmTests ( final int domainSizeGB , final int sizeRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = createCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; org.mockito.Mockito.doReturn ( createVmTemplate ( ) ) . when ( cmd ) . getVmTemplate ( ) ; org.mockito.Mockito.doReturn ( createStoragePool ( ) ) . when ( cmd ) . getStoragePool ( ) ; return cmd ; }

Target:
protected org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > setupCanAddVmFromSnapshotTests ( final int domainSizeGB , org.ovirt.engine.core.compat.Guid sourceSnapshotId ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB ) ; initializeVmDaoMock ( vm ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > cmd = createVmFromSnapshotCommand ( vm , sourceSnapshotId ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsDiskPluggedTo ( ) { if ( ( vmsDiskPluggedTo ) == null ) { vmsDiskPluggedTo = org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVmDAO ( ) . getForDisk ( getOldDisk ( ) . getId ( ) ) . get ( java.lang.Boolean.TRUE ) ; if ( ( vmsDiskPluggedTo ) == null ) { vmsDiskPluggedTo = java.util.Collections.emptyList ( ) ; } } return vmsDiskPluggedTo ; }

Target:
protected boolean shouldUpdateReadOnly ( ) { return ! ( vmDeviceForVm.getIsReadOnly ( ) . equals ( getNewDisk ( ) . getReadOnly ( ) ) ) ; }
Source:
public void checkMissingIpv6AddressDetailsBootProtocolStatic ( ) { final boolean initAddress = random.nextBoolean ( ) ; initIpv6ConfigurationDetails ( Ipv6BootProtocol.STATIC_IP , initAddress , ( ! initAddress ) ) ; org.junit.Assert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_STATIC_BOOT_PROTOCOL_MISSING_IP_ADDRESS_DETAILS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) ) ) ; }

Target:
public void checkMissingIpv6AddressDetailsBootProtocolStatic ( ) { final boolean initAddress = random.nextBoolean ( ) ; initIpv6ConfigurationDetails ( Ipv6BootProtocol.STATIC_IP , initAddress , ( ! initAddress ) ) ; org.hamcrest.MatcherAssert.assertThat ( underTest.validateNetworkAttachmentIpConfiguration ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ATTACHMENT_IP_CONFIGURATION_STATIC_BOOT_PROTOCOL_MISSING_IP_ADDRESS_DETAILS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_NETWORK_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.NETWORK_NAME ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentIpConfigurationValidator.VAR_INTERFACE_NAME , org.ovirt.engine.core.bll.validator.network.NetworkAttachmentIpConfigurationValidatorTest.INTERFACE_NAME ) ) ) ; }
Source:
public void testImagesDoesNotExist ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > guidsForDiskImages = new java.util.HashSet ( java.util.Arrays.asList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ; cmd.getParameters ( ) . setDiskIds ( guidsForDiskImages ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST ) ) . when ( diskExistenceValidator ) . diskImagesNotExist ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST ) ; }

Target:
public void testImagesDoesNotExist ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > guidsForDiskImages = new java.util.HashSet ( java.util.Arrays.asList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ; cmd.getParameters ( ) . setDiskIds ( guidsForDiskImages ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST ) ) . when ( diskExistenceValidator ) . disksNotExist ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST ) ; }
Source:
protected java.lang.String getTicketValue ( org.ovirt.engine.api.model.Action action ) { if ( ! ( ensureTicket ( action ) . isSetValue ( ) ) ) { action.getTicket ( ) . setValue ( org.ovirt.engine.core.utils.Ticketing.GenerateOTP ( ) ) ; } return action.getTicket ( ) . getValue ( ) ; }

Target:
protected java.lang.String getTicketValue ( org.ovirt.engine.api.model.Action action ) { if ( ! ( ensureTicket ( action ) . isSetValue ( ) ) ) { action.getTicket ( ) . setValue ( org.ovirt.engine.core.utils.Ticketing.generateOTP ( ) ) ; } return action.getTicket ( ) . getValue ( ) ; }
Source:
public void testRemoveNonExistant ( ) { setUpGetDomainExpectations ( StorageType.NFS , false ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpGetDomainExpectations ( StorageType.NFS , false ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected boolean hostToRunExist ( ) { if ( ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVds ( ) ) != null ) { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVds ( ) ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; return false ; } } return true ; }

Target:
protected boolean hostToRunExist ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > dedicatedHostsList = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVdsList ( ) ; if ( dedicatedHostsList.isEmpty ( ) ) { return true ; } for ( org.ovirt.engine.core.compat.Guid candidateHostGuid : dedicatedHostsList ) { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( candidateHostGuid ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; return false ; } } return true ; }
Source:
protected void SelectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . SelectedItemPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "status" ) ) { UpdateActionAvailability ( ) ; } else if ( e.PropertyName.equals ( "display_type" ) ) { UpdateConsoleModels ( ) ; } }

Target:
public org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel getSelectedHasConsoleModel ( ) { if ( ( ( selectedHasConsoleModels ) == null ) || ( ( selectedHasConsoleModels.size ( ) ) != 1 ) ) { return null ; } return selectedHasConsoleModels.get ( 0 ) ; }
Source:
protected void bindCommonPresenters ( ) { bindSingletonPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.ErrorPopupPresenterWidget.class , ErrorPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.ErrorPopupView.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget.class , DefaultConfirmationPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.DefaultConfirmationPopupView.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.RemoveConfirmationPopupPresenterWidget.class , RemoveConfirmationPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.RemoveConfirmationPopupView.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.ConsolePopupPresenterWidget.class , ConsolePopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.ConsolePopupView.class ) ; }

Target:
protected void bindCommonPresenters ( ) { bindSingletonPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.ErrorPopupPresenterWidget.class , ErrorPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.ErrorPopupView.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget.class , DefaultConfirmationPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.DefaultConfirmationPopupView.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.RemoveConfirmationPopupPresenterWidget.class , RemoveConfirmationPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.RemoveConfirmationPopupView.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.RolePermissionsRemoveConfirmationPopupPresenterWidget.class , RolePermissionsRemoveConfirmationPopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.RolePermissionsRemoveConfirmationPopupView.class ) ; bindPresenterWidget ( org.ovirt.engine.ui.common.presenter.popup.ConsolePopupPresenterWidget.class , ConsolePopupPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.popup.ConsolePopupView.class ) ; }
Source:
public void testRemoveLabel ( ) { org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig = dao.get ( FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2 ) ; checkLabels ( vfsConfig , 3 ) ; dao.removeLabel ( FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2 , vfsConfig.getLabels ( ) . iterator ( ) . next ( ) ) ; vfsConfig = dao.get ( FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2 ) ; checkLabels ( vfsConfig , 2 ) ; }

Target:
public void testRemoveLabel ( ) { org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig = dao.get ( FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2 ) ; checkLabels ( vfsConfig , 3 ) ; dao.removeLabel ( FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2 , vfsConfig.getNetworkLabels ( ) . iterator ( ) . next ( ) ) ; vfsConfig = dao.get ( FixturesTool.HOST_NIC_VFS_CONFIG_NOT_ALL_NETWORKS_ALLOWED_2 ) ; checkLabels ( vfsConfig , 2 ) ; }
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
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.GlusterVolumeSnapshotEntity > ( ) ; }
Source:
protected void ReadOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vm.getStaticData ( ) . setId ( new org.ovirt.engine.core.compat.Guid ( section.Attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { _vm.getStaticData ( ) . setos ( org.ovirt.engine.core.common.businessentities.VmOsType.valueOf ( node.InnerText ) ) ; } else { _vm.getStaticData ( ) . setos ( VmOsType.Unassigned ) ; } }

Target:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vm.getStaticData ( ) . setId ( new org.ovirt.engine.core.compat.Guid ( section.Attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { _vm.getStaticData ( ) . setos ( org.ovirt.engine.core.common.businessentities.VmOsType.valueOf ( node.InnerText ) ) ; } else { _vm.getStaticData ( ) . setos ( VmOsType.Unassigned ) ; } }
Source:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , java.lang.Boolean returnNull ) throws java.lang.Exception { org.ovirt.engine.api.model.Role role = null ; if ( ! returnNull ) { role = new org.ovirt.engine.api.model.Role ( ) ; role.setId ( entityId ) ; } setUpGetEntityExpectations ( VdcQueryType.GetRoleById , org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters.class , new java.lang.String [ ] { "RoleId" } , new java.lang.Object [ ] { entityId } , role ) ; }

Target:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , java.lang.Boolean returnNull ) throws java.lang.Exception { org.ovirt.engine.api.model.Role role = null ; if ( ! returnNull ) { role = new org.ovirt.engine.api.model.Role ( ) ; role.setId ( entityId ) ; } setUpGetEntityExpectations ( VdcQueryType.GetRoleById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { entityId } , role ) ; }
Source:
public void newNetwork ( ) { if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel networkModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.NewNetworkModel ( this ) ; setWindow ( networkModel ) ; networkModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) ) ; networkModel.getDataCenters ( ) . setSelectedItem ( getEntity ( ) ) ; }

Target:
public void edit ( ) { final org.ovirt.engine.core.common.businessentities.network.Network network = getSelectedItem ( ) ; if ( ( getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkModel networkModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.EditNetworkModel ( network , this ) ; setWindow ( networkModel ) ; networkModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) ) ; networkModel.getDataCenters ( ) . setSelectedItem ( getEntity ( ) ) ; }
Source:
public static void GetNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.GetAllNetworkQueryParamenters ( dataCenterId ) , aQuery ) ; }

Target:
public static void GetStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
private void validateReplacementsDoNotContainUnexpectedItems ( java.util.Collection < java.lang.String > replacements , java.util.List < java.lang.Object > items ) { java.util.Iterator < java.lang.String > iterator = replacements.iterator ( ) ; while ( iterator.hasNext ( ) ) { java.lang.String replacement = iterator.next ( ) ; for ( int i = ReplacementUtils.MAX_NUMBER_OF_PRINTED_ITEMS ; i < ( items.size ( ) ) ; i ++ ) { org.junit.Assert.assertFalse ( replacement.contains ( buildPropertyValue ( i ) ) ) ; } } }

Target:
private void validateReplacementsDoNotContainUnexpectedItems ( java.util.Collection < java.lang.String > replacements , java.util.List < java.lang.Object > items ) { java.util.Iterator < java.lang.String > iterator = replacements.iterator ( ) ; while ( iterator.hasNext ( ) ) { java.lang.String replacement = iterator.next ( ) ; for ( int i = ReplacementUtils.DEFAULT_MAX_NUMBER_OF_PRINTED_ITEMS ; i < ( items.size ( ) ) ; i ++ ) { org.junit.Assert.assertFalse ( replacement.contains ( buildPropertyValue ( i ) ) ) ; } } }
Source:
public void testDiskAttachedToAnyVM ( ) { org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.isDiskAttachedToAnyVm ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testDiskAttachedToAnyNonDownVM ( ) { org.junit.Assert.assertThat ( validator.isDiskAttachedToAnyNonDownVm ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public java.lang.Boolean getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { if ( ( selectedClusterGuid.contains ( object.getVdsGroupId ( ) ) ) || ( ( object.getMemSizeMB ( ) ) != null ) ) { return true ; } return false ; }

Target:
public java.lang.Boolean getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { if ( ( selectedClusterGuid.contains ( object.getVdsGroupId ( ) ) ) || ( ( ( object.getMemSizeMB ( ) ) != null ) && ( ( object.getVirtualCpu ( ) ) != null ) ) ) { if ( ! ( selectedClusterGuid.contains ( object.getVdsGroupId ( ) ) ) ) { selectedClusterGuid.add ( object.getVdsGroupId ( ) ) ; } return true ; } return false ; }