auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void ExecuteVdsBrokerCommand ( ) { glusterServices = org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getBroker ( ) . glusterServicesList ( org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getParameters ( ) . getServiceNames ( ) . toArray ( new java.lang.String [ 0 ] ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.ProceedProxyReturnValue ( ) ; if ( org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getVDSReturnValue ( ) . getSucceeded ( ) ) { setReturnValue ( glusterServices.getServices ( ) ) ; } }

Target:
protected void ExecuteVdsBrokerCommand ( ) { glusterServices = org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getBroker ( ) . glusterServicesList ( org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getParameters ( ) . getServiceNames ( ) . toArray ( new java.lang.String [ 0 ] ) ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.ProceedProxyReturnValue ( ) ; if ( org.ovirt.engine.core.vdsbroker.gluster.GlusterServicesListVDSCommand.getVDSReturnValue ( ) . getSucceeded ( ) ) { setReturnValue ( glusterServices.getServices ( ) ) ; } }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . CancelTasks ( getReturnValue ( ) . getTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }

Target:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . CancelTasks ( getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }
Source:
public org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Template setTimestamp ( java.lang.String column , java.lang.Long value ) { if ( value != null ) { columns.add ( column ) ; values.add ( ( ( "'" + ( new java.util.Date ( value ) ) ) + "'" ) ) ; } return this ; }

Target:
public org.ovirt.engine.extension.aaa.jdbc.core.datasource.Sql.Template setTimestamp ( java.lang.String column , java.lang.Long value ) { if ( value != null ) { columns.add ( column ) ; values.add ( org.ovirt.engine.extension.aaa.jdbc.DateUtils.toTimestamp ( value ) ) ; } return this ; }
Source:
public static org.ovirt.engine.api.model.Statistic setDatum ( org.ovirt.engine.api.model.Statistic statistic , java.lang.String datum ) { statistic.getValues ( ) . getValues ( ) . get ( 0 ) . setDetail ( datum ) ; return statistic ; }

Target:
public static org.ovirt.engine.api.model.Statistic setDatum ( org.ovirt.engine.api.model.Statistic statistic , java.lang.String datum ) { if ( datum != null ) { org.ovirt.engine.api.model.Value value = new org.ovirt.engine.api.model.Value ( ) ; value.setDetail ( datum ) ; statistic.getValues ( ) . getValues ( ) . add ( value ) ; } return statistic ; }
Source:
protected void onBind ( ) { super . onBind ( ) ; registerHandler ( getEventBus ( ) . addHandler ( org.ovirt.engine.ui.common.widget.refresh.ManualRefreshEvent.getType ( ) , new org.ovirt.engine.ui.common.widget.refresh.ManualRefreshEvent.ManualRefreshHandler ( ) { @ java.lang.Override public void onManualRefresh ( org.ovirt.engine.ui.common.widget.refresh.ManualRefreshEvent event ) { if ( org.ovirt.engine.ui.webadmin.section.main.presenter.tab.host.SubTabHostInterfacePresenter.this . isVisible ( ) ) { getView ( ) . removeContent ( ) ; } } } ) ) ; }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.String > event ) { getView ( ) . setRefreshButtonVisibility ( ( ! ( getModelProvider ( ) . getModel ( ) . getTimer ( ) . isActive ( ) ) ) ) ; }
Source:
private void attachDetachDisk ( org.ovirt.engine.core.common.businessentities.storage.Disk disk , org.ovirt.engine.core.common.action.VdcActionType actionType ) { runInternalAction ( actionType , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( disk.getId ( ) , org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) ) , disk.getPlugged ( ) , disk.getReadOnly ( ) ) ) ; }

Target:
private void attachDetachDisk ( org.ovirt.engine.core.common.businessentities.storage.Disk disk , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement oldDve = disk.getDiskVmElementForVm ( oldVmId ) ; runInternalAction ( actionType , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( disk.getId ( ) , org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) ) , oldDve.isPlugged ( ) , oldDve.isReadOnly ( ) ) ) ; }
Source:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
private boolean registerLibvirtSecrets ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.cinderProviderSupported ( getStoragePool ( ) . getCompatibilityVersion ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = getDbFacade ( ) . getLibvirtSecretDao ( ) . getAllByStoragePoolIdFilteredByActiveStorageDomains ( getStoragePoolId ( ) ) ; if ( ! ( libvirtSecrets.isEmpty ( ) ) ) { return registerLibvirtSecrets ( libvirtSecrets , false ) ; } } return true ; }

Target:
private boolean registerLibvirtSecrets ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.cinderProviderSupported ( getStoragePool ( ) . getCompatibilityVersion ( ) ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret > libvirtSecrets = libvirtSecretDao.getAllByStoragePoolIdFilteredByActiveStorageDomains ( getStoragePoolId ( ) ) ; if ( ! ( libvirtSecrets.isEmpty ( ) ) ) { return registerLibvirtSecrets ( libvirtSecrets , false ) ; } } return true ; }
Source:
public void createCommand ( ) { org.ovirt.engine.core.common.action.RunVmParams param = new org.ovirt.engine.core.common.action.RunVmParams ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > ( param ) ) ; mockVmRunHandler ( ) ; mockSuccessfulSnapshotValidator ( ) ; mockVmPropertiesUtils ( ) ; mockBackend ( ) ; }

Target:
public void createCommand ( ) { org.ovirt.engine.core.common.action.RunVmParams param = new org.ovirt.engine.core.common.action.RunVmParams ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RunVmCommand < org.ovirt.engine.core.common.action.RunVmParams > ( param ) ) ; mockVmRunHandler ( ) ; mockSuccessfulRunVmValidator ( ) ; mockSuccessfulSnapshotValidator ( ) ; mockBackend ( ) ; }
Source:
public boolean isSkipFencingIfSDActiveSupported ( java.lang.String version ) { boolean result = false ; if ( version != null ) { java.lang.Boolean b = ( ( java.lang.Boolean ) ( getConfigValuePreConverted ( ConfigurationValues.SkipFencingIfSDActiveSupported , version ) ) ) ; result = ( b != null ) && b ; } return result ; }

Target:
public int getUploadImageUiInactivityTimeoutInSeconds ( ) { return ( ( java.lang.Integer ) ( getConfigValuePreConverted ( ConfigurationValues.UploadImageUiInactivityTimeoutInSeconds ) ) ) ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb ) { if ( ( ( vds.getcpu_cores ( ) ) != null ) && ( ( getVm ( ) . getnum_of_cpus ( ) ) > ( vds.getcpu_cores ( ) ) ) ) { sb.append ( "has less cores(" ) . append ( vds.getcpu_cores ( ) ) . append ( ") than " ) . append ( getVm ( ) . getnum_of_cpus ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ! ( areRequiredNetworksAvailable ( vds ) ) ) { sb.append ( "is missing networks required by VM nics " ) . append ( org.ovirt.engine.core.common.businessentities.Entities.interfacesByNetworkName ( getVmNICs ( ) ) . keySet ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_NETWORKS ; } return null ; }
Source:
public void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public static void getUserMessageOfTheDayViaPublic ( 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.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
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 ) ; }
Source:
private boolean validDhcpOrNoneIpAddressDetails ( org.ovirt.engine.core.common.businessentities.network.IPv4Address iPv4Address ) { return ( ( org.apache.commons.lang.StringUtils.isEmpty ( iPv4Address.getAddress ( ) ) ) && ( org.apache.commons.lang.StringUtils.isEmpty ( iPv4Address.getNetmask ( ) ) ) ) && ( org.apache.commons.lang.StringUtils.isEmpty ( iPv4Address.getGateway ( ) ) ) ; }

Target:
private boolean isEmptyIpv4AddressDetails ( org.ovirt.engine.core.common.businessentities.network.IPv4Address iPv4Address ) { return ( ( org.apache.commons.lang.StringUtils.isEmpty ( iPv4Address.getAddress ( ) ) ) && ( org.apache.commons.lang.StringUtils.isEmpty ( iPv4Address.getNetmask ( ) ) ) ) && ( org.apache.commons.lang.StringUtils.isEmpty ( iPv4Address.getGateway ( ) ) ) ; }
Source:
public static void getAttachedTagsToUser ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.setAttachedTagsConverter ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTagsByUserId , new org.ovirt.engine.core.common.queries.GetTagsByUserIdParameters ( id.toString ( ) ) , aQuery ) ; }

Target:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public void onLogout ( ) { org.ovirt.engine.ui.frontend.AsyncQuery query = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; query.setHandleFailure ( true ) ; query.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { Window.Location.assign ( ( ( com.google.gwt.core.client.GWT.getModuleBaseURL ( ) ) + "sso/logout" ) ) ; } } ; frontend.logoffAsync ( query ) ; }

Target:
public void onLogout ( ) { org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.action.VdcReturnValueBase > query = new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { Window.Location.assign ( ( ( com.google.gwt.core.client.GWT.getModuleBaseURL ( ) ) + "sso/logout" ) ) ; } } ) ; query.setHandleFailure ( true ) ; frontend.logoffAsync ( query ) ; }
Source:
public static boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } boolean archMemorySnapshotSupported = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ; return ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) && archMemorySnapshotSupported ; }

Target:
public boolean canVmsBePaused ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > items ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : items ) { if ( ! ( isSuspendSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ) { return false ; } } return true ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase runAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunAction invoked!" ) ; debugAction ( actionType , params ) ; params.setSessionId ( getEngineSessionId ( ) ) ; return getBackend ( ) . runAction ( actionType , params ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase runAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunAction invoked!" ) ; debugAction ( actionType , params ) ; params.setSessionId ( getEngineSessionId ( ) ) ; if ( ( params.getCorrelationId ( ) ) == null ) { params.setCorrelationId ( org.ovirt.engine.core.utils.CorrelationIdTracker.getCorrelationId ( ) ) ; } return getBackend ( ) . runAction ( actionType , params ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.VM.name ( ) . toLowerCase ( ) , ( ( getVmName ( ) ) == null ? "" : getVmName ( ) ) ) ; } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( VdcObjectType.VM.name ( ) . toLowerCase ( ) , ( ( getVmName ( ) ) == null ? "" : getVmName ( ) ) ) ; jobProperties.put ( VdcObjectType.Storage.name ( ) . toLowerCase ( ) , getStorageDomainName ( ) ) ; } return jobProperties ; }
Source:
public void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.getUnregisteredOVFDataDao ( ) . removeEntity ( ovfEntityData.getEntityId ( ) , null ) ; } setActionReturnValue ( org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.getVmTemplate ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.setSucceeded ( true ) ; }

Target:
public void executeCommand ( ) { super . executeCommand ( ) ; if ( org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.isImagesAlreadyOnTarget ( ) ) { if ( ! ( getImages ( ) . isEmpty ( ) ) ) { findAndSaveDiskCopies ( ) ; } org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.getUnregisteredOVFDataDao ( ) . removeEntity ( ovfEntityData.getEntityId ( ) , null ) ; } setActionReturnValue ( org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.getVmTemplate ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.ImportVmTemplateFromConfigurationCommand.setSucceeded ( true ) ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { setIsFingerprintVerified ( false ) ; fetchFingerprint ( ( ( java.lang.String ) ( getGlusterHostAddress ( ) . getEntity ( ) ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( ( ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) != null ) && ( ( java.lang.Boolean ) ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) ) ) { getGlusterHostAddress ( ) . setIsChangable ( true ) ; getGlusterHostPassword ( ) . setIsChangable ( true ) ; } else { getGlusterHostAddress ( ) . setIsChangable ( false ) ; getGlusterHostPassword ( ) . setIsChangable ( false ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { getNetworkDAO ( ) . update ( getNetwork ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterAttachment : getNetworkClusterDAO ( ) . getAllForNetwork ( getNetwork ( ) . getId ( ) ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( clusterAttachment.getClusterId ( ) , getNetwork ( ) ) ; } if ( networkChangedToNonVmNetwork ( ) ) { removeVnicProfiles ( ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getNetworkDao ( ) . update ( getNetwork ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterAttachment : getNetworkClusterDao ( ) . getAllForNetwork ( getNetwork ( ) . getId ( ) ) ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( clusterAttachment.getClusterId ( ) , getNetwork ( ) ) ; } if ( networkChangedToNonVmNetwork ( ) ) { removeVnicProfiles ( ) ; } return null ; }
Source:
public void testNotEnoughSpaceToMergeSnapshotsWithMultipleDisk ( ) { spySdValidatorForOneDomain ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; org.mockito.Mockito.doReturn ( imagesDisks ) . when ( cmd ) . getSourceImages ( ) ; mockStorageDomainDAOGetForStoragePool ( 15 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertFalse ( "Validation should fail. Free space minus threshold should be smaller then summarize all disks size" , cmd.validateStorageDomains ( ) ) ; }

Target:
public void testCanDoActionNotEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( vmValidator ) . vmHostCanLiveMerge ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = mockDisksList ( 4 ) ; org.mockito.Mockito.when ( storageDomainsValidator.allDomainsHaveSpaceForClonedDisks ( imagesDisks ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public void getStorageDomainMaxNameLength ( 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 ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Integer > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( 1 ) ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void setup ( ) { urlValidation = org.mockito.Mockito.spy ( new org.ovirt.engine.ui.uicommonweb.validation.UrlValidation ( new java.lang.String [ ] { org.ovirt.engine.ui.uicommonweb.Uri.SCHEME_HTTP } ) ) ; hostValidation = new org.ovirt.engine.ui.uicommonweb.validation.UrlValidationTest.TestableHostValidation ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( urlValidation ) . getUriMessage ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( urlValidation ) . getSchemeMessage ( ) ; org.mockito.Mockito.doReturn ( hostValidation ) . when ( urlValidation ) . getHostValidation ( ) ; }

Target:
public void setup ( ) { urlValidation = org.mockito.Mockito.spy ( new org.ovirt.engine.ui.uicommonweb.validation.UrlValidation ( new java.lang.String [ ] { org.ovirt.engine.ui.uicommonweb.Uri.SCHEME_HTTP } ) ) ; hostValidation = new org.ovirt.engine.ui.uicommonweb.validation.UrlValidationTest.TestableHostValidation ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( urlValidation ) . getUriMessage ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( urlValidation ) . getSchemeMessage ( org.mockito.Matchers.any ( java.lang.String.class ) ) ; org.mockito.Mockito.doReturn ( hostValidation ) . when ( urlValidation ) . getHostValidation ( ) ; }
Source:
public void testRemoveWithoutParam ( ) { container.SetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE ) ; container.removeSession ( ) ; org.junit.Assert.assertEquals ( "Get should return the value since the session was not removed" , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_VALUE , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY ) ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID ) ; container.removeSession ( ) ; org.junit.Assert.assertNull ( "Get should return the value since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY ) ) ; }

Target:
public void testCleanExpiredUsersSessionsWithUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; org.mockito.Mockito.verify ( dbUserDAOMcok ) . removeUserSessions ( org.mockito.Matchers.anyMap ( ) ) ; }
Source:
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.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
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 ) ; }

Target:
public 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 ) ; }
Source:
public void testMigrateMacsToAnotherMacPool ( ) throws java.lang.Exception { underTest.migrateMacsToAnotherMacPool ( sourceMacPoolId , targetMacPoolId , macsToMigrate , false , commandContext ) ; org.mockito.Mockito.verify ( macPoolPerCluster ) . getMacPoolById ( sourceMacPoolId , commandContext ) ; org.mockito.Mockito.verify ( macPoolPerCluster ) . getMacPoolById ( targetMacPoolId , commandContext ) ; org.mockito.InOrder inOrder = org.mockito.Mockito.inOrder ( sourceMacPool , targetMacPool ) ; inOrder.verify ( sourceMacPool ) . freeMacs ( macsToMigrate ) ; inOrder.verify ( targetMacPool ) . forceAddMacs ( macsToMigrate ) ; }

Target:
public void testMigrateMacsWhenSourceAndTargetMacPoolsAreEqual ( ) { underTest.migrateMacsToAnotherMacPool ( sourceMacPoolId , sourceMacPoolId , macsToMigrate , commandContext ) ; org.mockito.Mockito.verifyNoMoreInteractions ( macPoolPerCluster , sourceMacPool , targetMacPool ) ; }
Source:
public void testStaticFooToBarInterfaceMapper ( ) { org.ovirt.engine.api.restapi.types.Mapper < org.ovirt.engine.api.restapi.test.mappers.api.IFoo , org.ovirt.engine.api.restapi.test.mappers.api.IBar > mapper = mappingLocator.getMapper ( org.ovirt.engine.api.restapi.test.mappers.api.IFoo.class , org.ovirt.engine.api.restapi.test.mappers.api.IBar.class ) ; assertNotNull ( mapper ) ; org.ovirt.engine.api.restapi.test.mappers.api.IBar bar = mapper.map ( new org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl ( "foo" ) , null ) ; assertEquals ( "foo" , bar.get ( ) ) ; }

Target:
public void testStaticFooToBarInterfaceMapper ( ) { org.ovirt.engine.api.restapi.types.Mapper < org.ovirt.engine.api.restapi.test.mappers.api.IFoo , org.ovirt.engine.api.restapi.test.mappers.api.IBar > mapper = mappingLocator.getMapper ( org.ovirt.engine.api.restapi.test.mappers.api.IFoo.class , org.ovirt.engine.api.restapi.test.mappers.api.IBar.class ) ; org.junit.Assert.assertNotNull ( mapper ) ; org.ovirt.engine.api.restapi.test.mappers.api.IBar bar = mapper.map ( new org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl ( "foo" ) , null ) ; org.junit.Assert.assertEquals ( "foo" , bar.get ( ) ) ; }
Source:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public static boolean isBondVlan ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( org.ovirt.engine.core.common.utils.NetworkCommonUtils.isVlan ( iface ) ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : interfaces ) { if ( ( java.lang.Boolean.TRUE.equals ( i.getBonded ( ) ) ) && ( i.getName ( ) . equals ( iface.getBaseInterface ( ) ) ) ) { return true ; } } } return false ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.IpConfiguration createIpConfigurationFromVdsNetworkInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { if ( nic == null ) { return org.ovirt.engine.core.common.utils.NetworkCommonUtils.createDefaultIpConfiguration ( ) ; } org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; org.ovirt.engine.core.common.businessentities.network.IPv4Address ipv4Address = org.ovirt.engine.core.utils.NetworkUtils.createIpv4FromNic ( nic ) ; org.ovirt.engine.core.common.businessentities.network.IpV6Address ipv6Address = org.ovirt.engine.core.utils.NetworkUtils.createIpv6FromNic ( nic ) ; ipConfiguration.setIPv4Addresses ( java.util.Collections.singletonList ( ipv4Address ) ) ; ipConfiguration.setIpV6Addresses ( java.util.Collections.singletonList ( ipv6Address ) ) ; return ipConfiguration ; }
Source:
public void setup ( ) { mockConfigRule.mockConfigValue ( ConfigValues.SupportedClusterLevels , java.util.Collections.singleton ( org.ovirt.engine.core.bll.validator.ClusterValidatorTest.SUPPORTED_VERSION ) ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; }

Target:
public void versionSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.SupportedClusterLevels , java.util.Collections.singleton ( org.ovirt.engine.core.bll.validator.ClusterValidatorTest.SUPPORTED_VERSION ) ) ; org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.ClusterValidatorTest.SUPPORTED_VERSION ) ; org.junit.Assert.assertThat ( validator.versionSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private static void addUsbSlots ( org.ovirt.engine.core.common.businessentities.VmBase vm , int numOfSlots ) { for ( int index = 1 ; index <= numOfSlots ; index ++ ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , vm.getId ( ) ) , VmDeviceType.REDIR , VmDeviceType.SPICEVMC , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getUsbSlotSpecParams ( ) , true , false ) ; } }

Target:
private static void addUsbSlots ( org.ovirt.engine.core.common.businessentities.VmBase vm , int numOfSlots ) { for ( int index = 1 ; index <= numOfSlots ; index ++ ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , vm.getId ( ) ) , VmDeviceGeneralType.CHANNEL , VmDeviceType.SPICEVMC , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getUsbSlotSpecParams ( ) , true , false , null ) ; } }
Source:
public void update ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster cluster ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , cluster.getClusterId ( ) ) . addValue ( "network_id" , cluster.getNetworkId ( ) ) . addValue ( "status" , cluster.getStatus ( ) ) . addValue ( "is_display" , cluster.isDisplay ( ) ) . addValue ( "required" , cluster.isRequired ( ) ) ; getCallsHandler ( ) . executeModification ( "Updatenetwork_cluster" , parameterSource ) ; }

Target:
public void update ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster cluster ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , cluster.getClusterId ( ) ) . addValue ( "network_id" , cluster.getNetworkId ( ) ) . addValue ( "status" , cluster.getStatus ( ) ) . addValue ( "is_display" , cluster.isDisplay ( ) ) . addValue ( "required" , cluster.isRequired ( ) ) . addValue ( "migration" , cluster.isMigration ( ) ) ; getCallsHandler ( ) . executeModification ( "Updatenetwork_cluster" , parameterSource ) ; }
Source:
protected org.ovirt.engine.api.model.VmPool deprecatedPopulate ( org.ovirt.engine.api.model.VmPool model , org.ovirt.engine.api.model.VmPool entity ) { if ( ( model.isSetSize ( ) ) && ( ( model.getSize ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , SearchType.VM , ( "Vms: pool=" + ( model.getName ( ) ) ) ) ; model.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; model.getTemplate ( ) . setId ( vm.getVmtGuid ( ) . toString ( ) ) ; } return model ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM getVM ( org.ovirt.engine.api.model.VmPool model ) { if ( isFiltered ( ) ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmDataByPoolId , new org.ovirt.engine.core.common.queries.GetVmdataByPoolIdParameters ( asGuid ( model.getId ( ) ) ) , model.getId ( ) ) ; } return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , SearchType.VM , ( "Vms: pool=" + ( model.getName ( ) ) ) ) ; }
Source:
public void testUpdate ( ) { dao.save ( dummyPolicy ) ; dummyPolicy.setName ( "Altered dummy policy" ) ; dao.update ( dummyPolicy ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy result = dao.get ( dummyPolicy.getId ( ) ) ; org.junit.Assert.assertTrue ( result.equals ( dummyPolicy ) ) ; }

Target:
public void testUpdate ( ) { dao.save ( dummyPolicy ) ; dummyPolicy.setName ( "Altered dummy policy" ) ; dao.update ( dummyPolicy ) ; org.ovirt.engine.core.common.scheduling.ClusterPolicy result = dao.get ( dummyPolicy.getId ( ) , java.util.Collections.emptyMap ( ) ) ; org.junit.Assert.assertTrue ( result.equals ( dummyPolicy ) ) ; }
Source:
private org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm createVdsmVm ( org.ovirt.engine.core.common.businessentities.VmDynamic dbVmDynamic , java.util.Map < java.lang.String , java.lang.Object > xmlRpcStruct , java.lang.Double notifyTime ) { org.ovirt.engine.core.common.businessentities.VmDynamic clonedVmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( dbVmDynamic ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( clonedVmDynamic , xmlRpcStruct , vdsManager.getCopyVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm ( notifyTime ) . setVmDynamic ( clonedVmDynamic ) . setDevicesHash ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getVmDevicesHash ( xmlRpcStruct ) ) ; }

Target:
private org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm createVdsmVm ( org.ovirt.engine.core.common.businessentities.VmDynamic dbVmDynamic , java.util.Map < java.lang.String , java.lang.Object > struct , java.lang.Double notifyTime ) { org.ovirt.engine.core.common.businessentities.VmDynamic clonedVmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( dbVmDynamic ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( clonedVmDynamic , struct , vdsManager.getCopyVds ( ) ) ; return new org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm ( notifyTime ) . setVmDynamic ( clonedVmDynamic ) . setDevicesHash ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getVmDevicesHash ( struct ) ) ; }
Source:
private void setupMock ( ) throws java.lang.Exception { commandMock = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.EndExternalJobCommand ( parameters , null ) ) ; org.mockito.Mockito.when ( commandMock.getParameters ( ) ) . thenReturn ( parameters ) ; org.mockito.Mockito.doReturn ( jobDaoMock ) . when ( commandMock ) . getJobDao ( ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.jobId ) ) . thenReturn ( makeExternalTestJob ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.jobId ) ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.nonExternalJobId ) ) . thenReturn ( makeNonExternalTestJob ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.nonExternalJobId ) ) ; }

