auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case noVM : org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase outEx = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.createDefaultConcreteException ( "Cancel migration has failed. Please try again in a few moments and track the VM's event log for details" ) ; InitializeVdsError ( returnStatus ) ; outEx.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( org.ovirt.engine.core.common.errors.VdcBllErrors.MIGRATION_CANCEL_ERROR_NO_VM , org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getReturnStatus ( ) . mMessage ) ) ; throw outEx ; default : super . ProceedProxyReturnValue ( ) ; } }

Target:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case noVM : org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase outEx = org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.createDefaultConcreteException ( "Cancel migration has failed. Please try again in a few moments and track the VM's event log for details" ) ; initializeVdsError ( returnStatus ) ; outEx.setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( org.ovirt.engine.core.common.errors.VdcBllErrors.MIGRATION_CANCEL_ERROR_NO_VM , org.ovirt.engine.core.vdsbroker.vdsbroker.CancelMigrateVDSCommand.getReturnStatus ( ) . mMessage ) ) ; throw outEx ; default : super . ProceedProxyReturnValue ( ) ; } }
Source:
protected void handleVdsErrors ( org.ovirt.engine.core.common.AuditLogType errType , java.util.List < java.lang.String > errors ) { errorType = errType ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getExecuteFailedMessages ( ) . addAll ( errors ) ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getFault ( ) . setMessage ( org.apache.commons.lang.StringUtils.join ( errors , SystemUtils.LINE_SEPARATOR ) ) ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getFault ( ) . setError ( null ) ; }

Target:
protected void handleVdsErrors ( org.ovirt.engine.core.common.AuditLogType errType , java.util.List < java.lang.String > errors ) { propagateFailure ( errType , errors ) ; org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getReturnValue ( ) . getFault ( ) . setError ( null ) ; }
Source:
public static void GetClusterList ( 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void GetTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.GetVmTemplatesDisksParameters ( templateId ) , aQuery ) ; }
Source:
public void testRemoveCommit ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.volumeId } , helper.getVolumeEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.CommitRemoveGlusterVolumeBricks , org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
private org.ovirt.engine.api.model.GlusterBricks getBrickModelsToRemove ( ) { org.ovirt.engine.api.model.GlusterBricks bricks = new org.ovirt.engine.api.model.GlusterBricks ( ) ; org.ovirt.engine.api.model.GlusterBrick brick = new org.ovirt.engine.api.model.GlusterBrick ( ) ; brick.setId ( GUIDS [ 0 ] . toString ( ) ) ; bricks.getGlusterBricks ( ) . add ( brick ) ; return bricks ; }
Source:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getDefaultManagementNetwork ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { runQueryByIdParameter ( VdcQueryType.GetDefaultManagementNetwork , aQuery , dataCenterId ) ; }
Source:
public static void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
private void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
protected void moveOrCopyAllImageGroups ( org.ovirt.engine.core.compat.Guid containerID , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalAction ( VdcActionType.CopyImageGroup , buildMoveOrCopyImageGroupParametersForDisk ( disk , containerID ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( getExecutionContext ( ) ) ) ; if ( ! ( vdcRetValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcRetValue.getFault ( ) . getError ( ) , "ImportVmCommand::MoveOrCopyAllImageGroups: Failed to copy disk!" ) ; } getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; return qRetVal.getSucceeded ( ) ? qRetVal.< java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getReturnValue ( ) : null ; }
Source:
private void Spice_Connected ( java.lang.Object sender ) { setIsConnected ( true ) ; UpdateActionAvailability ( ) ; }

Target:
private void spice_Disconnected ( java.lang.Object sender , org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs e ) { getspice ( ) . getDisconnectedEvent ( ) . removeListener ( this ) ; getspice ( ) . getMenuItemSelectedEvent ( ) . removeListener ( this ) ; setIsConnected ( false ) ; updateActionAvailability ( ) ; if ( ( e.getErrorCode ( ) ) > 100 ) { getErrorEvent ( ) . raise ( this , e ) ; } }
Source:
public void reportCompleted ( ) { try { super . reportCompleted ( ) ; } finally { if ( ( getDestinationVdsId ( ) ) != null ) { decreasePendingVms ( getDestinationVdsId ( ) ) ; } } }

Target:
private boolean perform ( ) { org.ovirt.engine.core.bll.MigrateVmCommand.getParameters ( ) . setStartTime ( new java.util.Date ( ) ) ; try { if ( ( connectLunDisks ( getDestinationVdsId ( ) ) ) && ( migrateVm ( ) ) ) { org.ovirt.engine.core.bll.job.ExecutionHandler.setAsyncJob ( org.ovirt.engine.core.bll.MigrateVmCommand.getExecutionContext ( ) , true ) ; return true ; } } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { } org.ovirt.engine.core.bll.MigrateVmCommand.runningFailed ( ) ; return false ; }
Source:
private static org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomain ( org.ovirt.engine.core.compat.Guid guid , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.Integer size ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( guid ) ; storageDomain.setStorageDomainType ( StorageDomainType.Data ) ; storageDomain.setStorageType ( storageType ) ; storageDomain.setStatus ( StorageDomainStatus.Active ) ; storageDomain.setAvailableDiskSize ( size ) ; return storageDomain ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomain ( org.ovirt.engine.core.compat.Guid guid , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.Integer size ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( guid ) ; storageDomain.setStorageDomainType ( StorageDomainType.Data ) ; storageDomain.setStorageType ( storageType ) ; storageDomain.setStatus ( StorageDomainStatus.Active ) ; storageDomain.setAvailableDiskSize ( size ) ; return storageDomain ; }
Source:
protected boolean validateUploadToImage ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( diskDao.get ( imageId ) ) ) ; org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator = getDiskValidator ( diskImage ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = getDiskImagesValidator ( diskImage ) ; return ( ( ( validate ( diskValidator.isDiskExists ( ) ) ) && ( validate ( diskValidator.isDiskAttachedToAnyVm ( ) ) ) ) && ( validate ( diskImagesValidator.diskImagesNotIllegal ( ) ) ) ) && ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) ; }

Target:
protected boolean validateImageTransfer ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( diskDao.get ( imageId ) ) ) ; org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator = getDiskValidator ( diskImage ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = getDiskImagesValidator ( diskImage ) ; return ( ( ( validate ( diskValidator.isDiskExists ( ) ) ) && ( validate ( diskValidator.isDiskAttachedToAnyVm ( ) ) ) ) && ( validate ( diskImagesValidator.diskImagesNotIllegal ( ) ) ) ) && ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) ; }
Source:
public void setUp ( ) { org.mockito.Mockito.when ( iconDefaultsProvider.getVmIconDefaults ( ) ) . thenReturn ( new java.util.HashMap < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > ( ) { { put ( 0 , new org.ovirt.engine.core.common.queries.VmIconIdSizePair ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "00000000-0000-0000-0000-00000000000a" ) , org.ovirt.engine.core.compat.Guid.createGuidFromString ( "00000000-0000-0000-0000-00000000000b" ) ) ) ; } } ) ; org.mockito.Mockito.doNothing ( ) . when ( ovfManager ) . updateBootOrderOnDevices ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmBase.class ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }

Target:
public void setUp ( ) { org.mockito.Mockito.when ( iconDefaultsProvider.getVmIconDefaults ( ) ) . thenReturn ( new java.util.HashMap < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > ( ) { { put ( 0 , new org.ovirt.engine.core.common.queries.VmIconIdSizePair ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "00000000-0000-0000-0000-00000000000a" ) , org.ovirt.engine.core.compat.Guid.createGuidFromString ( "00000000-0000-0000-0000-00000000000b" ) ) ) ; } } ) ; org.mockito.Mockito.doNothing ( ) . when ( ovfManager ) . updateBootOrderOnDevices ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmBase.class ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; ovfManager.setOsRepository ( osRepository ) ; }
Source:
private void mockVmHandler ( ) { org.powermock.api.mockito.PowerMockito.when ( org.ovirt.engine.core.bll.VmHandler.VerifyAddVm ( org.mockito.Matchers.< java.util.ArrayList > any ( java.util.ArrayList.class ) , org.mockito.Matchers.anyInt ( ) , org.mockito.Matchers.< org.ovirt.engine.core.common.businessentities.VmTemplate > anyObject ( ) , org.mockito.Matchers.< org.ovirt.engine.core.compat.Guid > any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anyInt ( ) ) ) . thenReturn ( java.lang.Boolean.TRUE ) ; }

Target:
private static void mockVerifyAddVM ( org.ovirt.engine.core.bll.AddVmCommand < ? > cmd ) { org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . verifyAddVM ( org.mockito.Matchers.anyListOf ( java.lang.String.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anyInt ( ) ) ; }
Source:
private java.lang.String resolveNamespace ( java.lang.String dn ) { java.lang.String candidate = "" ; for ( java.lang.String namespace : namespaces ) { if ( ( dn.endsWith ( ( "," + namespace ) ) ) && ( ( namespace.length ( ) ) > ( candidate.length ( ) ) ) ) { candidate = namespace ; } } if ( candidate.isEmpty ( ) ) { candidate = null ; } return candidate ; }

Target:
private java.lang.String resolveNamespace ( java.lang.String dn ) { java.lang.String candidate = "" ; for ( java.lang.String namespace : namespaces ) { if ( ( dn.endsWith ( ( "," + namespace ) ) ) && ( ( namespace.length ( ) ) > ( candidate.length ( ) ) ) ) { candidate = namespace ; } } if ( candidate.isEmpty ( ) ) { if ( ( defaultNamespace ) == null ) { candidate = null ; } else { candidate = defaultNamespace ; } } return candidate ; }
Source:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetStepsWithSubjectEntitiesByJobId , org.ovirt.engine.core.common.queries.GetStepsWithSubjectEntitiesByJobIdQueryParameters.class , new java.lang.String [ ] { "JobId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpSteps ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetStepsWithSubjectEntitiesByJobId , org.ovirt.engine.core.common.queries.GetStepsWithSubjectEntitiesByJobIdQueryParameters.class , new java.lang.String [ ] { "JobId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , setUpSteps ( ) , failure ) ; }
Source:
public void testTypedViewCache ( ) throws java.lang.Exception { java.io.File file = writeConf ( ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString view1 = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString.class ) ; org.junit.Assert.assertNotNull ( view1 ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString view2 = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString.class ) ; org.junit.Assert.assertNotNull ( view2 ) ; org.junit.Assert.assertSame ( view1 , view2 ) ; }

Target:
public void testTypedViewCache ( ) throws java.lang.Exception { java.io.File file = writeConf ( ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.jupiter.api.Assertions.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString view1 = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString.class ) ; org.junit.jupiter.api.Assertions.assertNotNull ( view1 ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString view2 = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString.class ) ; org.junit.jupiter.api.Assertions.assertNotNull ( view2 ) ; org.junit.jupiter.api.Assertions.assertSame ( view1 , view2 ) ; }
Source:
public javax.ws.rs.core.Response get ( ) { R tmp = newModel ( ) ; tmp.setId ( getId ( ) ) ; tmp = org.ovirt.engine.api.common.util.LinkHelper.addLinks ( getUriInfo ( ) , tmp ) ; javax.ws.rs.core.Response.Status status = javax.ws.rs.core.Response.Status.MOVED_PERMANENTLY ; return javax.ws.rs.core.Response.status ( status ) . location ( java.net.URI.create ( tmp.getHref ( ) ) ) . build ( ) ; }

Target:
public javax.ws.rs.core.Response get ( ) { R tmp = newModel ( ) ; tmp.setId ( getId ( ) ) ; tmp = org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , tmp ) ; javax.ws.rs.core.Response.Status status = javax.ws.rs.core.Response.Status.MOVED_PERMANENTLY ; return javax.ws.rs.core.Response.status ( status ) . location ( java.net.URI.create ( tmp.getHref ( ) ) ) . build ( ) ; }
Source:
private void changeIsAttached ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel , java.lang.Boolean value ) { clusterNetworkModel.setAttached ( value ) ; if ( ( ! value ) && ( clusterNetworkModel.isDisplayNetwork ( ) ) ) { clusterNetworkModel.setDisplayNetwork ( false ) ; } if ( ( ! value ) && ( clusterNetworkModel.isRequired ( ) ) ) { clusterNetworkModel.setRequired ( false ) ; } }

Target:
private void changeIsAttached ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel , java.lang.Boolean value ) { clusterNetworkModel.setAttached ( value ) ; if ( ! value ) { if ( clusterNetworkModel.isDisplayNetwork ( ) ) { updateDisplayNetwork ( clusterNetworkModel , false ) ; } if ( clusterNetworkModel.isMigrationNetwork ( ) ) { updateMigrationNetwork ( clusterNetworkModel , false ) ; } if ( clusterNetworkModel.isRequired ( ) ) { clusterNetworkModel.setRequired ( false ) ; } } }
Source:
public org.ovirt.engine.sdk.decorators.VMNIC add ( org.ovirt.engine.sdk.decorators.NIC nic ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , nic , org.ovirt.engine.sdk.entities.NIC.class , org.ovirt.engine.sdk.decorators.VMNIC.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.decorators.VMNIC add ( org.ovirt.engine.sdk.decorators.NIC nic ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . add ( url , nic , org.ovirt.engine.sdk.entities.NIC.class , org.ovirt.engine.sdk.decorators.VMNIC.class , headers ) ; }
Source:
public void onBootstrap ( ) { super . onBootstrap ( ) ; com.google.gwt.user.client.Window.setTitle ( dynamicMessages.applicationTitle ( ) ) ; org.ovirt.engine.ui.webadmin.uimode.UiModeData uiModeData = org.ovirt.engine.ui.webadmin.uimode.UiModeData.instance ( ) ; if ( uiModeData != null ) { handleUiMode ( uiModeData ) ; } placeManager.revealCurrentPlace ( ) ; }

Target:
protected void performBootstrap ( ) { super . performBootstrap ( ) ; com.google.gwt.user.client.Window.setTitle ( dynamicMessages.applicationTitle ( ) ) ; org.ovirt.engine.core.common.mode.ApplicationMode uiMode = org.ovirt.engine.ui.webadmin.uimode.UiModeData.getUiMode ( ) ; if ( uiMode != null ) { org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.setUiMode ( uiMode ) ; } placeManager.revealCurrentPlace ( ) ; }
Source:
public int getAvailableMacsCount ( ) { lockObj.readLock ( ) . lock ( ) ; try { if ( ! ( initialized ) ) { logInitializationError ( "Failed to get available Macs count." ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_NOT_INITIALIZED ) ; } int availableMacsSize = availableMacs.size ( ) ; org.ovirt.engine.core.bll.network.MacPoolManager.log.debugFormat ( "Number of available Mac addresses = {0}" , availableMacsSize ) ; return availableMacsSize ; } finally { lockObj.readLock ( ) . unlock ( ) ; } }

Target:
public int getAvailableMacsCount ( ) { lockObj.readLock ( ) . lock ( ) ; try { if ( ! ( initialized ) ) { logInitializationError ( "Failed to get available Macs count." ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_NOT_INITIALIZED ) ; } int availableMacsSize = availableMacs.size ( ) ; org.ovirt.engine.core.bll.network.MacPoolManager.log.debugFormat ( "{0}: Number of available Mac addresses = {1}" , instanceId ( ) , availableMacsSize ) ; return availableMacsSize ; } finally { lockObj.readLock ( ) . unlock ( ) ; } }
Source:
static org.ovirt.engine.api.model.Network setUpEntityExpectations ( org.ovirt.engine.api.model.Network entity , boolean isDisplay , boolean isRequired , int index ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; networkCluster.setis_display ( isDisplay ) ; networkCluster.setRequired ( isRequired ) ; org.easymock.EasyMock.expect ( entity.getCluster ( ) ) . andReturn ( networkCluster ) . anyTimes ( ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.setUpEntityExpectations ( entity , index ) ; }

Target:
static org.ovirt.engine.api.model.Network setUpEntityExpectations ( org.ovirt.engine.api.model.Network entity , boolean isDisplay , boolean isRequired , int index ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; networkCluster.setDisplay ( isDisplay ) ; networkCluster.setRequired ( isRequired ) ; org.easymock.EasyMock.expect ( entity.getCluster ( ) ) . andReturn ( networkCluster ) . anyTimes ( ) ; return org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.setUpEntityExpectations ( entity , index ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.bll.gluster.GetGlusterVolumeOptionsInfoQuery.getBackendResourceManager ( ) . RunVdsCommand ( VDSCommandType.GetGlusterVolumeOptionsInfo , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( getUpServerId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeOptionsInfoQuery.getParameters ( ) . getClusterId ( ) ) ) ) ; org.ovirt.engine.core.bll.gluster.GetGlusterVolumeOptionsInfoQuery.getQueryReturnValue ( ) . setReturnValue ( returnValue.getReturnValue ( ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.GetGlusterVolumeOptionsInfo , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( getUpServerId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeOptionsInfoQuery.getParameters ( ) . getClusterId ( ) ) ) ) ; org.ovirt.engine.core.bll.gluster.GetGlusterVolumeOptionsInfoQuery.getQueryReturnValue ( ) . setReturnValue ( returnValue.getReturnValue ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc getStorageDomainsList ( java.lang.String spUUID , int domainType , java.lang.String poolType , java.lang.String path ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getStorageDomains" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "domainClass" , domainType ) . withParameter ( "storageType" , poolType ) . withParameter ( "remotePath" , path ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "domlist" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturn getStorageDomainsList ( java.lang.String spUUID , int domainType , java.lang.String poolType , java.lang.String path ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getStorageDomains" ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "domainClass" , domainType ) . withParameter ( "storageType" , poolType ) . withParameter ( "remotePath" , path ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "domlist" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StorageDomainListReturn ( response ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM mockVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; vm.setVmtGuid ( vmTemplateId ) ; vm.setStaticData ( getVmStatic ( ) ) ; vm.setClusterArch ( ArchitectureType.x86_64 ) ; return vm ; }

Target:
private org.ovirt.engine.core.common.businessentities.VM mockVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; vm.setVmtGuid ( vmTemplateId ) ; vm.setStaticData ( getVmStatic ( ) ) ; vm.setClusterArch ( ArchitectureType.x86_64 ) ; vm.setName ( "my_vm" ) ; return vm ; }
Source:
public void removeAll ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > interfaces = getVmNetworkInterfaceDAO ( ) . getAllForVm ( vmId ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : interfaces ) { getMacPoolManager ( ) . freeMac ( iface.getMacAddress ( ) ) ; getVmNetworkInterfaceDAO ( ) . remove ( iface.getId ( ) ) ; getVmNetworkStatisticsDAO ( ) . remove ( iface.getId ( ) ) ; } } }

Target:
public void removeAll ( org.ovirt.engine.core.compat.Guid vmId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = getVmNetworkInterfaceDAO ( ) . getAllForVm ( vmId ) ; if ( interfaces != null ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : interfaces ) { getMacPoolManager ( ) . freeMac ( iface.getMacAddress ( ) ) ; getVmNetworkInterfaceDAO ( ) . remove ( iface.getId ( ) ) ; getVmNetworkStatisticsDAO ( ) . remove ( iface.getId ( ) ) ; } } }
Source:
public void vdsGroupWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }

Target:
public void clusterWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( clusterDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateClusterCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; validateFailedWithReason ( EngineMessage.CLUSTER_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }
Source:
public static java.util.List < java.lang.String > assertValidationMessages ( java.lang.String assertionMessage , org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.errors.EngineMessage message ) { java.util.List < java.lang.String > validationMessages = command.getReturnValue ( ) . getValidationMessages ( ) ; org.junit.Assert.assertTrue ( java.text.MessageFormat.format ( "{0}validate messages doesn''t contain expected message: {1}, messages are: {2}" , org.ovirt.engine.core.bll.ValidateTestUtils.optionalMessage ( assertionMessage ) , message.name ( ) , validationMessages ) , validationMessages.contains ( message.name ( ) ) ) ; return validationMessages ; }

Target:
public static java.util.List < java.lang.String > assertValidationMessages ( java.lang.String assertionMessage , org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.errors.EngineMessage message ) { java.util.List < java.lang.String > validationMessages = command.getReturnValue ( ) . getValidationMessages ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( validationMessages.contains ( message.name ( ) ) , java.text.MessageFormat.format ( "{0}validate messages doesn''t contain expected message: {1}, messages are: {2}" , org.ovirt.engine.core.bll.ValidateTestUtils.optionalMessage ( assertionMessage ) , message.name ( ) , validationMessages ) ) ; return validationMessages ; }
Source:
public org.ovirt.engine.core.utils.ssh.SSHClient getSSHClient ( ) { return new org.ovirt.engine.core.utils.ssh.SSHClient ( ) ; }

Target:
public org.ovirt.engine.core.utils.ssh.SSHClient getSSHClient ( java.lang.String hostname ) { java.lang.Long timeout = java.util.concurrent.TimeUnit.SECONDS.toMillis ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ConnectToServerTimeoutInSeconds ) ) ; org.ovirt.engine.core.utils.ssh.SSHClient sshclient = new org.ovirt.engine.core.utils.ssh.SSHClient ( ) ; sshclient.setHardTimeout ( timeout ) ; sshclient.setSoftTimeout ( timeout ) ; sshclient.setHost ( hostname ) ; sshclient.setUser ( org.ovirt.engine.core.bll.AddVdsCommand.USER_NAME ) ; sshclient.setPassword ( org.ovirt.engine.core.bll.AddVdsCommand.getParameters ( ) . getRootPassword ( ) ) ; return sshclient ; }
Source:
public void getQosByVmId ( ) { org.ovirt.engine.core.common.businessentities.qos.CpuQos cpuQos = dao.getCpuQosByVmId ( FixturesTool.VM_RHEL5_POOL_50 ) ; org.junit.Assert.assertNotNull ( cpuQos ) ; org.junit.Assert.assertEquals ( FixturesTool.QOS_ID_4 , cpuQos.getId ( ) ) ; }

Target:
public void getQosByVmId ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.qos.CpuQos > cpuQosMap = dao.getCpuQosByVmIds ( java.util.Collections.singleton ( FixturesTool.VM_RHEL5_POOL_50 ) ) ; org.junit.Assert.assertNotNull ( cpuQosMap ) ; org.junit.Assert.assertEquals ( FixturesTool.QOS_ID_4 , cpuQosMap.get ( FixturesTool.VM_RHEL5_POOL_50 ) . getId ( ) ) ; }
Source:
public void setupMock ( org.ovirt.engine.core.bll.utils.GlusterGeoRepUtil geoRepUtil , org.ovirt.engine.core.dao.gluster.GlusterGeoRepDao geoRepDao , org.ovirt.engine.core.dao.ClusterDao clusterDao ) { org.mockito.Mockito.doReturn ( geoRepDao ) . when ( geoRepUtil ) . getGeoRepDao ( ) ; org.mockito.Mockito.doReturn ( getGeoRepSessions ( ) ) . when ( geoRepDao ) . getAllSessions ( ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( geoRepUtil ) . getClusterDao ( ) ; org.mockito.Mockito.doReturn ( getCluster ( MASTER_CLUSTER_ID , CLUSTER_COMPATIBILITY_VERSION ) ) . when ( clusterDao ) . get ( MASTER_CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getCluster ( SLAVE_CLUSTER_ID , CLUSTER_COMPATIBILITY_VERSION ) ) . when ( clusterDao ) . get ( SLAVE_CLUSTER_ID ) ; }

Target:
public void setupMock ( org.ovirt.engine.core.bll.utils.GlusterGeoRepUtil geoRepUtil , org.ovirt.engine.core.dao.gluster.GlusterGeoRepDao geoRepDao , org.ovirt.engine.core.dao.ClusterDao clusterDao ) { org.mockito.Mockito.doReturn ( geoRepDao ) . when ( geoRepUtil ) . getGeoRepDao ( ) ; org.mockito.Mockito.doReturn ( getGeoRepSessions ( ) ) . when ( geoRepDao ) . getAllSessions ( ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( geoRepUtil ) . getClusterDao ( ) ; org.mockito.Mockito.doReturn ( getCluster ( MASTER_CLUSTER_ID , org.ovirt.engine.core.bll.gluster.GeoRepCreateEligibilityBaseTest.CLUSTER_COMPATIBILITY_VERSION ) ) . when ( clusterDao ) . get ( MASTER_CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getCluster ( SLAVE_CLUSTER_ID , org.ovirt.engine.core.bll.gluster.GeoRepCreateEligibilityBaseTest.CLUSTER_COMPATIBILITY_VERSION ) ) . when ( clusterDao ) . get ( SLAVE_CLUSTER_ID ) ; }
Source:
public void testTwoArgConstructor ( ) { java.lang.String pattern = "pattern" ; boolean caseSensitive = new java.util.Random ( ) . nextBoolean ( ) ; org.ovirt.engine.core.common.queries.AdGroupsSearchParameters params = new org.ovirt.engine.core.common.queries.AdGroupsSearchParameters ( pattern , caseSensitive ) ; org.junit.Assert.assertTrue ( "Wrong pattern" , params.getSearchPattern ( ) . endsWith ( pattern ) ) ; org.junit.Assert.assertEquals ( "Wrong type" , SearchType.AdGroup , params.getSearchTypeValue ( ) ) ; org.junit.Assert.assertEquals ( "Wrong case sensitivity" , caseSensitive , params.getCaseSensitive ( ) ) ; }

Target:
public void testTwoArgConstructor ( ) { java.lang.String pattern = "pattern" ; boolean caseSensitive = this . random.nextBoolean ( ) ; org.ovirt.engine.core.common.queries.AdGroupsSearchParameters params = new org.ovirt.engine.core.common.queries.AdGroupsSearchParameters ( pattern , caseSensitive ) ; org.junit.Assert.assertTrue ( "Wrong pattern" , params.getSearchPattern ( ) . endsWith ( pattern ) ) ; org.junit.Assert.assertEquals ( "Wrong type" , SearchType.AdGroup , params.getSearchTypeValue ( ) ) ; org.junit.Assert.assertEquals ( "Wrong case sensitivity" , caseSensitive , params.getCaseSensitive ( ) ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getSnapshotDao ( ) . get ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getParameters ( ) . getDstSnapshotId ( ) ) ; if ( snapshot != null ) { jobProperties.put ( VdcObjectType.Snapshot.name ( ) . toLowerCase ( ) , snapshot.getDescription ( ) ) ; } } return jobProperties ; }

Target:
public java.lang.String getSnapshotName ( ) { if ( ( super . getSnapshotName ( ) ) == null ) { final org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getSnapshotDao ( ) . get ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getParameters ( ) . getDstSnapshotId ( ) ) ; if ( snapshot != null ) { setSnapshotName ( snapshot.getDescription ( ) ) ; } } return super . getSnapshotName ( ) ; }
Source:
public void makeSortable ( ) { makeSortable ( new java.util.Comparator < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) { @ java.lang.Override public int compare ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity o1 , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity o2 ) { return ( o1.getStatus ( ) . ordinal ( ) ) - ( o2.getStatus ( ) . ordinal ( ) ) ; } } ) ; }

Target:
public void makeSortable ( ) { makeSortable ( java.util.Comparator.comparingInt ( ( g ) -> g.getStatus ( ) . ordinal ( ) ) ) ; }
Source:
private void mockVdsSingleAgent ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createHost ( ) ; vds.getFenceAgents ( ) . remove ( 1 ) ; org.mockito.Mockito.when ( vdsDao.get ( org.ovirt.engine.core.bll.StartVdsCommandTest.FENCECD_HOST_ID ) ) . thenReturn ( vds ) ; }

Target:
public void onFailureResetInitialStatus ( ) { mockExecutor ( false ) ; try { command.executeCommand ( ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException exception ) { org.mockito.Mockito.verify ( vdsBrokerFrontend ) . RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.SetVdsStatus ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters.class ) ) ; return ; } org.junit.Assert.fail ( ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { testServlet = new org.ovirt.engine.core.WelcomeServlet ( ) ; testServlet.setBackend ( mockBackend ) ; testServlet.init ( mockBrandingManager ) ; mockBackendQuery ( VdcQueryType.GetConfigurationValue , "oVirtVersion" ) ; org.mockito.Mockito.when ( mockBrandingManager.getBrandingThemes ( ) ) . thenReturn ( new java.util.ArrayList < org.ovirt.engine.core.branding.BrandingTheme > ( ) ) ; org.mockito.Mockito.when ( mockBrandingManager.getWelcomeSections ( org.mockito.Matchers.any ( java.util.Locale.class ) ) ) . thenReturn ( "Welcome Section HTML" ) ; }

Target:
public java.util.Map < java.lang.String , java.lang.Object > isSsoWebappDeployed ( ) { return java.util.Collections.emptyMap ( ) ; }
Source:
public static org.ovirt.engine.api.model.Tag map ( org.ovirt.engine.core.common.businessentities.Tags entity , org.ovirt.engine.api.model.Tag template ) { org.ovirt.engine.api.model.Tag model = ( template != null ) ? template : new org.ovirt.engine.api.model.Tag ( ) ; model.setId ( entity.gettag_id ( ) . toString ( ) ) ; model.setName ( entity.gettag_name ( ) ) ; model.setDescription ( entity.getdescription ( ) ) ; model.setParent ( org.ovirt.engine.api.restapi.types.TagMapper.parent ( entity ) ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.Tag map ( org.ovirt.engine.core.common.businessentities.Tags entity , org.ovirt.engine.api.model.Tag template ) { org.ovirt.engine.api.model.Tag model = ( template != null ) ? template : new org.ovirt.engine.api.model.Tag ( ) ; model.setId ( entity.getTagId ( ) . toString ( ) ) ; model.setName ( entity.getTagName ( ) ) ; model.setDescription ( entity.getDescription ( ) ) ; model.setParent ( org.ovirt.engine.api.restapi.types.TagMapper.parent ( entity ) ) ; return model ; }
Source:
public void setup ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) ) . when ( command ) . getCluster ( ) ; org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setClusterId ( clusterId ) ; org.mockito.Mockito.doReturn ( vmStatic ) . when ( vmStaticDao ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( clusterId ) . when ( command ) . getClusterId ( ) ; }

Target:
private org.ovirt.engine.core.common.scheduling.AffinityGroup createAffinityGroup ( ) { affinityGroup = new org.ovirt.engine.core.common.scheduling.AffinityGroup ( ) ; affinityGroup.setEntityIds ( new java.util.ArrayList < > ( ) ) ; affinityGroup.getEntityIds ( ) . add ( vmId ) ; affinityGroup.setClusterId ( clusterId ) ; return affinityGroup ; }
Source:
public void retrieveFromHttpSession ( final java.lang.String key , final org.ovirt.engine.ui.frontend.communication.StorageCallback callback ) { getService ( ) . retrieveFromHttpSession ( key , new com.google.gwt.user.client.rpc.AsyncCallback < java.lang.String > ( ) { @ java.lang.Override public void onSuccess ( final java.lang.String result ) { callback.onSuccess ( result ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { callback.onFailure ( caught ) ; } } ) ; }

Target:
public void serviceFound ( org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync service ) { service.retrieveFromHttpSession ( key , new com.google.gwt.user.client.rpc.AsyncCallback < java.lang.String > ( ) { @ java.lang.Override public void onSuccess ( final java.lang.String result ) { callback.onSuccess ( result ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { callback.onFailure ( caught ) ; } } ) ; }
Source:
public void testDnsResolverConfigurationInSyncWithHostWhenDhcpIsUsed ( ) { iface.setIpv4DefaultRoute ( false ) ; network.setDnsResolverConfiguration ( sampleDnsResolverConfiguration2 ) ; testedNetworkAttachment.setDnsResolverConfiguration ( null ) ; iface.setIpv4BootProtocol ( Ipv4BootProtocol.DHCP ) ; org.ovirt.engine.core.common.businessentities.network.IPv4Address address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; address.setBootProtocol ( Ipv4BootProtocol.DHCP ) ; testedNetworkAttachment.getIpConfiguration ( ) . setIPv4Addresses ( java.util.Collections.singletonList ( address ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( true , sampleDnsResolverConfiguration ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testDnsResolverConfigurationInSyncWithHostWhenDhcpIsUsed ( ) { iface.setIpv4DefaultRoute ( false ) ; network.setDnsResolverConfiguration ( sampleDnsResolverConfiguration2 ) ; testedNetworkAttachment.setDnsResolverConfiguration ( null ) ; iface.setIpv4BootProtocol ( Ipv4BootProtocol.DHCP ) ; org.ovirt.engine.core.common.businessentities.network.IPv4Address address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; address.setBootProtocol ( Ipv4BootProtocol.DHCP ) ; testedNetworkAttachment.getIpConfiguration ( ) . setIPv4Addresses ( java.util.Collections.singletonList ( address ) ) ; org.hamcrest.MatcherAssert.assertThat ( createTestedInstance ( true , sampleDnsResolverConfiguration ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
private void runVerify ( java.lang.String testMask , java.lang.String errorMessage ) { org.junit.Assert.assertFalse ( underTest.isValid ( testMask , contextMock ) ) ; org.mockito.Mockito.verify ( contextMock ) . disableDefaultConstraintViolation ( ) ; org.mockito.Mockito.verify ( contextMock ) . buildConstraintViolationWithTemplate ( errorMessage ) ; org.mockito.Mockito.verify ( mockConstraintViolationBuilder ) . addNode ( "mask" ) ; org.mockito.Mockito.verify ( mockNodeBuilderDefinedContext ) . addConstraintViolation ( ) ; }

Target:
private void runVerify ( java.lang.String testMask , java.lang.String errorMessage ) { org.junit.jupiter.api.Assertions.assertFalse ( underTest.isValid ( testMask , contextMock ) ) ; org.mockito.Mockito.verify ( contextMock ) . disableDefaultConstraintViolation ( ) ; org.mockito.Mockito.verify ( contextMock ) . buildConstraintViolationWithTemplate ( errorMessage ) ; org.mockito.Mockito.verify ( mockConstraintViolationBuilder ) . addNode ( "mask" ) ; org.mockito.Mockito.verify ( mockNodeBuilderDefinedContext ) . addConstraintViolation ( ) ; }