auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.util.Set < java.lang.String > getPeers ( java.lang.String server , java.lang.String password ) throws javax.naming.AuthenticationException { org.ovirt.engine.core.utils.ssh.EngineSSHClient client = null ; try { client = connect ( server ) ; authenticate ( client , org.ovirt.engine.core.utils.gluster.GlusterUtil.USER , password ) ; java.lang.String serversXml = executePeerStatusCommand ( client ) ; return extractServers ( serversXml ) ; } finally { if ( client != null ) { client.disconnect ( ) ; } } }

Target:
public java.util.Set < java.lang.String > getPeers ( java.lang.String server , java.lang.String password ) throws javax.naming.AuthenticationException { org.ovirt.engine.core.bll.utils.EngineSSHClient client = null ; try { client = connect ( server ) ; authenticate ( client , org.ovirt.engine.core.bll.utils.GlusterUtil.USER , password ) ; java.lang.String serversXml = executePeerStatusCommand ( client ) ; return extractServers ( serversXml ) ; } finally { if ( client != null ) { client.disconnect ( ) ; } } }
Source:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }

Target:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
protected boolean wasSkippedDueToPolicy ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { boolean skipped = false ; if ( ( result.getActionReturnValue ( ) ) instanceof org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue fenceReturnValue = result.getActionReturnValue ( ) ; if ( ( fenceReturnValue.getReturnValue ( ) ) instanceof org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) { skipped = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( fenceReturnValue.getReturnValue ( ) ) ) . getIsSkipped ( ) ; } } return skipped ; }

Target:
protected boolean wasSkippedDueToPolicy ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { boolean skipped = false ; if ( ( result.getActionReturnValue ( ) ) instanceof org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue fenceReturnValue = result.getActionReturnValue ( ) ; if ( ( fenceReturnValue.getReturnValue ( ) ) instanceof org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) { skipped = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( fenceReturnValue.getReturnValue ( ) ) ) . getIsSkippedDueToPolicy ( ) ; } } return skipped ; }
Source:
private static int compDigitSequence ( java.lang.String seq1 , java.lang.String seq2 ) { int compRes = ( ( java.lang.Integer ) ( java.lang.Integer.parseInt ( seq1 ) ) ) . compareTo ( java.lang.Integer.parseInt ( seq2 ) ) ; return compRes == 0 ? org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator.compNonDigitSequence ( seq1 , seq2 ) : compRes ; }

Target:
private static int compDigitSequence ( java.lang.String seq1 , java.lang.String seq2 , boolean caseSensitive ) { int compRes = ( ( java.lang.Integer ) ( java.lang.Integer.parseInt ( seq1 ) ) ) . compareTo ( java.lang.Integer.parseInt ( seq2 ) ) ; return compRes == 0 ? org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator.compNonDigitSequence ( seq1 , seq2 , caseSensitive ) : compRes ; }
Source:
private void movePoolToProblematicInDB ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolStatusChange ( storagePool.getId ( ) , StoragePoolStatus.NonResponsive , AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC , VdcBllErrors.ENGINE ) ; storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; }

Target:
private void movePoolToProblematicInDB ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolStatusChange ( storagePool.getId ( ) , StoragePoolStatus.NonResponsive , AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC , VdcBllErrors.ENGINE ) ; storagePool.setSpmVdsId ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; }
Source:
public void onSuccess ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > resultObject ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from runMultipleQueries!" ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , resultObject ) ; callback.executed ( f ) ; raiseQueryCompleteEvent ( queryTypeList , context ) ; }

