auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private com.google.gwt.user.client.ui.IsWidget createLinkStatusPanel ( boolean isLinked ) { org.ovirt.engine.ui.common.widget.uicommon.vm.IconStatusPanel iconStatusPanel = new org.ovirt.engine.ui.common.widget.uicommon.vm.IconStatusPanel ( ( isLinked ? org.gwtbootstrap3.client.ui.constants.IconType.ARROW_CIRCLE_O_UP : org.gwtbootstrap3.client.ui.constants.IconType.ARROW_CIRCLE_O_DOWN ) ) ; iconStatusPanel.addStyleName ( org.ovirt.engine.ui.common.widget.uicommon.vm.DOUBLE_SIZE ) ; iconStatusPanel.getElement ( ) . getStyle ( ) . setColor ( ( isLinked ? GREEN : RED ) ) ; return iconStatusPanel ; }

Target:
private com.google.gwt.user.client.ui.IsWidget createLinkStatusPanel ( boolean isLinked ) { org.ovirt.engine.ui.common.widget.uicommon.vm.IconStatusPanel iconStatusPanel = new org.ovirt.engine.ui.common.widget.uicommon.vm.IconStatusPanel ( ( isLinked ? org.gwtbootstrap3.client.ui.constants.IconType.ARROW_CIRCLE_O_UP : org.gwtbootstrap3.client.ui.constants.IconType.ARROW_CIRCLE_O_DOWN ) ) ; iconStatusPanel.addStyleName ( org.ovirt.engine.ui.common.widget.uicommon.vm.DOUBLE_SIZE ) ; iconStatusPanel.getElement ( ) . getStyle ( ) . setColor ( ( isLinked ? GREEN : RED ) ) ; java.lang.String tooltipText = ( isLinked ) ? org.ovirt.engine.ui.common.widget.uicommon.vm.VmInterfaceListGroupItem.constants.linkedNetworkInterface ( ) : org.ovirt.engine.ui.common.widget.uicommon.vm.VmInterfaceListGroupItem.constants.unlinkedNetworkInterface ( ) ; org.ovirt.engine.ui.common.widget.tooltip.WidgetTooltip tooltip = new org.ovirt.engine.ui.common.widget.tooltip.WidgetTooltip ( iconStatusPanel ) ; tooltip.setHtml ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( tooltipText ) ) ; return tooltip ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getHostPublicKey ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testGetManagementNetworkWhenInstancesContainOne ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( true , "a" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = java.util.Arrays.asList ( network , createNetwork ( false , "b" ) ) ; org.junit.Assert.assertThat ( underTest.getManagementNetwork ( networks , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , org.hamcrest.CoreMatchers.is ( network ) ) ; }

Target:
public void testGetManagementNetworkWhenInstancesContainOne ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( true , "a" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = java.util.Arrays.asList ( network , createNetwork ( false , "b" ) ) ; org.hamcrest.MatcherAssert.assertThat ( underTest.getManagementNetwork ( networks , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , org.hamcrest.CoreMatchers.is ( network ) ) ; }
Source:
public static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }

Target:
public static void getTemplateDiskList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
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.StorageDomain > allStorageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > isoStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : allStorageDomains ) { if ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { isoStorageDomains.add ( storageDomain ) ; } } return isoStorageDomains ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; }

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.StorageDomain > allStorageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > isoStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : allStorageDomains ) { if ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { isoStorageDomains.add ( storageDomain ) ; } } return isoStorageDomains ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; }
Source:
public void testGetNetworkNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; java.util.List < org.ovirt.engine.api.restapi.resource.Network > entities = new java.util.ArrayList < > ( ) ; setUpEntityQueryExpectations ( QueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , entities ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNetworkNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; java.util.List < org.ovirt.engine.api.restapi.resource.Network > entities = new java.util.ArrayList < > ( ) ; setUpEntityQueryExpectations ( QueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , entities ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { 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.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { if ( ( object.getMemSizeMB ( ) ) == null ) { return "" ; } else if ( object.getMemSizeMB ( ) . equals ( QuotaVdsGroup.UNLIMITED_MEM ) ) { return messages.unlimitedMemConsumption ( object.getMemSizeMBUsage ( ) ) ; } else { return messages.limitedMemConsumption ( object.getMemSizeMBUsage ( ) , object.getMemSizeMB ( ) ) ; } }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup object ) { if ( ( object.getMemSizeMB ( ) ) == null ) { return "" ; } else if ( object.getMemSizeMB ( ) . equals ( QuotaVdsGroup.UNLIMITED_MEM ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.QuotaPopupView.messages.unlimitedMemConsumption ( object.getMemSizeMBUsage ( ) ) ; } else { return org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.QuotaPopupView.messages.limitedMemConsumption ( object.getMemSizeMBUsage ( ) , object.getMemSizeMB ( ) ) ; } }
Source:
public void changeStateOfElementsWhenAccessIsForEveryone ( boolean isEveryone ) { profileSelection.setEnabled ( ( ! isEveryone ) ) ; searchStringEditor.setEnabled ( ( ! isEveryone ) ) ; searchButton.getCommand ( ) . setIsExecutionAllowed ( ( ! isEveryone ) ) ; searchItems.setVisible ( ( ! isEveryone ) ) ; }

Target:
public void changeStateOfElementsWhenAccessIsForEveryoneOrMyGroups ( boolean isEveryone , boolean isMyGroups ) { boolean isEveryoneOrMyGroups = isEveryone || isMyGroups ; profileSelection.setEnabled ( ( ! isEveryoneOrMyGroups ) ) ; namespaceSelection.setEnabled ( ( ! isEveryoneOrMyGroups ) ) ; searchStringEditor.setEnabled ( ( ! isEveryoneOrMyGroups ) ) ; searchButton.getCommand ( ) . setIsExecutionAllowed ( ( ! isEveryoneOrMyGroups ) ) ; searchItems.setVisible ( ( ! isEveryone ) ) ; }
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 returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return returnValue == null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ( ) : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ) ( returnValue ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getBehavior ( ) . updateTimeZone ( ) ; }

Target:
public void setDataCentersAndClusters ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters , java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters , org.ovirt.engine.core.compat.NGuid selectedCluster ) { if ( ( ( model.getBehavior ( ) . getSystemTreeSelectedItem ( ) ) != null ) && ( ( model.getBehavior ( ) . getSystemTreeSelectedItem ( ) . getType ( ) ) != ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.System ) ) ) { setupDataCenterWithClustersFromSystemTree ( model , dataCenters , clusters , selectedCluster ) ; } else { setupDataCenterWithClusters ( model , dataCenters , clusters , selectedCluster ) ; } }
Source:
public int hashCode ( ) { int result = id.hashCode ( ) ; result = ( 31 * result ) + ( hostId.hashCode ( ) ) ; result = ( 31 * result ) + ( iqn.hashCode ( ) ) ; result = ( 31 * result ) + ( userName.hashCode ( ) ) ; result = ( 31 * result ) + ( password.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( id , hostId , iqn , userName , password ) ; }
Source:
public void setCurrentRefreshRate ( int newRefreshRate ) { saveRefreshRate ( newRefreshRate ) ; getModelTimer ( ) . setRefreshRate ( readRefreshRate ( ) ) ; updateTimer ( ) ; }

Target:
private void updateController ( ) { this . controller = modelProvider.getModel ( ) ; org.ovirt.engine.ui.uicommonweb.models.GridTimer modelTimer = getModelTimer ( ) ; modelTimer.setRefreshRate ( readRefreshRate ( ) ) ; modelTimer.addValueChangeHandler ( new com.google.gwt.event.logical.shared.ValueChangeHandler < java.lang.String > ( ) { @ java.lang.Override public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { onRefresh ( event.getValue ( ) ) ; } } ) ; }
Source:
public void testDedicatedHostNotExistOrNotSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isDedicatedVdsExistOnSameCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmBase.class ) , org.mockito.Matchers.any ( java.util.ArrayList.class ) ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; }

Target:
public void testDedicatedHostNotExistOrNotSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isDedicatedVdsExistOnSameCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmBase.class ) , org.mockito.Matchers.any ( java.util.ArrayList.class ) ) ; vmStatic.setDedicatedVmForVdsList ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.NetworkCluster mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.NetworkCluster entity = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; entity.setcluster_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "cluster_id" ) ) ) ; entity.setnetwork_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "network_id" ) ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setis_display ( rs.getBoolean ( "is_display" ) ) ; entity.setRequired ( rs.getBoolean ( "required" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkCluster mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.NetworkCluster entity = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; entity.setClusterId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "cluster_id" ) ) ) ; entity.setNetworkId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "network_id" ) ) ) ; entity.setStatus ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setDisplay ( rs.getBoolean ( "is_display" ) ) ; entity.setRequired ( rs.getBoolean ( "required" ) ) ; return entity ; }
Source:
protected void connectAllHostToPoolAndDomain ( final org.ovirt.engine.core.common.businessentities.StorageDomain masterDomain ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand.getAllRunningVdssInPool ( ) ; final org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand.getStoragePool ( ) ; org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations sync = new org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations ( vdsList.size ( ) , null , new org.ovirt.engine.core.bll.storage.ActivateDeactivateSingleAsyncOperationFactory ( ) { @ java.lang.Override public org.ovirt.engine.core.utils.ISingleAsyncOperation createSingleAsyncOperation ( ) { return new org.ovirt.engine.core.bll.storage.ConntectVDSToPoolAndDomains ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( vdsList ) ) , masterDomain , storagePool ) ; } @ java.lang.Override public void initialize ( java.util.ArrayList parameters ) { } } ) ; sync.Execute ( ) ; }

Target:
protected void connectAllHostToPoolAndDomain ( final org.ovirt.engine.core.common.businessentities.StorageDomain masterDomain ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand.getAllRunningVdssInPool ( ) ; final org.ovirt.engine.core.common.businessentities.StoragePool storagePool = org.ovirt.engine.core.bll.storage.RemoveStoragePoolCommand.getStoragePool ( ) ; org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations sync = new org.ovirt.engine.core.utils.SyncronizeNumberOfAsyncOperations ( vdsList.size ( ) , null , new org.ovirt.engine.core.bll.storage.ActivateDeactivateSingleAsyncOperationFactory ( ) { @ java.lang.Override public org.ovirt.engine.core.utils.ISingleAsyncOperation createSingleAsyncOperation ( ) { return new org.ovirt.engine.core.bll.storage.ConntectVDSToPoolAndDomains ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( vdsList ) ) , masterDomain , storagePool ) ; } @ java.lang.Override public void initialize ( java.util.ArrayList parameters ) { } } ) ; sync.execute ( ) ; }
Source:
protected org.ovirt.engine.api.model.StorageDomain getInverse ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic to ) { org.ovirt.engine.api.model.StorageDomain inverse = new org.ovirt.engine.api.model.StorageDomain ( ) ; inverse.setId ( to.getId ( ) ) ; inverse.setStorageName ( to.getstorage_name ( ) ) ; inverse.setStorageDomainType ( to.getstorage_domain_type ( ) ) ; inverse.setStorageType ( to.getstorage_type ( ) ) ; inverse.setStorageFormat ( to.getStorageFormat ( ) ) ; return inverse ; }

