auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean activateOrDeactivateNic ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.action.PlugAction plugAction , boolean newNic ) { org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters parameters = new org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters ( nic , plugAction , newNic ) ; parameters.setVmId ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getBackend ( ) . runInternalAction ( VdcActionType.ActivateDeactivateVmNic , parameters ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { propagateFailure ( returnValue ) ; } return returnValue.getSucceeded ( ) ; }

Target:
private boolean activateOrDeactivateNic ( org.ovirt.engine.core.common.businessentities.network.VmNic nic , org.ovirt.engine.core.common.action.PlugAction plugAction , boolean newNic ) { org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters parameters = new org.ovirt.engine.core.common.action.ActivateDeactivateVmNicParameters ( nic , plugAction , newNic ) ; parameters.setVmId ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.ActivateDeactivateVmNic , parameters , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { propagateFailure ( returnValue ) ; } return returnValue.getSucceeded ( ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( 1 , true ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; setUpEntityQueryExpectations ( 1 , true ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage getMemoryMetadataDisk ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue : returnValues ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = returnValue.getActionReturnValue ( ) ; if ( ( disk.getSize ( ) ) == ( org.ovirt.engine.core.bll.memory.MemoryUtils.METADATA_SIZE_IN_BYTES ) ) { return disk ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.DiskImage getMemoryMetadataDisk ( java.util.List < org.ovirt.engine.core.common.action.ActionReturnValue > returnValues ) { for ( org.ovirt.engine.core.common.action.ActionReturnValue returnValue : returnValues ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = returnValue.getActionReturnValue ( ) ; if ( ( disk.getSize ( ) ) == ( org.ovirt.engine.core.bll.memory.MemoryUtils.METADATA_SIZE_IN_BYTES ) ) { return disk ; } } return null ; }
Source:
public static void GetAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
public static void GetProviderCertificateChain ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
public void testUpdateFieldsIsQuotaDefault ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setQuotaDefault ( true ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setQuotaDefault ( false ) ; org.junit.Assert.assertTrue ( "Update should be valid for different quota default statuses" , vmTemplateHandler.isUpdateValid ( src , dest ) ) ; }

Target:
public void testUpdateFieldsIsQuotaDefault ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setQuotaDefault ( true ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setQuotaDefault ( false ) ; org.junit.jupiter.api.Assertions.assertTrue ( vmTemplateHandler.isUpdateValid ( src , dest ) , "Update should be valid for different quota default statuses" ) ; }
Source:
private boolean slaveUsedMultipleTimesInDifferentBonds ( java.lang.String potentiallyDuplicateSlaveName ) { int count = 0 ; for ( org.ovirt.engine.core.common.businessentities.network.Bond bond : params.getBonds ( ) ) { for ( java.lang.String slaveName : bond.getSlaves ( ) ) { if ( slaveName.equals ( potentiallyDuplicateSlaveName ) ) { count ++ ; } } } return count >= 2 ; }

Target:
private boolean slaveUsedMultipleTimesInDifferentBonds ( java.lang.String potentiallyDuplicateSlaveName ) { int count = 0 ; for ( org.ovirt.engine.core.common.action.CreateOrUpdateBond createOrUpdateBond : params.getCreateOrUpdateBonds ( ) ) { for ( java.lang.String slaveName : createOrUpdateBond.getSlaves ( ) ) { if ( slaveName.equals ( potentiallyDuplicateSlaveName ) ) { count ++ ; } } } return count >= 2 ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateRole , org.ovirt.engine.core.common.action.RolesOperationsParameters.class , new java.lang.String [ ] { "RoleId" , "Role" } , new java.lang.Object [ ] { GUIDS [ 0 ] , getEntity ( 0 ) } , true , true ) ) ; verifyModel ( resource.update ( getModel ( ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateRole , org.ovirt.engine.core.common.action.RolesOperationsParameters.class , new java.lang.String [ ] { "RoleId" , "Role" } , new java.lang.Object [ ] { GUIDS [ 0 ] , getEntity ( 0 ) } , true , true ) ) ; verifyModel ( resource.update ( getModel ( ) ) , 0 ) ; }
Source:
protected void extractBondIfModified ( java.util.Set < java.lang.String > bonds , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String name ) { if ( org.apache.commons.lang.StringUtils.isBlank ( iface.getNetworkName ( ) ) ) { violations.add ( VdcBllMessages.NETWROK_NOT_EXISTS ) ; } else { if ( bonds.contains ( name ) ) { violations.add ( VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; } else { bonds.add ( name ) ; if ( interfaceWasModified ( iface ) ) { modifiedBonds.put ( name , iface ) ; } } } }

Target:
private boolean networkWasModified ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface existingIface = getExistingIfaces ( ) . get ( iface.getName ( ) ) ; if ( existingIface == null ) { return true ; } return ( ( ! ( org.apache.commons.lang.ObjectUtils.equals ( iface.getNetworkName ( ) , existingIface.getNetworkName ( ) ) ) ) || ( ( iface.getBootProtocol ( ) ) != ( existingIface.getBootProtocol ( ) ) ) ) || ( staticBootProtoPropertiesChanged ( iface , existingIface ) ) ; }
Source:
private boolean userHasPermissions ( org.ovirt.engine.core.domains.DomainsConfigurationEntry adUserNameEntry , org.ovirt.engine.core.domains.DomainsConfigurationEntry adUseridEntry ) { try { java.util.Set < java.util.Map.Entry < java.lang.String , java.lang.String > > userNameValues = adUserNameEntry.getValues ( ) ; for ( java.util.Map.Entry < java.lang.String , java.lang.String > currUserEntry : userNameValues ) { java.lang.String currDomain = currUserEntry.getKey ( ) ; java.lang.String currUser = currUserEntry.getValue ( ) ; if ( daoImpl.getUserHasPermissions ( currUser , currDomain ) ) { return true ; } } } catch ( java.sql.SQLException e ) { org.ovirt.engine.core.domains.ManageDomains.log.error ( e ) ; } return false ; }

Target:
private boolean userHasPermissions ( java.lang.String userName , java.lang.String domainName ) { boolean result = false ; try { result = daoImpl.getUserHasPermissions ( userName , domainName ) ; } catch ( java.sql.SQLException ex ) { org.ovirt.engine.core.domains.ManageDomains.log.error ( "Error testing user permissions" , ex ) ; } return result ; }
Source:
public void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }

Target:
public void getGlusterVolumeGeoRepStatusForMasterVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeGeoRepSessions , new org.ovirt.engine.core.common.queries.IdQueryParameters ( masterVolumeId ) , aQuery ) ; }
Source:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetVolumeInfoVDSCommand.log.info ( "Executing GetVolumeInfo using the current SPM" ) ; org.ovirt.engine.core.common.vdscommands.GetVolumeInfoVDSCommandParameters params = new org.ovirt.engine.core.common.vdscommands.GetVolumeInfoVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetVolumeInfoVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetVolumeInfoVDSCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetVolumeInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetVolumeInfoVDSCommand.getParameters ( ) . getImageGroupId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetVolumeInfoVDSCommand.getParameters ( ) . getImageId ( ) ) ; setVDSReturnValue ( resourceManager.runVdsCommand ( VDSCommandType.GetVolumeInfo , params ) ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetVolumeInfoVDSCommand.log.info ( "Executing GetVolumeInfo using the current SPM" ) ; org.ovirt.engine.core.common.vdscommands.GetVolumeInfoVDSCommandParameters params = new org.ovirt.engine.core.common.vdscommands.GetVolumeInfoVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetVolumeInfoVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetVolumeInfoVDSCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetVolumeInfoVDSCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetVolumeInfoVDSCommand.getParameters ( ) . getImageGroupId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetVolumeInfoVDSCommand.getParameters ( ) . getImageId ( ) ) ; params.setExpectedEngineErrors ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetVolumeInfoVDSCommand.getParameters ( ) . getExpectedEngineErrors ( ) ) ; setVDSReturnValue ( resourceManager.runVdsCommand ( VDSCommandType.GetVolumeInfo , params ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult referencedNetworkAttachmentActuallyExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { boolean doesNotReferenceExistingNetworkAttachment = networkAttachmentId == null ; if ( doesNotReferenceExistingNetworkAttachment ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult referencedNetworkAttachmentActuallyExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { boolean doesNotReferenceExistingNetworkAttachment = networkAttachmentId == null ; if ( doesNotReferenceExistingNetworkAttachment ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS ; java.lang.String id = networkAttachmentId.toString ( ) ; java.lang.String replacement = org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , id ) ; return new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , replacement ) ; }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.dom.client.Element parent , final org.ovirt.engine.ui.uicommonweb.models.ListModel model , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < org.ovirt.engine.ui.uicommonweb.models.ListModel > valueUpdater ) { delegate.onBrowserEvent ( context , parent , renderer.render ( ( ( T ) ( model.getSelectedItem ( ) ) ) ) , event , new com.google.gwt.cell.client.ValueUpdater < java.lang.String > ( ) { @ java.lang.Override public void update ( java.lang.String value ) { if ( value != null ) { model.setSelectedItem ( entityByName.get ( value ) ) ; } } } ) ; }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , final org.ovirt.engine.ui.uicommonweb.models.ListModel model , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < org.ovirt.engine.ui.uicommonweb.models.ListModel > valueUpdater ) { delegate.onBrowserEvent ( context , parent , renderer.render ( ( ( T ) ( model.getSelectedItem ( ) ) ) ) , event , new com.google.gwt.cell.client.ValueUpdater < java.lang.String > ( ) { @ java.lang.Override public void update ( java.lang.String value ) { if ( value != null ) { model.setSelectedItem ( entityByName.get ( value ) ) ; } } } ) ; }
Source:
protected void UpdateDetailsAvailability ( ) { if ( ( getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.DbUser adUser = ( ( org.ovirt.engine.core.common.businessentities.DbUser ) ( getSelectedItem ( ) ) ) ; userGroupListModel.setIsAvailable ( ( ! ( adUser.getIsGroup ( ) ) ) ) ; userEventNotifierListModel.setIsAvailable ( ( ! ( adUser.getIsGroup ( ) ) ) ) ; } }

Target:
protected void updateDetailsAvailability ( ) { if ( ( getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.DbUser adUser = ( ( org.ovirt.engine.core.common.businessentities.DbUser ) ( getSelectedItem ( ) ) ) ; userGroupListModel.setIsAvailable ( ( ! ( adUser.getIsGroup ( ) ) ) ) ; userEventNotifierListModel.setIsAvailable ( ( ! ( adUser.getIsGroup ( ) ) ) ) ; } }
Source:
public org.ovirt.engine.sdk.decorators.VMHostDevice add ( org.ovirt.engine.sdk.decorators.HostDevice hostdevice ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , hostdevice , org.ovirt.engine.sdk.entities.HostDevice.class , org.ovirt.engine.sdk.decorators.VMHostDevice.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.TemplateGraphicsConsole add ( org.ovirt.engine.sdk.decorators.GraphicsConsole graphicsconsole ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , graphicsconsole , org.ovirt.engine.sdk.entities.GraphicsConsole.class , org.ovirt.engine.sdk.decorators.TemplateGraphicsConsole.class , headers ) ; }
Source:
private void IsAutoAssign_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( java.lang.Boolean ) ( getIsAutoAssign ( ) . getEntity ( ) ) ) == true ) { clearAndDisable ( getRunVMOnSpecificHost ( ) ) ; clearAndDisable ( getHostCpu ( ) ) ; } else { getRunVMOnSpecificHost ( ) . setIsChangable ( true ) ; } behavior.updateCpuPinningVisibility ( ) ; }

Target:
private void UpdateNumOfMonitors ( ) { if ( isVncSelected ( ) ) { getNumOfMonitors ( ) . setSelectedItem ( 1 ) ; getNumOfMonitors ( ) . setIsChangable ( false ) ; } else { getNumOfMonitors ( ) . setIsChangable ( true ) ; } }
Source:
private boolean areAgentsVersionCompatible ( org.ovirt.engine.core.common.businessentities.VDS proxyCandidate ) { org.ovirt.engine.core.utils.pm.VdsFenceOptions options = new org.ovirt.engine.core.utils.pm.VdsFenceOptions ( proxyCandidate.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) ; boolean supported = true ; for ( org.ovirt.engine.core.common.businessentities.FenceAgent agent : proxyCandidate.getFenceAgents ( ) ) { supported = supported && ( options.isAgentSupported ( agent.getType ( ) ) ) ; } return supported ; }

Target:
protected boolean areAgentsVersionCompatible ( org.ovirt.engine.core.common.businessentities.VDS proxyCandidate ) { org.ovirt.engine.core.utils.pm.VdsFenceOptions options = createVdsFenceOptions ( proxyCandidate.getVdsGroupCompatibilityVersion ( ) . getValue ( ) ) ; boolean compatible = true ; for ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent : fencedHost.getFenceAgents ( ) ) { if ( ! ( options.isAgentSupported ( agent.getType ( ) ) ) ) { compatible = false ; break ; } } org.ovirt.engine.core.bll.pm.FenceProxyLocator.log.debug ( "Proxy candidate '{}' has compatible fence agents: {}" , proxyCandidate.getHostName ( ) , compatible ) ; return compatible ; }
Source:
java.util.List < java.io.File > getCreatedFiles ( java.util.List < java.io.File > originalFiles , java.util.List < java.io.File > fetchOneTimeFiles ) { java.util.List < java.io.File > newCreatedFiles = new java.util.ArrayList < java.io.File > ( ) ; for ( java.io.File file : fetchOneTimeFiles ) { if ( ! ( originalFiles.contains ( file ) ) ) { newCreatedFiles.add ( file ) ; } } return newCreatedFiles ; }

Target:
java.util.List < java.io.File > getCreatedFiles ( java.util.List < java.lang.String > originalFiles , java.util.List < java.lang.String > fetchOneTimeFiles ) { java.util.List < java.io.File > newCreatedFiles = new java.util.ArrayList < java.io.File > ( ) ; java.lang.String [ ] array = originalFiles.toArray ( new java.lang.String [ ] { } ) ; for ( java.lang.String file : fetchOneTimeFiles ) { int index = java.util.Arrays.binarySearch ( array , file ) ; if ( index < 0 ) { newCreatedFiles.add ( new java.io.File ( file ) ) ; } } return newCreatedFiles ; }
Source:
private java.util.Date getDateFromDiskDescription ( java.util.Map < java.lang.String , java.lang.Object > map ) { try { java.lang.Object lastUpdate = map.get ( OvfInfoFileConstants.LastUpdated ) ; if ( lastUpdate != null ) { return new java.text.SimpleDateFormat ( org.ovirt.engine.core.utils.ovf.OvfParser.formatStrFromDiskDescription ) . parse ( lastUpdate.toString ( ) ) ; } else { log.info ( "LastUpdate Date is not initialized in the OVF_STORE disk." ) ; } } catch ( java.text.ParseException e ) { log.errorFormat ( "LastUpdate Date could not be parsed from disk desscription. Exception: {0}" , e ) ; } return null ; }

Target:
private java.util.Date getDateFromDiskDescription ( java.util.Map < java.lang.String , java.lang.Object > map ) { try { java.lang.Object lastUpdate = map.get ( OvfInfoFileConstants.LastUpdated ) ; if ( lastUpdate != null ) { return new java.text.SimpleDateFormat ( org.ovirt.engine.core.utils.ovf.OvfParser.formatStrFromDiskDescription ) . parse ( lastUpdate.toString ( ) ) ; } else { log.info ( "LastUpdate Date is not initialized in the OVF_STORE disk." ) ; } } catch ( java.text.ParseException e ) { log.error ( "LastUpdate Date could not be parsed from disk description: {}" , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; } return null ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel vmGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( returnValue ) ) ; vmGuideModel.nics = nics ; vmGuideModel.updateOptionsPostData ( ) ; }

Target:
private void updateOptionsPostData ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > disks ) { org.ovirt.engine.ui.uicommonweb.UICommand addDiskAction = new org.ovirt.engine.ui.uicommonweb.UICommand ( "AddDisk" , this ) ; if ( disks.isEmpty ( ) ) { addDiskAction.setTitle ( VmConfigureVirtualDisksAction ) ; getCompulsoryActions ( ) . add ( addDiskAction ) ; } else { addDiskAction.setTitle ( VmAddAnotherVirtualDiskAction ) ; getOptionalActions ( ) . add ( addDiskAction ) ; } stopProgress ( ) ; }
Source:
public void setupMock ( org.ovirt.engine.core.bll.utils.GlusterGeoRepUtil geoRepUtil , org.ovirt.engine.core.dao.gluster.GlusterGeoRepDao geoRepDao , org.ovirt.engine.core.dao.VdsGroupDAO vdsGroupDao ) { org.mockito.Mockito.doReturn ( geoRepDao ) . when ( geoRepUtil ) . getGeoRepDao ( ) ; org.mockito.Mockito.doReturn ( getGeoRepSessions ( ) ) . when ( geoRepDao ) . getAllSessions ( ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( geoRepUtil ) . getVdsGroupDao ( ) ; org.mockito.Mockito.doReturn ( getVdsGroup ( MASTER_CLUSTER_ID , CLUSTER_COMPATIBILITY_VERSION ) ) . when ( vdsGroupDao ) . get ( MASTER_CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getVdsGroup ( SLAVE_CLUSTER_ID , CLUSTER_COMPATIBILITY_VERSION ) ) . when ( vdsGroupDao ) . get ( SLAVE_CLUSTER_ID ) ; }

Target:
public void setupMock ( org.ovirt.engine.core.bll.utils.GlusterGeoRepUtil geoRepUtil , org.ovirt.engine.core.dao.gluster.GlusterGeoRepDao geoRepDao , org.ovirt.engine.core.dao.VdsGroupDao vdsGroupDao ) { org.mockito.Mockito.doReturn ( geoRepDao ) . when ( geoRepUtil ) . getGeoRepDao ( ) ; org.mockito.Mockito.doReturn ( getGeoRepSessions ( ) ) . when ( geoRepDao ) . getAllSessions ( ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( geoRepUtil ) . getVdsGroupDao ( ) ; org.mockito.Mockito.doReturn ( getVdsGroup ( MASTER_CLUSTER_ID , CLUSTER_COMPATIBILITY_VERSION ) ) . when ( vdsGroupDao ) . get ( MASTER_CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getVdsGroup ( SLAVE_CLUSTER_ID , CLUSTER_COMPATIBILITY_VERSION ) ) . when ( vdsGroupDao ) . get ( SLAVE_CLUSTER_ID ) ; }
Source:
public void testQueryFailsIfPeerExists ( ) { mockQueryParameters ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.NEW_SERVER , org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.PASSWORD ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDao ) . getByHostName ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.SERVER_NAME1 ) ; try { getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.fail ( "Query didn't fail when one or more peers already exist(s)!" ) ; } catch ( java.lang.RuntimeException e ) { org.junit.Assert.assertEquals ( VdcBllMessages.SERVER_ALREADY_EXISTS_IN_ANOTHER_CLUSTER.toString ( ) , e.getMessage ( ) ) ; } }

Target:
public void testQueryFailsIfPeerExists ( ) { mockQueryParameters ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.NEW_SERVER , org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.PASSWORD ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDao ) . getByHostName ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.SERVER_NAME1 ) ; try { getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.fail ( "Query didn't fail when one or more peers already exist(s)!" ) ; } catch ( java.lang.RuntimeException e ) { org.junit.Assert.assertEquals ( EngineMessage.SERVER_ALREADY_EXISTS_IN_ANOTHER_CLUSTER.toString ( ) , e.getMessage ( ) ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : diskInfoDestinationMap.values ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaStorageConsumptionParameter.QuotaAction.CONSUME , disk.getstorage_ids ( ) . get ( 0 ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : diskInfoDestinationMap.values ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaStorageConsumptionParameter.QuotaAction.CONSUME , disk.getStorageIds ( ) . get ( 0 ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } return list ; }
Source:
public void testSaveAndGetByVolumeId ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig config = dao.getConfigByVolumeIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.VOLUME_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.NEW_PARAM_NAME ) ; org.junit.Assert.assertNull ( config ) ; newConfig = insertTestConfig ( ) ; config = dao.getConfigByVolumeIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.VOLUME_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.NEW_PARAM_NAME ) ; org.junit.Assert.assertNotNull ( config ) ; org.junit.Assert.assertEquals ( newConfig , config ) ; }

