auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getExternalProviderComputeResourceList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalComputeResource > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetComputeResourceFromExternalProvider , params , aQuery ) ; }

Target:
public 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 onLoginSuccess ( final java.lang.String userName , final java.lang.String password , final java.lang.String domain ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { final java.lang.String domainToken = "@" ; restApiSessionManager.acquireSession ( ( userName.contains ( domainToken ) ? userName : ( userName + domainToken ) + domain ) , password ) ; } } ) ; }

Target:
public void onLoginSuccess ( ) { com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { frontend.runQuery ( VdcQueryType.GetEngineSessionIdToken , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String engineAuthToken = ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; restApiSessionManager.acquireSession ( engineAuthToken ) ; } } ) ) ; } } ) ; }
Source:
private static void GetAllChildVlanInterfaces ( org.ovirt.engine.core.compat.Guid vdsID , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces , org.ovirt.engine.ui.uicompat.IFrontendMultipleQueryAsyncCallback callback ) { java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > parametersList = new java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryType > queryTypeList = new java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryType > ( ) ; for ( final org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface : ifaces ) { queryTypeList.add ( VdcQueryType.GetAllChildVlanInterfaces ) ; parametersList.add ( new org.ovirt.engine.core.common.queries.GetAllChildVlanInterfacesQueryParameters ( vdsID , iface ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleQueries ( queryTypeList , parametersList , callback ) ; }

Target:
private static void GetAllChildVlanInterfaces ( org.ovirt.engine.core.compat.Guid vdsID , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ifaces , org.ovirt.engine.ui.uicompat.IFrontendMultipleQueryAsyncCallback callback ) { java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > parametersList = new java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryType > queryTypeList = new java.util.ArrayList < org.ovirt.engine.core.common.queries.VdcQueryType > ( ) ; for ( final org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : ifaces ) { queryTypeList.add ( VdcQueryType.GetAllChildVlanInterfaces ) ; parametersList.add ( new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleQueries ( queryTypeList , parametersList , callback ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; storageListModel.removeConnection = true ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; storageListModel.connection.setid ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; storageListModel.removeConnection = true ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; storageListModel.connection.setid ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
private void fillWithRandomData ( org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension ssce ) { ssce.setHostId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; ssce.setIqn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; ssce.setUserName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; ssce.setPassword ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; }

Target:
private void fillWithRandomData ( org.ovirt.engine.core.common.businessentities.storage.StorageServerConnectionExtension ssce ) { ssce.setHostId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; ssce.setIqn ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextXmlString ( 10 ) ) ; ssce.setUserName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextXmlString ( 10 ) ) ; ssce.setPassword ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextXmlString ( 10 ) ) ; }
Source:
public static < T > T injectMembers ( T instance ) { javax.enterprise.inject.spi.AnnotatedType type = org.ovirt.engine.core.di.Injector.injector.manager.createAnnotatedType ( instance.getClass ( ) ) ; javax.enterprise.inject.spi.InjectionTarget injectionTarget = org.ovirt.engine.core.di.Injector.injector.manager.createInjectionTarget ( type ) ; injectionTarget.inject ( instance , org.ovirt.engine.core.di.Injector.injector.manager.createCreationalContext ( null ) ) ; injectionTarget.postConstruct ( instance ) ; return instance ; }

Target:
public static < T > T injectMembers ( T instance ) { javax.enterprise.inject.spi.AnnotatedType type = org.ovirt.engine.core.di.Injector.injector.getManager ( ) . createAnnotatedType ( instance.getClass ( ) ) ; javax.enterprise.inject.spi.InjectionTarget injectionTarget = org.ovirt.engine.core.di.Injector.injector.getManager ( ) . createInjectionTarget ( type ) ; injectionTarget.inject ( instance , org.ovirt.engine.core.di.Injector.injector.getManager ( ) . createCreationalContext ( null ) ) ; injectionTarget.postConstruct ( instance ) ; return instance ; }
Source:
public void processSoftwareCapabilities ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.GlusterServersList , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( vds.getId ( ) ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { vds.setStatus ( VDSStatus.NonOperational ) ; vds.setNonOperationalReason ( NonOperationalReason.GLUSTER_COMMAND_FAILED ) ; vdsNonOperational ( vds , NonOperationalReason.GLUSTER_COMMAND_FAILED ) ; } }

Target:
public void processSoftwareCapabilities ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = resourceManager.get ( ) . runVdsCommand ( VDSCommandType.GlusterServersList , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( vds.getId ( ) ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { vds.setStatus ( VDSStatus.NonOperational ) ; vds.setNonOperationalReason ( NonOperationalReason.GLUSTER_COMMAND_FAILED ) ; vdsNonOperational ( vds , NonOperationalReason.GLUSTER_COMMAND_FAILED ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( e.PropertyName.equals ( "IS_STATUS_APPLICABLE" ) ) { status.setText ( constants.rebalanceComplete ( ) ) ; status.setVisible ( true ) ; } else if ( e.PropertyName.equals ( "STOP_TIME_UPDATED" ) ) { stopTimePanel.setVisible ( object.isStopTimeVisible ( ) ) ; } }

Target:
private void localize ( final org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { status.setText ( constants.rebalanceComplete ( ) ) ; startTimeEditor.setLabel ( constants.rebalanceStartTime ( ) ) ; volumeEditor.setLabel ( constants.rebalanceVolumeName ( ) ) ; clusterEditor.setLabel ( constants.rebalanceClusterVolume ( ) ) ; statusTimeEditor.setLabel ( constants.rebalanceStatusTime ( ) ) ; stopTimeEditor.setLabel ( constants.rebalanceStopTime ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > getStorageQuotaListParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getDisksList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.StorageQuotaValidationParameter ( ( ( disk.getQuotaId ( ) ) != null ? disk.getQuotaId ( ) : org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getQuotaId ( ) ) , disk.getstorage_ids ( ) . get ( 0 ) , disk.getActualSize ( ) ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getDisksList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , disk.getstorage_ids ( ) . get ( 0 ) , disk.getActualSize ( ) ) ) ; } return list ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( java.lang.Object object ) { return ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . getWarning ( ) ) != null ? org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmFromExportDomainPopupView.resources.alertImage ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( java.lang.Object object ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData importVmData = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) ; if ( ( ! ( importVmData.getClone ( ) . getEntity ( ) ) ) && ( ( importVmData.getError ( ) ) != null ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmFromExportDomainPopupView.resources.errorImage ( ) ; } if ( ( importVmData.getWarning ( ) ) != null ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmFromExportDomainPopupView.resources.alertImage ( ) ; } return null ; }
Source:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getClusterIdOfSelectedVms ( ) { org.ovirt.engine.core.compat.Guid clusterId = null ; for ( java.lang.Object item : org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; if ( clusterId == null ) { clusterId = a.getVdsGroupId ( ) ; } else if ( ! ( clusterId.equals ( a.getVdsGroupId ( ) ) ) ) { clusterId = null ; break ; } } return clusterId ; }

Target:
private org.ovirt.engine.core.compat.Guid getClusterIdOfSelectedVms ( ) { org.ovirt.engine.core.compat.Guid clusterId = null ; for ( java.lang.Object item : org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; if ( clusterId == null ) { clusterId = a.getClusterId ( ) ; } else if ( ! ( clusterId.equals ( a.getClusterId ( ) ) ) ) { clusterId = null ; break ; } } return clusterId ; }
Source:
public static void LockVm ( final org.ovirt.engine.core.common.businessentities.VmDynamic vm , final org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { compensationContext.snapshotEntityStatus ( vm , vm.getStatus ( ) ) ; org.ovirt.engine.core.bll.VmHandler.LockVm ( vm.getId ( ) ) ; compensationContext.stateChanged ( ) ; return null ; } } ) ; }

Target:
public static void lockVm ( final org.ovirt.engine.core.common.businessentities.VmDynamic vm , final org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { compensationContext.snapshotEntityStatus ( vm ) ; org.ovirt.engine.core.bll.VmHandler.lockVm ( vm.getId ( ) ) ; compensationContext.stateChanged ( ) ; return null ; } } ) ; }
Source:
public void testCreatingBusinessEntityMapWithDuplicatesAmongIds ( ) { org.ovirt.engine.core.compat.Guid itemId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem first = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( itemId , "name" ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem second = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( itemId , "different name" ) ; new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Arrays.asList ( first , second ) ) ; }

Target:
public void testCreatingBusinessEntityMapWithDuplicatesAmongName ( ) { org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem first = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "name" ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem second = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "name" ) ; org.junit.jupiter.api.Assertions.assertThrows ( java.lang.IllegalArgumentException.class , ( ) -> new org.ovirt.engine.core.common.businessentities.BusinessEntityMap < > ( java.util.Arrays.asList ( first , second ) ) ) ; }
Source:
public void externalVmAreNotSavedAsLastVm ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs data ) { stubCalls ( data ) ; org.junit.Assert.assertTrue ( vmsListFetcher.fetch ( ) ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) ) != null ) ) ; org.junit.Assume.assumeTrue ( ( ( data.dbVm ( ) ) == null ) ) ; org.mockito.Mockito.verify ( vdsManager ) . setLastVmsList ( vdsManagerArgumentCaptor.capture ( ) ) ; org.junit.Assert.assertEquals ( 0 , vdsManagerArgumentCaptor.getValue ( ) . size ( ) ) ; }

Target:
public void externalVmAreNotSavedAsLastVm ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs data ) { stubCalls ( data ) ; org.junit.jupiter.api.Assertions.assertTrue ( vmsListFetcher.fetch ( ) ) ; org.junit.jupiter.api.Assumptions.assumeTrue ( ( ( data.vdsmVm ( ) ) != null ) ) ; org.junit.jupiter.api.Assumptions.assumeTrue ( ( ( data.dbVm ( ) ) == null ) ) ; org.mockito.Mockito.verify ( vdsManager ) . setLastVmsList ( vdsManagerArgumentCaptor.capture ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , vdsManagerArgumentCaptor.getValue ( ) . size ( ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( getNic ( ) ) == null ) { return failCanDoAction ( EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; } if ( ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isLabeled ( getNic ( ) ) ) ) || ( ! ( getNic ( ) . getLabels ( ) . contains ( getLabel ( ) ) ) ) ) { return failCanDoAction ( EngineMessage.INTERFACE_NOT_LABELED ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ( getNic ( ) ) == null ) { return failValidation ( EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; } if ( ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isLabeled ( getNic ( ) ) ) ) || ( ! ( getNic ( ) . getLabels ( ) . contains ( getLabel ( ) ) ) ) ) { return failValidation ( EngineMessage.INTERFACE_NOT_LABELED ) ; } return true ; }
Source:
public org.ovirt.vdsm.jsonrpc.client.JsonRpcEvent canProcessMore ( ) { if ( ( ! ( this . events.isEmpty ( ) ) ) && ( ( this . count.getAndDecrement ( ) ) > 0 ) ) { return this . events.removeLast ( ) ; } return null ; }

Target:
public org.ovirt.vdsm.jsonrpc.client.JsonRpcEvent canProcessMore ( ) { try ( org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper wrapper = new org.ovirt.vdsm.jsonrpc.client.utils.LockWrapper ( this . lock ) ) { if ( ( ! ( this . events.isEmpty ( ) ) ) && ( ( this . count.getAndDecrement ( ) ) > 0 ) ) { return this . events.removeLast ( ) ; } return null ; } }
Source:
public void testActionWithCorrelationId ( ) throws java.lang.Exception { setUpGetEntityExpectations ( false ) ; resource.getCurrent ( ) . getParameters ( ) . put ( "correlation_id" , "Some-Correlation-id" ) ; resource.setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" , "CorrelationId" } , new java.lang.Object [ ] { NAMES [ 2 ] , "Some-Correlation-id" } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setRootPassword ( NAMES [ 2 ] ) ; resource.install ( action ) ; }

Target:
public void testActionWithCorrelationId ( ) throws java.lang.Exception { setUpGetEntityExpectations ( false ) ; resource.getCurrent ( ) . getParameters ( ) . put ( "correlation_id" , "Some-Correlation-id" ) ; resource.setUriInfo ( setUpActionExpectations ( ActionType.UpdateVds , org.ovirt.engine.core.common.action.hostdeploy.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" , "CorrelationId" } , new java.lang.Object [ ] { NAMES [ 2 ] , "Some-Correlation-id" } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setRootPassword ( NAMES [ 2 ] ) ; resource.install ( action ) ; }
Source:
public void validateVmInPreview ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }

Target:
public void validateVmInPreview ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
Source:
public static java.lang.String getDiskLabelList ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { if ( disks.isEmpty ( ) ) { return null ; } final java.util.List < java.lang.String > labels = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { labels.add ( disk.getDiskAlias ( ) ) ; } return java.lang.String.join ( ", " , labels ) ; }

Target:
public static java.lang.String getDiskLabelList ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { if ( disks.isEmpty ( ) ) { return null ; } return disks.stream ( ) . map ( Disk :: getDiskAlias ) . collect ( java.util.stream.Collectors.joining ( ", " ) ) ; }
Source:
public java.lang.Object runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage di : org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) ) ) { org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( di.getImageId ( ) , sourceStorageDomainId ) ) ; org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( di.getImageId ( ) , targetStorageDomainId , di.getQuotaId ( ) ) ) ; } return null ; }

Target:
public java.lang.Object runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage di : org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) ) ) { org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( di.getImageId ( ) , sourceStorageDomainId ) ) ; org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getImageStorageDomainMapDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( di.getImageId ( ) , targetStorageDomainId , di.getQuotaId ( ) , di.getDiskProfileId ( ) ) ) ; } return null ; }
Source:
protected void copyVmDevices ( ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( vmDevicesSourceId , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , getSrcDeviceIdToTargetDeviceIdMapping ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isSoundDeviceEnabled ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isConsoleEnabled ( ) , isVirtioScsiEnabled ( ) , false ) ; }

Target:
protected void copyVmDevices ( ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( vmDevicesSourceId , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , getSrcDeviceIdToTargetDeviceIdMapping ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isSoundDeviceEnabled ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isConsoleEnabled ( ) , isVirtioScsiEnabled ( ) , isBalloonEnabled ( ) , false ) ; if ( ( instanceTypeId ) != null ) { copyDiskDevicesFromTemplate ( ) ; } }
Source:
public void testGetAllOfStorageType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomainStatic > result = dao.getAllOfStorageType ( StorageType.ISCSI ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic domain : result ) { org.junit.Assert.assertEquals ( StorageType.ISCSI , domain.getstorage_type ( ) ) ; } }

Target:
public void testGetAllOfStorageType ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomainStatic > result = dao.getAllOfStorageType ( StorageType.ISCSI ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic domain : result ) { org.junit.Assert.assertEquals ( StorageType.ISCSI , domain.getStorageType ( ) ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL ) ; } if ( ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) ) == null ) && ( ! ( selectProxyHost ( ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_NO_VDS_IN_POOL ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL ) ; } if ( ( ( org.ovirt.engine.core.bll.ConvertVmCommand.getVds ( ) ) == null ) && ( ! ( selectProxyHost ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_NO_VDS_IN_POOL ) ; } return true ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateCpuProfile , org.ovirt.engine.core.common.action.CpuProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendCpuProfileResourceTest.getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateCpuProfile , org.ovirt.engine.core.common.action.CpuProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendCpuProfileResourceTest.getModel ( 0 ) ) , 0 ) ; }
Source:
private void setupQuerySpy ( ) { org.mockito.Mockito.doReturn ( vdsDaoMocked ) . when ( getQuery ( ) ) . getVdsDao ( ) ; org.mockito.Mockito.doReturn ( interfaceDaoMocked ) . when ( getQuery ( ) ) . getInterfaceDao ( ) ; org.mockito.Mockito.doReturn ( networkDaoMocked ) . when ( getQuery ( ) ) . getNetworkDao ( ) ; org.mockito.Mockito.doReturn ( networkImplementationDetailsUtils ) . when ( getQuery ( ) ) . getNetworkImplementationDetailsUtils ( ) ; org.mockito.Mockito.doReturn ( networkAttachmentDao ) . when ( getQuery ( ) ) . getNetworkAttachmentDao ( ) ; }

Target:
private void setupQuerySpy ( ) { org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getVdsDao ( ) ) . thenReturn ( vdsDaoMocked ) ; org.mockito.Mockito.doReturn ( interfaceDaoMocked ) . when ( getQuery ( ) ) . getInterfaceDao ( ) ; org.mockito.Mockito.doReturn ( networkDaoMocked ) . when ( getQuery ( ) ) . getNetworkDao ( ) ; org.mockito.Mockito.doReturn ( networkImplementationDetailsUtils ) . when ( getQuery ( ) ) . getNetworkImplementationDetailsUtils ( ) ; org.mockito.Mockito.doReturn ( networkAttachmentDao ) . when ( getQuery ( ) ) . getNetworkAttachmentDao ( ) ; }
Source:
public org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler getCallsHandler ( ) { return callsHandler ; }

Target:
public void populateDwhOsInfo ( java.util.Map < java.lang.Integer , java.lang.String > osIdToName ) { new org.springframework.jdbc.core.simple.SimpleJdbcCall ( jdbcTemplate ) . withProcedureName ( "clear_osinfo" ) . execute ( ) ; java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > executions = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < java.lang.Integer , java.lang.String > e : osIdToName.entrySet ( ) ) { executions.add ( getCustomMapSqlParameterSource ( ) . addValue ( "os_id" , e.getKey ( ) ) . addValue ( "os_name" , e.getValue ( ) ) ) ; } callsHandler.executeStoredProcAsBatch ( "insert_osinfo" , executions ) ; }
Source:
public static void getMinimalVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VMMinMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static int getSchedulerAllowOverbookingPendingRequestsThreshold ( ) { return ( ( java.lang.Integer ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.SchedulerOverBookingThreshold , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ) ) ; }
Source:
private static boolean hasTaskCompleted ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask task ) { if ( ( ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.ABORTED ) == ( task.getStatus ( ) ) ) || ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.FINISHED ) == ( task.getStatus ( ) ) ) ) || ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.FAILED ) == ( task.getStatus ( ) ) ) ) { return true ; } return false ; }

Target:
private static boolean hasTaskCompleted ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask task ) { if ( ( ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.ABORTED ) == ( task.getStatus ( ) ) ) || ( ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.FINISHED ) == ( task.getStatus ( ) ) ) && ( ( task.getType ( ) ) != ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterTaskType.REMOVE_BRICK ) ) ) ) || ( ( org.ovirt.engine.core.common.job.JobExecutionStatus.FAILED ) == ( task.getStatus ( ) ) ) ) { return true ; } return false ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc monitorCommand ( java.lang.String vmId , java.lang.String monitorCommand ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.monitorCommand" ) . withParameter ( "vmID" , vmId ) . withParameter ( "command" , monitorCommand ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn mergeSubchain ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.String > subchainInfo ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.merge" ) . withParameter ( "job_id" , jobId ) . withParameter ( "subchain_info" , subchainInfo ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public void connect ( ) { org.ovirt.engine.ui.common.uicommon.SpicePluginImpl.logger.warning ( "Connecting via spice..." ) ; if ( configurator.isClientLinuxFirefox ( ) ) { connectNativelyViaXPI ( ) ; } else if ( ( configurator.isClientWindowsExplorer ( ) ) || ( cu.isIE11 ( ) ) ) { connectNativelyViaActiveX ( ) ; } }

Target:
public void invokeClient ( ) { org.ovirt.engine.ui.common.uicommon.SpicePluginImpl.logger.warning ( "Connecting via spice..." ) ; if ( configurator.isClientLinuxFirefox ( ) ) { connectNativelyViaXPI ( ) ; } else if ( ( configurator.isClientWindowsExplorer ( ) ) || ( cu.isIE11 ( ) ) ) { connectNativelyViaActiveX ( ) ; } }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.resources.client.ImageResource value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { sb.append ( org.ovirt.engine.ui.common.widget.table.column.StyledImageResourceCell.template.imageContainer ( title , style , com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( value ) . getHTML ( ) ) ) ) ; } }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.dom.client.Element parent , com.google.gwt.resources.client.ImageResource value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < com.google.gwt.resources.client.ImageResource > valueUpdater ) { titlePanel.setWidget ( new com.google.gwt.user.client.ui.Label ( title ) ) ; java.lang.String eventType = event.getType ( ) ; if ( BrowserEvents.MOUSEOVER.equals ( eventType ) ) { titlePanel.showRelativeTo ( parent ) ; } else if ( BrowserEvents.MOUSEOUT.equals ( eventType ) ) { titlePanel.hide ( ) ; } }
Source:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getUpHostListByCluster ( 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 ) { return source != null ? source : java.util.Collections.emptyList ( ) ; } } ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
protected boolean validateImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesToValidate = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) , true , false , true ) ; org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( imagesToValidate ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) && ( validate ( diskImagesValidator.diskImagesNotIllegal ( ) ) ) ; }

Target:
protected boolean validateImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesToValidate = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getVmId ( ) ) , true , false , true ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( imagesToValidate ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) && ( validate ( diskImagesValidator.diskImagesNotIllegal ( ) ) ) ; }
Source:
protected org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.StorageDomain > getPredicate ( final java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisks ) { return new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { updateDisksStorage ( storageDomain , memoryDisks ) ; org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = getStorageDomainValidator ( storageDomain ) ; return ( storageDomainValidator.isDomainWithinThresholds ( ) . isValid ( ) ) && ( storageDomainValidator.hasSpaceForClonedDisks ( memoryDisks ) . isValid ( ) ) ; } } ; }

Target:
protected java.util.function.Predicate < org.ovirt.engine.core.common.businessentities.StorageDomain > getPredicate ( final java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisks ) { return ( storageDomain ) -> { updateDisksStorage ( storageDomain , memoryDisks ) ; org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = getStorageDomainValidator ( storageDomain ) ; return ( storageDomainValidator.isDomainWithinThresholds ( ) . isValid ( ) ) && ( storageDomainValidator.hasSpaceForClonedDisks ( memoryDisks ) . isValid ( ) ) ; } ; }
Source:
public void testEchoBoth ( ) throws java.lang.Exception { java.lang.String content = "hello\nworld!\nother\ndata" ; java.io.InputStream stdin = new java.io.ByteArrayInputStream ( content.getBytes ( "UTF-8" ) ) ; java.io.ByteArrayOutputStream stdout = new java.io.ByteArrayOutputStream ( ) ; java.io.ByteArrayOutputStream stderr = new java.io.ByteArrayOutputStream ( ) ; client.executeCommand ( "cat | tee /proc/self/fd/2" , stdin , stdout , stderr ) ; assertEquals ( content , new java.lang.String ( stdout.toByteArray ( ) , "UTF-8" ) ) ; assertEquals ( content , new java.lang.String ( stderr.toByteArray ( ) , "UTF-8" ) ) ; }

Target:
public void testEchoBoth ( ) throws java.lang.Exception { java.lang.String content = "hello\nworld!\nother\ndata" ; java.io.InputStream stdin = new java.io.ByteArrayInputStream ( content.getBytes ( "UTF-8" ) ) ; java.io.ByteArrayOutputStream stdout = new java.io.ByteArrayOutputStream ( ) ; java.io.ByteArrayOutputStream stderr = new java.io.ByteArrayOutputStream ( ) ; client.executeCommand ( "cat | tee /proc/self/fd/2" , stdin , stdout , stderr ) ; org.junit.Assert.assertEquals ( content , new java.lang.String ( stdout.toByteArray ( ) , "UTF-8" ) ) ; org.junit.Assert.assertEquals ( content , new java.lang.String ( stderr.toByteArray ( ) , "UTF-8" ) ) ; }
Source:
public boolean getTaskGroupSuccess ( ) { boolean childrenTasksSuccess = taskGroupSuccess ; for ( org.ovirt.engine.core.common.action.VdcActionParametersBase childParameters : getImagesParameters ( ) ) { childrenTasksSuccess &= childParameters.getTaskGroupSuccess ( ) ; if ( ! childrenTasksSuccess ) { break ; } } return childrenTasksSuccess ; }

Target:
public boolean getTaskGroupSuccess ( ) { boolean childrenTasksSuccess = taskGroupSuccess ; if ( ( imagesParameters ) != null ) { for ( org.ovirt.engine.core.common.action.VdcActionParametersBase childParameters : imagesParameters ) { childrenTasksSuccess &= childParameters.getTaskGroupSuccess ( ) ; if ( ! childrenTasksSuccess ) { break ; } } } return childrenTasksSuccess ; }
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:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String engineAuthToken = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; restApiSessionManager.acquireSession ( engineAuthToken ) ; }
Source:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { 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 ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void securityKeysDoesNotExist ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . haveSecurityKey ( ) ; org.junit.Assert.assertThat ( validator.securityKeysExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_TRY_CREATE_SECURE_CERTIFICATE_NOT_FOUND ) ) ; }

Target:
public void securityKeysDoesNotExist ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . haveSecurityKey ( ) ; org.junit.Assert.assertThat ( validator.securityKeysExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_TRY_CREATE_SECURE_CERTIFICATE_NOT_FOUND ) ) ; }
Source:
public void testPersistNetworkAttachmentsWhenCustomPropertiesChanged ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachmentForClusterNetworkA = createNetworkAttachment ( clusterNetworkA ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = org.ovirt.engine.core.utils.NetworkUtils.createIpConfigurationFromVdsNetworkInterface ( interfaceWithAttachedClusterNetworkA ) ; networkAttachmentForClusterNetworkA.setIpConfiguration ( ipConfiguration ) ; networkAttachmentForClusterNetworkA.setProperties ( new java.util.HashMap < > ( ) ) ; callPersistNetworkAttachmentsAndVerifyThatNetworkAttachmentIsSynced ( networkAttachmentForClusterNetworkA , createLegacyPersister ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.IPv4Address createIpv4Address ( ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; address.setAddress ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.IPV4_ADDRESS ) ; address.setNetmask ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.IPV4_NETMASK ) ; address.setGateway ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.IPV4_GATEWAY ) ; address.setBootProtocol ( NetworkBootProtocol.STATIC_IP ) ; return address ; }
Source:
private void mockGetVmsListForDisk ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; vms.add ( vm ) ; org.mockito.Mockito.when ( vmDAO.getVmsListForDisk ( diskImageGuid ) ) . thenReturn ( vms ) ; }

Target:
private void mockGetForDisk ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > vmsMap = new java.util.HashMap < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > ( ) ; vmsMap.put ( java.lang.Boolean.TRUE , vms ) ; org.mockito.Mockito.when ( vmDAO.getForDisk ( diskImageGuid , true ) ) . thenReturn ( vmsMap ) ; }