Target:
public void onSuccess ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > resultObject ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from runMultipleQueries!" ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , resultObject ) ; callback.executed ( f ) ; raiseQueryCompleteEvent ( queryTypeList , state ) ; }
Source:
public void testAllocateMacFromRequestForNonStatelessVmWhenMacIsUntouched ( ) { java.lang.String sameMac = "sameMac" ; nicBeingUpdated.setMacAddress ( sameMac ) ; updatingNic.setMacAddress ( sameMac ) ; underTest.initMacPoolData ( ) ; org.junit.Assert.assertThat ( "mac is not changed, no action with mac pool should be performed" , underTest.allocateMacFromRequest ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; org.mockito.Mockito.verifyNoMoreInteractions ( macPool ) ; }

Target:
public void testAllocateMacFromRequestForNonStatelessVmWhenMacIsUntouched ( ) { java.lang.String sameMac = "sameMac" ; nicBeingUpdated.setMacAddress ( sameMac ) ; updatingNic.setMacAddress ( sameMac ) ; underTest.initMacPoolData ( ) ; org.hamcrest.MatcherAssert.assertThat ( "mac is not changed, no action with mac pool should be performed" , underTest.allocateMacFromRequest ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; org.mockito.Mockito.verifyNoMoreInteractions ( macPool ) ; }
Source:
private < T > void styleTextBoxEditor ( org.ovirt.engine.ui.common.widget.editor.generic.EntityModelTextBoxOnlyEditor < T > editor , boolean enabled ) { if ( ! enabled ) { editor.setEnabled ( true ) ; com.google.gwt.user.client.ui.ValueBox < T > valueBox = editor.asValueBox ( ) ; valueBox.setReadOnly ( true ) ; valueBox.getElement ( ) . getStyle ( ) . setBorderWidth ( 0 , Style.Unit.PX ) ; } }

Target:
void addStyles ( ) { pathEditor.addContentWidgetContainerStyleName ( style.pathEditorContent ( ) ) ; expanderContent.setStyleName ( style.expanderContent ( ) ) ; versionListEditor.setStyleName ( style.versionListEditor ( ) ) ; retransmissionsEditor.setStyleName ( style.storageTextBoxEditor ( ) ) ; timeoutEditor.setStyleName ( style.storageTextBoxEditor ( ) ) ; mountOptionsEditor.setStyleName ( style.mountTextBoxEditor ( ) ) ; }
Source:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , true ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , true ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.resource.get ( ) ) ) ; }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void invalidHighMTU ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = new org.ovirt.engine.core.common.businessentities.VdsNetworkInterface ( ) ; nic.setMtu ( 15000 ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > > validate = validate ( nic ) ; junit.framework.Assert.assertTrue ( ( ( validate.size ( ) ) > 0 ) ) ; }

Target:
public void useDefaultMTU ( ) { java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.utils.MTUValidatorTest.MtuContainer > > validate = validate ( new org.ovirt.engine.core.common.utils.MTUValidatorTest.MtuContainer ( 0 ) ) ; junit.framework.Assert.assertTrue ( ( ( validate.size ( ) ) == 0 ) ) ; }
Source:
private void mockFencedHost ( ) { fencedHost = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( fencedHost.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCECD_HOST_ID ) ; org.mockito.Mockito.when ( fencedHost.getClusterId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_CLUSTER_ID ) ; org.mockito.Mockito.when ( fencedHost.getStoragePoolId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_DATACENTER_ID ) ; org.mockito.Mockito.when ( fencedHost.getHostName ( ) ) . thenReturn ( "fencedHost" ) ; org.mockito.Mockito.when ( fencedHost.getFenceAgents ( ) ) . thenReturn ( java.util.Arrays.asList ( createFenceAgent ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCECD_HOST_ID , "ipmilan" ) ) ) ; }