Target:
public void testSaveAndGetByVolumeId ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig config = dao.getConfigByVolumeIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.VOLUME_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.NEW_PARAM_NAME ) ; org.junit.jupiter.api.Assertions.assertNull ( config ) ; newConfig = insertTestConfig ( ) ; config = dao.getConfigByVolumeIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.VOLUME_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.NEW_PARAM_NAME ) ; org.junit.jupiter.api.Assertions.assertNotNull ( config ) ; org.junit.jupiter.api.Assertions.assertEquals ( newConfig , config ) ; }
Source:
public void disconnect ( ) { if ( ( this . session ) != null ) { this . session.close ( true ) ; this . session = null ; } if ( ( this . client ) != null ) { this . client.stop ( ) ; this . client = null ; } }

Target:
public void disconnect ( ) { if ( ( _session ) != null ) { _session.close ( true ) ; _session = null ; } if ( ( _client ) != null ) { _client.stop ( ) ; _client = null ; } }
Source:
public org.ovirt.engine.api.v3.types.V3VM get ( ) { return org.ovirt.engine.api.v3.helpers.V3VmHelper.addDisksLink ( adaptGet ( getDelegate ( ) :: get ) ) ; }

Target:
public org.ovirt.engine.api.v3.types.V3VM get ( @ javax.ws.rs.core.Context javax.ws.rs.core.HttpHeaders headers , @ javax.ws.rs.core.Context javax.ws.rs.core.UriInfo ui ) { org.ovirt.engine.api.v3.types.V3VM vm = adaptGet ( getDelegate ( ) :: get ) ; org.ovirt.engine.api.v3.helpers.V3VmHelper.addDisksLink ( vm ) ; java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( headers , ui ) ; if ( ( details != null ) && ( ! ( details.isEmpty ( ) ) ) ) { org.ovirt.engine.api.v3.helpers.V3VmHelper.addInlineDetails ( vm , this , details ) ; } return vm ; }
Source:
public void setItems ( java.lang.Iterable value ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( value != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Disk > Cast ( value ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; org.ovirt.engine.ui.uicommonweb.Linq.Sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; super . setItems ( disks ) ; UpdateActionAvailability ( ) ; }

Target:
public void setItems ( java.lang.Iterable value ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( value != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Disk > cast ( value ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; super . setItems ( disks ) ; updateActionAvailability ( ) ; }
Source:
public static < TSource > TSource firstOrNull ( java.lang.Iterable < TSource > source , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < ? super TSource > predicate ) { if ( source != null ) { for ( TSource item : source ) { if ( predicate.match ( item ) ) { return item ; } } } return null ; }

Target:
public static < TSource > TSource firstOrDefault ( java.lang.Iterable < TSource > source , org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < ? super TSource > predicate , TSource defaultValue ) { if ( source != null ) { for ( TSource item : source ) { if ( predicate.match ( item ) ) { return item ; } } } return defaultValue ; }
Source:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( getDataCenterWithClustersList ( ) . getSelectedItem ( ) ) ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMaximalVmMemSize ( ) ; }

Target:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( getDataCenterWithClustersList ( ) . getSelectedItem ( ) ) ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMaximalVmMemSize ( ) ; handleQxlClusterLevel ( ) ; }
Source:
public org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel , org.ovirt.engine.ui.uicommonweb.models.vms.VmSessionsModel > getVmSessionsProvider ( com.google.gwt.event.shared.EventBus eventBus , com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider ) { return new org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel , org.ovirt.engine.ui.uicommonweb.models.vms.VmSessionsModel > ( eventBus , defaultConfirmPopupProvider , org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.class , org.ovirt.engine.ui.uicommonweb.models.vms.VmSessionsModel.class ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.scheduling.affinity_groups.list.VmAffinityGroupListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
public void starting ( org.junit.runners.model.FrameworkMethod method ) { try { mockTransactionManagement ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.utils.ejb.BeanType , java.lang.Object > mockBeanEntry : mockBeanMap.entrySet ( ) ) { org.mockito.Mockito.when ( mockStrategy.findBean ( org.mockito.Matchers.eq ( mockBeanEntry.getKey ( ) ) , org.mockito.Matchers.any ( org.ovirt.engine.core.utils.ejb.BeanProxyType.class ) ) ) . thenReturn ( mockBeanEntry.getValue ( ) ) ; } } catch ( javax.transaction.SystemException e ) { org.junit.Assert.fail ( "Unable to mock tranaction management" ) ; } }

Target:
public void starting ( org.junit.runner.Description description ) { try { mockTransactionManagement ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.utils.ejb.BeanType , java.lang.Object > mockBeanEntry : mockBeanMap.entrySet ( ) ) { org.mockito.Mockito.when ( mockStrategy.findBean ( org.mockito.Matchers.eq ( mockBeanEntry.getKey ( ) ) , org.mockito.Matchers.any ( org.ovirt.engine.core.utils.ejb.BeanProxyType.class ) ) ) . thenReturn ( mockBeanEntry.getValue ( ) ) ; } } catch ( javax.transaction.SystemException e ) { org.junit.Assert.fail ( "Unable to mock tranaction management" ) ; } }
Source:
private void initMockNetworkAttachmentIpConfigurationValidator ( org.ovirt.engine.core.common.errors.EngineMessage engineMessage , java.util.Collection < java.lang.String > replacements ) { org.ovirt.engine.core.bll.ValidationResult validationResult = ( replacements.isEmpty ( ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , replacements ) ; org.mockito.Mockito.when ( mockNetworkAttachmentIpConfigurationValidator.validateNetworkAttachmentIpConfiguration ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( validationResult ) ; }

Target:
private void initMockNetworkAttachmentIpConfigurationValidator ( org.ovirt.engine.core.common.errors.EngineMessage engineMessage , java.util.Collection < java.lang.String > replacements ) { org.ovirt.engine.core.bll.ValidationResult validationResult = ( replacements.isEmpty ( ) ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , replacements ) ; org.mockito.Mockito.when ( mockNetworkAttachmentIpConfigurationValidator.validateNetworkAttachmentIpConfiguration ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( validationResult ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.volumeSnapshotCreate" ) . withOptionalParameter ( "volumeName" , volumeName ) . withParameter ( "snapName" , snapshotName ) . withParameter ( "description" , description ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterSnapshotDelete ( java.lang.String snapshotName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.delete" ) . withOptionalParameter ( "snapName" , snapshotName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.ad_groups setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.ad_groups entity , int index ) { org.easymock.EasyMock.expect ( entity.getid ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getdomain ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.DOMAIN ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getstatus ( ) ) . andReturn ( AdRefStatus.Active ) . anyTimes ( ) ; return entity ; }

Target:
public static org.ovirt.engine.core.common.businessentities.LdapGroup setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.LdapGroup entity , int index ) { org.easymock.EasyMock.expect ( entity.getid ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getdomain ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.DOMAIN ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getstatus ( ) ) . andReturn ( AdRefStatus.Active ) . anyTimes ( ) ; return entity ; }
Source:
private void setupVdsDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > expectedVds = java.util.Collections.singletonList ( vds ) ; org.ovirt.engine.core.dao.VdsDAO vdsDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsDAO.class ) ; org.mockito.Mockito.when ( vdsDaoMock.getAllForNetwork ( networkId ) ) . thenReturn ( expectedVds ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVdsDao ( ) ) . thenReturn ( vdsDaoMock ) ; }

Target:
private void setupHostNetworkQosDao ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getHostNetworkQosDao ( ) ) . thenReturn ( hostNetworkQosDaoMocked ) ; org.mockito.Mockito.when ( networkMocked.getQosId ( ) ) . thenReturn ( qosId ) ; org.mockito.Mockito.when ( hostNetworkQosDaoMocked.get ( networkMocked.getQosId ( ) ) ) . thenReturn ( hostNetworkQos ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VdsNetworkInterface createVdsInterface ( org.ovirt.engine.core.compat.Guid id , java.lang.String name , java.lang.Boolean bonded , java.lang.String bondName , java.lang.Integer vlanId , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface = new org.ovirt.engine.core.common.businessentities.VdsNetworkInterface ( ) ; iface.setId ( id ) ; iface.setName ( name ) ; iface.setBonded ( bonded ) ; iface.setBondName ( bondName ) ; iface.setVlanId ( vlanId ) ; iface.setNetworkName ( networkName ) ; return iface ; }

Target:
private org.ovirt.engine.core.common.businessentities.VdsNetworkInterface createVdsInterface ( org.ovirt.engine.core.compat.Guid id , java.lang.String name , java.lang.Boolean bonded , java.lang.String bondName , java.lang.Integer vlanId , java.lang.String networkName , boolean bridged ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface = new org.ovirt.engine.core.common.businessentities.VdsNetworkInterface ( ) ; iface.setId ( id ) ; iface.setName ( name ) ; iface.setBonded ( bonded ) ; iface.setBondName ( bondName ) ; iface.setVlanId ( vlanId ) ; iface.setNetworkName ( networkName ) ; iface.setBridged ( bridged ) ; return iface ; }
Source:
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 ) ; } }

