auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain domain = createDataStorageDomain ( status , name , HE_SD_ID ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( cmd ) . getStorageDomainDao ( ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( domain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return domain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain domain = createDataStorageDomain ( status , name , HE_SD_ID ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( domain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return domain ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.VM model = new org.ovirt.engine.api.model.VM ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "VM" , "add" , "template.id|name" , "cluster.id|name" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.VM model = new org.ovirt.engine.api.model.VM ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "VM" , "add" , "cluster.id|name" ) ; } }
Source:
public org.ovirt.engine.ui.common.widget.HasUiCommandClickHandlers addFooterButton ( java.lang.String label , java.lang.String uniqueId ) { org.ovirt.engine.ui.common.widget.AbstractUiCommandButton button = createCommandButton ( label ) ; org.ovirt.engine.ui.common.view.popup.AbstractModelBoundPopupView.asWidget ( ) . addFooterButton ( button ) ; button.asWidget ( ) . getElement ( ) . setId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , uniqueId ) ) ; return button ; }

Target:
public org.ovirt.engine.ui.common.widget.HasUiCommandClickHandlers addFooterButton ( java.lang.String label , java.lang.String uniqueId ) { org.ovirt.engine.ui.common.widget.AbstractUiCommandButton button = createCommandButton ( label , uniqueId ) ; org.ovirt.engine.ui.common.view.popup.AbstractModelBoundPopupView.asWidget ( ) . addFooterButton ( button ) ; button.asWidget ( ) . getElement ( ) . setId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , uniqueId ) ) ; return button ; }
Source:
protected void actualSave ( ) { flush ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( action , new org.ovirt.engine.core.common.action.ProviderParameters ( provider ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { sourceListModel.getSearchCommand ( ) . execute ( ) ; } } ) ; cancel ( ) ; }

Target:
protected void actualSave ( ) { flush ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( action , new org.ovirt.engine.core.common.action.ProviderParameters ( provider ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ( ( result.getReturnValue ( ) ) == null ) || ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) ) { return ; } sourceListModel.getSearchCommand ( ) . execute ( ) ; cancel ( ) ; } } ) ; }
Source:
protected void onReveal ( ) { super . onReveal ( ) ; if ( hasSelection ( ) ) { clearSelection ( ) ; } else { org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.setSubTabPanelVisible ( false ) ; } getTable ( ) . resetScrollPosition ( ) ; getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; }

Target:
protected void onReveal ( ) { super . onReveal ( ) ; if ( hasSelection ( ) ) { clearSelection ( ) ; } else { org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.setSubTabPanelVisible ( false ) ; } getTable ( ) . resetScrollPosition ( ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.CommandAssociatedEntity other = ( ( org.ovirt.engine.core.common.businessentities.CommandAssociatedEntity ) ( obj ) ) ; return ( java.util.Objects.equals ( commandId , other.commandId ) ) && ( super . equals ( obj ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.CommandAssociatedEntity ) ) { return false ; } org.ovirt.engine.core.common.businessentities.CommandAssociatedEntity other = ( ( org.ovirt.engine.core.common.businessentities.CommandAssociatedEntity ) ( obj ) ) ; return ( super . equals ( obj ) ) && ( java.util.Objects.equals ( commandId , other.commandId ) ) ; }
Source:
public org.ovirt.engine.api.model.NIC update ( org.ovirt.engine.api.model.NIC resource ) { validateParameters ( resource , requiredUpdateFields ) ; org.ovirt.engine.core.common.businessentities.network.Network network = findNetwork ( resource ) ; if ( network != null ) { resource.getNetwork ( ) . setName ( network.getname ( ) ) ; resource.getNetwork ( ) . setId ( null ) ; } return performUpdate ( resource , entityResolver , updateType , updateParametersProvider ) ; }

Target:
public org.ovirt.engine.api.model.NIC update ( org.ovirt.engine.api.model.NIC resource ) { validateParameters ( resource , requiredUpdateFields ) ; org.ovirt.engine.core.common.businessentities.network.Network network = findNetwork ( resource ) ; if ( network != null ) { resource.getNetwork ( ) . setName ( network.getName ( ) ) ; resource.getNetwork ( ) . setId ( null ) ; } return performUpdate ( resource , entityResolver , updateType , updateParametersProvider ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.storage.VolumeClassification deleteVolumeByClassificationType ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { org.ovirt.engine.core.common.businessentities.storage.VolumeClassification cinderVolumeType = cinderDisk.getVolumeClassification ( ) ; if ( cinderVolumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeClassification.Volume ) ) { deleteVolume ( cinderDisk ) ; } else if ( cinderVolumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeClassification.Snapshot ) ) { deleteSnapshot ( cinderDisk.getImageId ( ) ) ; } org.ovirt.engine.core.bll.storage.CinderBroker.log.error ( "Error, could not determine Cinder entity with id from Cinder provider." , cinderDisk.getDiskAlias ( ) , cinderDisk.getImageId ( ) ) ; return cinderVolumeType ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.VolumeClassification deleteVolumeByClassificationType ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { org.ovirt.engine.core.common.businessentities.storage.VolumeClassification cinderVolumeType = cinderDisk.getVolumeClassification ( ) ; if ( cinderVolumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeClassification.Volume ) ) { deleteVolume ( cinderDisk ) ; } else if ( cinderVolumeType == ( org.ovirt.engine.core.common.businessentities.storage.VolumeClassification.Snapshot ) ) { deleteSnapshot ( cinderDisk.getImageId ( ) ) ; } else { org.ovirt.engine.core.bll.storage.CinderBroker.log.error ( "Error, could not determine Cinder entity with id from Cinder provider." , cinderDisk.getDiskAlias ( ) , cinderDisk.getImageId ( ) ) ; } return cinderVolumeType ; }
Source:
private java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActionsImpl ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isInternal , boolean isRunOnlyIfAllValidationPass , boolean isWaitForResult , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { org.ovirt.engine.core.bll.MultipleActionsRunner runner = multipleActionsRunnersFactory.createMultipleActionsRunner ( actionType , parameters , isInternal , commandContext ) ; runner.setIsRunOnlyIfAllValidatePass ( isRunOnlyIfAllValidationPass ) ; runner.setIsWaitForResult ( isWaitForResult ) ; return runner.execute ( ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActionsImpl ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.List < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isInternal , boolean isRunOnlyIfAllValidationPass , boolean isWaitForResult , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { org.ovirt.engine.core.bll.MultipleActionsRunner runner = multipleActionsRunnersFactory.createMultipleActionsRunner ( actionType , parameters , isInternal , commandContext ) ; runner.setIsRunOnlyIfAllValidatePass ( isRunOnlyIfAllValidationPass ) ; runner.setIsWaitForResult ( isWaitForResult ) ; return runner.execute ( ) ; }
Source:
public void filterUnSelectableModels ( ) { java.util.ArrayList < java.lang.Object > filterredItems = new java.util.ArrayList < java.lang.Object > ( ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > cast ( getModel ( ) . getItems ( ) ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : items ) { if ( ( ( org.ovirt.engine.ui.uicommonweb.models.Model ) ( model ) ) . getIsSelectable ( ) ) { filterredItems.add ( model ) ; } } getModel ( ) . getAvailableStorageItems ( ) . setItems ( filterredItems ) ; }

Target:
public void filterUnSelectableModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > filterredItems = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > cast ( getModel ( ) . getItems ( ) ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : items ) { if ( ( ( org.ovirt.engine.ui.uicommonweb.models.Model ) ( model ) ) . getIsSelectable ( ) ) { filterredItems.add ( model ) ; } } getModel ( ) . getAvailableStorageItems ( ) . setItems ( filterredItems ) ; }
Source:
private void executeFenceVdsManulalyAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.RestartVdsCommand.getVds ( ) . getstorage_pool_id ( ) ) ; fenceVdsManuallyParams.setVdsId ( vdsId ) ; fenceVdsManuallyParams.setSessionId ( sessionId ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams ) ; }

Target:
private void executeFenceVdsManulalyAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.RestartVdsCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( vdsId ) ; fenceVdsManuallyParams.setSessionId ( sessionId ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( defaultDisplayType ) == null ? 0 : defaultDisplayType.hashCode ( ) ) ; result = ( prime * result ) + ( ( id.tagId ) == null ? 0 : id.tagId.hashCode ( ) ) ; result = ( prime * result ) + ( ( id.vmId ) == null ? 0 : id.vmId.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( id.tagId ) == null ? 0 : id.tagId.hashCode ( ) ) ; result = ( prime * result ) + ( ( id.vmId ) == null ? 0 : id.vmId.hashCode ( ) ) ; result = ( prime * result ) + ( ( defaultDisplayType ) == null ? 0 : defaultDisplayType.hashCode ( ) ) ; return result ; }
Source:
public void updateTasksInCluster ( ) { org.mockito.Mockito.doReturn ( getTasks ( ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 2 ) ) . updateSteps ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void updateTasksInCluster ( ) { org.mockito.Mockito.doReturn ( getTasks ( ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; prepareMocks ( ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 2 ) ) . updateSteps ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public boolean hasSpaceForSnapshots ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.ArrayList < java.lang.String > message ) { java.lang.Integer minSnapshotSize = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.InitStorageSparseSizeInGB ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.storage_domains , java.lang.Integer > e : mapStorageDomainsToNumOfDisks ( vm ) . entrySet ( ) ) { if ( ! ( destinationHasSpace ( e.getKey ( ) , ( minSnapshotSize * ( e.getValue ( ) ) ) , message ) ) ) { return false ; } } return true ; }

Target:
public boolean hasSpaceForSnapshots ( org.ovirt.engine.core.common.businessentities.VM vm , java.util.ArrayList < java.lang.String > message ) { java.lang.Integer minSnapshotSize = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.InitStorageSparseSizeInGB ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.StorageDomain , java.lang.Integer > e : mapStorageDomainsToNumOfDisks ( vm ) . entrySet ( ) ) { if ( ! ( destinationHasSpace ( e.getKey ( ) , ( minSnapshotSize * ( e.getValue ( ) ) ) , message ) ) ) { return false ; } } return true ; }
Source:
protected boolean validate ( ) { if ( ! ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . isSkipDomainChecks ( ) ) ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getStorageDomain ( ) ) ; if ( ( ! ( validate ( storageDomainValidator.isDomainExistAndActive ( ) ) ) ) || ( ! ( validate ( storageDomainValidator.isDataDomain ( ) ) ) ) ) { return false ; } } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . isSkipDomainChecks ( ) ) ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getStorageDomain ( ) ) ; return ( validate ( storageDomainValidator.isDomainExistAndActive ( ) ) ) && ( validate ( storageDomainValidator.isDataDomain ( ) ) ) ; } return true ; }
Source:
public void configure ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { if ( spice instanceof org.ovirt.engine.ui.uicommonweb.models.vms.ISpicePlugin ) { ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpicePlugin ) ( spice ) ) . setPluginVersion ( getSpiceVersion ( ) ) ; ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpicePlugin ) ( spice ) ) . setSpiceBaseURL ( org.ovirt.engine.ui.uicommonweb.Configurator.getSpiceBaseURL ( ) ) ; } spice.getOptions ( ) . setAdminConsole ( getSpiceAdminConsole ( ) ) ; spice.getOptions ( ) . setUsbFilter ( getUsbFilter ( ) ) ; updateSpiceUsbAutoShare ( spice ) ; updateSpiceFullScreenDefault ( spice ) ; }

Target:
public void configure ( org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice ) { spice.getOptions ( ) . setAdminConsole ( getSpiceAdminConsole ( ) ) ; spice.getOptions ( ) . setUsbFilter ( getUsbFilter ( ) ) ; updateSpiceUsbAutoShare ( spice ) ; updateSpiceFullScreenDefault ( spice ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > sortTemplates ( java.util.Collection < org.ovirt.engine.core.common.businessentities.VmTemplate > value ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > sortedValues = new java.util.ArrayList ( value ) ; java.util.Collections.sort ( sortedValues , new org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalTemplateListModel.TemplateComparator ( ) ) ; return sortedValues ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > sortTemplates ( java.util.Collection < org.ovirt.engine.core.common.businessentities.VmTemplate > value ) { if ( value == null ) { return null ; } final java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > sortedValues = new java.util.ArrayList ( value ) ; java.util.Collections.sort ( sortedValues , new org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalTemplateListModel.TemplateComparator ( ) ) ; return sortedValues ; }
Source:
private boolean validateDestStorage ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid destDomainId ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator validator = getValidator ( destDomainId , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePoolId ( ) . getValue ( ) ) ; return ( validate ( validator.isDomainExistAndActive ( ) ) ) && ( validate ( validator.domainIsValidDestination ( ) ) ) ; }

Target:
private boolean validateDestStorage ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid destDomainId ) { org.ovirt.engine.core.bll.validator.StorageDomainValidator validator = getValidator ( destDomainId , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePoolId ( ) ) ; return ( validate ( validator.isDomainExistAndActive ( ) ) ) && ( validate ( validator.domainIsValidDestination ( ) ) ) ; }
Source:
public void onSuccess ( java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Quota > ) ( returnValue ) ) ; quotas = ( quotas != null ) ? quotas : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ( ) ; getStorageQuota ( ) . setItems ( quotas ) ; getStorageQuota ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( quotas ) ) ; }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas ) { quotas = ( quotas != null ) ? quotas : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Quota > ( ) ; getStorageQuota ( ) . setItems ( quotas ) ; getStorageQuota ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( quotas ) ) ; }
Source:
public void getNetworkLabelsByDataCenterId ( org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.ui.frontend.AsyncQuery query ) { query.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.SortedSet < java.lang.String > > ( ) { @ java.lang.Override public java.util.SortedSet < java.lang.String > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.SortedSet < java.lang.String > sortedSet = new java.util.TreeSet < java.lang.String > ( new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; sortedSet.addAll ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; return sortedSet ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworkLabelsByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , query ) ; }

Target:
public void getNetworkLabelsByDataCenterId ( org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.ui.frontend.AsyncQuery query ) { query.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.SortedSet < java.lang.String > > ( ) { @ java.lang.Override public java.util.SortedSet < java.lang.String > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { java.util.SortedSet < java.lang.String > sortedSet = new java.util.TreeSet ( new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; sortedSet.addAll ( ( ( java.util.Collection < java.lang.String > ) ( returnValue ) ) ) ; return sortedSet ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworkLabelsByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , query ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getCommonPassword ( ) . setIsChangable ( ( ( java.lang.Boolean ) ( getUseCommonPassword ( ) . getEntity ( ) ) ) ) ; getApplyPasswordCommand ( ) . setIsExecutionAllowed ( ( ( java.lang.Boolean ) ( getUseCommonPassword ( ) . getEntity ( ) ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getCommonPassword ( ) . setIsChangable ( getUseCommonPassword ( ) . getEntity ( ) ) ; getApplyPasswordCommand ( ) . setIsExecutionAllowed ( getUseCommonPassword ( ) . getEntity ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.DbGroup mapRow ( final java.sql.ResultSet rs , final int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.DbGroup entity = new org.ovirt.engine.core.common.businessentities.DbGroup ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "id" ) ) ; entity.setName ( rs.getString ( "name" ) ) ; entity.setActive ( rs.getBoolean ( "active" ) ) ; entity.setDomain ( rs.getString ( "domain" ) ) ; entity.setDistinguishedName ( rs.getString ( "distinguishedname" ) ) ; entity.setExternalId ( new org.ovirt.engine.core.common.utils.ExternalId ( rs.getBytes ( "external_id" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.DbGroup mapRow ( final java.sql.ResultSet rs , final int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.DbGroup entity = new org.ovirt.engine.core.common.businessentities.DbGroup ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "id" ) ) ; entity.setName ( rs.getString ( "name" ) ) ; entity.setActive ( rs.getBoolean ( "active" ) ) ; entity.setDomain ( rs.getString ( "domain" ) ) ; entity.setDistinguishedName ( rs.getString ( "distinguishedname" ) ) ; entity.setExternalId ( rs.getString ( "external_id" ) ) ; return entity ; }
Source:
private org.ovirt.engine.core.common.action.RemoveCinderDiskParameters buildRemoveDiskChildCommandParameters ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { org.ovirt.engine.core.common.action.RemoveCinderDiskParameters removeDiskParams = new org.ovirt.engine.core.common.action.RemoveCinderDiskParameters ( cinderDisk.getId ( ) ) ; removeDiskParams.setFaultTolerant ( true ) ; removeDiskParams.setShouldBeLogged ( false ) ; removeDiskParams.setParentCommand ( org.ovirt.engine.core.bll.storage.RestoreFromCinderSnapshotCommand.getActionType ( ) ) ; removeDiskParams.setParentParameters ( org.ovirt.engine.core.bll.storage.RestoreFromCinderSnapshotCommand.getParameters ( ) ) ; return removeDiskParams ; }

Target:
private org.ovirt.engine.core.common.action.RemoveCinderDiskParameters buildRemoveDiskChildCommandParameters ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { org.ovirt.engine.core.common.action.RemoveCinderDiskParameters removeDiskParams = new org.ovirt.engine.core.common.action.RemoveCinderDiskParameters ( cinderDisk.getId ( ) ) ; removeDiskParams.setShouldBeLogged ( false ) ; removeDiskParams.setParentCommand ( org.ovirt.engine.core.bll.storage.RestoreFromCinderSnapshotCommand.getActionType ( ) ) ; removeDiskParams.setParentParameters ( org.ovirt.engine.core.bll.storage.RestoreFromCinderSnapshotCommand.getParameters ( ) ) ; return removeDiskParams ; }
Source:
public boolean Validate ( ) { org.ovirt.engine.ui.uicommonweb.validation.LengthValidation tempVar = new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( ) ; tempVar.setMaxLength ( 40 ) ; getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , tempVar , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( ) } ) ; return getName ( ) . getIsValid ( ) ; }

Target:
public boolean validate ( ) { org.ovirt.engine.ui.uicommonweb.validation.LengthValidation tempVar = new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( ) ; tempVar.setMaxLength ( 40 ) ; getName ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , tempVar , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( ) } ) ; return getName ( ) . getIsValid ( ) ; }
Source:
protected java.util.List < org.ovirt.engine.api.model.Network > getClusterNetworks ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( org.ovirt.engine.core.common.businessentities.VDS.class , VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( getHostId ( ) ) ) , "Host" ) ; return getEntity ( java.util.List.class , VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vds.getVdsGroupId ( ) ) , "Networks" ) ; }

Target:
protected java.util.List < org.ovirt.engine.api.model.Network > getClusterNetworks ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( org.ovirt.engine.core.common.businessentities.VDS.class , VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( getHostId ( ) ) ) , "Host" ) ; return getEntity ( java.util.List.class , VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vds.getVdsGroupId ( ) ) , "Networks" ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider < org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties > > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider < org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties > > ) ( result ) ) ; providers.add ( 0 , null ) ; getNetworkProviders ( ) . setItems ( providers ) ; getNetworkProviders ( ) . setSelectedItem ( null ) ; }

Target:
public void onSuccess ( java.lang.Object result ) { stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider < org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties > > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider < org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties > > ) ( result ) ) ; providers.add ( 0 , null ) ; getNetworkProviders ( ) . setItems ( providers ) ; getNetworkProviders ( ) . setSelectedItem ( null ) ; }
Source:
private void setupMock ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( expected.getId ( ) ) ; glusterBrickDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class ) ; org.mockito.Mockito.when ( glusterBrickDaoMock.getBricksOfVolume ( expected.getId ( ) ) ) . thenReturn ( bricks ) ; org.mockito.Mockito.doReturn ( glusterBrickDaoMock ) . when ( getQuery ( ) ) . getGlusterBrickDao ( ) ; }

Target:
private void setupMock ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getId ( ) ) . thenReturn ( expected.getId ( ) ) ; org.mockito.Mockito.when ( glusterBrickDaoMock.getBricksOfVolume ( expected.getId ( ) ) ) . thenReturn ( bricks ) ; }
Source:
public static boolean isImagesExists ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , org.ovirt.engine.core.compat.Guid storagePoolId ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage fromIrs = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.isImageExist ( storagePoolId , image ) ; if ( fromIrs == null ) { return false ; } } return true ; }

Target:
public boolean isImagesExists ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , org.ovirt.engine.core.compat.Guid storagePoolId ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage fromIrs = isImageExist ( storagePoolId , image ) ; if ( fromIrs == null ) { return false ; } } return true ; }
Source:
private void RestoreVmFromBaseSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vm.getId ( ) , SnapshotType.STATELESS ) ) { log.infoFormat ( "Deleting snapshots for stateless vm {0}" , vm.getId ( ) ) ; org.ovirt.engine.core.common.action.VmOperationParameterBase restoreParams = new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vm.getId ( ) ) ; restoreParams.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RestoreStatelessVm , restoreParams , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.DetachUserFromVmFromPoolCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.DetachUserFromVmFromPoolCommand.getLock ( ) ) ) ; } }

Target:
private void RestoreVmFromBaseSnapshot ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getSnapshotDao ( ) . exists ( vm.getId ( ) , SnapshotType.STATELESS ) ) { log.infoFormat ( "Deleting snapshots for stateless vm {0}" , vm.getId ( ) ) ; org.ovirt.engine.core.common.action.VmOperationParameterBase restoreParams = new org.ovirt.engine.core.common.action.VmOperationParameterBase ( vm.getId ( ) ) ; restoreParams.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; runInternalAction ( VdcActionType.RestoreStatelessVm , restoreParams , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.DetachUserFromVmFromPoolCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.DetachUserFromVmFromPoolCommand.getLock ( ) ) ) ; } }
Source:
private boolean initRange ( java.lang.String start , java.lang.String end ) { java.util.List < java.lang.String > macAddresses = org.ovirt.engine.core.utils.MacAddressRangeUtils.initRange ( start , end ) ; if ( ( ( macAddresses.size ( ) ) + ( availableMacs.size ( ) ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxMacsCountInPool ) ) ) { throw new org.ovirt.engine.core.bll.network.MacPoolManager.MacPoolExceededMaxException ( ) ; } availableMacs.addAll ( macAddresses ) ; return true ; }

Target:
private boolean initRange ( java.lang.String start , java.lang.String end ) { java.util.List < java.lang.String > macAddresses = org.ovirt.engine.core.utils.MacAddressRangeUtils.initRange ( start , end ) ; if ( ( ( macAddresses.size ( ) ) + ( availableMacs.size ( ) ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxMacsCountInPool ) ) ) { throw new org.ovirt.engine.core.bll.network.MacPoolManager.MacPoolExceededMaxException ( ) ; } availableMacs.addAll ( macAddresses ) ; return true ; }
Source:
private void setCookie ( final javax.servlet.http.HttpServletResponse response , final javax.servlet.ServletContext servletContext , final java.util.Locale userLocale ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.LocaleFilter.LOCALE , userLocale.toString ( ) ) ; cookie.setPath ( org.ovirt.engine.core.utils.servlet.LocaleFilter.ROOT_PATH ) ; cookie.setMaxAge ( java.lang.Integer.MAX_VALUE ) ; cookie.setHttpOnly ( true ) ; response.addCookie ( cookie ) ; }

Target:
private void setCookie ( final javax.servlet.http.HttpServletResponse response , final javax.servlet.ServletContext servletContext , final java.util.Locale userLocale ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.LocaleFilter.LOCALE , userLocale.toString ( ) ) ; cookie.setPath ( org.ovirt.engine.core.utils.servlet.LocaleFilter.ROOT_PATH ) ; cookie.setMaxAge ( java.lang.Integer.MAX_VALUE ) ; response.addCookie ( cookie ) ; }
Source:
public void initUserAndGroupData ( ) { if ( ( dbUser ) == null ) { dbUser = org.ovirt.engine.core.bll.PermissionsCommandBase.getDbUserDAO ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getad_element_id ( ) ) ; } if ( ( dbGroup ) == null ) { dbGroup = org.ovirt.engine.core.bll.PermissionsCommandBase.getAdGroupDAO ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getad_element_id ( ) ) ; } }

Target:
public void initUserAndGroupData ( ) { if ( ( dbUser ) == null ) { dbUser = org.ovirt.engine.core.bll.PermissionsCommandBase.getDbUserDAO ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getad_element_id ( ) ) ; } if ( ( ( dbUser ) == null ) && ( ( dbGroup ) == null ) ) { dbGroup = org.ovirt.engine.core.bll.PermissionsCommandBase.getAdGroupDAO ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getad_element_id ( ) ) ; } }
Source:
public static org.ovirt.engine.api.model.Application map ( java.lang.String appName , org.ovirt.engine.api.model.Application template ) { org.ovirt.engine.api.model.Application model = ( template != null ) ? template : new org.ovirt.engine.api.model.Application ( ) ; model.setName ( appName ) ; model.setId ( new org.ovirt.engine.core.compat.NGuid ( appName.getBytes ( ) , true ) . toString ( ) ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.Application map ( java.lang.String appName , org.ovirt.engine.api.model.Application template ) { org.ovirt.engine.api.model.Application model = ( template != null ) ? template : new org.ovirt.engine.api.model.Application ( ) ; model.setName ( appName ) ; model.setId ( new org.ovirt.engine.core.compat.Guid ( appName.getBytes ( ) , true ) . toString ( ) ) ; return model ; }
Source:
protected boolean canMigrateVm ( org.ovirt.engine.core.compat.Guid vmGuid , java.util.ArrayList < java.lang.String > reasons ) { if ( ( org.ovirt.engine.core.bll.InternalMigrateVmCommand.getVm ( ) . getMigrationSupport ( ) ) == ( org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE ) ) { return super . canMigrateVm ( vmGuid , reasons ) ; } else { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NON_MIGRTABLE ) ; } }

Target:
protected boolean canMigrateVm ( org.ovirt.engine.core.compat.Guid vmGuid , java.util.List < java.lang.String > reasons ) { if ( ( org.ovirt.engine.core.bll.InternalMigrateVmCommand.getVm ( ) . getMigrationSupport ( ) ) == ( org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE ) ) { return super . canMigrateVm ( vmGuid , reasons ) ; } else { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NON_MIGRTABLE ) ; } }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; if ( getIsShareable ( ) . getIsChangable ( ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; } }

Target:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain updateStorageDomainInMemoryVolumes ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.METADATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( org.ovirt.engine.core.bll.ImportVmCommand.getParameters ( ) . getStoragePoolId ( ) , memoryDisksList , getVmDisksDummies ( ) , getVm ( ) ) ; disksList.addAll ( memoryDisksList ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain updateStorageDomainInMemoryVolumes ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList = org.ovirt.engine.core.bll.memory.MemoryUtils.createDiskDummies ( org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) . getTotalMemorySizeInBytes ( ) , MemoryUtils.METADATA_SIZE_IN_BYTES ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( org.ovirt.engine.core.bll.ImportVmCommand.getParameters ( ) . getStoragePoolId ( ) , memoryDisksList , getVmDisksDummies ( ) , org.ovirt.engine.core.bll.ImportVmCommand.getVm ( ) ) ; disksList.addAll ( memoryDisksList ) ; return storageDomain ; }
Source:
public void before ( ) { injectorRule.bind ( javax.transaction.TransactionManager.class , transactionManager ) ; injectorRule.bind ( org.ovirt.engine.core.bll.interfaces.BackendInternal.class , org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.interfaces.BackendInternal.class ) ) ; injectorRule.bind ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.class , org.mockito.Mockito.mock ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.class ) ) ; glusterManager = org.mockito.Mockito.spy ( org.ovirt.engine.core.bll.gluster.GlusterSyncJob.getInstance ( ) ) ; }

Target:
public void before ( ) { injectorRule.bind ( javax.transaction.TransactionManager.class , transactionManager ) ; glusterManager = org.mockito.Mockito.spy ( org.ovirt.engine.core.bll.gluster.GlusterSyncJob.getInstance ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { final java.util.Map < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > returnMap = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; if ( ( returnMap.get ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DEFAULT_OS_ID ) ) == null ) { throw new java.lang.RuntimeException ( "Engine did not provide icon IDs of default OS." ) ; } osIdToDefaultIconIdMap = java.util.Collections.unmodifiableMap ( returnMap ) ; initializeLargeToSmallIconMap ( ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { final java.util.Map < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > returnMap = returnValue.getReturnValue ( ) ; if ( ( returnMap.get ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DEFAULT_OS_ID ) ) == null ) { throw new java.lang.RuntimeException ( "Engine did not provide icon IDs of default OS." ) ; } osIdToDefaultIconIdMap = java.util.Collections.unmodifiableMap ( returnMap ) ; initializeLargeToSmallIconMap ( ) ; }
Source:
public void testList ( ) { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetHostDevicesByHostId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { HOST_ID } , getHostDeviceCollection ( ) ) ; control.replay ( ) ; verifyHostDevices ( resource.list ( ) . getHostDevices ( ) ) ; }

Target:
public void testList ( ) { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetHostDevicesByHostId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { HOST_ID } , getHostDeviceCollection ( ) ) ; verifyHostDevices ( resource.list ( ) . getHostDevices ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > list = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > newList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : list ) { if ( ! ( permission.getRoleId ( ) . equals ( ApplicationGuids.quotaConsumer.asGuid ( ) ) ) ) { newList.add ( permission ) ; } } setItems ( newList ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > list = returnValue.getReturnValue ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > newList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permission permission : list ) { if ( ! ( permission.getRoleId ( ) . equals ( ApplicationGuids.quotaConsumer.asGuid ( ) ) ) ) { newList.add ( permission ) ; } } setItems ( newList ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase endAction ( org.ovirt.engine.core.compat.Guid stepId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.businessentities.AsyncTasks dbAsyncTask , org.ovirt.engine.core.bll.job.ExecutionContext context ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = dbAsyncTask.getActionParameters ( ) ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.getInstance ( ) . createCommand ( actionType , parameters ) ; command.setContext ( new org.ovirt.engine.core.bll.context.CommandContext ( context ) ) ; return command.endAction ( ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase endAction ( org.ovirt.engine.core.compat.Guid stepId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.businessentities.AsyncTasks dbAsyncTask , org.ovirt.engine.core.bll.job.ExecutionContext context ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = dbAsyncTask.getActionParameters ( ) ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters ) ; command.setContext ( new org.ovirt.engine.core.bll.context.CommandContext ( context ) ) ; return command.endAction ( ) ; }
Source:
protected void updateModelDataCenterFromVds ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters , org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( dataCenters != null ) { getDataCenter ( ) . setItems ( dataCenters ) ; getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters , new org.ovirt.engine.ui.uicommonweb.Linq.IdPredicate ( vds.getStoragePoolId ( ) ) ) ) ; if ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) { getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters ) ) ; } } }

Target:
protected void updateModelDataCenterFromVds ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters , org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( dataCenters != null ) { getDataCenter ( ) . setItems ( dataCenters ) ; getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters , new org.ovirt.engine.ui.uicommonweb.Linq.IdPredicate < > ( vds.getStoragePoolId ( ) ) ) ) ; if ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) { getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters ) ) ; } } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { if ( command == ( runOnceCommand ) ) { if ( validate ( ) ) { onRunOnce ( ) ; } } else if ( command == ( cancelCommand ) ) { commandTarget.executeCommand ( command ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( runOnceCommand ) ) { if ( validate ( ) ) { onRunOnce ( ) ; } } else if ( command == ( cancelCommand ) ) { commandTarget.executeCommand ( command ) ; } }