auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void networkInUseByHosts ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS host = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( NAMEABLE_NAME ) ; networkNotUsedByHostsTest ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_IN_USE ) , java.util.Collections.singletonList ( host ) ) ; }

Target:
public void networkInUseByHosts ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS host = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( NAMEABLE_NAME ) ; networkNotUsedByHostsTest ( failsWithNetworkInUse ( ) , java.util.Collections.singletonList ( host ) ) ; }
Source:
public void setUp ( ) { facade = org.mockito.Mockito.mock ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class ) ; dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; cmd = new org.ovirt.engine.core.bll.storage.StorageHandlingCommandBaseTest.TestStorageHandlingCommandBase ( new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBaseTest.createStoragePool ( ) ) ) ; org.mockito.Mockito.when ( facade.getStoragePoolDAO ( ) ) . thenReturn ( dao ) ; }

Target:
public void setUp ( ) { facade = org.mockito.Mockito.mock ( org.ovirt.engine.core.dal.dbbroker.DbFacade.class ) ; dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; cmd = new org.ovirt.engine.core.bll.storage.StorageHandlingCommandBaseTest.TestStorageHandlingCommandBase ( new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBaseTest.createStoragePool ( ) ) ) ; org.mockito.Mockito.when ( facade.getStoragePoolDao ( ) ) . thenReturn ( dao ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain addNewStorageDomainToDisk ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.StorageDomain storage = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; storage.setStorageType ( storageType ) ; diskImage.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( storage.getId ( ) ) ) ) ; return storage ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain addNewStorageDomainToDisk ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.StorageDomain storage = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; storage.setStorageType ( storageType ) ; storage.setStatus ( StorageDomainStatus.Active ) ; diskImage.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( storage.getId ( ) ) ) ) ; return storage ; }
Source:
public void setUp ( ) { virtStrategy = org.mockito.Mockito.spy ( new org.ovirt.engine.core.vdsbroker.monitoring.VirtMonitoringStrategy ( mockCluster ( ) , mockVdsDao ( ) , null ) ) ; org.mockito.Mockito.doNothing ( ) . when ( virtStrategy ) . vdsNonOperational ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.NonOperationalReason.class ) , org.mockito.Matchers.any ( java.util.Map.class ) ) ; }

Target:
public void setUp ( ) { vdsFromDb = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vdsFromDb.setId ( vdsId ) ; vdsFromDb.setClusterId ( clusterId ) ; virtStrategy = org.mockito.Mockito.spy ( new org.ovirt.engine.core.vdsbroker.monitoring.VirtMonitoringStrategy ( mockCluster ( ) , mockVdsDao ( ) , null ) ) ; org.mockito.Mockito.doNothing ( ) . when ( virtStrategy ) . vdsNonOperational ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VDS.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.NonOperationalReason.class ) , org.mockito.Matchers.any ( java.util.Map.class ) ) ; }
Source:
protected void setCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { org.ovirt.engine.ui.uicommonweb.UICommand newCommand = ( command != null ) ? command : org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.EMPTY_COMMAND ; if ( ( this . command ) != newCommand ) { this . command = newCommand ; com.google.gwt.event.logical.shared.InitializeEvent.fire ( this ) ; if ( newCommand != ( org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.EMPTY_COMMAND ) ) { newCommand.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { com.google.gwt.event.logical.shared.InitializeEvent.fire ( org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.this ) ; } } ) ; } } }

Target:
void addPropertyChangeEventHandler ( ) { propertyChangeListener = new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { com.google.gwt.event.logical.shared.InitializeEvent.fire ( org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.this ) ; } } ; command.getPropertyChangedEvent ( ) . addListener ( propertyChangeListener ) ; }
Source:
public void getNetworkConnectivityCheckTimeoutInSeconds ( 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 ( ) : 120 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.NetworkConnectivityCheckTimeoutInSeconds , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageDomainMaxNameLength ( 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 ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public java.lang.String getInnerJoin ( java.lang.String searchObj , java.lang.String crossRefObj ) { final java.lang.String [ ] joinKey = mJoinDictionary.get ( org.ovirt.engine.core.compat.StringFormat.format ( "%1$s.%2$s" , searchObj , crossRefObj ) ) ; final java.lang.String crossRefTable = getRelatedTableName ( crossRefObj ) ; final java.lang.String searchObjTable = getRelatedTableName ( searchObj ) ; return org.ovirt.engine.core.compat.StringFormat.format ( " LEFT OUTER JOIN %3$s ON %1$s.%2$s=%3$s.%4$s " , searchObjTable , joinKey [ 0 ] , crossRefTable , joinKey [ 1 ] ) ; }

Target:
public java.lang.String getInnerJoin ( java.lang.String searchObj , java.lang.String crossRefObj , boolean useTags ) { final java.lang.String [ ] joinKey = mJoinDictionary.get ( org.ovirt.engine.core.compat.StringFormat.format ( "%1$s.%2$s" , searchObj , crossRefObj ) ) ; final java.lang.String crossRefTable = getRelatedTableName ( crossRefObj , true ) ; final java.lang.String searchObjTable = getRelatedTableName ( searchObj , useTags ) ; return org.ovirt.engine.core.compat.StringFormat.format ( " LEFT OUTER JOIN %3$s ON %1$s.%2$s=%3$s.%4$s " , searchObjTable , joinKey [ 0 ] , crossRefTable , joinKey [ 1 ] ) ; }
Source:
protected void AsyncSearch ( ) { super . AsyncSearch ( ) ; if ( ( getEntity ( ) ) == null ) { return ; } setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetPermissionByRoleId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters ( getEntity ( ) . getId ( ) ) ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }

Target:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; if ( ( getEntity ( ) ) == null ) { return ; } setAsyncResult ( org.ovirt.engine.ui.frontend.Frontend.RegisterQuery ( VdcQueryType.GetPermissionByRoleId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters ( getEntity ( ) . getId ( ) ) ) ) ; setItems ( getAsyncResult ( ) . getData ( ) ) ; }
Source:
public java.util.List < java.lang.String > allocateMacAddresses ( int numberOfAddresses ) { java.util.List < java.lang.String > macAddresses = new java.util.ArrayList < java.lang.String > ( numberOfAddresses ) ; for ( int i = 0 ; i < numberOfAddresses ; ++ i ) { macAddresses.add ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . allocateNewMac ( ) ) ; } java.util.Collections.sort ( macAddresses ) ; return macAddresses ; }