Target:
private void updateVmsOfInstanceType ( ) { if ( ! ( isInstanceType ( ) ) ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsToUpdate = vmDao.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:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public void ClearTasks ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.CommandAsyncTask > CurrentActionTypeTasks = getCurrentTasks ( ) ; for ( org.ovirt.engine.core.bll.CommandAsyncTask task : CurrentActionTypeTasks ) { task.clearAsyncTask ( ) ; } } }

Target:
public void ClearTasks ( ) { synchronized ( _listTasks ) { java.util.ArrayList < org.ovirt.engine.core.bll.CommandAsyncTask > CurrentActionTypeTasks = getCurrentTasks ( ) ; for ( org.ovirt.engine.core.bll.CommandAsyncTask task : CurrentActionTypeTasks ) { if ( ( task.getLastTaskStatus ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.finished ) ) { task.clearAsyncTask ( ) ; } } } }
Source:
public static void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

Target:
public static void getMaxSpmPriority ( 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 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
protected void updateCustomPropertySheet ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; getModel ( ) . getCustomPropertySheet ( ) . setKeyValueString ( getModel ( ) . getCustomPropertiesKeysList ( ) . get ( cluster.getcompatibility_version ( ) ) ) ; }

Target:
protected void updateCustomPropertySheet ( org.ovirt.engine.core.compat.Version clusterVersion ) { getModel ( ) . getCustomPropertySheet ( ) . setKeyValueMap ( getModel ( ) . getCustomPropertiesKeysList ( ) . get ( clusterVersion ) ) ; }