auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void init ( ) { super . init ( ) ; org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHooksResourceTest.parentMock = control.createMock ( org.ovirt.engine.api.restapi.resource.BackendClusterResource.class ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHooksResourceTest.clusterId.toString ( ) ) ; org.easymock.EasyMock.expect ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHooksResourceTest.parentMock.get ( ) ) . andReturn ( cluster ) . anyTimes ( ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHooksResourceTest.parentMock ) ; setupListExpectations ( ) ; }

Target:
protected void init ( ) { super . init ( ) ; org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHooksResourceTest.parentMock = org.mockito.Mockito.mock ( org.ovirt.engine.api.restapi.resource.BackendClusterResource.class ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHooksResourceTest.clusterId.toString ( ) ) ; org.mockito.Mockito.when ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHooksResourceTest.parentMock.get ( ) ) . thenReturn ( cluster ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHooksResourceTest.parentMock ) ; setupListExpectations ( ) ; }
Source:
public void fillTagsRecursive ( org.ovirt.engine.core.common.businessentities.Tags tagToFill , java.util.List < org.ovirt.engine.core.common.businessentities.Tags > children ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > list = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : children ) { if ( ( tag.gettype ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { list.add ( tag ) ; if ( ( tag.getChildren ( ) ) != null ) { fillTagsRecursive ( tag , tag.getChildren ( ) ) ; } } } tagToFill.setChildren ( list ) ; }

Target:
public void fillTagsRecursive ( org.ovirt.engine.core.common.businessentities.Tags tagToFill , java.util.List < org.ovirt.engine.core.common.businessentities.Tags > children ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > list = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : children ) { if ( ( tag.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { list.add ( tag ) ; if ( ( tag.getChildren ( ) ) != null ) { fillTagsRecursive ( tag , tag.getChildren ( ) ) ; } } } tagToFill.setChildren ( list ) ; }
Source:
protected static org.ovirt.engine.core.compat.Guid getPrestartedVmToAttach ( org.ovirt.engine.core.compat.NGuid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Up ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( map.getvm_guid ( ) ) ) { return map.getvm_guid ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
private static org.ovirt.engine.core.dao.DiskDao getDiskDao ( ) { return org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) ; }
Source:
protected org.ovirt.engine.sdk4.Connection testConnection ( ) { return org.ovirt.engine.sdk4.ConnectionBuilder.connection ( ) . url ( testUrl ( ) ) . user ( testUser ( ) ) . password ( testPassword ( ) ) . keyStorePath ( testKeyStorePath ( ) ) . keyStorePassword ( testKeyStorePassword ( ) ) . build ( ) ; }

Target:
protected org.ovirt.engine.sdk4.Connection testConnection ( ) { return org.ovirt.engine.sdk4.ConnectionBuilder.connection ( ) . url ( testUrl ( ) ) . user ( testUser ( ) ) . password ( testPassword ( ) ) . trustStoreFile ( testTrustStoreFile ( ) ) . trustStorePassword ( testTrustStorePassword ( ) ) . build ( ) ; }
Source:
public static int GetDataCenterMaxNameLength ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.DataProvider.cacheDataCenterMaxNameLength ) == ( - 1 ) ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { org.ovirt.engine.ui.uicommonweb.DataProvider.cacheDataCenterMaxNameLength = ( ( java.lang.Integer ) ( returnValue.getReturnValue ( ) ) ) ; } else { org.ovirt.engine.ui.uicommonweb.DataProvider.cacheDataCenterMaxNameLength = 1 ; } } return org.ovirt.engine.ui.uicommonweb.DataProvider.cacheDataCenterMaxNameLength ; }

Target:
public static int GetDataCenterMaxNameLength ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.DataProvider.cacheDataCenterMaxNameLength ) == ( - 1 ) ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = org.ovirt.engine.ui.uicommonweb.DataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) ) ; if ( ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { org.ovirt.engine.ui.uicommonweb.DataProvider.cacheDataCenterMaxNameLength = ( ( java.lang.Integer ) ( returnValue.getReturnValue ( ) ) ) ; } else { org.ovirt.engine.ui.uicommonweb.DataProvider.cacheDataCenterMaxNameLength = 1 ; } } return org.ovirt.engine.ui.uicommonweb.DataProvider.cacheDataCenterMaxNameLength ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsDiskSnapshotPluggedTo ( ) { return vmsDiskSnapshotPluggedTo ; }

Target:
private boolean validateCanUpdateReadOnly ( ) { if ( ( ( updateReadOnlyRequested ( ) ) && ( ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) && ( vmDeviceForVm.getIsPlugged ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; } return true ; }
Source:
public void testIsNetworkInSyncWhenStaticBootProtocolAddressEqual ( ) throws java.lang.Exception { initIpConfigurationBootProtocolAddress ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL , true ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4BootProtocolDifferent ( ) throws java.lang.Exception { initIpv4ConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNetworkIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.compat.Guid networkId = attachment.getNetworkId ( ) ; java.lang.String networkName = attachment.getNetworkName ( ) ; boolean bothIdentificationSet = ( networkId != null ) && ( networkName != null ) ; java.lang.String [ ] replacements = createIncoherentNetworkIdentificationErrorReplacements ( attachment.getId ( ) , networkId , networkName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY , replacements ) . when ( ( bothIdentificationSet && ( networkNameAndNetworkIdIsIncoherent ( networkId , networkName ) ) ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNetworkIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.core.compat.Guid networkId = attachment.getNetworkId ( ) ; java.lang.String networkName = attachment.getNetworkName ( ) ; org.ovirt.engine.core.compat.Guid violatingEntityId = attachment.getId ( ) ; return validateCoherentIdentification ( violatingEntityId , networkId , networkName , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NETWORK_INCOHERENTLY , networkBusinessEntityMap ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; hostSetupNetworksParametersData.getNetworkAttachments ( ) . addAll ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ) ( returnValue2 ) ) ) ; queryVfsConfig ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; hostSetupNetworksParametersData.getNetworkAttachments ( ) . addAll ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ) ( returnValue2 ) ) ) ; initNetworkIdToExistingAttachmentMap ( ) ; queryVfsConfig ( ) ; }
Source:
public org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient call ( ) throws java.lang.Exception { org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = reactorForClient.createClient ( org.ovirt.vdsm.jsonrpc.client.reactors.TestReactor.HOSTNAME , 6668 ) ; client.addEventListener ( new org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.EventListener ( ) { @ java.lang.Override public void onMessageReceived ( byte [ ] message ) { queue.add ( message ) ; } } ) ; client.setRetryPolicy ( new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy ( 2000 , 10 , java.io.IOException.class ) ) ; client.connect ( ) ; return client ; }

Target:
public org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient call ( ) throws java.lang.Exception { org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = reactorForClient.createClient ( org.ovirt.vdsm.jsonrpc.client.reactors.TestReactor.HOSTNAME , 6668 ) ; client.addEventListener ( new org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.MessageListener ( ) { @ java.lang.Override public void onMessageReceived ( byte [ ] message ) { queue.add ( message ) ; } } ) ; client.setRetryPolicy ( new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy ( 2000 , 10 , java.io.IOException.class ) ) ; client.connect ( ) ; return client ; }
Source:
public void testGetLunsToUpdateInDbDiffLunIdDiffPvId ( ) { org.ovirt.engine.core.compat.Guid lunFromVgLunId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.Map < org.ovirt.engine.core.bll.storage.domain.SyncLunsInfoForBlockStorageDomainCommand.LunHandler , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > lunsToUpdateInDb = getLunsToUpdateInDb ( lunFromVgLunId , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > newLunsToSaveInDb = lunsToUpdateInDb.get ( command.saveLunsHandler ) ; org.junit.Assert.assertEquals ( java.util.stream.Stream.of ( command.saveLunsHandler , command.removeLunsHandler ) . collect ( java.util.stream.Collectors.toSet ( ) ) , lunsToUpdateInDb.keySet ( ) ) ; assertLunIdInList ( newLunsToSaveInDb , lunFromVgLunId ) ; }

Target:
public void testGetLunsToUpdateInDbDiffLunIdDiffPvId ( ) { org.ovirt.engine.core.compat.Guid lunFromVgLunId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.Map < org.ovirt.engine.core.bll.storage.domain.SyncLunsInfoForBlockStorageDomainCommand.LunHandler , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > lunsToUpdateInDb = getLunsToUpdateInDb ( lunFromVgLunId , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > newLunsToSaveInDb = lunsToUpdateInDb.get ( command.saveLunsHandler ) ; org.junit.jupiter.api.Assertions.assertEquals ( java.util.stream.Stream.of ( command.saveLunsHandler , command.removeLunsHandler ) . collect ( java.util.stream.Collectors.toSet ( ) ) , lunsToUpdateInDb.keySet ( ) ) ; assertLunIdInList ( newLunsToSaveInDb , lunFromVgLunId ) ; }
Source:
public void testGetAllMultiDiskImageSearch ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "Disks" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.Disk ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( diskImageResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testGetAllMultiDiskImageSearch ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "Disks" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.Disk ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( diskImageResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
public static void GetAllProviders ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } java.util.Collections.sort ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( source ) ) , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) , aQuery ) ; }

Target:
public static void getAllProviders ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } java.util.Collections.sort ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( source ) ) , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStatus" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc glusterVolumeSnapshotConfigGet ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.configList" ) . withOptionalParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc ( clusterId , response ) ; }
Source:
private static void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.errors.VdcFault fault ) { if ( ( org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) ) != null ) { java.lang.String translatedMessage = org.ovirt.engine.ui.frontend.Frontend.vdsmErrorsTranslator.TranslateErrorTextSingle ( ( ( fault.getError ( ) ) == null ? fault.getMessage ( ) : fault.getError ( ) . toString ( ) ) ) ; fault.setMessage ( translatedMessage ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runActionExecutionFailed ( actionType , fault ) ; } }

Target:
private static void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.errors.VdcFault fault ) { if ( ( org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) ) != null ) { java.lang.String translatedMessage = org.ovirt.engine.ui.frontend.Frontend.translateVdcFault ( fault ) ; fault.setMessage ( translatedMessage ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runActionExecutionFailed ( actionType , fault ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; cleanConnection ( storageListModel.fileConnection , storageListModel.hostId ) ; storageListModel.fileConnection = null ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storages = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; if ( ( storages != null ) && ( ( storages.size ( ) ) > 0 ) ) { handleDomainAlreadyExists ( storageListModel , storages ) ; } else { storageListModel.saveNewPosixStorage ( ) ; } }
Source:
private void extractRemovedBonds ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : getExistingIfaces ( ) . values ( ) ) { java.lang.String bondName = iface.getBondName ( ) ; if ( ( org.apache.commons.lang.StringUtils.isNotBlank ( bondName ) ) && ( ! ( bonds.containsKey ( bondName ) ) ) ) { removedBonds.add ( bondName ) ; } } }

Target:
private void extractRemovedBonds ( ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : getExistingIfaces ( ) . values ( ) ) { java.lang.String bondName = iface.getBondName ( ) ; if ( ( org.apache.commons.lang.StringUtils.isNotBlank ( bondName ) ) && ( ! ( bonds.containsKey ( bondName ) ) ) ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface existingBond = getExistingIfaces ( ) . get ( bondName ) ; existingBond.setLabels ( null ) ; removedBonds.put ( bondName , existingBond ) ; } } }
Source:
public void autoSelectImageType ( final java.lang.String pathname ) { if ( pathname != null ) { getVolumeFormat ( ) . setSelectedItem ( VolumeFormat.RAW ) ; } }

Target:
private void updateVolumeType ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = getDiskModel ( ) . getStorageDomain ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.storage.VolumeType volumeType = getDiskModel ( ) . getVolumeType ( ) . getSelectedItem ( ) ; if ( storageDomain != null ) { getVolumeFormat ( ) . setItems ( new java.util.ArrayList ( java.util.Collections.singletonList ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDiskVolumeFormat ( volumeType , storageDomain.getStorageType ( ) ) ) ) ) ; } }
Source:
public void execute ( int iterationId ) { try { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( getStorageDomain ( ) . getstorage_type ( ) ) . ConnectStorageToDomainByVdsId ( getStorageDomain ( ) , getVdss ( ) . get ( iterationId ) . getId ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.storage.ConnectSingleAsyncOperation.log.errorFormat ( "Failed to connect host {0} to storage pool {1}. Exception: {3}" , getVdss ( ) . get ( iterationId ) . getvds_name ( ) , getStoragePool ( ) . getname ( ) , e ) ; } }

Target:
public void execute ( int iterationId ) { try { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( getStorageDomain ( ) . getstorage_type ( ) ) . connectStorageToDomainByVdsId ( getStorageDomain ( ) , getVdss ( ) . get ( iterationId ) . getId ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.storage.ConnectSingleAsyncOperation.log.errorFormat ( "Failed to connect host {0} to storage pool {1}. Exception: {3}" , getVdss ( ) . get ( iterationId ) . getvds_name ( ) , getStoragePool ( ) . getname ( ) , e ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc migrateStatus ( java.lang.String vmId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.getMigrationStatus" ) . withParameter ( "vmID" , vmId ) . 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 glusterGeoRepKeysUpdate ( java.util.List < java.lang.String > geoRepPubKeys , java.lang.String userName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepKeysUpdate" ) . withParameter ( "geoRepPubKeys" , geoRepPubKeys ) . withOptionalParameter ( "userName" , userName ) . 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 java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "NetworkCluster {id=" ) . append ( getId ( ) ) . append ( ", status=" ) . append ( getstatus ( ) ) . append ( ", is_display=" ) . append ( getis_display ( ) ) . append ( ", required=" ) . append ( isRequired ( ) ) . append ( "}" ) ; return builder.toString ( ) ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "NetworkCluster {id=" ) . append ( getId ( ) ) . append ( ", status=" ) . append ( getStatus ( ) ) . append ( ", display=" ) . append ( isDisplay ( ) ) . append ( ", required=" ) . append ( isRequired ( ) ) . append ( "}" ) ; return builder.toString ( ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.StorageDomain object ) { if ( ( object.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . get ( object.getStorageDomainSharedStatus ( ) ) ; } else { return org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . get ( object.getStatus ( ) ) ; } }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.StorageDomain object ) { if ( ( object.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) { return org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . translate ( object.getStorageDomainSharedStatus ( ) ) ; } else { return org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . translate ( object.getStatus ( ) ) ; } }
Source:
private void doInit ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { context = input.< org.ovirt.engine.api.extensions.ExtMap > get ( Base.InvokeKeys.CONTEXT ) ; context.< java.util.List < java.lang.String > > get ( Base.ContextKeys.CONFIGURATION_SENSITIVE_KEYS ) . add ( "config.authn.user.password" ) ; context.mput ( Base.ContextKeys.AUTHOR , "The oVirt Project" ) . mput ( Base.ContextKeys.EXTENSION_NAME , "Internal Authn (Built-in)" ) . mput ( Base.ContextKeys.LICENSE , "ASL 2.0" ) . mput ( Base.ContextKeys.HOME_URL , "http://www.ovirt.org" ) . mput ( Base.ContextKeys.VERSION , "N/A" ) . mput ( Authn.ContextKeys.CAPABILITIES , Authn.Capabilities.AUTHENTICATE_PASSWORD ) . mput ( Base.ContextKeys.BUILD_INTERFACE_VERSION , Base.INTERFACE_VERSION_CURRENT ) ; java.util.Properties config = context.< java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) ; adminUser = config.getProperty ( "config.authn.user.name" ) ; adminPassword = config.getProperty ( "config.authn.user.password" ) ; }

Target:
private void doLoad ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { context = input.< org.ovirt.engine.api.extensions.ExtMap > get ( Base.InvokeKeys.CONTEXT ) ; context.< java.util.List < java.lang.String > > get ( Base.ContextKeys.CONFIGURATION_SENSITIVE_KEYS ) . add ( "config.authn.user.password" ) ; context.mput ( Base.ContextKeys.AUTHOR , "The oVirt Project" ) . mput ( Base.ContextKeys.EXTENSION_NAME , "Internal Authn (Built-in)" ) . mput ( Base.ContextKeys.LICENSE , "ASL 2.0" ) . mput ( Base.ContextKeys.HOME_URL , "http://www.ovirt.org" ) . mput ( Base.ContextKeys.VERSION , "N/A" ) . mput ( Authn.ContextKeys.CAPABILITIES , Authn.Capabilities.AUTHENTICATE_PASSWORD ) . mput ( Base.ContextKeys.BUILD_INTERFACE_VERSION , Base.INTERFACE_VERSION_CURRENT ) ; java.util.Properties config = context.< java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) ; adminUser = config.getProperty ( "config.authn.user.name" ) ; adminPassword = config.getProperty ( "config.authn.user.password" ) ; }
Source:
public void testAlreadyExistStorageDomain ( ) { org.mockito.Mockito.when ( storageDomainStaticDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.domain.AddExistingBlockStorageDomainCommandTest.getStorageDomain ( ) ) ; org.junit.Assert.assertFalse ( "Storage Domain already exists" , command.canAddDomain ( ) ) ; org.junit.Assert.assertTrue ( "Import block Storage Domain should have failed due to already existing Storage Domain" , command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST.toString ( ) ) ) ; }

Target:
public void testAlreadyExistStorageDomain ( ) { org.mockito.Mockito.when ( storageDomainStaticDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.domain.AddExistingBlockStorageDomainCommandTest.getStorageDomain ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( command.canAddDomain ( ) , "Storage Domain already exists" ) ; org.junit.jupiter.api.Assertions.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST.toString ( ) ) , "Import block Storage Domain should have failed due to already existing Storage Domain" ) ; }
Source:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getImage ( ) { if ( ( image ) == null ) { image = org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getDiskImageDao ( ) . get ( getImageId ( ) ) ; if ( ( image ) == null ) { image = org.ovirt.engine.core.bll.storage.disk.image.BaseImagesCommand.getDiskImageDao ( ) . getSnapshotById ( getImageId ( ) ) ; } } return image ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskImage getImage ( ) { if ( ( image ) == null ) { image = diskImageDao.get ( getImageId ( ) ) ; if ( ( image ) == null ) { image = diskImageDao.getSnapshotById ( getImageId ( ) ) ; } } return image ; }
Source:
private void dumpMap ( java.lang.String prefix , org.ovirt.engine.api.extensions.ExtMap map ) { org.slf4j.Logger logger = context.< org.slf4j.Logger > get ( ExtensionsManager.TRACE_LOG_CONTEXT_KEY ) ; if ( logger.isDebugEnabled ( ) ) { logger.debug ( ( prefix + " BEGIN" ) ) ; logger.debug ( map.toString ( ) ) ; logger.debug ( ( prefix + " END" ) ) ; } }

Target:
private void dumpMap ( java.lang.String prefix , org.ovirt.engine.api.extensions.ExtMap map ) { org.slf4j.Logger logger = context.< org.slf4j.Logger > get ( ExtensionsManager.TRACE_LOG_CONTEXT_KEY ) ; if ( logger.isTraceEnabled ( ) ) { logger.trace ( ( prefix + " BEGIN" ) ) ; logger.trace ( map.toString ( ) ) ; logger.trace ( ( prefix + " END" ) ) ; } }
Source:
public void getGlusterSwiftServerServices ( 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.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > > aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
public void isConnWithSameDetailsExist ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections existingConn = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; existingConn.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; org.mockito.Mockito.when ( iscsiStorageHelper.findConnectionWithSameDetails ( newISCSIConnection ) ) . thenReturn ( existingConn ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertTrue ( isExists ) ; }

Target:
public void isConnWithSameDetailsExist ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections existingConn = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3650" , "user1" , "mypassword123" ) ; existingConn.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; org.mockito.Mockito.when ( iscsiStorageHelper.findConnectionWithSameDetails ( newISCSIConnection ) ) . thenReturn ( existingConn ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.jupiter.api.Assertions.assertTrue ( isExists ) ; }
Source:
public void executeCommandWhenServerIdPresent ( ) { setUpMocksForUpdate ( ) ; mockForReadContent ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_UPDATED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWhenServerIdPresent ( ) { setUpMocksForUpdate ( ) ; mockForReadContent ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_UPDATED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public static org.ovirt.engine.core.bll.provider.storage.OpenStackVolumeProviderProxy getFromStorageDomainId ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomainStatic = getDbFacade ( ) . getStorageDomainStaticDao ( ) . get ( storageDomainId ) ; if ( storageDomainStatic != null ) { org.ovirt.engine.core.common.businessentities.Provider provider = getDbFacade ( ) . getProviderDao ( ) . get ( new org.ovirt.engine.core.compat.Guid ( storageDomainStatic.getStorage ( ) ) ) ; return org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( provider ) ; } return null ; }

Target:
private static org.ovirt.engine.core.bll.provider.storage.OpenStackVolumeProviderProxy getProviderFromStorageDomainStatic ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomainStatic ) { org.ovirt.engine.core.common.businessentities.Provider provider = getDbFacade ( ) . getProviderDao ( ) . get ( new org.ovirt.engine.core.compat.Guid ( storageDomainStatic.getStorage ( ) ) ) ; return org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( provider ) ; }
Source:
private void endVmRelatedOps ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getVmFromDB ( ) ; if ( vm != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( vm.getId ( ) ) ; UpdateVmImSpm ( ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } }

Target:
protected void EndImportCommand ( ) { setVm ( null ) ; EndActionOnAllImageGroups ( ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) ) ; updateVmInSpm ( ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } setSucceeded ( true ) ; }
Source:
public static void GetHighUtilizationForEvenDistribution ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.HighUtilizationForEvenlyDistribute , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetLocalFSPath ( 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.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RhevhLocalFSPath , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . endAction ( org.ovirt.engine.core.bll.ImportVmCommand.getImagesActionType ( ) , p ) ; } }

Target:
protected void endActionOnAllImageGroups ( ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase p : getParameters ( ) . getImagesParameters ( ) ) { p.setTaskGroupSuccess ( getParameters ( ) . getTaskGroupSuccess ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getBackend ( ) . endAction ( VdcActionType.CopyImageGroup , p , org.ovirt.engine.core.bll.ImportVmCommand.getContext ( ) . clone ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ) ; } }
Source:
private org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator createHostSetupNetworkValidator ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setNetworkAttachments ( networkAttachments ) ; return new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setHost ( host ) . setParams ( params ) . build ( ) ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedBonds ( org.ovirt.engine.core.compat.Guid ... ids ) { if ( nullParameters ( ids ) ) { return this ; } if ( ( parameters.getRemovedBonds ( ) ) == null ) { parameters.setRemovedBonds ( new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ) ; } parameters.getRemovedBonds ( ) . addAll ( java.util.Arrays.asList ( ids ) ) ; return this ; }
Source:
public javax.ws.rs.core.Response remove ( org.ovirt.engine.api.model.Action action ) { get ( ) ; org.ovirt.engine.core.common.action.RemoveDiskParameters params = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( asGuid ( id ) ) ; if ( action.isSetForce ( ) ) { params.setForceDelete ( action.isForce ( ) ) ; } if ( ( action.isSetStorageDomain ( ) ) && ( action.getStorageDomain ( ) . isSetId ( ) ) ) { params.setStorageDomainId ( asGuid ( action.getStorageDomain ( ) . getId ( ) ) ) ; } return performAction ( VdcActionType.RemoveDisk , params ) ; }

Target:
public org.ovirt.engine.api.model.Disk addParents ( org.ovirt.engine.api.model.Disk entity ) { entity.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; entity.getTemplate ( ) . setId ( templateId.toString ( ) ) ; return entity ; }
Source:
public void testAttachFailDomainAlreadyInPool ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap > isoMap = new java.util.ArrayList < > ( ) ; isoMap.add ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ) ; org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( isoMap ) ; org.ovirt.engine.core.bll.ValidationResult attachedDomainInsertionResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertFalse ( "Attaching domain that is already in a pool succeeded while it should have failed" , attachedDomainInsertionResult.isValid ( ) ) ; assertFailingMessage ( "Attaching domain that is already in a pool failed with the wrong message" , attachedDomainInsertionResult , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ; }

Target:
public void testAttachFailDomainAlreadyInPool ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap > isoMap = new java.util.ArrayList < > ( ) ; isoMap.add ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ) ; org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( isoMap ) ; org.ovirt.engine.core.bll.ValidationResult attachedDomainInsertionResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertThat ( attachedDomainInsertionResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ) ; }
Source:
public void rollbackQuotaByVmId ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmId ) ; if ( vm != null ) { rollbackQuota ( vm.getstorage_pool_id ( ) , java.util.Arrays.asList ( vm.getQuotaId ( ) ) ) ; } }

Target:
public void rollbackQuotaByVmId ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmId ) ; if ( vm != null ) { removeQuotaFromCache ( vm.getstorage_pool_id ( ) , vm.getQuotaId ( ) ) ; } }
Source:
private void init ( ) { this . setIsAnimated ( TooltipConfig.IS_ANIMATED ) ; this . setPlacement ( TooltipConfig.PLACEMENT ) ; this . setIsHtml ( TooltipConfig.IS_HTML ) ; this . setTrigger ( TooltipConfig.TRIGGER ) ; this . setShowDelayMs ( TooltipConfig.SHOW_DELAY_MS ) ; this . setHideDelayMs ( TooltipConfig.HIDE_DELAY_MS ) ; this . setContainer ( TooltipConfig.CONTAINER ) ; }

Target:
public void execute ( ) { applyTooltip ( ) ; tooltipUpdateScheduled = false ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveCluster , org.ovirt.engine.core.common.action.ClusterParametersBase.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.RemoveCluster , org.ovirt.engine.core.common.action.ClusterParametersBase.class , new java.lang.String [ ] { "ClusterId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void New ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewDiskModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.NewDiskModel ( getSystemTreeSelectedItem ( ) ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . addVirtualDiskTitle ( ) ) ; model.setHashName ( "new_virtual_disk" ) ; setWindow ( model ) ; org.ovirt.engine.ui.uicommonweb.UICommand cancelCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , this ) ; cancelCommand.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) ; cancelCommand.setIsCancel ( true ) ; model.setCancelCommand ( cancelCommand ) ; model.Initialize ( ) ; }

Target:
private void newEntity ( ) { org.ovirt.engine.ui.uicommonweb.models.vms.NewDiskModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.NewDiskModel ( getSystemTreeSelectedItem ( ) ) ; model.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . addVirtualDiskTitle ( ) ) ; model.setHashName ( "new_virtual_disk" ) ; setWindow ( model ) ; org.ovirt.engine.ui.uicommonweb.UICommand cancelCommand = new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , this ) ; cancelCommand.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) ; cancelCommand.setIsCancel ( true ) ; model.setCancelCommand ( cancelCommand ) ; model.initialize ( ) ; }