Target:
public void validateNonExternalJobFails ( ) throws java.lang.Exception { setupMock ( ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.jobId ) ) . thenReturn ( makeNonExternalTestJob ( ) ) ; org.junit.Assert.assertTrue ( ( ! ( commandMock.validate ( ) ) ) ) ; }
Source:
public java.lang.String getServerFingerprint ( java.lang.String serverName ) { java.lang.String fingerPrint = null ; org.ovirt.engine.core.utils.ssh.EngineSSHDialog dialog = getEngineSSHDialog ( ) ; try { dialog.setHost ( serverName ) ; dialog.connect ( ) ; fingerPrint = dialog.getHostFingerprint ( ) ; } catch ( java.lang.Throwable e ) { log.errorFormat ( "Could not fetch fingerprint of host {0} with message: {1}" , serverName , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; } finally { dialog.disconnect ( ) ; } return fingerPrint ; }

Target:
public org.ovirt.engine.core.bll.interfaces.BackendInternal getBackendInstance ( ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) ; }
Source:
private void processFence ( ) { org.ovirt.engine.core.bll.FenceExecutor executor = new org.ovirt.engine.core.bll.FenceExecutor ( getVds ( ) ) ; vdsProxyFound = new org.ovirt.engine.core.bll.FenceProxyLocator ( getVds ( ) ) . isProxyHostAvailable ( ) ; if ( ( getVds ( ) . getpm_enabled ( ) ) && ( vdsProxyFound ) ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue returnValue = executor.checkStatus ( ) ; fenceSucceeded = returnValue.getSucceeded ( ) ; fenceStatusReturnValue = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( returnValue.getReturnValue ( ) ) ) ; } }

Target:
private void processFence ( ) { org.ovirt.engine.core.bll.FenceExecutor executor = new org.ovirt.engine.core.bll.FenceExecutor ( getVds ( ) ) ; vdsProxyFound = new org.ovirt.engine.core.bll.FenceProxyLocator ( getVds ( ) ) . isProxyHostAvailable ( ) ; if ( ( getVds ( ) . isPmEnabled ( ) ) && ( vdsProxyFound ) ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue returnValue = executor.checkStatus ( ) ; fenceSucceeded = returnValue.getSucceeded ( ) ; fenceStatusReturnValue = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( returnValue.getReturnValue ( ) ) ) ; } }
Source:
protected void initWidget ( T widget ) { super . initWidget ( widget ) ; widget.setModal ( true ) ; widget.setGlassEnabled ( true ) ; widget.addStyleName ( org.ovirt.engine.ui.common.view.AbstractPopupView.resources.dialogBoxStyle ( ) . getName ( ) ) ; }

Target:
protected void initWidget ( T widget ) { super . initWidget ( widget ) ; widget.setModal ( true ) ; widget.setGlassEnabled ( true ) ; widget.addStyleName ( org.ovirt.engine.ui.common.view.AbstractPopupView.resources.dialogBoxStyle ( ) . getName ( ) ) ; widget.addStyleName ( org.ovirt.engine.ui.common.view.AbstractPopupView.POPUP_CONTENT_STYLE_NAME ) ; }
Source:
public void checkCidrBadFormat ( ) { org.mockito.Mockito.doReturn ( false ) . when ( mockedCidrValidator ) . isCidrFormatValid ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult actualResult = underTest.validate ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult expectedResult = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( false , java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.BAD_CIDR_FORMAT ) ) ; org.junit.Assert.assertEquals ( expectedResult , actualResult ) ; }

Target:
public void checkCidrBadFormat ( ) { org.mockito.Mockito.doReturn ( false ) . when ( mockedCidrValidator ) . isCidrFormatValid ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult actualResult = underTest.validate ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult expectedResult = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( false , java.util.Collections.singletonList ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.BAD_CIDR_FORMAT ) ) ; org.junit.Assert.assertEquals ( expectedResult , actualResult ) ; }
Source:
public int getOsIdByUniqueName ( java.lang.String uniqueOsName ) { for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > entry : getUniqueOsNames ( ) . entrySet ( ) ) { if ( entry.getValue ( ) . equals ( uniqueOsName ) ) { return entry.getKey ( ) ; } } return 0 ; }

Target:
public int getOsIdByUniqueName ( java.lang.String uniqueOsName ) { for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > entry : getUniqueOsNames ( ) . entrySet ( ) ) { if ( entry.getValue ( ) . equals ( uniqueOsName ) ) { return entry.getKey ( ) ; } } if ( getBackwardCompatibleNamesToIds ( ) . containsKey ( uniqueOsName ) ) { return getBackwardCompatibleNamesToIds ( ) . get ( uniqueOsName ) ; } return 0 ; }