Target:
private void mockFencedHost ( ) { fencedHost = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( fencedHost.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCECD_HOST_ID ) ; org.mockito.Mockito.when ( fencedHost.getClusterId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_CLUSTER_ID ) ; org.mockito.Mockito.when ( fencedHost.getStoragePoolId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCED_HOST_DATACENTER_ID ) ; org.mockito.Mockito.when ( fencedHost.getHostName ( ) ) . thenReturn ( "fencedHost" ) ; org.mockito.Mockito.when ( fencedHost.getFenceAgents ( ) ) . thenReturn ( java.util.Collections.singletonList ( createFenceAgent ( org.ovirt.engine.core.bll.pm.FenceProxyLocatorTest.FENCECD_HOST_ID , "ipmilan" ) ) ) ; }
Source:
public void canDoActionPreallocatedSpaceCheckSucceeds ( ) { final int availableSize = 12 ; final int usedSize = 8 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
private static org.ovirt.engine.core.bll.validator.StorageDomainValidator mockStorageDomainValidatorWithoutSpace ( ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.mockStorageDomainValidator ( ) ; org.mockito.Mockito.when ( storageDomainValidator.hasSpaceForNewDisk ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.DiskImage.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN ) ) ; return storageDomainValidator ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel entity = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel ) ( sender ) ) ; boolean inputFieldsEnabled = ( ( java.lang.Boolean ) ( entity.getEntity ( ) ) ) ; getView ( ) . setInputFieldsEnabled ( inputFieldsEnabled ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.lang.String propertyName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "IsExecutionAllowed" . equals ( propertyName ) ) { getView ( ) . setApplyEnabled ( model.getApplyCommand ( ) . getIsExecutionAllowed ( ) ) ; } }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateParameters ( volume , "name" , "volumeType" , "bricks" ) ; validateEnumParameters ( volume ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getMapper ( org.ovirt.engine.api.model.GlusterVolume.class , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) . map ( volume , null ) ; volumeEntity.setClusterId ( asGuid ( parent.get ( ) . getId ( ) ) ) ; mapBricks ( volume , volumeEntity ) ; return performCreation ( VdcActionType.CreateGlusterVolume , new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( volumeEntity ) , new org.ovirt.engine.api.restapi.resource.gluster.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.gluster.IdQueryParameters.class ) , true ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateParameters ( volume , "name" , "volumeType" , "bricks" ) ; validateEnumParameters ( volume ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getMapper ( org.ovirt.engine.api.model.GlusterVolume.class , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) . map ( volume , null ) ; volumeEntity.setClusterId ( asGuid ( parent.get ( ) . getId ( ) ) ) ; mapBricks ( volume , volumeEntity ) ; return performCreate ( VdcActionType.CreateGlusterVolume , new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( volumeEntity ) , new org.ovirt.engine.api.restapi.resource.gluster.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) , true ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.ActivateVdsCommand.getParameters ( ) . isRunSilent ( ) ) { return org.ovirt.engine.core.bll.ActivateVdsCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.VDS_ACTIVATE_ASYNC : org.ovirt.engine.core.common.AuditLogType.VDS_ACTIVATE_FAILED_ASYNC ; } else { return org.ovirt.engine.core.bll.ActivateVdsCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.VDS_ACTIVATE : org.ovirt.engine.core.common.AuditLogType.VDS_ACTIVATE_FAILED ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.ActivateVdsCommand.getParameters ( ) . isRunSilent ( ) ) { return org.ovirt.engine.core.bll.ActivateVdsCommand.getSucceeded ( ) ? haMaintenanceFailed ? org.ovirt.engine.core.common.AuditLogType.VDS_ACTIVATE_MANUAL_HA_ASYNC : org.ovirt.engine.core.common.AuditLogType.VDS_ACTIVATE_ASYNC : org.ovirt.engine.core.common.AuditLogType.VDS_ACTIVATE_FAILED_ASYNC ; } else { return org.ovirt.engine.core.bll.ActivateVdsCommand.getSucceeded ( ) ? haMaintenanceFailed ? org.ovirt.engine.core.common.AuditLogType.VDS_ACTIVATE_MANUAL_HA : org.ovirt.engine.core.common.AuditLogType.VDS_ACTIVATE : org.ovirt.engine.core.common.AuditLogType.VDS_ACTIVATE_FAILED ; } }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( getGlusterVolume ( ) . getVolumeType ( ) . isDispersedType ( ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_REMOVE_BRICK_FROM_DISPERSE_VOLUME_NOT_SUPPORTED ) ; } org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator brickValidator = new org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator ( ) ; return validate ( brickValidator.canRemoveBrick ( getParameters ( ) . getBricks ( ) , getGlusterVolume ( ) , getParameters ( ) . getReplicaCount ( ) , true ) ) ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } if ( getGlusterVolume ( ) . getVolumeType ( ) . isDispersedType ( ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_REMOVE_BRICK_FROM_DISPERSE_VOLUME_NOT_SUPPORTED ) ; } org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator brickValidator = new org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator ( ) ; return validate ( brickValidator.canRemoveBrick ( getParameters ( ) . getBricks ( ) , getGlusterVolume ( ) , getParameters ( ) . getReplicaCount ( ) , true ) ) ; }
Source:
public void testActivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.HotPlugDiskToVm , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "DiskVmElement" } , new java.lang.Object [ ] { new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID ) } , true , true ) ) ; javax.ws.rs.core.Response response = resource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }

Target:
public void testActivate ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.HotPlugDiskToVm , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "DiskVmElement" } , new java.lang.Object [ ] { new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID ) } , true , true ) ) ; javax.ws.rs.core.Response response = resource.activate ( new org.ovirt.engine.api.model.Action ( ) ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }
Source:
public java.lang.String getHeaderHtml ( ) { if ( ( getDefaultImage ( ) ) == null ) { return org.ovirt.engine.ui.common.widget.table.column.ImageResourceColumn.CONSTANTS.empty ( ) ; } return org.ovirt.engine.ui.common.widget.table.column.ImageResourceColumn.TEMPLATES.imageWithTitle ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( getDefaultImage ( ) ) . getHTML ( ) ) , getDefaultTitle ( ) ) . asString ( ) ; }

Target:
public java.lang.String getHeaderHtml ( ) { if ( ( getDefaultImage ( ) ) == null ) { return org.ovirt.engine.ui.common.widget.table.column.AbstractImageResourceColumn.CONSTANTS.empty ( ) ; } return org.ovirt.engine.ui.common.widget.table.column.AbstractImageResourceColumn.TEMPLATES.imageWithTitle ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( getDefaultImage ( ) ) . getHTML ( ) ) , getDefaultTitle ( ) ) . asString ( ) ; }
Source:
public static java.lang.Object load ( java.io.File f ) { try ( java.io.ObjectInputStream ois = new java.io.ObjectInputStream ( new java.io.FileInputStream ( f ) ) ) { final org.ovirt.vdsmfake.domain.BaseObject baseObject = ( ( org.ovirt.vdsmfake.domain.BaseObject ) ( ois.readObject ( ) ) ) ; baseObject.setLastUpdate ( f.lastModified ( ) ) ; return baseObject ; } catch ( java.lang.Exception e ) { org.ovirt.vdsmfake.PersistUtils.log.error ( "Cannot save object" , e ) ; throw new java.lang.RuntimeException ( "Cannot load object" , e ) ; } }

Target:
public void remove ( org.ovirt.vdsmfake.domain.BaseObject baseObject ) { cache.remove ( ( ( baseObject.getClass ( ) . getSimpleName ( ) ) + ( baseObject.getId ( ) ) ) ) ; }
Source:
private java.lang.String GetLocalStoragesFormattedString ( ) { java.lang.StringBuilder localStorages = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { localStorages.append ( a.getStorageName ( ) ) . append ( ", " ) ; } } return localStorages.substring ( 0 , ( ( localStorages.length ( ) ) - 2 ) ) ; }

Target:
private java.lang.String getLocalStoragesFormattedString ( ) { java.lang.StringBuilder localStorages = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain a : org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > cast ( getSelectedItems ( ) ) ) { if ( ( a.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { localStorages.append ( a.getStorageName ( ) ) . append ( ", " ) ; } } return localStorages.substring ( 0 , ( ( localStorages.length ( ) ) - 2 ) ) ; }
Source:
public void testActiveDomainInList ( ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase param = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ) ; org.ovirt.engine.core.bll.storage.pool.RemoveStoragePoolCommand < org.ovirt.engine.core.common.action.StoragePoolParametersBase > cmd = org.ovirt.engine.core.bll.storage.pool.RemoveStoragePoolCommandTest.createCommand ( param ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain tempStorageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; tempStorageDomains.setStatus ( StorageDomainStatus.Active ) ; domainsList.add ( tempStorageDomains ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > listReturned = cmd.getActiveOrLockedDomainList ( domainsList ) ; org.junit.Assert.assertTrue ( ( ! ( listReturned.isEmpty ( ) ) ) ) ; }

Target:
public void testMaintenanceDomainInList ( ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase param = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ) ; org.ovirt.engine.core.bll.storage.pool.RemoveStoragePoolCommand < org.ovirt.engine.core.common.action.StoragePoolParametersBase > cmd = org.ovirt.engine.core.bll.storage.pool.RemoveStoragePoolCommandTest.createCommand ( param ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain tempStorageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; tempStorageDomains.setStatus ( StorageDomainStatus.Maintenance ) ; domainsList.add ( tempStorageDomains ) ; org.junit.Assert.assertTrue ( cmd.validateDomainsInMaintenance ( domainsList ) ) ; }
Source:
private void mockStorageDomainDao ( ) { org.ovirt.engine.core.common.businessentities.storage_domains storageDomains = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; storageDomains.setstatus ( StorageDomainStatus.Active ) ; storageDomains.setavailable_disk_size ( 10000000 ) ; storageDomains.setused_disk_size ( 10 ) ; org.mockito.Mockito.doReturn ( storageDomainDAO ) . when ( spyCommand ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.when ( storageDomainDAO.getForStoragePool ( storageDomainId , Guid.Empty ) ) . thenReturn ( storageDomains ) ; org.mockito.Mockito.when ( storageDomainDAO.get ( storageDomainId ) ) . thenReturn ( storageDomains ) ; }

Target:
private void mockStorageDomainDao ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomains.setStatus ( StorageDomainStatus.Active ) ; storageDomains.setAvailableDiskSize ( 10000000 ) ; storageDomains.setUsedDiskSize ( 10 ) ; org.mockito.Mockito.doReturn ( storageDomainDAO ) . when ( spyCommand ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.when ( storageDomainDAO.getForStoragePool ( storageDomainId , Guid.Empty ) ) . thenReturn ( storageDomains ) ; org.mockito.Mockito.when ( storageDomainDAO.get ( storageDomainId ) ) . thenReturn ( storageDomains ) ; }
Source:
public void testUpdateVolumeOption ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity optionAuthAllow = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.EXISTING_OPTION_ID ) ; org.junit.Assert.assertEquals ( GlusterConstants.OPTION_AUTH_ALLOW , optionAuthAllow.getKey ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.OPTION_AUTH_ALLOW_VALUE_ALL , optionAuthAllow.getValue ( ) ) ; dao.updateVolumeOption ( optionAuthAllow.getId ( ) , org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.OPTION_AUTH_ALLOW_VALUE_NEW ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity retrievedOption = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.EXISTING_OPTION_ID ) ; org.junit.Assert.assertNotNull ( retrievedOption ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.OPTION_AUTH_ALLOW_VALUE_NEW , retrievedOption.getValue ( ) ) ; }

Target:
public void testUpdateVolumeOption ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity optionAuthAllow = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.EXISTING_OPTION_ID ) ; org.junit.jupiter.api.Assertions.assertEquals ( GlusterConstants.OPTION_AUTH_ALLOW , optionAuthAllow.getKey ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.OPTION_AUTH_ALLOW_VALUE_ALL , optionAuthAllow.getValue ( ) ) ; dao.updateVolumeOption ( optionAuthAllow.getId ( ) , org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.OPTION_AUTH_ALLOW_VALUE_NEW ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity retrievedOption = dao.getById ( org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.EXISTING_OPTION_ID ) ; org.junit.jupiter.api.Assertions.assertNotNull ( retrievedOption ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dao.gluster.GlusterOptionDaoTest.OPTION_AUTH_ALLOW_VALUE_NEW , retrievedOption.getValue ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain getSourceDomain ( ) { if ( ( ( sourceDomain ) == null ) && ( ! ( Guid.Empty.equals ( sourceDomainId ) ) ) ) { sourceDomain = org.ovirt.engine.core.bll.ImportVmCommandBase.getStorageDomainDAO ( ) . getForStoragePool ( sourceDomainId , org.ovirt.engine.core.bll.ImportVmCommandBase.getStoragePool ( ) . getId ( ) ) ; } return sourceDomain ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain getSourceDomain ( ) { if ( ( ( sourceDomain ) == null ) && ( ! ( Guid.Empty.equals ( sourceDomainId ) ) ) ) { sourceDomain = org.ovirt.engine.core.bll.ImportVmCommandBase.getStorageDomainDao ( ) . getForStoragePool ( sourceDomainId , org.ovirt.engine.core.bll.ImportVmCommandBase.getStoragePool ( ) . getId ( ) ) ; } return sourceDomain ; }
Source:
public org.ovirt.engine.core.common.businessentities.VDSGroupHostsAndVMs mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.VDSGroupHostsAndVMs entity = new org.ovirt.engine.core.common.businessentities.VDSGroupHostsAndVMs ( ) ; entity.setHosts ( rs.getInt ( "hosts" ) ) ; entity.setVms ( rs.getInt ( "vms" ) ) ; entity.setVdsGroupId ( getGuid ( rs , "vds_group_id" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.ClusterHostsAndVMs mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.ClusterHostsAndVMs entity = new org.ovirt.engine.core.common.businessentities.ClusterHostsAndVMs ( ) ; entity.setHosts ( rs.getInt ( "hosts" ) ) ; entity.setVms ( rs.getInt ( "vms" ) ) ; entity.setClusterId ( getGuid ( rs , "cluster_id" ) ) ; return entity ; }
Source:
public void testListFailure ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae ) ; } }

Target:
public void testListFailure ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) ) ; }
Source:
public void setup ( ) { initVds ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsUpdateRunTimeInfoTest.initStaticMocks ( ) ; org.powermock.api.mockito.PowerMockito.spy ( org.ovirt.engine.core.utils.transaction.TransactionSupport.class ) ; org.powermock.api.mockito.PowerMockito.spy ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.class ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsUpdateRunTimeInfoTest.mockConfigVals ( ) ; org.mockito.MockitoAnnotations.initMocks ( this ) ; initConditions ( ) ; updater = org.powermock.api.mockito.PowerMockito.spy ( new org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo ( null , vds ) ) ; }

Target:
public void setup ( ) { initVds ( ) ; mockEjbStrategy ( ) ; initConditions ( ) ; updater = new org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo ( null , vds ) { @ java.lang.Override public org.ovirt.engine.core.dal.dbbroker.DbFacade getDbFacade ( ) { return dbFacade ; } @ java.lang.Override protected org.ovirt.engine.core.vdsbroker.MonitoringStrategy getMonitoringStrategyForVds ( org.ovirt.engine.core.common.businessentities.VDS param ) { return org.mockito.Mockito.mock ( org.ovirt.engine.core.vdsbroker.MonitoringStrategy.class ) ; } @ java.lang.Override protected void auditLog ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogable , org.ovirt.engine.core.common.AuditLogType logType ) { org.ovirt.engine.core.common.businessentities.AuditLog al = new org.ovirt.engine.core.common.businessentities.AuditLog ( ) ; al.setlog_type ( logType ) ; mockAuditLogDao.save ( al ) ; } } ; }
Source:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.ExportVmCommand.endActionOnAllImageGroups ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.unLockVm ( vm ) ; endDiskRelatedActions ( vm ) ; if ( org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getCopyCollapse ( ) ) { endCopyCollapseOperations ( vm ) ; } else { updateSnapshotOvf ( vm ) ; } org.ovirt.engine.core.bll.ExportVmCommand.setSucceeded ( true ) ; }

Target:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.ExportVmCommand.endActionOnAllImageGroups ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.ExportVmCommand.getVm ( ) ; org.ovirt.engine.core.bll.VmHandler.unLockVm ( vm ) ; populateVmData ( vm ) ; if ( org.ovirt.engine.core.bll.ExportVmCommand.getParameters ( ) . getCopyCollapse ( ) ) { endCopyCollapseOperations ( vm ) ; } else { updateSnapshotOvf ( vm ) ; } org.ovirt.engine.core.bll.ExportVmCommand.setSucceeded ( true ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { testFilter = new org.ovirt.engine.ui.frontend.server.caching.CachingFilter ( ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( CachingFilter.CACHE_INIT_PARAM ) ) . thenReturn ( ".*\\.cache\\..*|.*\\/theme(-resource)?\\/.*|.*\\.(css|gif|png|favicon|js|ttf|woff|woff2)(\\?.*)?" ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( CachingFilter.NO_CACHE_INIT_PARAM ) ) . thenReturn ( ".*WebAdmin\\.html|.*\\.nocache\\..*|.*\\/plugin\\/.*" ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( CachingFilter.NO_STORE_INIT_PARAM ) ) . thenReturn ( ".*GenericApiGWTService" ) ; testFilter.init ( mockConfig ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { testFilter = new org.ovirt.engine.core.utils.servlet.CachingFilter ( ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( CachingFilter.CACHE_INIT_PARAM ) ) . thenReturn ( ".*\\.cache\\..*|.*\\/theme(-resource)?\\/.*|.*\\.(css|gif|png|favicon|js|ttf|woff|woff2)(\\?.*)?" ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( CachingFilter.NO_CACHE_INIT_PARAM ) ) . thenReturn ( ".*WebAdmin\\.html|.*\\.nocache\\..*|.*\\/plugin\\/.*" ) ; org.mockito.Mockito.when ( mockConfig.getInitParameter ( CachingFilter.NO_STORE_INIT_PARAM ) ) . thenReturn ( ".*GenericApiGWTService" ) ; testFilter.init ( mockConfig ) ; }
Source:
private void setUpGetCertuficateExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsCertificateSubjectByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.CERTIFICATE ) ; } }

Target:
public void testCloneFromTemplateWithClonePermissionsDontClone ( ) throws java.lang.Exception { doTestCloneFromTemplateWithClonePermissions ( createModel ( createDisksCollection ( ) ) , false ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getStorageDomainId ( org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.common.businessentities.StorageDomainType type , org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { org.ovirt.engine.core.compat.Guid returnValue = org.ovirt.engine.core.compat.Guid.Empty ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = getStorageDomain ( poolId , type , status ) ; if ( domain != null ) { returnValue = domain.getId ( ) ; } return returnValue ; }

Target:
private org.ovirt.engine.core.compat.Guid getStorageDomainId ( org.ovirt.engine.core.compat.Guid poolId , org.ovirt.engine.core.common.businessentities.StorageDomainType type , org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { org.ovirt.engine.core.compat.Guid returnValue = org.ovirt.engine.core.compat.Guid.Empty ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = getStorageDomains ( poolId , type , status ) ; if ( ! ( domains.isEmpty ( ) ) ) { returnValue = domains.get ( 0 ) . getId ( ) ; } return returnValue ; }
Source:
public static void getDataCenterList ( 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }
Source:
public synchronized void cancelTask ( org.ovirt.engine.core.compat.Guid vdsmTaskId ) { if ( _tasks.containsKey ( vdsmTaskId ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.infoFormat ( "Attempting to cancel task '{0}'." , vdsmTaskId ) ; _tasks.get ( vdsmTaskId ) . stopTask ( ) ; _tasks.get ( vdsmTaskId ) . concreteStartPollingTask ( ) ; } }

Target:
public synchronized void cancelTask ( org.ovirt.engine.core.compat.Guid vdsmTaskId ) { if ( _tasks.containsKey ( vdsmTaskId ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.info ( "Attempting to cancel task '{}'." , vdsmTaskId ) ; _tasks.get ( vdsmTaskId ) . stopTask ( ) ; _tasks.get ( vdsmTaskId ) . concreteStartPollingTask ( ) ; } }
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:
private void processSingleClusterChanges ( org.ovirt.engine.core.common.action.ManageNetworkClustersParameters param ) { final org.ovirt.engine.core.bll.network.cluster.transformer.NetworkClustersToSetupNetworksParametersTransformer networkClustersToSetupNetworksParametersTransformer = networkClustersToSetupNetworksParametersTransformerFactory.createNetworkClustersToSetupNetworksParametersTransformer ( getContext ( ) ) ; final java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > setupNetworksParams = new java.util.ArrayList < > ( ) ; setupNetworksParams.addAll ( networkClustersToSetupNetworksParametersTransformer.transform ( param.getAttachments ( ) , param.getDetachments ( ) ) ) ; org.ovirt.engine.core.bll.network.HostSetupNetworksParametersBuilder.updateParametersSequencing ( setupNetworksParams ) ; runInternalMultipleActions ( VdcActionType.PersistentHostSetupNetworks , setupNetworksParams ) ; }

Target:
private void processSingleClusterChanges ( org.ovirt.engine.core.common.action.ManageNetworkClustersParameters param ) { final org.ovirt.engine.core.bll.network.cluster.transformer.NetworkClustersToSetupNetworksParametersTransformer networkClustersToSetupNetworksParametersTransformer = networkClustersToSetupNetworksParametersTransformerFactory.createNetworkClustersToSetupNetworksParametersTransformer ( getContext ( ) ) ; final java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > setupNetworksParams = new java.util.ArrayList < > ( ) ; setupNetworksParams.addAll ( networkClustersToSetupNetworksParametersTransformer.transform ( param.getAttachments ( ) , param.getDetachments ( ) ) ) ; org.ovirt.engine.core.bll.network.HostSetupNetworksParametersBuilder.updateParametersSequencing ( setupNetworksParams ) ; setParentCommandInfo ( setupNetworksParams ) ; runInternalMultipleActions ( VdcActionType.PersistentHostSetupNetworks , setupNetworksParams ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.action.UiAction unlabelNics ( java.util.List < org.ovirt.engine.core.common.action.LabelNicParameters > removedLabelsParameters ) { org.ovirt.engine.ui.uicommonweb.action.UiVdcAction uiVdcAction = new org.ovirt.engine.ui.uicommonweb.action.UiVdcAction ( org.ovirt.engine.core.common.action.VdcActionType.UnlabelNic , removedLabelsParameters.get ( 0 ) , this , true ) ; int size = removedLabelsParameters.size ( ) ; if ( size == 1 ) { return uiVdcAction ; } else { return uiVdcAction.then ( unlabelNics ( removedLabelsParameters.subList ( 1 , size ) ) ) ; } }

Target:
private void initAllModels ( boolean fetchFromBackend ) { if ( fetchFromBackend ) { startProgress ( ) ; queryLabels ( ) ; } else { initLabelModels ( ) ; initNetworkModels ( ) ; initNicModels ( ) ; } }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Permit model , int index ) { org.junit.Assert.assertEquals ( java.lang.Integer.toString ( ( index + 1 ) ) , model.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup = org.ovirt.engine.core.common.businessentities.ActionGroup.forValue ( ( index + 1 ) ) ; org.junit.Assert.assertEquals ( actionGroup.name ( ) . toLowerCase ( ) , model.getName ( ) ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Permit model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( java.lang.Integer.toString ( ( index + 1 ) ) , model.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup = org.ovirt.engine.core.common.businessentities.ActionGroup.forValue ( ( index + 1 ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( actionGroup.name ( ) . toLowerCase ( ) , model.getName ( ) ) ; }
Source:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public void getIsGlusterVolumeSnapshotCliScheduleEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotCliScheduleFlag , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

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