auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants , org.ovirt.engine.ui.webadmin.ApplicationMessages messages ) { selectHostAutomaticallyEditor.setLabel ( constants.vmMigratePopupSelectHostAutomaticallyLabel ( ) ) ; selectDestinationHostEditor.setLabel ( constants.vmMigratePopupSelectDestinationHostLabel ( ) ) ; hostsListEditor.setLabel ( constants.vmMigratePopupHostsListLabel ( ) ) ; clustersEditor.setLabel ( constants.hostClusterVmPopup ( ) ) ; message1.setText ( messages.migrateHostDisabledVMsInServerClusters ( ) ) ; message2.setText ( messages.migrateSomeVmsAlreadyRunningOnHost ( ) ) ; message3.setText ( messages.migrateNoAvailableHost ( ) ) ; }

Target:
void localize ( ) { selectHostAutomaticallyEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.constants.vmMigratePopupSelectHostAutomaticallyLabel ( ) ) ; selectDestinationHostEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.constants.vmMigratePopupSelectDestinationHostLabel ( ) ) ; hostsListEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.constants.vmMigratePopupHostsListLabel ( ) ) ; clustersEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.constants.hostClusterVmPopup ( ) ) ; message1.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.messages.migrateHostDisabledVMsInServerClusters ( ) ) ; message2.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.messages.migrateSomeVmsAlreadyRunningOnHost ( ) ) ; message3.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.messages.migrateNoAvailableHost ( ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > searchVDSsByDb ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > data = genericSearch ( org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVdsDao ( ) , true ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : data ) { vds.setCpuName ( getCpuFlagsManagerHandler ( ) . findMaxServerCpuByFlags ( vds.getCpuFlags ( ) , vds.getClusterCompatibilityVersion ( ) ) ) ; } return data ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > searchVmsFromDb ( ) { org.ovirt.engine.core.aaa.QueryData data = initQueryData ( true ) ; if ( data == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = vmDao.getAllUsingQuery ( data.getQuery ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { vmHandler.updateVmGuestAgentVersion ( vm ) ; vmHandler.updateVmLock ( vm ) ; vmHandler.updateOperationProgress ( vm ) ; vmHandler.updateVmStatistics ( vm ) ; } return vms ; }
Source:
protected org.ovirt.engine.core.bll.CommandBase < ? > constructCommand ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , boolean runAsInternal , org.ovirt.engine.core.bll.context.CommandContext context ) { org.ovirt.engine.core.bll.job.ExecutionHandler.evaluateCorrelationId ( parameters ) ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.CreateCommand ( actionType , parameters ) ; command.setInternalExecution ( runAsInternal ) ; command.setContext ( context ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , actionType , runAsInternal ) ; return command ; }

Target:
protected org.ovirt.engine.core.compat.Guid createTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return createTask ( taskId , asyncTaskCreationInfo , parentCommand , null , new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > ( ) ) ; }
Source:
protected org.ovirt.engine.core.bll.SPMAsyncTask ConcreteCreateTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parametersForTask = getParametersForTask ( parentCommand , getParameters ( ) ) ; org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , new org.ovirt.engine.core.common.businessentities.async_tasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getTaskID ( ) , parametersForTask , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , 0 ) ) ; p.setEntityId ( getParameters ( ) . getEntityId ( ) ) ; return org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CreateTask ( getTaskType ( ) , p ) ; }

Target:
private org.ovirt.engine.core.common.asynctasks.AsyncTaskType internalGetTaskType ( ) { if ( hasTaskHandlers ( ) ) { if ( ( getParameters ( ) . getExecutionReason ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionParametersBase.CommandExecutionReason.REGULAR_FLOW ) ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; } return getCurrentTaskHandler ( ) . getRevertTaskType ( ) ; } return getTaskType ( ) ; }
Source:
protected void handleError ( ) { if ( ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getSpmStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) { log.infoFormat ( "Fence failed on vds {0} which is spm of pool {1} - moving pool to non operational" , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getName ( ) , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) ) ; runInternalAction ( VdcActionType.SetStoragePoolStatus , new org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational , org.ovirt.engine.core.common.AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_NO_HOST_FOR_SPM ) ) ; } log.errorFormat ( "Failed to run Fence script on vds:{0}." , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsName ( ) ) ; org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.AlertIfPowerManagementOperationSkipped ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.RESTART , null ) ; }

Target:
protected void handleError ( ) { if ( ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getSpmStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) { log.info ( "Fence failed on vds '{}' which is spm of pool '{}' - moving pool to non operational" , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getName ( ) , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) ) ; runInternalAction ( VdcActionType.SetStoragePoolStatus , new org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational , org.ovirt.engine.core.common.AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_NO_HOST_FOR_SPM ) ) ; } log.error ( "Failed to run Fence script on vds '{}'." , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsName ( ) ) ; org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.alertIfPowerManagementOperationSkipped ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.RESTART , null ) ; }
Source:
public 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.storage.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.Map < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > > aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.MapConverter < > ( ) ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getNewCommand ( ) ) ) { newNetwork ( ) ; } else if ( command == ( getEditCommand ( ) ) ) { edit ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } }

Target:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getNewCommand ( ) ) ) { newNetwork ( ) ; } else if ( command == ( getEditCommand ( ) ) ) { edit ( ) ; } else if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , EditNetworkModel.APPLY_COMMAND_NAME ) ) { apply ( ) ; } }
Source:
public void setExecutionContext ( org.ovirt.engine.core.bll.job.ExecutionContext executionContext ) { context.setExecutionContext ( executionContext ) ; }

Target:
protected void freeLock ( ) { if ( ( context.getLock ( ) ) != null ) { getLockManager ( ) . releaseLock ( context.getLock ( ) ) ; log.infoFormat ( "Lock freed to object {0}" , context.getLock ( ) ) ; context.withLock ( null ) ; } }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Creation model ) throws java.lang.Exception { assertNotNull ( model ) ; assertEquals ( java.net.URLEncoder.encode ( org.ovirt.engine.api.restapi.resource.BackendCreationResourceTest.CREATION_ID , "UTF-8" ) , model.getId ( ) ) ; assertEquals ( CreationStatus.COMPLETE.value ( ) , model.getStatus ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Creation model ) throws java.lang.Exception { org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertEquals ( java.net.URLEncoder.encode ( org.ovirt.engine.api.restapi.resource.BackendCreationResourceTest.CREATION_ID , "UTF-8" ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( CreationStatus.COMPLETE.value ( ) , model.getStatus ( ) ) ; verifyLinks ( model ) ; }
Source:
public static boolean detectOverflowUsingScrollWidth ( com.google.gwt.dom.client.Element element ) { int scrollWidthBefore = element.getScrollWidth ( ) ; java.lang.String overflowValue = element.getStyle ( ) . getProperty ( "overflow" ) ; element.getStyle ( ) . setProperty ( "overflow" , "auto" ) ; int scrollWidthAfter = element.getScrollWidth ( ) ; int clientWidthAfter = element.getClientWidth ( ) ; element.getStyle ( ) . setProperty ( "overflow" , overflowValue ) ; return ( scrollWidthAfter > scrollWidthBefore ) || ( scrollWidthAfter > clientWidthAfter ) ; }

Target:
public static boolean detectHorizontalOverflow ( com.google.gwt.dom.client.Element element ) { int scrollWidth = element.getScrollWidth ( ) ; int clientWidth = element.getClientWidth ( ) ; return scrollWidth > clientWidth ; }
Source:
private void addTimerChangeHandler ( ) { timerChangeHandler = timer.addValueChangeHandler ( new com.google.gwt.event.logical.shared.ValueChangeHandler < java.lang.Integer > ( ) { @ java.lang.Override public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Integer > event ) { int newInterval = event.getValue ( ) ; if ( timer.isActive ( ) ) { if ( newInterval != ( timer.getRefreshRate ( ) ) ) { timer.stop ( ) ; timer.setRefreshRate ( newInterval ) ; timer.start ( ) ; } } else { timer.setRefreshRate ( newInterval ) ; } } } ) ; }

Target:
private void addTimerChangeHandler ( ) { timerChangeHandler = timer.addGridTimerStateChangeEventHandler ( new org.ovirt.engine.ui.uicommonweb.models.GridTimerStateChangeEvent.GridTimerStateChangeEventHandler ( ) { @ java.lang.Override public void onGridTimerStateChange ( org.ovirt.engine.ui.uicommonweb.models.GridTimerStateChangeEvent event ) { int newInterval = event.getRefreshRate ( ) ; if ( timer.isActive ( ) ) { if ( newInterval != ( timer.getRefreshRate ( ) ) ) { timer.stop ( ) ; timer.setRefreshRate ( newInterval ) ; timer.start ( ) ; } } else { timer.setRefreshRate ( newInterval ) ; } } } ) ; }
Source:
public java.lang.String getSessionIdBySeqId ( long sessionSequenceId ) { java.lang.String sessionId = null ; for ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo : sessionInfoMap.values ( ) ) { if ( sessionInfo.contentOfSession.get ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_SEQ_ID ) . equals ( sessionSequenceId ) ) { sessionId = ( ( java.lang.String ) ( sessionInfo.contentOfSession.get ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_ID ) ) ) ; break ; } } return sessionId ; }

Target:
public java.lang.String getSessionIdBySeqId ( long sessionSequenceId ) { java.lang.String sessionId = null ; for ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo : sessionInfoMap.values ( ) ) { if ( java.lang.Long.valueOf ( sessionSequenceId ) . equals ( sessionInfo.contentOfSession.get ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_SEQ_ID ) ) ) { sessionId = ( ( java.lang.String ) ( sessionInfo.contentOfSession.get ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_ID ) ) ) ; break ; } } return sessionId ; }
Source:
public void validateVmInPreview ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }

Target:
public void validateVmInPreview ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
Source:
private void addStyles ( ) { storageValueEditor.addContentWidgetStyleName ( style.textBoxWidth ( ) ) ; storageValueEditor.addLabelStyleName ( style.labelVisible ( ) ) ; specificStorageRadioButtonEditor.addContentWidgetStyleName ( style.radioButtonWidth ( ) ) ; unlimitedStorageRadioButtonEditor.addContentWidgetStyleName ( style.radioButtonWidth ( ) ) ; }

Target:
private void addStyles ( ) { storageValueEditor.addContentWidgetContainerStyleName ( style.textBoxWidth ( ) ) ; storageValueEditor.addLabelStyleName ( style.labelVisible ( ) ) ; specificStorageRadioButtonEditor.addContentWidgetContainerStyleName ( style.radioButtonWidth ( ) ) ; unlimitedStorageRadioButtonEditor.addContentWidgetContainerStyleName ( style.radioButtonWidth ( ) ) ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { getEntry ( widget ) . removeLastButton ( ) ; org.ovirt.engine.core.common.utils.Pair < T , V > item = addGhostEntry ( ) ; onAdd ( item.getFirst ( ) , item.getSecond ( ) ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { final T value = item.getFirst ( ) ; final V widget = item.getSecond ( ) ; if ( vetoRemoveWidget ( item , value , widget ) ) { return ; } doRemoveItem ( item , value , widget ) ; }
Source:
public void setUp ( ) { connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setid ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; connection.setstorage_type ( StorageType.ISCSI ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.StorageConnectionValidator ( connection ) ) ; domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setStorageType ( StorageType.ISCSI ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; domain.setStatus ( StorageDomainStatus.Maintenance ) ; domain.setStorageDomainSharedStatus ( StorageDomainSharedStatus.InActive ) ; }

Target:
public void setUp ( ) { connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setid ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; connection.setstorage_type ( StorageType.ISCSI ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.StorageConnectionValidator ( connection ) ) ; domain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; domain.setStorageType ( StorageType.ISCSI ) ; domain.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ) ; domain.setStatus ( StorageDomainStatus.Maintenance ) ; domain.setStorageDomainSharedStatus ( StorageDomainSharedStatus.Inactive ) ; }
Source:
public static void fillBondSlaves ( java.util.Collection < ? extends org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { java.util.Map < java.lang.String , java.util.List < java.lang.String > > bondToSlaves = org.ovirt.engine.core.common.utils.NetworkCommonUtils.getBondNameToBondSlavesMap ( nics ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : nics ) { if ( nic instanceof org.ovirt.engine.core.common.businessentities.network.Bond ) { org.ovirt.engine.core.common.businessentities.network.Bond bond = ( ( org.ovirt.engine.core.common.businessentities.network.Bond ) ( nic ) ) ; bond.setSlaves ( ( bondToSlaves.containsKey ( bond.getName ( ) ) ? bondToSlaves.get ( bond.getName ( ) ) : new java.util.ArrayList < java.lang.String > ( ) ) ) ; } } }

Target:
public static void fillBondSlaves ( java.util.Collection < ? extends org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { java.util.Map < java.lang.String , java.util.List < java.lang.String > > bondToSlaves = org.ovirt.engine.core.common.utils.NetworkCommonUtils.getBondNameToBondSlaveNamesMap ( nics ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : nics ) { if ( nic instanceof org.ovirt.engine.core.common.businessentities.network.Bond ) { org.ovirt.engine.core.common.businessentities.network.Bond bond = ( ( org.ovirt.engine.core.common.businessentities.network.Bond ) ( nic ) ) ; bond.setSlaves ( ( bondToSlaves.containsKey ( bond.getName ( ) ) ? bondToSlaves.get ( bond.getName ( ) ) : new java.util.ArrayList < java.lang.String > ( ) ) ) ; } } }
Source:
public void Move ( int sourceIndex , int destIndex ) { if ( ( ( sourceIndex == destIndex ) || ( sourceIndex > ( this . size ( ) ) ) ) || ( destIndex > ( this . size ( ) ) ) ) { return ; } T tempObj = this . get ( sourceIndex ) ; this . remove ( sourceIndex ) ; this . add ( destIndex , tempObj ) ; }

Target:
public void move ( int sourceIndex , int destIndex ) { if ( ( ( sourceIndex == destIndex ) || ( sourceIndex > ( this . size ( ) ) ) ) || ( destIndex > ( this . size ( ) ) ) ) { return ; } T tempObj = this . get ( sourceIndex ) ; this . remove ( sourceIndex ) ; this . add ( destIndex , tempObj ) ; }
Source:
private boolean selectionContainsPlaceholderDevices ( ) { if ( ( getSelectedItems ( ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.HostDeviceView hostDeviceView : getSelectedItems ( ) ) { if ( hostDeviceView.isIommuPlaceholder ( ) ) { return true ; } } } return false ; }

Target:
private java.util.ArrayList < java.lang.String > getSelectedPrimaryDeviceNames ( ) { java.util.ArrayList < java.lang.String > deviceNames = new java.util.ArrayList < > ( ) ; if ( ( getSelectedItems ( ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.HostDeviceView vmHostDevice : getSelectedItems ( ) ) { if ( ! ( vmHostDevice.isIommuPlaceholder ( ) ) ) { deviceNames.add ( vmHostDevice.getDeviceName ( ) ) ; } } } return deviceNames ; }
Source:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getSpiceUsbAutoShare ( 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SpiceUsbAutoShare , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue1 ) { org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel backupModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel ) ( model1 ) ) ; backupModel1.setItems ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue1 ) ) . getReturnValue ( ) ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object ReturnValue1 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue1 ) ) . getReturnValue ( ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.ui.uicommonweb.Linq.VmComparator ( ) ) ; setItems ( ( ( java.util.ArrayList ) ( vms ) ) ) ; }
Source:
private void copyFromCommandEntity ( org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask , org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { if ( cmdEntity != null ) { asyncTask.setActionParameters ( cmdEntity.getActionParameters ( ) ) ; asyncTask.setParentCommandId ( cmdEntity.getParentCommandId ( ) ) ; asyncTask.setRootCommandId ( cmdEntity.getRootCommandId ( ) ) ; asyncTask.setCommandStatus ( cmdEntity.getCommandStatus ( ) ) ; asyncTask.setCommandType ( cmdEntity.getCommandType ( ) ) ; asyncTask.setCreatedAt ( cmdEntity.getCreatedAt ( ) ) ; } }

Target:
public org.ovirt.engine.core.compat.CommandStatus getCommandStatus ( final org.ovirt.engine.core.compat.Guid commandId ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = commandsCache.get ( commandId ) ; if ( cmdEntity != null ) { return cmdEntity.getCommandStatus ( ) ; } return org.ovirt.engine.core.compat.CommandStatus.UNKNOWN ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Erratum getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.Erratum erratum = control.createMock ( org.ovirt.engine.core.common.businessentities.Erratum.class ) ; org.easymock.EasyMock.expect ( erratum.getId ( ) ) . andReturn ( GUIDS [ index ] . toString ( ) ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( erratum.getDescription ( ) ) . andReturn ( DESCRIPTIONS [ index ] ) . anyTimes ( ) ; return erratum ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Erratum getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.Erratum erratum = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Erratum.class ) ; org.mockito.Mockito.when ( erratum.getId ( ) ) . thenReturn ( GUIDS [ index ] . toString ( ) ) ; org.mockito.Mockito.when ( erratum.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; return erratum ; }
Source:
public org.ovirt.engine.core.common.errors.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { org.ovirt.engine.core.common.errors.VdcBllMessages returnValue = validateRequiredNetworksAvailable ( vds ) ; if ( ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_NETWORKS ) == returnValue ) { sb.append ( "is missing networks required by VM nics " ) . append ( org.ovirt.engine.core.common.businessentities.Entities.interfacesByNetworkName ( getVmNICs ( ) ) . keySet ( ) ) ; } else if ( ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_MISSING_DISPLAY_NETWORK ) == returnValue ) { sb.append ( "is missing the cluster's display network" ) ; } return returnValue ; }

Target:
public org.ovirt.engine.core.common.errors.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate , java.util.List < org.ovirt.engine.core.compat.Guid > vdsBlackList ) { org.ovirt.engine.core.common.errors.VdcBllMessages returnValue = validateRequiredNetworksAvailable ( vds ) ; if ( ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_NETWORKS ) == returnValue ) { sb.append ( "is missing networks required by VM nics " ) . append ( org.ovirt.engine.core.common.businessentities.Entities.interfacesByNetworkName ( getVmNICs ( ) ) . keySet ( ) ) ; } else if ( ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_MISSING_DISPLAY_NETWORK ) == returnValue ) { sb.append ( "is missing the cluster's display network" ) ; } return returnValue ; }
Source:
public void testUpdateLatency ( ) { existingDynamic.setReadLatency ( 1.0E-9 ) ; existingDynamic.setWriteLatency ( 2.0E-9 ) ; existingDynamic.setFlushLatency ( 0.999999999 ) ; dao.update ( existingDynamic ) ; org.ovirt.engine.core.common.businessentities.DiskImageDynamic result = dao.get ( existingDynamic.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingDynamic , result ) ; }

Target:
public void testUpdateLatency ( ) { existingDynamic.setReadLatency ( 1.0E-9 ) ; existingDynamic.setWriteLatency ( 2.0E-9 ) ; existingDynamic.setFlushLatency ( 0.999999999 ) ; dao.update ( existingDynamic ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic result = dao.get ( existingDynamic.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingDynamic , result ) ; }
Source:
public void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { 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.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void diskImagesNotIllegalFirstIllegal ( ) { disk1.setImageStatus ( ImageStatus.ILLEGAL ) ; org.junit.Assert.assertThat ( validator.diskImagesNotIllegal ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISKS_ILLEGAL ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk1 ) ) ) ) ) ; }

Target:
public void diskImagesNotIllegalFirstIllegal ( ) { disk1.setImageStatus ( ImageStatus.ILLEGAL ) ; org.hamcrest.MatcherAssert.assertThat ( validator.diskImagesNotIllegal ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISKS_ILLEGAL ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk1 ) ) ) ) ) ; }
Source:
public java.util.List < org.ovirt.engine.sdk.decorators.HostStorage > list ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; return list ( url , org.ovirt.engine.sdk.entities.HostStorage.class , org.ovirt.engine.sdk.decorators.HostStorage.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.HostHostStorage get ( java.util.UUID id ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ) + ( SLASH ) ) + ( id.toString ( ) ) ; return getProxy ( ) . get ( url , org.ovirt.engine.sdk.entities.HostStorage.class , org.ovirt.engine.sdk.decorators.HostHostStorage.class ) ; }
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 ) ) ; cachedMaxPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; int value = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getRoundedPriority ( priority , cachedMaxPriority ) ; org.ovirt.engine.ui.uicommonweb.models.EntityModel tempVar = new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( ) ; tempVar.setEntity ( value ) ; model.getPriority ( ) . setSelectedItem ( tempVar ) ; updatePriority ( ) ; }

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 ) ) ; cachedMaxPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; int value = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getRoundedPriority ( priority , cachedMaxPriority ) ; org.ovirt.engine.ui.uicommonweb.models.EntityModel tempVar = new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( ) ; tempVar.setEntity ( value ) ; before ( callbacks ) ; model.getPriority ( ) . setSelectedItem ( tempVar ) ; after ( callbacks ) ; updatePriority ( callbacks ) ; }
Source:
public void setChildren ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel > value ) { if ( ( ( ( children ) == null ) && ( value != null ) ) || ( ( ( children ) != null ) && ( ! ( children.equals ( value ) ) ) ) ) { children = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Children" ) ) ; } }

Target:
public void setChildren ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel > value ) { if ( ( ( ( children ) == null ) && ( value != null ) ) || ( ( ( children ) != null ) && ( ! ( children.equals ( value ) ) ) ) ) { children = value ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Children" ) ) ; } }
Source:
public void canDoActionVmInPreview ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , null , diskImageId ) ; setVmInPreview ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }

Target:
public void validateVmInPreview ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , null , diskImageId ) ; setVmInPreview ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
Source:
public void testAddLunDisk ( ) { org.ovirt.engine.api.model.Disk model = getModel ( 0 ) ; model.setName ( NAMES [ 0 ] ) ; model.setLunStorage ( new org.ovirt.engine.api.model.Storage ( ) ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . add ( new org.ovirt.engine.api.model.LogicalUnit ( ) ) ; model.setSize ( null ) ; model.setProvisionedSize ( null ) ; testAddDiskImpl ( model ) ; }

Target:
public void testAddLunDisk ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; testAddDiskImpl ( model ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveRole , org.ovirt.engine.core.common.action.RolesParameterBase.class , new java.lang.String [ ] { "RoleId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveRole , org.ovirt.engine.core.common.action.RolesParameterBase.class , new java.lang.String [ ] { "RoleId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void removeMemoryFromActiveSnapshot ( ) { java.lang.String memory = org.ovirt.engine.core.bll.RunVmCommand.getActiveSnapshot ( ) . getMemoryVolume ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( memory ) ) { return ; } snapshotDao.removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; if ( ( snapshotDao.getNumOfSnapshotsByMemory ( memory ) ) == 0 ) { org.ovirt.engine.core.bll.RunVmCommand.removeMemoryDisks ( memory ) ; } }

Target:
public void onPowerringUp ( ) { decreasePendingVm ( vmStaticDao.get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ) ; }
Source:
public final void setId ( org.ovirt.engine.core.compat.Guid id ) { policyUnit.setId ( id ) ; }

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:
public static void GetPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.GetVmPoolByIdParameters ( poolId ) , aQuery ) ; }

Target:
public static void GetClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters ( id ) , aQuery ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.CanUpdateFieldGenericQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.ObjectIdentityChecker.CanUpdateField ( org.ovirt.engine.core.bll.CanUpdateFieldGenericQuery.getParameters ( ) . getFieldContainer ( ) , org.ovirt.engine.core.bll.CanUpdateFieldGenericQuery.getParameters ( ) . getFieldName ( ) , org.ovirt.engine.core.bll.CanUpdateFieldGenericQuery.getParameters ( ) . getStatus ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.CanUpdateFieldGenericQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.utils.ObjectIdentityChecker.CanUpdateField ( org.ovirt.engine.core.bll.CanUpdateFieldGenericQuery.getParameters ( ) . getFieldContainer ( ) , org.ovirt.engine.core.bll.CanUpdateFieldGenericQuery.getParameters ( ) . getFieldName ( ) , org.ovirt.engine.core.bll.CanUpdateFieldGenericQuery.getParameters ( ) . getStatus ( ) ) ) ; }
Source:
public void testInterfaceInHostWhenInDifferentHost ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceInHost ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NIC_NOT_EXISTS_ON_HOST ) ) ; }

Target:
public void testInterfaceInHostWhenInDifferentHost ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceInHost ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NIC_NOT_EXISTS_ON_HOST ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook ( ) ; entity.setHookId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "hook_id" ) ) ) ; entity.setServerId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "server_id" ) ) ) ; entity.setStatus ( rs.getString ( "hook_status" ) ) ; entity.setContentType ( rs.getString ( "content_type" ) ) ; entity.setChecksum ( rs.getString ( "checksum" ) ) ; entity.setServerName ( rs.getString ( "server_name" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook entity = new org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook ( ) ; entity.setHookId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "hook_id" ) ) ) ; entity.setServerId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "server_id" ) ) ) ; entity.setStatus ( rs.getString ( "hook_status" ) ) ; entity.setContentType ( rs.getString ( "content_type" ) ) ; entity.setChecksum ( rs.getString ( "checksum" ) ) ; entity.setServerName ( rs.getString ( "server_name" ) ) ; return entity ; }
Source:
public void testGetNetworkNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.ISCSI_BOND_ID } , getIscsiBondContainingNetwork ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , null , null ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNetworkNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; java.util.List < org.ovirt.engine.api.restapi.resource.Network > entities = new java.util.ArrayList < > ( ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , entities ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private org.ovirt.engine.api.restapi.resource.BackendUserResource getUserResource ( ) { if ( ( this . userResource ) == null ) { org.ovirt.engine.api.restapi.resource.BackendUsersResource usersResource = new org.ovirt.engine.api.restapi.resource.BackendUsersResource ( ) ; inject ( usersResource ) ; org.ovirt.engine.api.resource.UserResource userResource = usersResource.getUserSubResource ( "" ) ; this . userResource = ( ( org.ovirt.engine.api.restapi.resource.BackendUserResource ) ( userResource ) ) ; } return this . userResource ; }

Target:
private org.ovirt.engine.api.restapi.resource.aaa.BackendUserResource getUserResource ( ) { if ( ( this . userResource ) == null ) { org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResource usersResource = new org.ovirt.engine.api.restapi.resource.aaa.BackendUsersResource ( ) ; inject ( usersResource ) ; org.ovirt.engine.api.resource.aaa.UserResource userResource = usersResource.getUserSubResource ( "" ) ; this . userResource = ( ( org.ovirt.engine.api.restapi.resource.aaa.BackendUserResource ) ( userResource ) ) ; } return this . userResource ; }
Source:
private org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > setupCanAddVmFromTemplateTests ( final int domainSizeGB , final int sizeRequired ) { org.ovirt.engine.core.common.businessentities.VM vm = initializeMock ( domainSizeGB , sizeRequired ) ; org.ovirt.engine.core.bll.AddVmFromTemplateCommand < org.ovirt.engine.core.common.action.AddVmFromTemplateParameters > cmd = createVmFromTemplateCommand ( vm ) ; org.ovirt.engine.core.bll.AddVmCommandTest.initCommandMethods ( cmd ) ; return cmd ; }

Target:
public void validateSpaceNotWithinThreshold ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.VmManagementParametersBase > command = setupCanAddVmTests ( 0 , 0 ) ; storageDomainValidator = org.mockito.Mockito.mock ( org.ovirt.engine.core.bll.validator.StorageDomainValidator.class ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( command ) . createStorageDomainValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; junit.framework.Assert.assertFalse ( command.validateSpaceRequirements ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepStatus ( volumeName , slaveHost , slaveVolumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepSessionList ( volumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }