auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void addStoragePoolToDb ( ) { org.ovirt.engine.core.bll.storage.pool.AddEmptyStoragePoolCommand.getStoragePool ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.storage.pool.AddEmptyStoragePoolCommand.getStoragePool ( ) . setStatus ( StoragePoolStatus.Uninitialized ) ; org.ovirt.engine.core.bll.storage.pool.AddEmptyStoragePoolCommand.getStoragePool ( ) . setMacPoolId ( calculateMacPoolIdToUse ( ) ) ; org.ovirt.engine.core.bll.storage.pool.AddEmptyStoragePoolCommand.getStoragePoolDao ( ) . save ( org.ovirt.engine.core.bll.storage.pool.AddEmptyStoragePoolCommand.getStoragePool ( ) ) ; }

Target:
protected void addStoragePoolToDb ( ) { org.ovirt.engine.core.bll.storage.pool.AddEmptyStoragePoolCommand.getStoragePool ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.storage.pool.AddEmptyStoragePoolCommand.getStoragePool ( ) . setStatus ( StoragePoolStatus.Uninitialized ) ; org.ovirt.engine.core.bll.storage.pool.AddEmptyStoragePoolCommand.getStoragePoolDao ( ) . save ( org.ovirt.engine.core.bll.storage.pool.AddEmptyStoragePoolCommand.getStoragePool ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( returnValue ) ) ; model.SetDataCenter ( model , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.storage_pool [ ] { dataCenter } ) ) ) ; model.getDataCenter ( ) . setIsChangable ( false ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.storage_pool ) ( returnValue ) ) ; model.SetDataCenter ( model , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.storage_pool [ ] { dataCenter } ) ) ) ; model.getDataCenter ( ) . setIsChangable ( false ) ; }
Source:
protected void handleCopyResult ( org.ovirt.engine.core.common.businessentities.DiskImage copiedDiskImage , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getParameters ( ) . getImagesParameters ( ) . add ( parameters ) ; if ( ! ( result.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.VolumeCreationError ) ; } else { org.ovirt.engine.core.bll.ImagesHandler.addDiskImageWithNoVmDevice ( copiedDiskImage ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getTaskIdList ( ) . addAll ( result.getInternalTaskIdList ( ) ) ; newDiskImages.add ( copiedDiskImage ) ; } }

Target:
protected void handleCopyResult ( org.ovirt.engine.core.common.businessentities.DiskImage copiedDiskImage , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { if ( ! ( result.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.VolumeCreationError ) ; } else { org.ovirt.engine.core.bll.ImagesHandler.addDiskImageWithNoVmDevice ( copiedDiskImage ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getTaskIdList ( ) . addAll ( result.getInternalTaskIdList ( ) ) ; newDiskImages.add ( copiedDiskImage ) ; } }
Source:
public static void GetAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
public static void GetAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
public void setup ( ) { org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; initVm ( ) ; images = new java.util.ArrayList < > ( ) ; emulatedMachine = "pc" ; cpuId = "SandyBridge" ; underTest = new org.ovirt.engine.core.utils.ovf.HostedEngineOvfWriter ( vm , images , version , emulatedMachine , cpuId , osRepository ) ; }

Target:
public void setup ( ) { initVm ( ) ; images = new java.util.ArrayList < > ( ) ; emulatedMachine = "pc" ; cpuId = "SandyBridge" ; underTest = new org.ovirt.engine.core.utils.ovf.HostedEngineOvfWriter ( vm , images , version , emulatedMachine , cpuId , osRepository ) ; }
Source:
public void ovfConfigurationMap ( ) { java.lang.String ovfConfig = "config" ; org.ovirt.engine.api.model.ConfigurationType configurationType = org.ovirt.engine.api.model.ConfigurationType.OVF ; org.ovirt.engine.api.model.Vm model = new org.ovirt.engine.api.model.Vm ( ) ; org.ovirt.engine.api.restapi.types.VmMapper.map ( ovfConfig , ConfigurationType.OVF , model ) ; assertNotNull ( model.getInitialization ( ) ) ; assertNotNull ( model.getInitialization ( ) . getConfiguration ( ) ) ; assertEquals ( model.getInitialization ( ) . getConfiguration ( ) . getData ( ) , ovfConfig ) ; assertEquals ( model.getInitialization ( ) . getConfiguration ( ) . getType ( ) , configurationType ) ; }

Target:
public void ovfConfigurationMap ( ) { java.lang.String ovfConfig = "config" ; org.ovirt.engine.api.model.ConfigurationType configurationType = org.ovirt.engine.api.model.ConfigurationType.OVF ; org.ovirt.engine.api.model.Vm model = new org.ovirt.engine.api.model.Vm ( ) ; org.ovirt.engine.api.restapi.types.VmMapper.map ( ovfConfig , ConfigurationType.OVF , model ) ; assertNotNull ( model.getInitialization ( ) ) ; assertNotNull ( model.getInitialization ( ) . getConfiguration ( ) ) ; assertEquals ( ovfConfig , model.getInitialization ( ) . getConfiguration ( ) . getData ( ) ) ; assertEquals ( model.getInitialization ( ) . getConfiguration ( ) . getType ( ) , configurationType ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName , org.ovirt.engine.core.common.errors.VdcBllMessages message ) { boolean bothIdentificationSet = ( nicId != null ) && ( nicName != null ) ; java.lang.String [ ] replacements = createIncoherentNicIdentificationErrorReplacements ( violatingEntityId , nicId , nicName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( isNicNameAndNicIdIncoherent ( nicId , nicName ) ) ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName , org.ovirt.engine.core.common.errors.EngineMessage message ) { boolean bothIdentificationSet = ( nicId != null ) && ( nicName != null ) ; java.lang.String [ ] replacements = createIncoherentNicIdentificationErrorReplacements ( violatingEntityId , nicId , nicName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( isNicNameAndNicIdIncoherent ( nicId , nicName ) ) ) ) ; }
Source:
public void testTryParse ( ) { org.ovirt.engine.core.compat.TimeSpan ref = org.ovirt.engine.core.compat.TimeSpan.tryParse ( "-1.02:03:04.05" ) ; org.junit.Assert.assertNotNull ( "A TimeSpan should be returned" , ref ) ; org.junit.Assert.assertEquals ( "days" , ( - 1 ) , ref.Days ) ; ref = org.ovirt.engine.core.compat.TimeSpan.tryParse ( "A Long Time" ) ; org.junit.Assert.assertNull ( "A TimeSpan should not be returned" , ref ) ; }

Target:
public void testTryParse ( ) { org.ovirt.engine.core.compat.TimeSpan ref = org.ovirt.engine.core.compat.TimeSpan.tryParse ( "-1.02:03:04.05" ) ; org.junit.Assert.assertNotNull ( "A TimeSpan should be returned" , ref ) ; org.junit.Assert.assertEquals ( ( - 1 ) , ref.Days ) ; ref = org.ovirt.engine.core.compat.TimeSpan.tryParse ( "A Long Time" ) ; org.junit.Assert.assertNull ( "A TimeSpan should not be returned" , ref ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap runInTransaction ( ) { org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; context.snapshotEntityStatus ( map , map.getStatus ( ) ) ; map.setStatus ( status ) ; getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , map.getStatus ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap runInTransaction ( ) { org.ovirt.engine.core.bll.context.CompensationContext context = getCompensationContext ( ) ; context.snapshotEntityStatus ( map ) ; map.setStatus ( status ) ; getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , map.getStatus ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public org.ovirt.engine.api.model.Hook getHook ( org.ovirt.engine.api.model.Hooks hooks ) { for ( org.ovirt.engine.api.model.Hook hook : hooks.getHooks ( ) ) { if ( org.ovirt.engine.api.restapi.types.HostMapper.generateHookId ( hook.getEventName ( ) , hook.getName ( ) , hook.getMd5 ( ) ) . equals ( guid ) ) { return hook ; } } return notFound ( ) ; }

Target:
public org.ovirt.engine.api.model.Hook getHook ( org.ovirt.engine.api.model.Hooks hooks ) { for ( org.ovirt.engine.api.model.Hook hook : hooks.getHooks ( ) ) { if ( hook.getId ( ) . equals ( guid ) ) { return hook ; } } return notFound ( ) ; }
Source:
private void updateHaMaintenanceAvailability ( java.util.List items ) { if ( ( items == null ) || ( ( items.size ( ) ) != 1 ) ) { setHaMaintenanceAvailability ( false ) ; return ; } org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getSelectedItem ( ) ; if ( ( ( vm == null ) || ( ! ( vm.isHostedEngine ( ) ) ) ) || ( ( vm.getCompatibilityVersion ( ) . compareTo ( Version.v3_4 ) ) < 0 ) ) { setHaMaintenanceAvailability ( false ) ; } else { setHaMaintenanceAvailability ( true ) ; } }

Target:
private void updateHaMaintenanceAvailability ( java.util.List items ) { if ( ( items == null ) || ( ( items.size ( ) ) != 1 ) ) { setHaMaintenanceAvailability ( false ) ; return ; } org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getSelectedItem ( ) ; if ( ( vm == null ) || ( ! ( vm.isHostedEngine ( ) ) ) ) { setHaMaintenanceAvailability ( false ) ; } else { setHaMaintenanceAvailability ( true ) ; } }
Source:
private org.ovirt.engine.ui.frontend.server.dashboard.Dashboard getFakeDashboard ( final javax.servlet.http.HttpServletRequest request ) { java.util.Random random = new java.util.Random ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.Dashboard dashboard = new org.ovirt.engine.ui.frontend.server.dashboard.Dashboard ( ) ; dashboard.setGlobalUtilization ( org.ovirt.engine.ui.frontend.server.dashboard.fake.FakeDataGenerator.fakeGlobalUtilization ( random ) ) ; dashboard.setHeatMapData ( org.ovirt.engine.ui.frontend.server.dashboard.fake.FakeDataGenerator.fakeHeatMapData ( random ) ) ; dashboard.setInventory ( org.ovirt.engine.ui.frontend.server.dashboard.fake.FakeDataGenerator.fakeInventory ( random ) ) ; return dashboard ; }

Target:
private org.ovirt.engine.ui.frontend.server.dashboard.Dashboard getFakeDashboard ( ) { java.util.Random random = new java.util.Random ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.Dashboard dashboard = new org.ovirt.engine.ui.frontend.server.dashboard.Dashboard ( ) ; dashboard.setGlobalUtilization ( org.ovirt.engine.ui.frontend.server.dashboard.fake.FakeDataGenerator.fakeGlobalUtilization ( random ) ) ; dashboard.setHeatMapData ( org.ovirt.engine.ui.frontend.server.dashboard.fake.FakeDataGenerator.fakeHeatMapData ( random ) ) ; dashboard.setInventory ( org.ovirt.engine.ui.frontend.server.dashboard.fake.FakeDataGenerator.fakeInventory ( random ) ) ; return dashboard ; }
Source:
private void updateCanSpecify ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( getNetwork ( ) . getSelectedItem ( ) ) ) ; boolean isChangable = ( bootProtocolsAvailable ) && ( getIsStaticAddress ( ) ) ; getAddress ( ) . setIsChangable ( isChangable ) ; getSubnet ( ) . setIsChangable ( isChangable ) ; }

Target:
private void updateCanSpecify ( ) { boolean isChangable = ( bootProtocolsAvailable ) && ( getIsStaticAddress ( ) ) ; getAddress ( ) . setIsChangable ( isChangable ) ; getSubnet ( ) . setIsChangable ( isChangable ) ; }
Source:
protected void executeQueryCommand ( ) { java.lang.String password = null ; try { password = org.ovirt.engine.core.aaa.SsoUtils.getPassword ( sessionDataContainer.getSsoAccessToken ( org.ovirt.engine.core.bll.aaa.IsPasswordDelegationPossibleQuery.getParameters ( ) . getSessionId ( ) ) ) ; } catch ( java.lang.Exception ex ) { log.error ( "Unable to execute IsPasswordDelegationPossibleQuery with message {}" , ex.getMessage ( ) ) ; log.debug ( "Exception" , ex ) ; } org.ovirt.engine.core.bll.aaa.IsPasswordDelegationPossibleQuery.getQueryReturnValue ( ) . setReturnValue ( ( password != null ) ) ; org.ovirt.engine.core.bll.aaa.IsPasswordDelegationPossibleQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; }

Target:
protected void executeQueryCommand ( ) { java.lang.String password = org.ovirt.engine.core.aaa.SsoUtils.getPassword ( sessionDataContainer.getSsoAccessToken ( org.ovirt.engine.core.bll.aaa.IsPasswordDelegationPossibleQuery.getParameters ( ) . getSessionId ( ) ) ) ; org.ovirt.engine.core.bll.aaa.IsPasswordDelegationPossibleQuery.getQueryReturnValue ( ) . setReturnValue ( ( password != null ) ) ; org.ovirt.engine.core.bll.aaa.IsPasswordDelegationPossibleQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; }
Source:
public void testDiskAttachedToAnyVM ( ) { org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.isDiskAttachedToAnyVm ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testDiskAttachedToAnyVM ( ) { org.junit.Assert.assertThat ( validator.isDiskAttachedToAnyVm ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceVlanIdIsEmpty ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ( i.getVlanId ( ) ) == null ) { ret.add ( i ) ; } } return ret ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceVlanIdIsEmpty ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ( i.getVlanId ( ) ) == null ) { ret.add ( i ) ; } } return ret ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdcActionType actionToExecute = org.ovirt.engine.core.bll.RunAsyncActionCommand.getParameters ( ) . getAction ( ) ; org.ovirt.engine.core.common.action.VdcActionParametersBase actionParameters = org.ovirt.engine.core.bll.RunAsyncActionCommand.getParameters ( ) . getActionParameters ( ) ; actionParameters.setParentCommand ( VdcActionType.RunAsyncAction ) ; actionParameters.setParentParameters ( org.ovirt.engine.core.bll.RunAsyncActionCommand.getParameters ( ) ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( actionToExecute , actionParameters , org.ovirt.engine.core.bll.RunAsyncActionCommand.cloneContextAndDetachFromParent ( ) ) ; org.ovirt.engine.core.bll.RunAsyncActionCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.executeAsyncCommand ( org.ovirt.engine.core.bll.RunAsyncActionCommand.getParameters ( ) . getAction ( ) , org.ovirt.engine.core.bll.RunAsyncActionCommand.getParameters ( ) . getActionParameters ( ) , org.ovirt.engine.core.bll.RunAsyncActionCommand.cloneContextAndDetachFromParent ( ) ) ; org.ovirt.engine.core.bll.RunAsyncActionCommand.setSucceeded ( true ) ; }
Source:
protected void mockVmRunHandler ( ) { org.mockito.Mockito.doReturn ( vmRunHandler ) . when ( command ) . getVmRunHandler ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( vmRunHandler ) . performImageChecksForRunningVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) , org.mockito.Matchers.anyListOf ( java.lang.String.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.action.RunVmParams.class ) , org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.Disk.class ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( vmRunHandler ) . isVmInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
protected void mockVmRunHandler ( ) { org.mockito.Mockito.doReturn ( vmRunHandler ) . when ( command ) . getVmRunHandler ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( vmRunHandler ) . performImageChecksForRunningVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) , org.mockito.Matchers.anyListOf ( java.lang.String.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.action.RunVmParams.class ) , org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.Disk.class ) ) ; }
Source:
private static void exitOnError ( org.ovirt.engine.core.domains.ManageDomainsResult result ) { if ( ! ( result.isSuccessful ( ) ) ) { org.ovirt.engine.core.domains.ManageDomains.log.error ( result.getDetailedMessage ( ) ) ; java.lang.System.out.println ( result.getDetailedMessage ( ) ) ; java.lang.System.exit ( result.getExitCode ( ) ) ; } }

Target:
public static void exitOnError ( org.ovirt.engine.core.domains.ManageDomainsResult result ) { if ( ! ( result.isSuccessful ( ) ) ) { org.ovirt.engine.core.domains.ManageDomains.log.error ( result.getDetailedMessage ( ) ) ; java.lang.System.out.println ( result.getDetailedMessage ( ) ) ; java.lang.System.exit ( result.getExitCode ( ) ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlan ( java.lang.String baseIfaceName , int vlanId , java.lang.String networkName ) { return createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , ( ( baseIfaceName + "." ) + vlanId ) , false , null , vlanId , networkName , true , null ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlan ( java.lang.String baseIfaceName , int vlanId , java.lang.String networkName ) { return createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , ( ( baseIfaceName + "." ) + vlanId ) , false , null , vlanId , networkName , true , null , false , null ) ; }
Source:
protected void setBallooning ( org.ovirt.engine.api.model.VM vm ) { java.lang.Boolean balloonEnabled = getEntity ( java.lang.Boolean.class , VdcQueryType.IsBalloonEnabled , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( new org.ovirt.engine.core.compat.Guid ( vm.getId ( ) ) ) , null , true ) ; if ( ! ( vm.isSetMemoryPolicy ( ) ) ) { vm.setMemoryPolicy ( new org.ovirt.engine.api.model.MemoryPolicy ( ) ) ; } vm.getMemoryPolicy ( ) . setBallooning ( balloonEnabled ) ; }

Target:
protected void setBallooning ( org.ovirt.engine.api.model.VM vm ) { java.lang.Boolean balloonEnabled = getEntity ( java.lang.Boolean.class , VdcQueryType.IsBalloonEnabled , new org.ovirt.engine.core.common.queries.IdQueryParameters ( new org.ovirt.engine.core.compat.Guid ( vm.getId ( ) ) ) , null , true ) ; if ( ! ( vm.isSetMemoryPolicy ( ) ) ) { vm.setMemoryPolicy ( new org.ovirt.engine.api.model.MemoryPolicy ( ) ) ; } vm.getMemoryPolicy ( ) . setBallooning ( balloonEnabled ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . getId ( ) ) == null ) || ( ! ( entityExists ( ) ) ) ) { return failCanDoAction ( ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . isVm ( ) ? org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND : org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST ) ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( entityExists ( ) ) ) { return failCanDoAction ( ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . isVm ( ) ? org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND : org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST ) ) ; } return true ; }
Source:
private void setUpParentMock ( org.ovirt.engine.api.restapi.resource.BackendHostsResource parent ) { parent.setBackend ( backend ) ; parent.setMappingLocator ( mapperLocator ) ; parent.setValidatorLocator ( validatorLocator ) ; parent.setSessionHelper ( sessionHelper ) ; parent.setMessageBundle ( messageBundle ) ; parent.setHttpHeaders ( httpHeaders ) ; }

Target:
private void setUpParentMock ( org.ovirt.engine.api.restapi.resource.BackendHostsResource parent ) { parent.setBackend ( backend ) ; parent.setMappingLocator ( mapperLocator ) ; parent.setValidatorLocator ( validatorLocator ) ; parent.setMessageBundle ( messageBundle ) ; parent.setHttpHeaders ( httpHeaders ) ; }
Source:
public void validateFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void validateFailsOnNoHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) , null ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters getActionParameters ( org.ovirt.engine.api.model.Network network , org.ovirt.engine.api.model.Network entity ) { if ( namedDataCenter ( network ) ) { entity.setDataCenterId ( getDataCenterId ( network ) ) ; } return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) . getValue ( ) , entity ) ; }

Target:
protected org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters getActionParameters ( org.ovirt.engine.api.model.Network network , org.ovirt.engine.api.model.Network entity ) { if ( namedDataCenter ( network ) ) { entity.setDataCenterId ( getDataCenterId ( network ) ) ; } return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) , entity ) ; }
Source:
public void findNoneOfActiveVmsUsingNetworks ( ) { mockDaos ( ) ; java.util.List < java.lang.String > vmNames = vmInterfaceManager.findActiveVmsUsingNetworks ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , java.util.Collections.singletonList ( ( ( NETWORK_NAME ) + "1" ) ) ) ; org.junit.Assert.assertTrue ( vmNames.isEmpty ( ) ) ; }

Target:
public void findNoneOfActiveVmsUsingNetworks ( ) { mockDaos ( true ) ; java.util.List < java.lang.String > vmNames = vmInterfaceManager.findActiveVmsUsingNetworks ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , java.util.Collections.singletonList ( ( ( NETWORK_NAME ) + "1" ) ) ) ; org.junit.Assert.assertTrue ( vmNames.isEmpty ( ) ) ; }
Source:
public void setUp ( ) { clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( clusterDao ) . get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( clusterUtils ) . when ( command ) . getClusterUtils ( ) ; org.mockito.Mockito.doReturn ( glusterUtils ) . when ( command ) . getGlusterUtils ( ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( clusterId ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }

Target:
public void setUp ( ) { clusterId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( clusterDao ) . get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( clusterUtils ) . when ( command ) . getClusterUtils ( ) ; org.mockito.Mockito.when ( glusterUtils.getUpServer ( clusterId ) ) . thenReturn ( getVds ( VDSStatus.Up ) ) ; }
Source:
public void validateShareableDiskVolumeFormatSucceeds ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createShareableDiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( image ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId , Version.v3_1 ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; runAndAssertValidateSuccess ( ) ; }

Target:
public void validateShareableDiskVolumeFormatSucceeds ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createShareableDiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( image ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; runAndAssertValidateSuccess ( ) ; }
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.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public 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.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
static org.ovirt.engine.api.model.VM getModel ( int index ) { org.ovirt.engine.api.model.VM model = new org.ovirt.engine.api.model.VM ( ) ; model.setName ( NAMES [ index ] ) ; model.setDescription ( DESCRIPTIONS [ index ] ) ; model.setId ( GUIDS [ 0 ] . toString ( ) ) ; model.setCluster ( new org.ovirt.engine.api.model.Cluster ( ) ) ; model.getCluster ( ) . setId ( GUIDS [ 2 ] . toString ( ) ) ; return model ; }

Target:
static org.ovirt.engine.api.model.VM getModel ( int index ) { org.ovirt.engine.api.model.VM model = new org.ovirt.engine.api.model.VM ( ) ; model.setName ( NAMES [ index ] ) ; model.setDescription ( DESCRIPTIONS [ index ] ) ; model.setId ( GUIDS [ index ] . toString ( ) ) ; model.setCluster ( new org.ovirt.engine.api.model.Cluster ( ) ) ; model.getCluster ( ) . setId ( GUIDS [ 2 ] . toString ( ) ) ; return model ; }
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.setId ( vmId ) ; vm.setStoragePoolId ( spId ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.doReturn ( vmDao ) . when ( spyCommand ) . getVmDao ( ) ; org.mockito.Mockito.when ( vmDao.get ( vmId ) ) . thenReturn ( vm ) ; 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.setId ( vmId ) ; vm.setStoragePoolId ( spId ) ; vm.setStatus ( VMStatus.Down ) ; org.mockito.Mockito.when ( vmDao.get ( vmId ) ) . thenReturn ( vm ) ; return vm ; }
Source:
public void syncWithBackend ( ) { final org.ovirt.engine.core.common.businessentities.storage_pool dc = getSelectedDc ( ) ; if ( dc == null ) { return ; } boolean isSupportBridgesReportByVDSM = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.SupportBridgesReportByVDSM , dc.getcompatibility_version ( ) . toString ( ) ) ) ) ; setSupportBridgesReportByVDSM ( isSupportBridgesReportByVDSM ) ; boolean isMTUOverrideSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.MTUOverrideSupported , dc.getcompatibility_version ( ) . toString ( ) ) ) ) ; setMTUOverrideSupported ( isMTUOverrideSupported ) ; }

Target:
public void syncWithBackend ( ) { final org.ovirt.engine.core.common.businessentities.StoragePool dc = getSelectedDc ( ) ; if ( dc == null ) { return ; } boolean isSupportBridgesReportByVDSM = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.SupportBridgesReportByVDSM , dc.getcompatibility_version ( ) . toString ( ) ) ) ) ; setSupportBridgesReportByVDSM ( isSupportBridgesReportByVDSM ) ; boolean isMTUOverrideSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.MTUOverrideSupported , dc.getcompatibility_version ( ) . toString ( ) ) ) ) ; setMTUOverrideSupported ( isMTUOverrideSupported ) ; }
Source:
public void setText ( java.lang.String text ) { super . setText ( text ) ; java.lang.String renderedText = text ; if ( ( getTooltipCaption ( ) ) != null ) { renderedText = ( ( getTooltipCaption ( ) ) + ": " ) + renderedText ; } org.ovirt.engine.ui.common.widget.label.TextBoxLabelBase.setTitle ( renderedText ) ; }

Target:
public void setText ( java.lang.String text ) { super . setText ( text ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; java.util.HashMap < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > map = ( ( java.util.HashMap < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) ; templates.add ( map.get ( true ) ) ; searchableListModel.setItems ( templates ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; java.util.HashMap < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > map = ( ( java.util.HashMap < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) ; templates.add ( map.get ( true ) ) ; searchableListModel.setItems ( templates ) ; }
Source:
public void testRemoveById ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMapId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; for ( org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry : entries ) { org.junit.Assert.assertNotEquals ( entry.getStorageDomainId ( ) , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 ) ; } org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( entries.isEmpty ( ) ) ; }

Target:
public void testRemoveById ( ) { dao.remove ( new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMapId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByStorageDomainId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) ; for ( org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry : entries ) { org.junit.Assert.assertNotEquals ( FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , entry.getStorageDomainId ( ) ) ; } org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertTrue ( entries.isEmpty ( ) ) ; }
Source:
private static void logVmStatusTransition ( org.ovirt.engine.core.common.businessentities.VM vmToUpdate , org.ovirt.engine.core.common.businessentities.VmDynamic runningVm ) { if ( ( vmToUpdate.getStatus ( ) ) != ( runningVm.getstatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "VM {0} {1} moved from {2} --> {3}" , vmToUpdate.getName ( ) , vmToUpdate.getId ( ) , vmToUpdate.getStatus ( ) . name ( ) , runningVm.getstatus ( ) . name ( ) ) ; } }

Target:
private static void logVmStatusTransition ( org.ovirt.engine.core.common.businessentities.VM vmToUpdate , org.ovirt.engine.core.common.businessentities.VmDynamic runningVm ) { if ( ( vmToUpdate.getStatus ( ) ) != ( runningVm.getStatus ( ) ) ) { org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "VM {0} {1} moved from {2} --> {3}" , vmToUpdate.getName ( ) , vmToUpdate.getId ( ) , vmToUpdate.getStatus ( ) . name ( ) , runningVm.getStatus ( ) . name ( ) ) ; } }
Source:
public static 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 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 ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( hostedEngineHelper.getStorageDomain ( ) ) != null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST ) ; } if ( ! ( fetchStorageDomainInfo ( ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } if ( ! ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES ) . contains ( heStorageDomain.getStorageType ( ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ( hostedEngineHelper.getStorageDomain ( ) ) != null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST ) ; } if ( ( heStorageDomain ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; } if ( ! ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.ImportHostedEngineStorageDomainCommand.SUPPORTED_DOMAIN_TYPES ) . contains ( heStorageDomain.getStorageType ( ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED ) ; } return true ; }
Source:
public void nameLengthIsTooLong ( ) { mockConfigRule.mockConfigValue ( ConfigValues.MaxVdsNameLength , org.ovirt.engine.core.bll.validator.HostValidatorTest.HOST_NAME_SIZE ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( ( ( org.ovirt.engine.core.bll.validator.HostValidatorTest.HOST_NAME_SIZE ) * 2 ) ) ) ; org.junit.Assert.assertThat ( validator.nameLengthIsLegal ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ) ; }

Target:
public void nameLengthIsTooLong ( ) { org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( ( ( org.ovirt.engine.core.bll.validator.HostValidatorTest.HOST_NAME_SIZE ) * 2 ) ) ) ; org.junit.Assert.assertThat ( validator.nameLengthIsLegal ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) . setCpuProfileId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) , getEffectiveCompatibilityVersion ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { getVm ( ) . getStaticData ( ) . setVdsGroupId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroupId ( ) ) ; getVm ( ) . getStaticData ( ) . setCpuProfileId ( org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( getVm ( ) . getStaticData ( ) , getEffectiveCompatibilityVersion ( ) ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateQos ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure ) { org.ovirt.engine.core.bll.ValidationResult vr = org.ovirt.engine.core.bll.ValidationResult.VALID ; vr = ( skipValidation ( vr ) ) ? vr : validateQosOverriddenInterfaces ( ) ; vr = ( skipValidation ( vr ) ) ? vr : validateQosNotPartiallyConfigured ( attachmentsToConfigure ) ; vr = ( skipValidation ( vr ) ) ? vr : validateQosCommitment ( attachmentsToConfigure ) ; return vr ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateQos ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure ) { org.ovirt.engine.core.bll.ValidationResult vr = org.ovirt.engine.core.bll.ValidationResult.VALID ; vr = ( skipValidation ( vr ) ) ? vr : validateQosOverriddenInterfaces ( ) ; vr = ( skipValidation ( vr ) ) ? vr : validateQosNotPartiallyConfigured ( attachmentsToConfigure ) ; return vr ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getBehavior ( ) . deactivateInstanceTypeManager ( ) ; updateWatchdogItems ( ( ( java.util.HashSet < org.ovirt.engine.core.common.businessentities.VmWatchdogType > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; getBehavior ( ) . activateInstanceTypeManager ( ) ; }

Target:
public void onSuccess ( java.lang.Object returnValue ) { getBehavior ( ) . deactivateInstanceTypeManager ( ) ; updateWatchdogItems ( ( ( java.util.HashSet < org.ovirt.engine.core.common.businessentities.VmWatchdogType > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; getBehavior ( ) . activateInstanceTypeManager ( ) ; }
Source:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmDisksDummies ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksDummies = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageDomainId : org.ovirt.engine.core.bll.ImportVmCommand.getParameters ( ) . getImageToDestinationDomainMap ( ) . values ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( storageDomainId ) ) ) ; disksDummies.add ( diskImage ) ; } return disksDummies ; }

Target:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getVmDisksDummies ( ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksDummies = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageDomainId : org.ovirt.engine.core.bll.ImportVmCommand.getParameters ( ) . getImageToDestinationDomainMap ( ) . values ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList ( java.util.Arrays.asList ( storageDomainId ) ) ) ; disksDummies.add ( diskImage ) ; } return disksDummies ; }
Source:
protected void initFrontend ( ) { frontend.setEventsHandler ( frontendEventsHandler ) ; frontend.getFrontendFailureEvent ( ) . addListener ( frontendFailureEventListener ) ; frontend.getFrontendNotLoggedInEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { user.logout ( ) ; } } ) ; frontend.setFilterQueries ( filterFrontendQueries ( ) ) ; }

Target:
protected void initFrontend ( ) { frontend.setEventsHandler ( frontendEventsHandler ) ; frontend.getFrontendFailureEvent ( ) . addListener ( frontendFailureEventListener ) ; frontend.getFrontendNotLoggedInEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { user.logout ( ) ; } } ) ; frontend.setFilterQueries ( filterFrontendQueries ( ) ) ; }