Target:
public void freeMac ( java.lang.String mac ) { macPoolManagerStrategy.freeMac ( mac ) ; }
Source:
public static java.lang.String toJson ( final java.util.List < org.ovirt.engine.core.bll.validator.InClusterUpgradeValidator.UPGRADE_ERROR > vm ) { final org.codehaus.jackson.map.ObjectMapper mapper = new org.codehaus.jackson.map.ObjectMapper ( ) ; mapper.setSerializationInclusion ( JsonSerialize.Inclusion.NON_NULL ) ; try { return mapper.writerWithDefaultPrettyPrinter ( ) . writeValueAsString ( new org.ovirt.engine.core.bll.validator.InClusterUpgradeValidator.VmValidation ( vm ) ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
private java.util.List < java.lang.String > toVmEngineMessage ( final org.ovirt.engine.core.common.businessentities.VM vm , final org.ovirt.engine.core.common.errors.EngineMessage error ) { return java.util.Arrays.asList ( error.name ( ) , java.lang.String.format ( "$%1$s %2$s" , "vmName" , vm.getName ( ) ) , java.lang.String.format ( "$%1$s %2$s" , "vmId" , vm.getId ( ) ) ) ; }
Source:
com.google.gwt.safehtml.shared.SafeHtml getRenderedValue ( final java.lang.String text ) { java.lang.String result = text ; if ( ( ( maxTextLength ) > 0 ) && ( ( text.length ( ) ) > ( maxTextLength ) ) ) { result = result.substring ( 0 , java.lang.Math.max ( ( ( maxTextLength ) - ( org.ovirt.engine.ui.common.widget.table.column.TextCellWithTooltip.TOO_LONG_TEXT_POSTFIX.length ( ) ) ) , 0 ) ) ; result = result + ( org.ovirt.engine.ui.common.widget.table.column.TextCellWithTooltip.TOO_LONG_TEXT_POSTFIX ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( result ) ; }

Target:
com.google.gwt.safehtml.shared.SafeHtml getRenderedValue ( com.google.gwt.safehtml.shared.SafeHtml value ) { java.lang.String result = value.asString ( ) ; if ( ( ( maxTextLength ) > 0 ) && ( ( result.length ( ) ) > ( maxTextLength ) ) ) { result = result.substring ( 0 , java.lang.Math.max ( ( ( maxTextLength ) - ( org.ovirt.engine.ui.common.widget.table.column.TextCellWithTooltip.TOO_LONG_TEXT_POSTFIX.length ( ) ) ) , 0 ) ) ; result = result + ( org.ovirt.engine.ui.common.widget.table.column.TextCellWithTooltip.TOO_LONG_TEXT_POSTFIX ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( result ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addManagedDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type , org.ovirt.engine.core.common.utils.VmDeviceType device , java.util.Map < java.lang.String , java.lang.Object > specParams , boolean plugged , java.lang.Boolean readOnly , java.lang.String address , java.util.Map < java.lang.String , java.lang.String > customProp ) { org.ovirt.engine.core.common.businessentities.VmDevice managedDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , type , device , specParams , plugged , readOnly , customProp , false ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { managedDevice.setAddress ( address ) ; } return managedDevice ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice addInterface ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid deviceId , boolean plugged , boolean hostDev ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addInterface ( vmId , deviceId , plugged , hostDev , null ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult iscsiBondWithTheSameNameExistInDataCenter ( org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond ) { java.util.List < org.ovirt.engine.core.common.businessentities.IscsiBond > iscsiBonds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getIscsiBondDao ( ) . getAllByStoragePoolId ( iscsiBond.getStoragePoolId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.IscsiBond bond : iscsiBonds ) { if ( ( bond.getName ( ) . equals ( iscsiBond.getName ( ) ) ) && ( ! ( bond.getId ( ) . equals ( iscsiBond.getId ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ISCSI_BOND_WITH_SAME_NAME_EXIST_IN_DATA_CENTER ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult iscsiBondWithTheSameNameExistInDataCenter ( org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond ) { java.util.List < org.ovirt.engine.core.common.businessentities.IscsiBond > iscsiBonds = getDBFacade ( ) . getIscsiBondDao ( ) . getAllByStoragePoolId ( iscsiBond.getStoragePoolId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.IscsiBond bond : iscsiBonds ) { if ( ( bond.getName ( ) . equals ( iscsiBond.getName ( ) ) ) && ( ! ( bond.getId ( ) . equals ( iscsiBond.getId ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ISCSI_BOND_WITH_SAME_NAME_EXIST_IN_DATA_CENTER ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getDetachCommand ( ) ) ) { Detach ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnDetach" ) ) { OnDetach ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getDetachCommand ( ) ) ) { Detach ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnDetach" ) ) { OnDetach ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }
Source:
protected void addStyles ( ) { volumeTypeEditor.addContentWidgetStyleName ( style.editorContentWidget ( ) ) ; replicaCountEditor.addContentWidgetStyleName ( style.editorContentWidget ( ) ) ; stripeCountEditor.addContentWidgetStyleName ( style.editorContentWidget ( ) ) ; forceEditor.addContentWidgetStyleName ( style.forceEditorWidget ( ) ) ; }

Target:
protected void addStyles ( ) { volumeTypeEditor.addContentWidgetContainerStyleName ( style.editorContentWidget ( ) ) ; replicaCountEditor.addContentWidgetContainerStyleName ( style.editorContentWidget ( ) ) ; stripeCountEditor.addContentWidgetContainerStyleName ( style.editorContentWidget ( ) ) ; forceEditor.addContentWidgetContainerStyleName ( style.forceEditorWidget ( ) ) ; }
Source:
protected void onReveal ( ) { super . onReveal ( ) ; org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; _asyncQuery.setModel ( this ) ; _asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String version = ( ( java.lang.String ) ( result ) ) ; getView ( ) . setVersion ( version ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getRpmVersion ( _asyncQuery ) ; }

Target:
protected void onReveal ( ) { super . onReveal ( ) ; java.lang.String version = org.ovirt.engine.ui.common.system.EngineRpmVersionData.getVersion ( ) ; getView ( ) . setVersion ( version ) ; }
Source:
public void PostOnNew ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; if ( ( returnValues != null ) && ( org.ovirt.engine.ui.uicommonweb.Linq.All ( returnValues , new org.ovirt.engine.ui.uicommonweb.Linq.CanDoActionSucceedPredicate ( ) ) ) ) { Cancel ( ) ; } }

Target:
public void PostOnNew ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > returnValues ) { org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; if ( ( returnValues != null ) && ( org.ovirt.engine.ui.uicommonweb.Linq.all ( returnValues , new org.ovirt.engine.ui.uicommonweb.Linq.CanDoActionSucceedPredicate ( ) ) ) ) { Cancel ( ) ; } }
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.GetAllFromExportDomainQueryParamenters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParamenters ( storagePoolId , storageDomainId ) ; getAllFromExportDomainQueryParamenters.setGetAll ( true ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
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 ) ; getAllFromExportDomainQueryParamenters.setGetAll ( true ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster ) { if ( networkCluster.isManagement ( ) ) { final org.ovirt.engine.core.common.businessentities.network.NetworkCluster currentNetworkCluster = networkClusterDao.get ( networkCluster.getId ( ) ) ; if ( ( currentNetworkCluster != null ) && ( ! ( currentNetworkCluster.isManagement ( ) ) ) ) { return true ; } } return false ; }

Target:
public boolean test ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster ) { if ( networkCluster.isManagement ( ) ) { final org.ovirt.engine.core.common.businessentities.network.NetworkCluster currentNetworkCluster = networkClusterDao.get ( networkCluster.getId ( ) ) ; if ( ( currentNetworkCluster != null ) && ( ! ( currentNetworkCluster.isManagement ( ) ) ) ) { return true ; } } return false ; }
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . update ( _vds.getDynamicData ( ) ) ; return null ; }

Target:
public java.lang.Object call ( ) throws java.lang.Exception { if ( ( _managementNetwork ) != null ) { _parser.cliEnvironmentSet ( VdsmEnv.MANAGEMENT_BRIDGE_NAME , _managementNetwork ) ; } else if ( _isNode ) { _parser.cliEnvironmentSet ( VdsmEnv.MANAGEMENT_BRIDGE_NAME , org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) ) ; } else { _parser.cliNoop ( ) ; } return null ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; setTitle ( ( disk.isShareable ( ) ? constants.shareable ( ) : null ) ) ; return disk.isShareable ( ) ? resources.shareableDiskIcon ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; return disk.isBoot ( ) ? org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmDiskAttachPopupWidget.resources.bootableDiskIcon ( ) : null ; }
Source:
protected org.ovirt.engine.core.dao.QuotaDao getQuotaDao ( ) { return quotaDao ; }

Target:
private void validateQuota ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( vm.getQuotaId ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.Quota quota = quotaDao.getById ( vm.getQuotaId ( ) ) ; if ( quota == null ) { vm.setQuotaId ( null ) ; } } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { }

Target:
private void OnRemove ( ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = ( ( org.ovirt.engine.core.common.businessentities.Snapshot ) ( getSelectedItem ( ) ) ) ; if ( snapshot == null ) { Cancel ( ) ; return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveSnapshot , new org.ovirt.engine.core.common.action.RemoveSnapshotParameters ( snapshot.getId ( ) , vm.getId ( ) ) , null , null ) ; } getCanSelectSnapshot ( ) . setEntity ( false ) ; Cancel ( ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.VnicProfileView get ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userId , boolean filtered ) { return getCallsHandler ( ) . executeRead ( getProcedureNameForGet ( ) , org.ovirt.engine.core.dao.network.VnicProfileViewDaoDbFacadeImpl.VnicProfileViewRowMapper.INSTANCE , getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "user_id" , userId ) . addValue ( "is_filtered" , filtered ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > getAllForDataCenter ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userId , boolean filtered ) { return getCallsHandler ( ) . executeReadList ( "GetVnicProfileViewsByDataCenterId" , org.ovirt.engine.core.dao.network.VnicProfileViewDaoDbFacadeImpl.VnicProfileViewRowMapper.INSTANCE , getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "user_id" , userId ) . addValue ( "is_filtered" , filtered ) ) ; }
Source:
public void validateFailsOnSameServerIncreasingReplica ( ) { initTestCommand ( volumeIdRepl , getBricks ( volumeIdRepl , 2 , true ) , 3 , 0 , false ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity vol = getMultiBrickVolume ( volumeIdRepl , 4 ) ; vol.setVolumeType ( GlusterVolumeType.DISTRIBUTED_REPLICATE ) ; vol.setReplicaCount ( 2 ) ; org.mockito.Mockito.doReturn ( vol ) . when ( volumeDao ) . getById ( volumeIdRepl ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsOnSameServerIncreasingReplica ( ) { initTestCommand ( volumeIdRepl , getBricks ( volumeIdRepl , 2 , true ) , 3 , 0 , false ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity vol = getMultiBrickVolume ( volumeIdRepl , 4 ) ; vol.setVolumeType ( GlusterVolumeType.DISTRIBUTED_REPLICATE ) ; vol.setReplicaCount ( 2 ) ; org.mockito.Mockito.doReturn ( vol ) . when ( volumeDao ) . getById ( volumeIdRepl ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validate ( ) ) ; }
Source:
public 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > balance ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , java.util.Map < java.lang.String , java.lang.String > parameters , java.util.ArrayList < java.lang.String > messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( ( ( "policy unit:" + ( getName ( ) ) ) + "balance is not implemented" ) ) ; return null ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filter ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , org.ovirt.engine.core.common.businessentities.VM vm , java.util.Map < java.lang.String , java.lang.String > parameters , java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( ( ( "policy unit:" + ( getPolicyUnit ( ) . getName ( ) ) ) + "filter is not implemented" ) ) ; return hosts ; }
Source:
private void applyNetworkChangesToHosts ( ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand < T > . SyncNetworkParametersBuilder builder = new SyncNetworkParametersBuilder ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getContext ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) , getOldNetwork ( ) ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.HostSetupNetworksParametersBuilder.updateParametersSequencing ( parameters ) ; runInternalMultipleActions ( VdcActionType.PersistentHostSetupNetworks , parameters ) ; } }

Target:
private void applyNetworkChangesToHosts ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = syncNetworkParametersBuilder.buildParameters ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) , getOldNetwork ( ) ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.HostSetupNetworksParametersBuilder.updateParametersSequencing ( parameters ) ; runInternalMultipleActions ( VdcActionType.PersistentHostSetupNetworks , parameters ) ; } }
Source:
public void isConnWithSameDetailsExistBlockDomains ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "user1" , "mypassword123" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection1 = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "user1" , "mypassword123" ) ; connections.add ( connection1 ) ; org.mockito.Mockito.when ( storageConnDao.getAllForConnection ( newISCSIConnection ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertTrue ( isExists ) ; }

Target:
public void isConnWithSameDetailsExistCheckSameConn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; connections.add ( newISCSIConnection ) ; org.mockito.Mockito.when ( storageConnDao.getAllForConnection ( newISCSIConnection ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; model.setDataCentersAndClusters ( model , dataCenters , ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) , null ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( returnValue ) ) ; clusters = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.filterClustersWithoutArchitecture ( clusters ) ; model.setDataCentersAndClusters ( model , dataCenters , clusters , null ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.image_storage_domain_map saveImage ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . save ( diskImage.getImage ( ) ) ; org.ovirt.engine.core.common.businessentities.image_storage_domain_map image_storage_domain_map = new org.ovirt.engine.core.common.businessentities.image_storage_domain_map ( diskImage.getImageId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getQuotaId ( ) , diskImage.getDiskProfileId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . save ( image_storage_domain_map ) ; return image_storage_domain_map ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.image_storage_domain_map saveImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageDao ( ) . save ( diskImage.getImage ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.image_storage_domain_map image_storage_domain_map = new org.ovirt.engine.core.common.businessentities.storage.image_storage_domain_map ( diskImage.getImageId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getQuotaId ( ) , diskImage.getDiskProfileId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . save ( image_storage_domain_map ) ; return image_storage_domain_map ; }
Source:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.Nic model = new org.ovirt.engine.api.model.Nic ( ) ; model.setName ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Nic" , "add" , "name" ) ; } }

Target:
public void testAddIncompleteParameters ( ) { org.ovirt.engine.api.model.Nic model = new org.ovirt.engine.api.model.Nic ( ) ; model.setName ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; verifyIncompleteException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( model ) ) , "Nic" , "add" , "name" ) ; }
Source:
public java.lang.String getValue ( ) { final java.lang.StringBuilder val = new java.lang.StringBuilder ( ) ; if ( ( this . major ) > ( - 1 ) ) { val.append ( this . major ) ; } org.ovirt.engine.core.compat.Version.appendVersionComponent ( val , this . minor ) ; org.ovirt.engine.core.compat.Version.appendVersionComponent ( val , this . build ) ; org.ovirt.engine.core.compat.Version.appendVersionComponent ( val , this . revision ) ; return val.toString ( ) ; }

Target:
public java.lang.String getValue ( ) { final java.lang.StringBuilder val = new java.lang.StringBuilder ( ) ; if ( ( this . major ) > ( org.ovirt.engine.core.compat.Version.VERSION_NOT_SET ) ) { val.append ( this . major ) ; } org.ovirt.engine.core.compat.Version.appendVersionComponent ( val , this . minor ) ; org.ovirt.engine.core.compat.Version.appendVersionComponent ( val , this . build ) ; org.ovirt.engine.core.compat.Version.appendVersionComponent ( val , this . revision ) ; return val.toString ( ) ; }
Source:
private void setupCanImportPpcTest ( ) { setupDiskSpaceTest ( ) ; cmd.getParameters ( ) . getVm ( ) . setClusterArch ( ArchitectureType.ppc64 ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setArchitecture ( ArchitectureType.ppc64 ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
private void setupCanImportPpcTest ( ) { setupDiskSpaceTest ( ) ; cmd.getParameters ( ) . getVm ( ) . setClusterArch ( ArchitectureType.ppc64 ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setStoragePoolId ( cmd.getParameters ( ) . getStoragePoolId ( ) ) ; cluster.setArchitecture ( ArchitectureType.ppc64 ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }
Source:
private void enableEditPoolFields ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { descriptionEditor.setEnabled ( true ) ; prestartedVmsEditor.setEnabled ( true ) ; editPrestartedVmsEditor.setEnabled ( true ) ; incraseNumOfVmsEditor.setEnabled ( true ) ; editMaxAssignedVmsPerUserEditor.setEnabled ( true ) ; spiceProxyEditor.setEnabled ( model.getSpiceProxyEnabled ( ) . getEntity ( ) ) ; }

Target:
private void enableEditPoolFields ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { descriptionEditor.setEnabled ( true ) ; commentEditor.setEnabled ( true ) ; prestartedVmsEditor.setEnabled ( true ) ; editPrestartedVmsEditor.setEnabled ( true ) ; incraseNumOfVmsEditor.setEnabled ( true ) ; editMaxAssignedVmsPerUserEditor.setEnabled ( true ) ; spiceProxyEditor.setEnabled ( model.getSpiceProxyEnabled ( ) . getEntity ( ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.DbUser persistAuthenticatedUser ( org.ovirt.engine.core.common.businessentities.LdapUser ldapUser ) { org.ovirt.engine.core.common.businessentities.DbUser dbUser = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . get ( ldapUser.getUserId ( ) ) ; boolean newUser = dbUser == null ; dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ldapUser ) ; if ( newUser ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . save ( dbUser ) ; } else { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . update ( dbUser ) ; } return dbUser ; }

Target:
public static org.ovirt.engine.core.common.businessentities.DbUser persistAuthenticatedUser ( org.ovirt.engine.core.common.businessentities.LdapUser directoryUser ) { org.ovirt.engine.core.dao.DbUserDAO dao = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) ; org.ovirt.engine.core.common.businessentities.DbUser dbUser = dao.getByExternalId ( directoryUser.getDomainControler ( ) , directoryUser.getUserId ( ) ) ; if ( dbUser != null ) { dao.update ( dbUser ) ; } else { dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( directoryUser ) ; dbUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; dao.save ( dbUser ) ; } return dbUser ; }
Source:
public static java.lang.Integer getSizeOfMemoryDeviceMb ( org.ovirt.engine.core.common.businessentities.VmDevice memoryDevice ) { if ( ( memoryDevice.getType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.MEMORY ) ) { throw new java.lang.RuntimeException ( ( ( ( "Memory device expected but device " + memoryDevice ) + " passed of type " ) + ( memoryDevice.getType ( ) ) ) ) ; } return ( ( java.lang.Integer ) ( memoryDevice.getSpecParams ( ) . get ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.SPEC_PARAM_SIZE ) ) ) ; }

Target:
public static boolean isMemory ( org.ovirt.engine.core.common.businessentities.VmDevice device ) { return ( ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.MEMORY ) == ( device.getType ( ) ) ) && ( VmDeviceType.MEMORY.getName ( ) . equals ( device.getDevice ( ) ) ) ; }
Source:
public void numOfSocketChanged ( ) { int numOfSockets = extractIntFromListModel ( getModel ( ) . getNumOfSockets ( ) ) ; int totalCpuCores = getTotalCpuCores ( ) ; if ( numOfSockets == 0 ) { return ; } getModel ( ) . getCoresPerSocket ( ) . setSelectedItem ( ( totalCpuCores / numOfSockets ) ) ; }

Target:
public boolean isNumOfSocketsCorrect ( int totalCpuCores ) { int numOfSockets = extractIntFromListModel ( getModel ( ) . getNumOfSockets ( ) ) ; int coresPerSocket = extractIntFromListModel ( getModel ( ) . getCoresPerSocket ( ) ) ; int threadsPerCore = extractIntFromListModel ( getModel ( ) . getThreadsPerCore ( ) ) ; return totalCpuCores == ( ( coresPerSocket * numOfSockets ) * threadsPerCore ) ; }
Source:
public java.lang.Object runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.storage_pool sp : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDAO ( ) . getAll ( ) ) { if ( ! ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.containsKey ( sp.getId ( ) ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.put ( sp.getId ( ) , new org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData ( sp.getId ( ) ) ) ; } } return null ; }

Target:
public java.lang.Object runInTransaction ( ) { for ( org.ovirt.engine.core.common.businessentities.storage_pool sp : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . getAll ( ) ) { if ( ! ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.containsKey ( sp.getId ( ) ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.put ( sp.getId ( ) , new org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData ( sp.getId ( ) ) ) ; } } return null ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.GetVmTemplatesDisksParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetVmTemplatesDisks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionResume ( java.lang.String volumeName , java.lang.String slaveHostName , java.lang.String slaveVolumeName , java.lang.String userName , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionResume" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHostName ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withOptionalParameter ( "remoteUserName" , userName ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterVolumeGeoRepSessionResume ( java.lang.String volumeName , java.lang.String slaveHostName , java.lang.String slaveVolumeName , java.lang.String userName , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionResume" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHostName ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withOptionalParameter ( "remoteUserName" , userName ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public void testExecuteCommandByServerIdForRestart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( null , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_RESTART ) ) ) ; setUpMockUpForRestart ( ) ; mockBackend ( true , null , GlusterServiceStatus.RUNNING ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.times ( 2 ) ) . update ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_RESTARTED ) ; }

Target:
public void testExecuteCommandByServerIdForRestart ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( null , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT , org.ovirt.engine.core.common.constants.gluster.GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_RESTART ) ) ) ; setUpMockUpForRestart ( ) ; mockBackend ( true , null , GlusterServiceStatus.RUNNING ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( serverServiceDao , org.mockito.Mockito.times ( 2 ) ) . updateByServerIdAndServiceType ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService.class ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_SERVICE_RESTARTED ) ; }