Target:
protected org.ovirt.engine.api.model.StorageDomain getInverse ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic to ) { org.ovirt.engine.api.model.StorageDomain inverse = new org.ovirt.engine.api.model.StorageDomain ( ) ; inverse.setId ( to.getId ( ) ) ; inverse.setStorageName ( to.getStorageName ( ) ) ; inverse.setStorageDomainType ( to.getStorageDomainType ( ) ) ; inverse.setStorageType ( to.getStorageType ( ) ) ; inverse.setStorageFormat ( to.getStorageFormat ( ) ) ; return inverse ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ( getrdp ( ) . getDisconnectedEvent ( ) ) != null ) && ( ev.equals ( getrdp ( ) . getDisconnectedEvent ( ) ) ) ) { Rdp_Disconnected ( sender , ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs ) ( args ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ( getrdp ( ) . getDisconnectedEvent ( ) ) != null ) && ( ev.equals ( getrdp ( ) . getDisconnectedEvent ( ) ) ) ) { rdp_Disconnected ( sender , ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs ) ( args ) ) ) ; } }
Source:
public void AutoLogin ( org.ovirt.engine.core.common.users.VdcUser user ) { loggingInAutomatically = true ; getUserName ( ) . setEntity ( user.getUserName ( ) ) ; getDomain ( ) . setSelectedItem ( user.getDomainControler ( ) ) ; disableLoginScreen ( ) ; setLoggedUser ( user ) ; getLoggedInEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
protected void raiseLoggedInEvent ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CacheConfigValues ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( target ) ) ; loginModel.getLoggedInEvent ( ) . raise ( this , EventArgs.Empty ) ; } } ) ) ; }
Source:
public void getRpmVersion ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getIsPasswordDelegationPossible ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { final org.ovirt.engine.ui.frontend.INewAsyncCallback chainedCallback = asyncQuery.asyncCallback ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { chainedCallback.onSuccess ( model , ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsPasswordDelegationPossible , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , asyncQuery ) ; }
Source:
public void canDoActionFailsOnNullHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void validateFailsOnNullHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; log.error ( "Failed deleting disk from Cinder. ID: {}" , getDiskId ( ) ) ; if ( getCommand ( ) . getParameters ( ) . getShouldBeLogged ( ) ) { new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( getCommand ( ) , AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ) ; } org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( getDiskId ( ) , ImageStatus.ILLEGAL ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onSucceeded ( cmdId , childCmdIds ) ; log.info ( "Volume/Snapshot has been successfully deleted from Cinder. ID: {}" , getDiskId ( ) ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }
Source:
private void mockGetStorageDomainInfoVdsCommand ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.StorageDomainStatic , org.ovirt.engine.core.compat.Guid > pairResult = new org.ovirt.engine.core.common.utils.Pair ( storageDomain , null ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValueForGetStorageDomainInfo = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValueForGetStorageDomainInfo.setSucceeded ( true ) ; returnValueForGetStorageDomainInfo.setReturnValue ( pairResult ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.HSMGetStorageDomainInfo ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ) . thenReturn ( returnValueForGetStorageDomainInfo ) ; }

Target:
private void mockGetStorageDomainInfoVdsCommand ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomain ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.StorageDomainStatic , org.ovirt.engine.core.compat.Guid > pairResult = new org.ovirt.engine.core.common.utils.Pair ( storageDomain , null ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValueForGetStorageDomainInfo = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValueForGetStorageDomainInfo.setSucceeded ( true ) ; returnValueForGetStorageDomainInfo.setReturnValue ( pairResult ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.HSMGetStorageDomainInfo ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ) . thenReturn ( returnValueForGetStorageDomainInfo ) ; }
Source:
public void canDoActionFailureNotExists ( ) { org.ovirt.engine.core.bll.ValidationResult result = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( result ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; }

Target:
public void canDoActionFailureNotExists ( ) { org.ovirt.engine.core.bll.ValidationResult result = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( result ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; }
Source:
public void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { 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.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
private void runQueryByIdParameter ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.AsIsAsyncConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( queryType , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.RemoveQuotaCommand createCommand ( ) { org.ovirt.engine.core.common.action.QuotaCRUDParameters param = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( ) ; param.setQuotaId ( generalGuidQuota ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveQuotaCommand ( param ) ) ; org.mockito.Mockito.doReturn ( storagePoolDAO ) . when ( command ) . getStoragePoolDAO ( ) ; org.mockito.Mockito.doReturn ( quotaDAO ) . when ( command ) . getQuotaDAO ( ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDAO ) ; return command ; }

Target:
private org.ovirt.engine.core.bll.RemoveQuotaCommand createCommand ( ) { org.ovirt.engine.core.common.action.QuotaCRUDParameters param = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( ) ; param.setQuotaId ( generalGuidQuota ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveQuotaCommand ( param ) ) ; org.mockito.Mockito.doReturn ( storagePoolDAO ) . when ( command ) . getStoragePoolDAO ( ) ; org.mockito.Mockito.doReturn ( quotaDAO ) . when ( command ) . getQuotaDAO ( ) ; org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; return command ; }
Source:
public static void GetExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }

Target:
public static void GetGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmImageDisks ( ) { if ( ( cachedVmImageDisks ) == null ) { cachedVmImageDisks = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( getVmDisks ( ) , true , false , false ) ; cachedVmImageDisks.addAll ( org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( getVmDisks ( ) , true ) ) ; } return cachedVmImageDisks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmImageDisks ( ) { if ( ( cachedVmImageDisks ) == null ) { cachedVmImageDisks = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( getVmDisks ( ) , true , false , false ) ; cachedVmImageDisks.addAll ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterDisksBasedOnCinder ( getVmDisks ( ) , true ) ) ; } return cachedVmImageDisks ; }
Source:
public void canDoActionFailedVMHasNotDisk ( ) throws java.lang.Exception { initializeCommand ( ) ; mockVmStatusDown ( ) ; createNullDisk ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }

Target:
private void initializeCommand ( org.ovirt.engine.core.common.action.UpdateVmDiskParameters params ) { initializeCommand ( params , java.util.Collections.singletonList ( createVmStatusDown ( ) ) ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsedByHosts ( final org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostsWithNetwork = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVdsDAO ( ) . getAllForNetwork ( network.getId ( ) ) ; if ( hostsWithNetwork.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "ENTITIES_USING_NETWORK" , hostsWithNetwork ) ; replacements.add ( VdcBllMessages.VAR__TYPE__HOSTS.name ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_IN_USE , replacements ) ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsedByVms ( final org.ovirt.engine.core.common.businessentities.network.Network network ) { return networkNotUsed ( org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVmDAO ( ) . getAllForNetwork ( network.getId ( ) ) , VdcBllMessages.VAR__ENTITIES__VMS ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query ) throws java.lang.Exception { setUpQueryExpectations ( query , null ) ; }

Target:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }
Source:
public void insufficientDiskSpace ( ) { final int lotsOfSpaceRequired = 1073741824 ; final org.ovirt.engine.core.bll.ImportVmTemplateCommand c = setupDiskSpaceTest ( lotsOfSpaceRequired ) ; org.junit.Assert.assertFalse ( c.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( c.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW.toString ( ) ) ) ; }

Target:
public void insufficientDiskSpace ( ) { final int lotsOfSpaceRequired = 1073741824 ; final org.ovirt.engine.core.bll.ImportVmTemplateCommand c = setupDiskSpaceTest ( lotsOfSpaceRequired ) ; org.junit.Assert.assertFalse ( c.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( c.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }
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 GetVmById ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( vmId ) , aQuery ) ; }
Source:
public static void addCustomDrlFiles ( org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig config , java.util.List < java.io.File > customDrlFiles ) { if ( ( config.getScoreDrlFileList ( ) ) != null ) { config.getScoreDrlFileList ( ) . addAll ( customDrlFiles ) ; } else { config.setScoreDrlFileList ( customDrlFiles ) ; } }

Target:
public static void addCustomDrlFiles ( org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig config , java.util.List < java.nio.file.Path > customDrlFiles ) { java.util.List < java.io.File > fileCollection = customDrlFiles.stream ( ) . map ( java.nio.file.Path :: toFile ) . collect ( java.util.stream.Collectors.toList ( ) ) ; if ( ( config.getScoreDrlFileList ( ) ) != null ) { config.getScoreDrlFileList ( ) . addAll ( fileCollection ) ; } else { config.setScoreDrlFileList ( fileCollection ) ; } }
Source:
public java.lang.String getFingerprint ( java.lang.String hostName ) { org.ovirt.engine.core.utils.ssh.EngineSSHClient client = null ; try { client = connect ( hostName ) ; return client.getHostFingerprint ( ) ; } catch ( java.io.IOException e ) { log.error ( "Could not get server key" ) ; return null ; } finally { if ( client != null ) { client.disconnect ( ) ; } } }

Target:
public java.lang.String getFingerprint ( java.lang.String hostName ) { org.ovirt.engine.core.bll.utils.EngineSSHClient client = null ; try { client = connect ( hostName ) ; return client.getHostFingerprint ( ) ; } catch ( java.io.IOException e ) { log.error ( "Could not get server key" ) ; return null ; } finally { if ( client != null ) { client.disconnect ( ) ; } } }
Source:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( _vds.getstatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getvds_name ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warnFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getvds_name ( ) , e.getMessage ( ) ) ; } }

Target:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( _vds.getStatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getVdsName ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warnFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getVdsName ( ) , e.getMessage ( ) ) ; } }
Source:
private void migrateMacs ( org.ovirt.engine.core.compat.Guid oldMacPoolId , org.ovirt.engine.core.compat.Guid newMacPoolId , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { java.util.List < java.lang.String > vmInterfaceMacs = vmNicDao.getAllMacsByClusterId ( clusterId ) ; java.util.Objects.requireNonNull ( vmInterfaceMacs ) ; org.ovirt.engine.core.bll.network.macpool.MacPool sourcePool = poolPerCluster.getMacPoolById ( oldMacPoolId , commandContext ) ; org.ovirt.engine.core.bll.network.macpool.MacPool targetPool = poolPerCluster.getMacPoolById ( newMacPoolId , commandContext ) ; for ( java.lang.String mac : vmInterfaceMacs ) { sourcePool.freeMac ( mac ) ; targetPool.forceAddMac ( mac ) ; } }

Target:
private void migrateMacsToAnotherMacPool ( org.ovirt.engine.core.compat.Guid sourceMacPoolId , org.ovirt.engine.core.compat.Guid targetMacPoolId , java.util.List < java.lang.String > macsToMigrate , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { java.util.Objects.requireNonNull ( macsToMigrate ) ; org.ovirt.engine.core.bll.network.macpool.MacPool sourcePool = poolPerCluster.getMacPoolById ( sourceMacPoolId , commandContext ) ; org.ovirt.engine.core.bll.network.macpool.MacPool targetPool = poolPerCluster.getMacPoolById ( targetMacPoolId , commandContext ) ; for ( java.lang.String mac : macsToMigrate ) { sourcePool.freeMac ( mac ) ; targetPool.forceAddMac ( mac ) ; } }
Source:
private org.ovirt.engine.core.common.action.LiveMigrateDiskParameters createLiveMigrateDiskParameters ( org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters , org.ovirt.engine.core.compat.Guid vmId ) { return new org.ovirt.engine.core.common.action.LiveMigrateDiskParameters ( moveDiskParameters.getImageId ( ) , moveDiskParameters.getSourceDomainId ( ) , moveDiskParameters.getStorageDomainId ( ) , vmId , moveDiskParameters.getQuotaId ( ) , moveDiskParameters.getDiskProfileId ( ) , org.ovirt.engine.core.bll.storage.disk.MoveDiskCommand.getParameters ( ) . getImageGroupID ( ) ) ; }

Target:
private org.ovirt.engine.core.common.action.LiveMigrateDiskParameters createLiveMigrateDiskParameters ( org.ovirt.engine.core.common.action.MoveDiskParameters moveDiskParameters , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.action.LiveMigrateDiskParameters params = new org.ovirt.engine.core.common.action.LiveMigrateDiskParameters ( moveDiskParameters.getImageId ( ) , moveDiskParameters.getSourceDomainId ( ) , moveDiskParameters.getStorageDomainId ( ) , vmId , moveDiskParameters.getQuotaId ( ) , moveDiskParameters.getDiskProfileId ( ) , org.ovirt.engine.core.bll.storage.disk.MoveDiskCommand.getParameters ( ) . getImageGroupID ( ) ) ; params.setCorrelationId ( org.ovirt.engine.core.bll.storage.disk.MoveDiskCommand.getCorrelationId ( ) ) ; return params ; }
Source:
protected org.ovirt.engine.core.common.businessentities.DiskInterface getRawValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; return disk.getDiskInterface ( ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; if ( disk.isShareable ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( constants.shareable ( ) ) ; } return null ; }
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterBricksForServer ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , 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.gluster.GlusterBrickEntity > glusterBricks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ) ( returnValue ) ) ; java.util.Collections.sort ( glusterBricks , new org.ovirt.engine.ui.uicommonweb.Linq.ServerBricksComparer ( ) ) ; setItems ( glusterBricks ) ; } } ) , getEntity ( ) . getId ( ) ) ; }

Target:
public void search ( ) { if ( ( getEntity ( ) ) != null ) { super . search ( ) ; } }
Source:
static java.util.List < org.ovirt.engine.core.common.businessentities.tags > setUpTags ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.tags > tags = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.tags > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { tags.add ( new org.ovirt.engine.core.common.businessentities.tags ( DESCRIPTIONS [ i ] , null , false , GUIDS [ i ] , NAMES [ i ] ) ) ; } return tags ; }

Target:
static java.util.List < org.ovirt.engine.core.common.businessentities.Tags > setUpTags ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Tags > tags = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { tags.add ( new org.ovirt.engine.core.common.businessentities.Tags ( DESCRIPTIONS [ i ] , null , false , GUIDS [ i ] , NAMES [ i ] ) ) ; } return tags ; }