auphong2707/dl4se-code-review-dataset huggingface dataset:
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 && ( nicNameAndNicIdIsIncoherent ( 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:
protected void executeVdsIdCommand ( ) { org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.info ( "AddVds - entered , starting logic to add VDS '{}'" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.info ( "AddVds - VDS '{}' was added, will try to add it to the resource manager" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; resourceManager.addVds ( vds , false , true ) ; }

Target:
protected void executeVdsIdCommand ( ) { org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.info ( "AddVds - entered , starting logic to add VDS '{}'" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.common.businessentities.VDS vds = vdsDao.get ( org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.log.info ( "AddVds - VDS '{}' was added, will try to add it to the resource manager" , org.ovirt.engine.core.vdsbroker.AddVdsVDSCommand.getVdsId ( ) ) ; resourceManager.addVds ( vds , false , true ) ; }
Source:
public void handleTasksOfCommandWithEmptyVdsmId ( final java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > tasks ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.SuppressWarnings ( value = "synthetic-access" ) @ java.lang.Override public void run ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Object > ( ) { @ java.lang.Override public java.lang.Object runInTransaction ( ) { try { boolean isPartiallySubmittedCommand = isPartiallySubmittedCommand ( tasks ) ; for ( org.ovirt.engine.core.common.businessentities.AsyncTasks task : tasks ) { handleTaskOfCommandWithEmptyVdsmId ( isPartiallySubmittedCommand , task ) ; } return null ; } finally { irsBrokerLatch.countDown ( ) ; } } } ) ; } } ) ; }

Target:
public void handlePartiallyExecuteTasksOfCommand ( final java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTask > tasks ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.SuppressWarnings ( value = "synthetic-access" ) @ java.lang.Override public void run ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Object > ( ) { @ java.lang.Override public java.lang.Object runInTransaction ( ) { try { for ( org.ovirt.engine.core.common.businessentities.AsyncTask task : tasks ) { handlePartiallyExecutedTaskOfCommand ( task ) ; } return null ; } finally { irsBrokerLatch.countDown ( ) ; } } } ) ; } } ) ; }
Source:
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 ) ; }

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:
public static void getoVirtISOsList ( 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.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void testGetAllByStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool > result = dao.getAllByStatus ( StoragePoolStatus.Up ) ; org.junit.Assert.assertNotNull ( "list of returned pools in status up shouldn't be null" , result ) ; org.junit.Assert.assertEquals ( "wrong number of storage pools returned for up status" , 5 , result.size ( ) ) ; result = dao.getAllByStatus ( StoragePoolStatus.Maintanance ) ; org.junit.Assert.assertNotNull ( "list of returned pools in maintanance status shouldn't be null" , result ) ; org.junit.Assert.assertEquals ( "wrong number of storage pool returned for maintanance status" , 0 , result.size ( ) ) ; }

Target:
public void testGetAllByStatus ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_pool > result = dao.getAllByStatus ( StoragePoolStatus.Up ) ; org.junit.Assert.assertNotNull ( "list of returned pools in status up shouldn't be null" , result ) ; org.junit.Assert.assertEquals ( "wrong number of storage pools returned for up status" , 5 , result.size ( ) ) ; result = dao.getAllByStatus ( StoragePoolStatus.Maintenance ) ; org.junit.Assert.assertNotNull ( "list of returned pools in maintenance status shouldn't be null" , result ) ; org.junit.Assert.assertEquals ( "wrong number of storage pool returned for maintenance status" , 0 , result.size ( ) ) ; }
Source:
public static void GetClusterServerMemoryOverCommit ( 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.MaxVdsMemOverCommitForServers , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetDataCenterMaxNameLength ( 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.StoragePoolNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public void getDefaultSpmPriority ( 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 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
public void send ( byte [ ] message ) { outbox.addFirst ( java.nio.ByteBuffer.wrap ( message ) ) ; if ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient.LOG.isDebugEnabled ( ) ) { try { org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient.LOG.debug ( ( "Message sent: " + ( org.ovirt.vdsm.jsonrpc.client.reactors.stomp.impl.Message.parse ( message ) ) ) ) ; } catch ( org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ignored ) { } } final org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = this ; scheduleTask ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { client.updateInterestedOps ( ) ; return null ; } } ) ; }

Target:
public void send ( byte [ ] message ) { outbox.addFirst ( java.nio.ByteBuffer.wrap ( message ) ) ; updateOps ( message ) ; }
Source:
public void getHostById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.action.VmManagementParametersBase getUpdateVmParameters ( boolean applyCpuChangesLater ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; params.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; params.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; setRngDeviceToParams ( model , params ) ; params.setApplyChangesLater ( applyCpuChangesLater ) ; setGraphicsDevicesToParams ( model , params ) ; return params ; }

Target:
private org.ovirt.engine.core.common.action.VmManagementParametersBase getUpdateVmParameters ( boolean applyCpuChangesLater ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; params.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; params.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; setRngDeviceToParams ( model , params ) ; params.setApplyChangesLater ( applyCpuChangesLater ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , params , new org.ovirt.engine.ui.uicommonweb.builders.vm.UnitToGraphicsDeviceParamsBuilder ( ) ) ; return params ; }
Source:
private void waitForConnect ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { this . connected.await ( policy.getRetryTimeOut ( ) , policy.getTimeUnit ( ) ) ; } catch ( java.lang.InterruptedException e ) { disconnect ( "Waiting for connect interrupted" ) ; throw new java.lang.IllegalStateException ( "Communication interrupted" ) ; } }

Target:
private void waitForConnect ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { if ( ! ( this . connected.await ( policy.getRetryTimeOut ( ) , policy.getTimeUnit ( ) ) ) ) { closeChannel ( ) ; throw new org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ( "Connection timeout" ) ; } } catch ( java.lang.InterruptedException e ) { disconnect ( "Waiting for connect interrupted" ) ; throw new java.lang.IllegalStateException ( "Communication interrupted" ) ; } }
Source:
private org.ovirt.engine.core.utils.lock.EngineLock buildPoolEngineLock ( org.ovirt.engine.core.common.businessentities.StoragePool pool ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > exclusiveLocks = java.util.Collections.singletonMap ( pool.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.OVF_UPDATE , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; return new org.ovirt.engine.core.utils.lock.EngineLock ( exclusiveLocks , null ) ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase performOvfUpdateForStoragePool ( org.ovirt.engine.core.compat.Guid storagePoolId ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ProcessOvfUpdateForStoragePool , new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( storagePoolId ) ) ; }
Source:
public java.lang.Runnable process ( ) throws java.io.IOException { final java.lang.Runnable op = handshake ( ) ; if ( op != null ) { return op ; } return null ; }

Target:
public java.lang.Runnable process ( ) throws java.io.IOException { if ( ! ( handshakeInProgress ( ) ) ) { if ( ( this . callback ) != null ) { this . callback.checkAndExecute ( ) ; } return null ; } final javax.net.ssl.SSLEngineResult.HandshakeStatus hs = this . engine.getHandshakeStatus ( ) ; switch ( hs ) { case NEED_UNWRAP : this . read ( appPeerBuffer ) ; return null ; case NEED_WRAP : this . write ( appBuffer ) ; return null ; case NEED_TASK : return engine.getDelegatedTask ( ) ; } return null ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.Search , org.ovirt.engine.core.common.queries.SearchParameters.class , new java.lang.String [ ] { "SearchPattern" , "SearchTypeValue" } , new java.lang.Object [ ] { "users:" , org.ovirt.engine.core.common.interfaces.SearchType.DBUser } , getUsers ( ) ) ; setUpGetEntityExpectations ( ) ; control.replay ( ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { true , false } , getUsers ( ) ) ; setUpGetEntityExpectations ( ) ; control.replay ( ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
private void verifyCertificate ( org.ovirt.engine.api.model.VM model ) { assertNotNull ( model.getDisplay ( ) ) ; assertNotNull ( model.getDisplay ( ) . getCertificate ( ) ) ; assertEquals ( model.getDisplay ( ) . getCertificate ( ) . getSubject ( ) , org.ovirt.engine.api.restapi.resource.BackendVmResourceTest.CERTIFICATE ) ; }

Target:
private void setUpGetCertuficateExpectations ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVdsCertificateSubjectByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , org.ovirt.engine.api.restapi.resource.BackendVmResourceTest.CERTIFICATE ) ; }
Source:
protected void flush ( org.ovirt.engine.ui.uicommonweb.models.ListModel model ) { java.util.ArrayList < T > values = new java.util.ArrayList < T > ( ) ; for ( org.ovirt.engine.core.common.utils.Pair < T , V > item : items ) { T value = item.getFirst ( ) ; if ( ! ( isGhost ( value ) ) ) { values.add ( value ) ; } } model.setItems ( values ) ; }

Target:
public M flush ( ) { modelItems.clear ( ) ; for ( org.ovirt.engine.core.common.utils.Pair < T , V > item : items ) { T value = item.getFirst ( ) ; if ( ! ( isGhost ( value ) ) ) { modelItems.add ( value ) ; } } return model ; }
Source:
private java.util.Map < java.lang.String , java.lang.String > getOptionValues ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity option ) { java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < > ( ) ; values.put ( GlusterConstants.CLUSTER , getVdsGroupName ( ) ) ; values.put ( GlusterConstants.VOLUME , volume.getName ( ) ) ; values.put ( GlusterConstants.OPTION_KEY , option.getKey ( ) ) ; values.put ( GlusterConstants.OPTION_VALUE , option.getValue ( ) ) ; return values ; }

Target:
private java.util.Map < java.lang.String , java.lang.String > getOptionValues ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity option ) { java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < > ( ) ; values.put ( GlusterConstants.CLUSTER , getClusterName ( ) ) ; values.put ( GlusterConstants.VOLUME , volume.getName ( ) ) ; values.put ( GlusterConstants.OPTION_KEY , option.getKey ( ) ) ; values.put ( GlusterConstants.OPTION_VALUE , option.getValue ( ) ) ; return values ; }
Source:
public void canDoActionFailsOnNullHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookStatusChangeParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnNullHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }
Source:
public void testUpdateBootOrder ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = dao.get ( getExistingEntityId ( ) ) ; int newBootOrderValue = ( vmDevice.getBootOrder ( ) ) + 1 ; org.junit.Assert.assertTrue ( org.apache.commons.lang.StringUtils.isNotBlank ( vmDevice.getAddress ( ) ) ) ; vmDevice.setBootOrder ( newBootOrderValue ) ; dao.updateHotPlugDisk ( vmDevice ) ; dao.get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertEquals ( vmDevice.getBootOrder ( ) , newBootOrderValue ) ; }

Target:
public void testUpdateBootOrder ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = dao.get ( getExistingEntityId ( ) ) ; int newBootOrderValue = ( vmDevice.getBootOrder ( ) ) + 1 ; org.junit.Assert.assertTrue ( org.apache.commons.lang.StringUtils.isNotBlank ( vmDevice.getAddress ( ) ) ) ; vmDevice.setBootOrder ( newBootOrderValue ) ; dao.updateBootOrder ( vmDevice ) ; dao.get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertEquals ( vmDevice.getBootOrder ( ) , newBootOrderValue ) ; }
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 bootProtocolChanged ( ) { updateCanSpecify ( ) ; getAddress ( ) . setIsValid ( true ) ; getSubnet ( ) . setIsValid ( true ) ; getGateway ( ) . setIsValid ( true ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.SelectedItemChangedEventDefinition ) ) && ( sender == ( getStorageTypeList ( ) ) ) ) { StorageType_SelectedItemChanged ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getStorageTypeList ( ) ) ) ) { StorageType_SelectedItemChanged ( ) ; } }
Source:
public void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private void castEveryonePermissionsToUser ( org.ovirt.engine.core.common.businessentities.Permissions entity ) { if ( ( ( ( entity.getAdElementId ( ) ) != null ) && ( entity.getAdElementId ( ) . equals ( Guid.EVERYONE ) ) ) && ( queryType.equals ( VdcQueryType.GetPermissionsByAdElementId ) ) ) { entity.setAdElementId ( this . targetId ) ; } }

Target:
private void castEveryonePermissionsToUser ( org.ovirt.engine.api.model.Permission entity ) { if ( ( ( ( entity.getAdElementId ( ) ) != null ) && ( entity.getAdElementId ( ) . equals ( Guid.EVERYONE ) ) ) && ( queryType.equals ( VdcQueryType.GetPermissionsByAdElementId ) ) ) { entity.setAdElementId ( this . targetId ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkBelongsToClusterDataCenter ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , org.ovirt.engine.core.common.businessentities.network.Network network ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_FROM_DIFFERENT_DC , java.lang.String.format ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) . unless ( cluster.getStoragePoolId ( ) . equals ( network.getDataCenterId ( ) ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult managementNetworkRequired ( org.ovirt.engine.core.common.businessentities.network.Network network ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_MANAGEMENT_NETWORK_REQUIRED , java.lang.String.format ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidatorBase.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) . when ( ( ( networkCluster.isManagement ( ) ) && ( ! ( networkCluster.isRequired ( ) ) ) ) ) ; }
Source:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ; org.ovirt.engine.core.bll.ValidationResult slavesValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , "slaveA" ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_NAME , "networkName" ) ) ; org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , slavesValidationResult , slavesValidationResult ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveIsNotValid ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.CreateOrUpdateBond createOrUpdateBond = createNewCreateOrUpdateBond ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "bond1" , "slaveA" , "slaveB" ) ; org.ovirt.engine.core.bll.ValidationResult cannotBeSlaveValidationResult = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_NIC_NAME , createOrUpdateBond.getName ( ) ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addBonds ( createOrUpdateBond ) ) . build ( ) ; doTestValidateModifiedBondSlaves ( org.mockito.Mockito.spy ( validator ) , ValidationResult.VALID , cannotBeSlaveValidationResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( cannotBeSlaveValidationResult ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( masterDomain.getStoragePoolIsoMapData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDAO ( ) . remove ( masterDomain.getStoragePoolIsoMapData ( ) . getId ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( masterDomain.getStoragePoolIsoMapData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . remove ( masterDomain.getStoragePoolIsoMapData ( ) . getId ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
protected void executeCommand ( ) { labelDao.update ( getParameters ( ) . getLabel ( ) ) ; setActionReturnValue ( getParameters ( ) . getLabel ( ) ) ; setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.Label label = labelDao.get ( getLabelId ( ) ) ; java.util.Collection changedVms = org.apache.commons.collections.CollectionUtils.disjunction ( label.getVms ( ) , getParameters ( ) . getLabel ( ) . getVms ( ) ) ; vmStaticDao.incrementDbGenerationForVms ( new java.util.ArrayList < > ( changedVms ) ) ; labelDao.update ( getParameters ( ) . getLabel ( ) ) ; setActionReturnValue ( getParameters ( ) . getLabel ( ) ) ; setSucceeded ( true ) ; }
Source:
public static boolean qosConfiguredOnInterface ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.network.Network network ) { if ( iface.isQosOverridden ( ) ) { return ( ( iface.getQos ( ) ) != null ) && ( ! ( iface.getQos ( ) . isEmpty ( ) ) ) ; } else { return ( network != null ) && ( ( network.getQosId ( ) ) != null ) ; } }

Target:
public static boolean qosConfiguredOnInterface ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment , org.ovirt.engine.core.common.businessentities.network.Network network ) { if ( ( networkAttachment != null ) && ( networkAttachment.isQosOverridden ( ) ) ) { return ( ( networkAttachment.getHostNetworkQos ( ) ) != null ) && ( ! ( networkAttachment.getHostNetworkQos ( ) . isEmpty ( ) ) ) ; } else { return ( network != null ) && ( ( network.getQosId ( ) ) != null ) ; } }
Source:
public void canDoActionPreallocatedSpaceCheckSucceeds ( ) { final int availableSize = 12 ; final int usedSize = 8 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionSpaceValidationSucceeds ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
Source:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
private org.ovirt.engine.core.bll.network.macpool.MacPool decoratePool ( org.ovirt.engine.core.compat.Guid macPoolId , org.ovirt.engine.core.bll.network.macpool.MacPool poolById , java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPoolDecorator > decorators ) { org.ovirt.engine.core.bll.network.macpool.MacPool result = poolById ; if ( decorators != null ) { for ( org.ovirt.engine.core.bll.network.macpool.MacPoolDecorator decorator : decorators ) { decorator.setMacPool ( result ) ; decorator.setMacPoolId ( macPoolId ) ; result = decorator ; } } return result ; }

Target:
private org.ovirt.engine.core.bll.network.macpool.MacPool decoratePool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool , java.util.List < org.ovirt.engine.core.bll.network.macpool.MacPoolDecorator > decorators ) { org.ovirt.engine.core.bll.network.macpool.MacPool result = macPool ; if ( decorators != null ) { for ( org.ovirt.engine.core.bll.network.macpool.MacPoolDecorator decorator : decorators ) { decorator.setMacPool ( result ) ; result = decorator ; } } return result ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator validator = new org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator ( getNetworkCluster ( ) ) ; return ( ( ( vdsGroupExists ( ) ) && ( changesAreClusterCompatible ( ) ) ) && ( logicalNetworkExists ( ) ) ) && ( ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isManagementNetwork ( getNetwork ( ) ) ) ) || ( validate ( validator.managementNetworkAttachment ( getNetworkName ( ) ) ) ) ) ; }

Target:
protected boolean canDoAction ( ) { return ( ( ( vdsGroupExists ( ) ) && ( changesAreClusterCompatible ( ) ) ) && ( logicalNetworkExists ( ) ) ) && ( validateAttachment ( ) ) ; }
Source:
protected org.ovirt.engine.api.model.NIC getNic ( boolean withNetwork ) { org.ovirt.engine.api.model.NIC nic = new org.ovirt.engine.api.model.NIC ( ) ; nic.setMac ( new org.ovirt.engine.api.model.MAC ( ) ) ; nic.getMac ( ) . setAddress ( "00:1a:4a:16:85:18" ) ; if ( withNetwork ) { org.ovirt.engine.api.model.Network network = new org.ovirt.engine.api.model.Network ( ) ; network.setId ( GUIDS [ 0 ] . toString ( ) ) ; } org.ovirt.engine.api.model.Network network = new org.ovirt.engine.api.model.Network ( ) ; network.setId ( GUIDS [ 0 ] . toString ( ) ) ; return nic ; }

Target:
protected org.ovirt.engine.api.model.NIC getNic ( boolean withNetwork ) { org.ovirt.engine.api.model.NIC nic = new org.ovirt.engine.api.model.NIC ( ) ; nic.setMac ( new org.ovirt.engine.api.model.Mac ( ) ) ; nic.getMac ( ) . setAddress ( "00:1a:4a:16:85:18" ) ; if ( withNetwork ) { org.ovirt.engine.api.model.Network network = new org.ovirt.engine.api.model.Network ( ) ; network.setId ( GUIDS [ 0 ] . toString ( ) ) ; } org.ovirt.engine.api.model.Network network = new org.ovirt.engine.api.model.Network ( ) ; network.setId ( GUIDS [ 0 ] . toString ( ) ) ; return nic ; }
Source:
public void testRemoveNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.GetAllNetworkQueryParamenters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; control.replay ( ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testRemoveNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; control.replay ( ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.Cluster createCluster ( int index , org.ovirt.engine.core.compat.Version v ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterGeoRepSyncJobTest.CLUSTER_GUIDS [ index ] ) ; cluster.setName ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setCompatibilityVersion ( v ) ; return cluster ; }

Target:
private static org.ovirt.engine.core.common.businessentities.Cluster createCluster ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterGeoRepSyncJobTest.CLUSTER_GUID ) ; cluster.setName ( "cluster" ) ; cluster.setGlusterService ( true ) ; cluster.setVirtService ( false ) ; cluster.setCompatibilityVersion ( Version.v4_0 ) ; return cluster ; }
Source:
public void canDoActionShareableDiskVolumeFormatSucceeds ( ) { 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 ( ) ; runAndAssertCanDoActionSuccess ( ) ; }

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 , Version.v3_1 ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; runAndAssertValidateSuccess ( ) ; }
Source:
private void incrementVdsPendingVmsCount ( ) { synchronized ( _vds_pending_vm_count ) { if ( ! ( _vds_pending_vm_count.containsKey ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) ) ) ) { _vds_pending_vm_count.put ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) , 1 ) ; } else { int i = _vds_pending_vm_count.get ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) ) ; _vds_pending_vm_count.put ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) , ( i + 1 ) ) ; } } }

Target:
protected void updateCurrentCd ( java.lang.String cdPath ) { org.ovirt.engine.core.bll.VmHandler.updateCurrentCd ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) , cdPath ) ; }
Source:
public static void GetDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public void BuildVirtualSystem ( ) { _writer.WriteStartElement ( "Content" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "id" , "out" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.XSI_URI , "type" , ( ( OVF_PREFIX ) + ":VirtualSystem_Type" ) ) ; writeGeneralData ( ) ; WriteAppList ( ) ; WriteContentItems ( ) ; _writer.WriteEndElement ( ) ; }

Target:
public void buildVirtualSystem ( ) { _writer.WriteStartElement ( "Content" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "id" , "out" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.XSI_URI , "type" , ( ( OVF_PREFIX ) + ":VirtualSystem_Type" ) ) ; writeGeneralData ( ) ; WriteAppList ( ) ; WriteContentItems ( ) ; _writer.WriteEndElement ( ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VmDevice getVmDevice ( org.ovirt.engine.core.compat.Guid deviceId , org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type , java.lang.String device , boolean isManaged ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vmId ) , type , device , "" , 0 , java.util.Collections.EMPTY_MAP , isManaged , true , false , "" , java.util.Collections.EMPTY_MAP , null , null ) ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VmDevice getVmDevice ( org.ovirt.engine.core.compat.Guid deviceId , org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type , java.lang.String device , boolean isManaged ) { return new org.ovirt.engine.core.common.businessentities.VmDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vmId ) , type , device , "" , 0 , java.util.Collections.emptyMap ( ) , isManaged , true , false , "" , java.util.Collections.emptyMap ( ) , null , null ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.users.UserQuotaListModel quotaListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.users.UserQuotaListModel ) ( model ) ) ; quotaListModel.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } super . syncSearch ( ) ; org.ovirt.engine.core.common.queries.GetQuotasByAdElementIdQueryParameters parameters = new org.ovirt.engine.core.common.queries.GetQuotasByAdElementIdQueryParameters ( ) ; parameters.setAdElementId ( getEntity ( ) . getId ( ) ) ; parameters.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetQuotasByAdElementId , parameters , new org.ovirt.engine.ui.uicommonweb.models.users.SetItemsAsyncQuery ( ) ) ; }
Source:
public static void GetVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void GetVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }