auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void executeQueryCommand ( ) { java.util.Map < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > , java.lang.Object > configValuesMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.queries.ConfigurationValues configValue : org.ovirt.engine.core.common.queries.ConfigurationValues.values ( ) ) { if ( ! ( shouldReturnValue ( configValue ) ) ) { continue ; } for ( java.lang.String version : org.ovirt.engine.core.bll.GetConfigurationValuesQuery.versions ) { populateValueForConfigValue ( configValue , version , configValuesMap ) ; } } org.ovirt.engine.core.bll.GetConfigurationValuesQuery.getQueryReturnValue ( ) . setReturnValue ( configValuesMap ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.Map < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.config.ConfigValues , java.lang.String > , java.lang.Object > configValuesMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.config.ConfigValues configValue : org.ovirt.engine.core.common.config.ConfigValues.values ( ) ) { if ( ! ( shouldReturnValue ( configValue ) ) ) { continue ; } for ( java.lang.String version : org.ovirt.engine.core.bll.GetConfigurationValuesQuery.versions ) { populateValueForConfigValue ( configValue , version , configValuesMap ) ; } } org.ovirt.engine.core.bll.GetConfigurationValuesQuery.getQueryReturnValue ( ) . setReturnValue ( configValuesMap ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) , null ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) , null ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; }

Target:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > cpuList = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.ServerCpu > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) ) ; return cpuList ; } return null ; }
Source:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public void hostNameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_VDS_WITH_SAME_HOST_EXIST ) ) ; }

Target:
public void hostNameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VDS_WITH_SAME_HOST_EXIST ) ) ; }
Source:
public static org.ovirt.engine.api.model.EntityExternalStatus map ( org.ovirt.engine.core.common.businessentities.ExternalStatus entityStatus , org.ovirt.engine.api.model.EntityExternalStatus template ) { switch ( entityStatus ) { case Ok : return org.ovirt.engine.api.model.EntityExternalStatus.OK ; case Info : return org.ovirt.engine.api.model.EntityExternalStatus.INFO ; case Warning : return org.ovirt.engine.api.model.EntityExternalStatus.WARNING ; case Error : return org.ovirt.engine.api.model.EntityExternalStatus.ERROR ; case Failure : return org.ovirt.engine.api.model.EntityExternalStatus.FAILURE ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.ExternalStatus map ( org.ovirt.engine.api.model.ExternalStatus status ) { switch ( status ) { case OK : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.ExternalStatus ; case INFO : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.ExternalStatus ; case WARNING : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.ExternalStatus ; case ERROR : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.ExternalStatus ; case FAILURE : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.ExternalStatus ; default : return null ; } }
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.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 ) ; }

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 ) ; bindPresenterWidget ( org.ovirt.engine.ui.common.presenter.ScrollableTabBarPresenterWidget.class , ScrollableTabBarPresenterWidget.ViewDef.class , org.ovirt.engine.ui.common.view.ScrollableTabBarView.class ) ; }
Source:
private void mockBackendQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValueMock = org.mockito.Mockito.when ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue.class ) . getReturnValue ( ) ) . thenReturn ( returnValue ) . getMock ( ) ; org.mockito.Mockito.when ( mockBackend.runPublicQuery ( org.mockito.ArgumentMatchers.eq ( queryType ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ) . thenReturn ( queryReturnValueMock ) ; }

Target:
private void mockBackendQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; queryReturnValue.setReturnValue ( returnValue ) ; org.mockito.Mockito.when ( mockBackend.runPublicQuery ( org.mockito.ArgumentMatchers.eq ( queryType ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ) . thenReturn ( queryReturnValue ) ; }
Source:
private java.lang.String readPasswordFile ( java.lang.String passwordFile ) throws java.io.FileNotFoundException , java.io.IOException { java.io.FileReader in = new java.io.FileReader ( passwordFile ) ; java.io.BufferedReader bufferedReader = new java.io.BufferedReader ( in ) ; java.lang.String readLine = bufferedReader.readLine ( ) ; org.ovirt.engine.core.utils.FileUtil.closeQuietly ( in , bufferedReader ) ; return readLine ; }

Target:
private java.lang.String readPasswordFile ( java.lang.String passwordFile ) throws java.io.FileNotFoundException , java.io.IOException { java.io.FileReader in = new java.io.FileReader ( passwordFile ) ; java.io.BufferedReader bufferedReader = new java.io.BufferedReader ( in ) ; java.lang.String readLine = bufferedReader.readLine ( ) ; org.ovirt.engine.core.domains.ManageDomains.closeQuietly ( in , bufferedReader ) ; return readLine ; }
Source:
public void testNicIsCorrectlyAllocatedInScopedPool ( ) throws java.lang.Exception { mockCluster ( cluster ) ; mockGettingAllMacPools ( macPool ) ; mockAllMacsForCluster ( cluster , vmNic.getMacAddress ( ) ) ; macPoolPerCluster.initialize ( ) ; org.junit.Assert.assertThat ( "scoped pool for this nic should exist" , getMacPool ( cluster.getId ( ) ) , org.hamcrest.CoreMatchers.is ( org.hamcrest.CoreMatchers.notNullValue ( ) ) ) ; org.junit.Assert.assertThat ( "provided mac should be used in returned pool" , getMacPool ( cluster.getId ( ) ) . isMacInUse ( vmNic.getMacAddress ( ) ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testNicIsCorrectlyAllocatedInScopedPool ( ) throws java.lang.Exception { mockCluster ( cluster ) ; mockGettingAllMacPools ( macPool ) ; mockUsedMacsInSystem ( macPool.getId ( ) , vmNic.getMacAddress ( ) ) ; macPoolPerCluster.initialize ( ) ; org.junit.Assert.assertThat ( "scoped pool for this nic should exist" , getMacPool ( cluster.getId ( ) ) , org.hamcrest.CoreMatchers.is ( org.hamcrest.CoreMatchers.notNullValue ( ) ) ) ; org.junit.Assert.assertThat ( "provided mac should be used in returned pool" , getMacPool ( cluster.getId ( ) ) . isMacInUse ( vmNic.getMacAddress ( ) ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
private boolean isOptionEnabledOnVolume ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , java.util.List < org.ovirt.engine.core.common.utils.ListUtils.PredicateFilter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > > predicates ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > volumeOptionsEnabled = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > ( volume.getOptions ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > filteredOptions = volumeOptionsEnabled ; for ( org.ovirt.engine.core.common.utils.ListUtils.PredicateFilter < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > predicate : predicates ) { filteredOptions = org.ovirt.engine.core.common.utils.ListUtils.filter ( filteredOptions , predicate ) ; } if ( ( filteredOptions.size ( ) ) > 0 ) { return true ; } return false ; }

Target:
private boolean isOptionEnabledOnVolume ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > predicate ) { return ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( volume.getOptions ( ) , predicate ) ) != null ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo option = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo ) ( obj ) ) ; return ( ( option.getKey ( ) . equals ( key ) ) && ( option.getDefaultValue ( ) . equals ( defaultValue ) ) ) && ( option.getDescription ( ) . equals ( description ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo option = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionInfo ) ( obj ) ) ; return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( option.getKey ( ) , key ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( option.getDefaultValue ( ) , defaultValue ) ) ; }
Source:
public void testFaultyMultipathSeveralReport ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; multipathHealthHandler.handleMultipathHealthReport ( vds , generateFaultyMultipathReport ( ) ) ; multipathHealthHandler.handleMultipathHealthReport ( vds , generateFaultyMultipathReport ( ) ) ; multipathHealthHandler.handleMultipathHealthReport ( vds , generateFaultyMultipathReport ( ) ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 1 ) ) . log ( org.mockito.ArgumentMatchers.any ( ) , logTypeCaptor.capture ( ) ) ; org.junit.Assert.assertTrue ( logTypeCaptor.getAllValues ( ) . contains ( AuditLogType.FAULTY_MULTIPATHS_ON_HOST ) ) ; }

Target:
public void testFaultyMultipathSeveralReport ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; multipathHealthHandler.handleMultipathHealthReport ( vds , generateFaultyMultipathReport ( ) ) ; multipathHealthHandler.handleMultipathHealthReport ( vds , generateFaultyMultipathReport ( ) ) ; multipathHealthHandler.handleMultipathHealthReport ( vds , generateFaultyMultipathReport ( ) ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 1 ) ) . log ( org.mockito.ArgumentMatchers.any ( ) , logTypeCaptor.capture ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( logTypeCaptor.getAllValues ( ) . contains ( AuditLogType.FAULTY_MULTIPATHS_ON_HOST ) ) ; }
Source:
protected void render ( java.lang.String value , boolean fireEvents ) { boolean isEmptyReplace = ( org.ovirt.engine.ui.uicompat.external.StringUtils.isEmpty ( value ) ) || ( value.equals ( nullReplacementText ) ) ; asSuggestBox ( ) . setValue ( ( isEmptyReplace ? nullReplacementText : value ) , fireEvents ) ; asSuggestBox ( ) . getElement ( ) . getStyle ( ) . setColor ( ( isEmptyReplace ? "gray" : "black" ) ) ; }

Target:
protected void render ( java.lang.String value , boolean fireEvents ) { boolean isEmptyReplace = ( org.ovirt.engine.ui.uicompat.external.StringUtils.isEmpty ( value ) ) || ( value.equals ( nullReplacementText ) ) ; asSuggestBox ( ) . setValue ( ( isEmptyReplace ? nullReplacementText : value ) , fireEvents ) ; grayOutPlaceholderText ( isEmptyReplace ) ; }
Source:
public static void getClusterListByName ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public static void getExternalProviderHostGroupList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalHostGroup > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostGroupsFromExternalProvider , params , aQuery ) ; }
Source:
public static void getAAAProfilesList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public void onFailure ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final java.lang.Throwable caught ) { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runAction: " + caught ) , caught ) ; failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null , state ) ; if ( callback != null ) { callback.executed ( f ) ; } org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent.fire ( this , state ) ; }

Target:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.lang.Throwable caught ) { try { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleQueries: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; failureEventHandler ( caught ) ; callback.executed ( f ) ; } finally { fireAsyncQueryFailedEvent ( state ) ; } }
Source:
private void commitLabelChanges ( org.ovirt.engine.ui.uicommonweb.models.hosts.NicLabelModel labelModel , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > potentialNetworks ) { labelModel.commit ( iface ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ifaceModel = nicMap.get ( iface.getName ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.clearNetworks ( ifaceModel , allNics ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.attachNetworks ( ifaceModel , new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( potentialNetworks ) , allNics ) ; }

Target:
private void commitLabelChanges ( org.ovirt.engine.ui.uicommonweb.models.hosts.PfNicLabelModel labelModel , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > potentialNetworks ) { labelModel.commit ( iface ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ifaceModel = nicMap.get ( iface.getName ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.clearNetworks ( ifaceModel , allNics ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.attachNetworks ( ifaceModel , new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( potentialNetworks ) , allNics ) ; }
Source:
public void qosValuesModified ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; iface.setQosOverridden ( true ) ; mockExistingIfaces ( iface ) ; iface.setQos ( createQos ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_4 ) ; validateAndAssertNetworkModified ( helper , network ) ; }

Target:
public void qosValuesModified ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosValuesTest ( network , createQos ( ) ) ; validateAndAssertNetworkModified ( helper , network ) ; }
Source:
public static void GetClusterDesktopMemoryOverCommit ( 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.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit ) , aQuery ) ; }

Target:
public static void GetClusterServerMemoryOverCommit ( 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.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers ) , aQuery ) ; }
Source:
private void handleConnectAutomatically ( ) { if ( ( model.getCanConnectAutomatically ( ) ) && ( ! ( alreadyOpened ) ) ) { 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 ) { connect ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getIsPasswordDelegationPossible ( asyncQuery ) ; } }

Target:
private void handleConnectAutomatically ( ) { if ( ( model.getCanConnectAutomatically ( ) ) && ( ! ( alreadyOpened ) ) ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getIsPasswordDelegationPossible ( new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.Boolean > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Boolean returnValue ) { connect ( returnValue ) ; } } ) ) ; } }
Source:
private void updateVmsOfInstanceType ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getTemplateType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsToUpdate = org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmDAO ( ) . getVmsListByInstanceType ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsToUpdate ) { org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( vm ) ; params.setApplyChangesLater ( true ) ; runInternalAction ( VdcActionType.UpdateVm , params ) ; } }

Target:
private void updateVmsOfInstanceType ( ) { if ( ! ( isInstanceType ( ) ) ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsToUpdate = org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmDAO ( ) . getVmsListByInstanceType ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsToUpdate ) { org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( vm ) ; params.setApplyChangesLater ( true ) ; runInternalAction ( VdcActionType.UpdateVm , params ) ; } }
Source:
protected void endWithFailure ( ) { if ( isVmRunningStateless ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , buildCreateSnapshotParametersForEndAction ( ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }

Target:
protected void endWithFailure ( ) { if ( isStatelessSnapshotExistsForVm ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , buildCreateSnapshotParametersForEndAction ( ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }
Source:
public void hostProviderTypeDoesNotMatch ( ) { org.mockito.Mockito.when ( host.getHostProviderId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.Provider provider = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Provider.class ) ; org.mockito.Mockito.when ( provider.getType ( ) ) . thenReturn ( ProviderType.OPENSTACK_IMAGE ) ; org.mockito.Mockito.when ( providerDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( provider ) ; org.junit.Assert.assertThat ( validator.hostProviderTypeMatches ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_HOST_PROVIDER_TYPE_MISMATCH ) ) ; }

Target:
public void hostProviderTypeDoesNotMatch ( ) { org.mockito.Mockito.when ( host.getHostProviderId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.Provider provider = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Provider.class ) ; org.mockito.Mockito.when ( provider.getType ( ) ) . thenReturn ( ProviderType.OPENSTACK_IMAGE ) ; org.mockito.Mockito.when ( providerDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( provider ) ; org.hamcrest.MatcherAssert.assertThat ( validator.hostProviderTypeMatches ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_HOST_PROVIDER_TYPE_MISMATCH ) ) ; }
Source:
public javax.ws.rs.core.Response remove ( java.lang.String id , org.ovirt.engine.api.model.Action action ) { getEntity ( id ) ; if ( ( action.isSetDetach ( ) ) && ( action.isDetach ( ) ) ) { return performAction ( VdcActionType.DetachDiskFromVm , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( parentId , org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( id ) ) ) ; } else { return remove ( id ) ; } }

Target:
public javax.ws.rs.core.Response deprecatedRemove ( java.lang.String id , org.ovirt.engine.api.model.Action action ) { getEntity ( id ) ; if ( ( action.isSetDetach ( ) ) && ( action.isDetach ( ) ) ) { return performAction ( VdcActionType.DetachDiskFromVm , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( parentId , org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( id ) ) ) ; } else { return remove ( id ) ; } }
Source:
protected void executeCommand ( ) { if ( ( ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) != null ) && ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.CanRemoveVmPoolWithoutReasons ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . remove ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) ; org.ovirt.engine.core.bll.RemoveVmPoolCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { if ( ( ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) != null ) && ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.canRemoveVmPoolWithoutReasons ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . remove ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) ; org.ovirt.engine.core.bll.RemoveVmPoolCommand.setSucceeded ( true ) ; } }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Permission model , int index ) { super . verifyModel ( model , index ) ; assertTrue ( model.isSetUser ( ) ) ; assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getUser ( ) . getId ( ) ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Permission model , int index ) { super . verifyModel ( model , index ) ; if ( index == 0 ) { assertTrue ( model.isSetUser ( ) ) ; assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getUser ( ) . getId ( ) ) ; } else { assertTrue ( model.isSetGroup ( ) ) ; assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getGroup ( ) . getId ( ) ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentByIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentByIdQuery.getDbFacade ( ) . getNetworkAttachmentDao ( ) . get ( org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentByIdQuery.getParameters ( ) . getId ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid networkAttachmentId = org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentByIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = networkAttachmentDao.get ( networkAttachmentId ) ; if ( networkAttachment != null ) { fillReportedConfigurations ( networkAttachment ) ; } org.ovirt.engine.core.bll.network.host.GetNetworkAttachmentByIdQuery.getQueryReturnValue ( ) . setReturnValue ( networkAttachment ) ; }
Source:
public void testRefreshUserSessionAfterExpiration ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , true ) ; org.junit.Assert.assertNull ( "Get should return null since the session wasn't refresh" , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; }

Target:
public void testRefreshUserSessionAfterExpiration ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , true ) ; org.junit.Assert.assertNull ( "Get should return null since the session wasn't refresh" , container.getData ( org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.aaa.SessionDataContainerTest.USER , false ) ) ; }
Source:
public javax.ws.rs.core.Response performRemove ( java.lang.String id ) { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( id ) ) ; org.ovirt.engine.core.common.action.RemoveVmFromImportExportParamenters params = new org.ovirt.engine.core.common.action.RemoveVmFromImportExportParamenters ( vm , storageDomainId , getDataCenterId ( storageDomainId ) ) ; return performAction ( VdcActionType.RemoveVmFromImportExport , params ) ; }

Target:
public javax.ws.rs.core.Response performRemove ( java.lang.String id ) { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( id ) ) ; org.ovirt.engine.core.common.action.RemoveVmFromImportExportParamenters params = new org.ovirt.engine.core.common.action.RemoveVmFromImportExportParamenters ( vm , storageDomainId , getDataCenterId ( storageDomainId ) ) ; return performAction ( VdcActionType.RemoveVmFromImportExport , params ) ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > getImagesParameters ( ) { if ( ( imagesParameters ) == null ) { imagesParameters = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; } return imagesParameters ; }

Target:
public boolean getTaskGroupSuccess ( ) { boolean childrenTasksSuccess = taskGroupSuccess ; if ( ( imagesParameters ) != null ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase childParameters : imagesParameters ) { childrenTasksSuccess &= childParameters.getTaskGroupSuccess ( ) ; if ( ! childrenTasksSuccess ) { break ; } } } return childrenTasksSuccess ; }
Source:
public void testAttributeOnlyOutput ( ) { java.lang.String attributeName = "attr1" ; int attributeValue = 100 ; java.lang.String expected = ( ( ToStringBuilder.ATTRIBUTES_LIST_PREFIX ) + ( createFirstAttributeOutput ( attributeName , java.lang.String.valueOf ( attributeValue ) ) ) ) + ( ToStringBuilder.ATTRIBUTES_LIST_SUFFIX ) ; org.junit.Assert.assertEquals ( expected , org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( null ) . append ( attributeName , attributeValue ) . build ( ) ) ; }

Target:
public void testAttributeOnlyOutput ( ) { java.lang.String attributeName = "attr1" ; int attributeValue = 100 ; java.lang.String expected = ( ( ToStringBuilder.ATTRIBUTES_LIST_PREFIX ) + ( createFirstAttributeOutput ( attributeName , java.lang.String.valueOf ( attributeValue ) ) ) ) + ( ToStringBuilder.ATTRIBUTES_LIST_SUFFIX ) ; org.junit.jupiter.api.Assertions.assertEquals ( expected , org.ovirt.engine.core.common.utils.ToStringBuilder.forInstance ( null ) . append ( attributeName , attributeValue ) . build ( ) ) ; }
Source:
public void testAllDomainsHaveSpaceForNewDisksSuccess ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }

Target:
public void testAllDomainsHaveSpaceForAllDisksSuccess ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForAllDisks ( org.mockito.Matchers.eq ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.DiskImage > emptyList ( ) ) , org.mockito.Matchers.anyList ( ) ) ; }
Source:
private void updateSnapshotsFromExport ( ) { if ( ( getVm ( ) . getSnapshots ( ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : getVm ( ) . getSnapshots ( ) ) { if ( getSnapshotDao ( ) . exists ( getVm ( ) . getId ( ) , snapshot.getId ( ) ) ) { getSnapshotDao ( ) . update ( snapshot ) ; } else { getSnapshotDao ( ) . save ( snapshot ) ; } } } }

Target:
protected void saveSnapshotIfNotExists ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { if ( ! ( getSnapshotDao ( ) . exists ( getVm ( ) . getId ( ) , snapshotId ) ) ) { getSnapshotDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.Snapshot ( snapshotId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , getVm ( ) . getId ( ) , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR , disk.getdescription ( ) , disk.getlast_modified_date ( ) , disk.getappList ( ) ) ) ; } }
Source:
public static void getHostById ( 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.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
private void initSorting ( ) { hostStatus.makeSortable ( ) ; nameColumn.makeSortable ( ) ; clusterColumn.makeSortable ( ) ; dcColumn.makeSortable ( ) ; speedColumn.makeSortable ( ) ; }

Target:
private void initSorting ( ) { hostStatus.makeSortable ( ) ; nameColumn.makeSortable ( ) ; clusterColumn.makeSortable ( ) ; dcColumn.makeSortable ( ) ; nicStatusColumn.makeSortable ( new org.ovirt.engine.ui.common.widget.table.column.SimpleStatusColumnComparator < org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface , org.ovirt.engine.core.common.businessentities.VDS > > ( nicStatusColumn ) ) ; speedColumn.makeSortable ( ) ; }
Source:
public static void GetSpiceUsbAutoShare ( 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.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getSpiceUsbAutoShare ( 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.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void checkStorageDomainNotEqualWithStatusActive ( ) { setStorageDomainStatus ( StorageDomainStatus.Active ) ; org.junit.Assert.assertFalse ( cmd.checkStorageDomainStatusNotEqual ( StorageDomainStatus.Active ) ) ; java.util.List < java.lang.String > messages = cmd.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertEquals ( messages.size ( ) , 2 ) ; org.junit.Assert.assertEquals ( messages.get ( 0 ) , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2.toString ( ) ) ; org.junit.Assert.assertEquals ( messages.get ( 1 ) , java.lang.String.format ( "$status %1$s" , StorageDomainStatus.Active ) ) ; }

Target:
public void checkStorageDomainNotEqualWithStatusActive ( ) { setStorageDomainStatus ( StorageDomainStatus.Active ) ; org.junit.Assert.assertFalse ( cmd.checkStorageDomainStatusNotEqual ( StorageDomainStatus.Active ) ) ; java.util.List < java.lang.String > messages = cmd.getReturnValue ( ) . getValidationMessages ( ) ; org.junit.Assert.assertEquals ( messages.size ( ) , 2 ) ; org.junit.Assert.assertEquals ( messages.get ( 0 ) , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2.toString ( ) ) ; org.junit.Assert.assertEquals ( messages.get ( 1 ) , java.lang.String.format ( "$status %1$s" , StorageDomainStatus.Active ) ) ; }
Source:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , 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 ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getHostById ( 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.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }