auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public static void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private void refreshCapabilities ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.RefreshHost , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
public void start ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.StartVds , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
private void endJobOrStepAsFailed ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) ; if ( ( ( executionContext != null ) && ( executionContext.isMonitored ( ) ) ) && ( ! ( executionContext.isCompleted ( ) ) ) ) { switch ( executionContext.getExecutionMethod ( ) ) { case AsJob : org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , false ) ; break ; case AsStep : org.ovirt.engine.core.bll.job.ExecutionHandler.endStep ( executionContext , executionContext.getStep ( ) , false ) ; break ; } } }

Target:
protected void endExecutionMonitoring ( ) { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) ; switch ( executionContext.getExecutionMethod ( ) ) { case AsJob : org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , false ) ; break ; case AsStep : org.ovirt.engine.core.bll.job.ExecutionHandler.endStep ( executionContext , executionContext.getStep ( ) , false ) ; break ; default : } }
Source:
private void PollAndUpdateAsyncTasks ( ) { if ( logChangedMap ) { org.ovirt.engine.core.bll.AsyncTaskManager.log.infoFormat ( "Polling and updating Async Tasks: {0} tasks, {1} tasks to poll now" , _tasks.size ( ) , NumberOfTasksToPoll ( ) ) ; } java.util.Set < org.ovirt.engine.core.compat.Guid > poolsOfActiveTasks = getPoolIdsTasks ( ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > > poolsAllTasksMap = getSPMsTasksStatuses ( poolsOfActiveTasks ) ; updateTaskStatuses ( poolsAllTasksMap ) ; }

Target:
private int NumberOfTasksToPoll ( ) { int retValue = 0 ; for ( org.ovirt.engine.core.bll.SPMAsyncTask task : _tasks.values ( ) ) { if ( task.getShouldPoll ( ) ) { retValue ++ ; } } return retValue ; }
Source:
private void removeMemoryFromSnapshot ( ) { if ( memoryVolumeFromSnapshot.isEmpty ( ) ) { return ; } if ( ( getSnapshotDao ( ) . getNumOfSnapshotsByMemory ( memoryVolumeFromSnapshot ) ) == 1 ) { removeMemoryVolumes ( memoryVolumeFromSnapshot , org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) , true ) ; } getSnapshotDao ( ) . removeMemoryFromSnapshot ( getBaselineSnapshot ( ) . getId ( ) ) ; }

Target:
private void removeMemoryFromActiveSnapshot ( ) { if ( memoryVolumeFromSnapshot.isEmpty ( ) ) { return ; } if ( ( getSnapshotDao ( ) . getNumOfSnapshotsByMemory ( memoryVolumeFromSnapshot ) ) == 1 ) { removeMemoryVolumes ( memoryVolumeFromSnapshot , org.ovirt.engine.core.bll.RunVmCommand.getActionType ( ) , true ) ; } getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) ; }
Source:
private void updateOptions ( ) { getCompulsoryActions ( ) . clear ( ) ; getOptionalActions ( ) . clear ( ) ; if ( ( getEntity ( ) ) != null ) { startProgress ( null ) ; if ( ( getEntity ( ) . getstorage_pool_type ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { updateOptionsNonLocalFSData ( ) ; } else { updateOptionsLocalFSData ( ) ; } } }

Target:
private void updateOptions ( ) { getCompulsoryActions ( ) . clear ( ) ; getOptionalActions ( ) . clear ( ) ; if ( ( getEntity ( ) ) != null ) { startProgress ( null ) ; if ( ( getEntity ( ) . getStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) { updateOptionsNonLocalFSData ( ) ; } else { updateOptionsLocalFSData ( ) ; } } }
Source:
private void storeVncData ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles vmConsoles , org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.KeyMaker keyMaker ) { org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel consoleModel = vmConsoles.getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel.class ) ; if ( consoleModel != null ) { clientStorage.setLocalItem ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.VNC_CLIENT_MODE ) , consoleModel.getClientConsoleMode ( ) . toString ( ) ) ; storeBool ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.REMAP_CAD_VNC ) , consoleModel.getVncImpl ( ) . isRemapCtrlAltDelete ( ) ) ; } }

Target:
private void storeVncData ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles vmConsoles , org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.KeyMaker keyMaker ) { org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel consoleModel = vmConsoles.getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel.class ) ; if ( consoleModel != null ) { clientStorage.setLocalItem ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.VNC_CLIENT_MODE ) , consoleModel.getClientConsoleMode ( ) . toString ( ) ) ; storeBool ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.REMAP_CAD_VNC ) , consoleModel.getVncImpl ( ) . getOptions ( ) . isRemapCtrlAltDelete ( ) ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.permissions > getAllForEntity ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetPermissionsByEntityId" , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.permissions > getAllForEntity ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered , boolean allUsersWithPermission , int appMode ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) . addValue ( "app_mode" , appMode ) ; java.lang.String functionName = "GetPermissionsByEntityId" ; if ( allUsersWithPermission ) { functionName = "GetAllUsersWithPermissionsOnEntityByEntityId" ; } return getCallsHandler ( ) . executeReadList ( functionName , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }
Source:
public static void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
public void imageProvidedForOvirtNode ( ) { org.mockito.Mockito.when ( host.getVdsType ( ) ) . thenReturn ( VDSType.oVirtNode ) ; java.lang.String imageName = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 20 ) ; org.junit.Assert.assertThat ( validator.imageProvidedForOvirtNode ( imageName ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void imageProvidedForOvirtNode ( ) { org.mockito.Mockito.when ( host.getVdsType ( ) ) . thenReturn ( VDSType.oVirtVintageNode ) ; java.lang.String imageName = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 20 ) ; org.junit.Assert.assertThat ( validator.imageProvidedForOvirtNode ( imageName ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeBrickAdd ( java.lang.String volumeName , java.lang.String [ ] bricks , int replicaCount , int stripeCount ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeBrickAdd ( volumeName , bricks , replicaCount , stripeCount ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc refreshVolume ( java.lang.String sdUUID , java.lang.String spUUID , java.lang.String imgUUID , java.lang.String volUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmpRpcReturnValue = vdsServer.refreshVolume ( sdUUID , spUUID , imgUUID , volUUID ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmpRpcReturnValue ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) , null ) ; 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 ( QueryType.GetClustersByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterClusterResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ( ) , null ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected void executeQueryCommand ( ) { java.lang.String domain = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getDomain ( ) ; org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.bll.adbroker.LdapBroker broker = org.ovirt.engine.core.bll.adbroker.LdapFactory.getInstance ( domain ) ; org.ovirt.engine.core.common.businessentities.LdapUser user = ( ( org.ovirt.engine.core.common.businessentities.LdapUser ) ( broker.RunAdAction ( AdActionType.GetAdUserByUserId , new org.ovirt.engine.core.bll.adbroker.LdapSearchByIdParameters ( domain , id ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setReturnValue ( user ) ; }

Target:
protected void executeQueryCommand ( ) { java.lang.String domain = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getDomain ( ) ; org.ovirt.engine.core.common.utils.ExternalId id = org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.bll.adbroker.LdapBroker broker = org.ovirt.engine.core.bll.adbroker.LdapFactory.getInstance ( domain ) ; org.ovirt.engine.core.common.businessentities.LdapUser user = ( ( org.ovirt.engine.core.common.businessentities.LdapUser ) ( broker.runAdAction ( AdActionType.GetAdUserByUserId , new org.ovirt.engine.core.bll.adbroker.LdapSearchByIdParameters ( domain , id ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.core.bll.GetDirectoryUserByIdQuery.getQueryReturnValue ( ) . setReturnValue ( user ) ; }
Source:
public void getVmTemplateWithVm ( ) { b.setVmTemplate ( null ) ; b.setVmTemplateId ( null ) ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVmtGuid ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VmTemplate t = b.getVmTemplate ( ) ; org.junit.Assert.assertNotNull ( t ) ; }

Target:
public void getVmTemplateWithVm ( ) { b.setVmTemplate ( null ) ; b.setVmTemplateId ( null ) ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setVmtGuid ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VmTemplate t = b.getVmTemplate ( ) ; org.junit.jupiter.api.Assertions.assertNotNull ( t ) ; }
Source:
public void writeData ( java.io.ObjectOutputStream dos ) { try { writeString ( this . var_name , dos ) ; writeString ( this . var_value , dos ) ; writeDate ( this . var_datetime , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.configurationsync_4_1.ConfigurationSync.copyOfupdateFirstSyncStruct.commonByteArrayLock_OVIRT_ENGINE_DWH_ConfigurationSync ) { try { int length = 0 ; this . var_name = readString ( dis ) ; this . var_value = readString ( dis ) ; this . var_datetime = readDate ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }
Source:
private org.ovirt.engine.core.common.businessentities.VmStatic getVmStatic ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setOsId ( OsRepository.DEFAULT_X86_OS ) ; vmStatic.setNumOfMonitors ( 1 ) ; vmStatic.setMemSizeMb ( 300 ) ; vmStatic.setStateless ( false ) ; vmStatic.setVmtGuid ( vmTemplateId ) ; return vmStatic ; }

Target:
private org.ovirt.engine.core.common.businessentities.VmStatic getVmStatic ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; vmStatic.setOsId ( OsRepository.DEFAULT_X86_OS ) ; vmStatic.setNumOfMonitors ( 1 ) ; vmStatic.setMemSizeMb ( 300 ) ; vmStatic.setMaxMemorySizeMb ( org.ovirt.engine.core.bll.CommonVmPoolCommandTestAbstract.MAX_MEMORY_SIZE ) ; vmStatic.setStateless ( false ) ; vmStatic.setVmtGuid ( vmTemplateId ) ; return vmStatic ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return new org.ovirt.engine.ui.uicommonweb.UICommand ( constants.treeCollapseAll ( ) , new org.ovirt.engine.ui.uicommonweb.BaseCommandTarget ( ) { @ java.lang.Override public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { com.google.gwt.user.cellview.client.TreeNode collapseNode = findNode ( getDataDisplayWidget ( ) . getRootTreeNode ( ) , modelProvider.getSelectionModel ( ) . getSelectedObject ( ) ) ; if ( collapseNode != null ) { collapseTree ( collapseNode ) ; } } } ) ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.UICommand resolveCommand ( ) { return new org.ovirt.engine.ui.uicommonweb.UICommand ( org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.constants.treeCollapseAll ( ) , new org.ovirt.engine.ui.uicommonweb.BaseCommandTarget ( ) { @ java.lang.Override public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { com.google.gwt.user.cellview.client.TreeNode collapseNode = findNode ( getDataDisplayWidget ( ) . getRootTreeNode ( ) , modelProvider.getSelectionModel ( ) . getSelectedObject ( ) ) ; if ( collapseNode != null ) { collapseTree ( collapseNode ) ; } } } ) ; }
Source:
private void updatePriority ( final org.ovirt.engine.ui.uicommonweb.models.vms.PriorityUtil.PriorityUpdatingCallbacks callbacks ) { if ( ( cachedMaxPriority ) == null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( model , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { cachedMaxPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; postUpdatePriority ( callbacks ) ; } } ) ) ; } else { postUpdatePriority ( callbacks ) ; } }

Target:
private void updatePriority ( final org.ovirt.engine.ui.uicommonweb.models.vms.PriorityUtil.PriorityUpdatingCallbacks callbacks ) { if ( ( cachedMaxPriority ) == null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxVmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.Integer > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Integer returnValue ) { cachedMaxPriority = returnValue ; postUpdatePriority ( callbacks ) ; } } ) ) ; } else { postUpdatePriority ( callbacks ) ; } }
Source:
private void setUpDiskVmElementExpectations ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID ) ; dve.setDiskInterface ( DiskInterface.VirtIO ) ; dve.setBoot ( false ) ; setUpGetEntityExpectations ( VdcQueryType.GetDiskVmElementById , org.ovirt.engine.core.common.queries.VmDeviceIdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID ) } , dve ) ; }

Target:
private void setUpDiskVmElementExpectations ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID ) ; dve.setDiskInterface ( DiskInterface.VirtIO ) ; dve.setBoot ( false ) ; setUpGetEntityExpectations ( QueryType.GetDiskVmElementById , org.ovirt.engine.core.common.queries.VmDeviceIdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID , org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID ) } , dve ) ; }
Source:
public void setText ( java.lang.String text ) { super . setText ( text ) ; java.lang.String renderedText = text ; if ( ( getTooltipCaption ( ) ) != null ) { renderedText = ( ( getTooltipCaption ( ) ) + ": " ) + renderedText ; } org.ovirt.engine.ui.common.widget.label.TextBoxLabelBase.setTitle ( renderedText ) ; }

Target:
public void setText ( java.lang.String text ) { super . setText ( text ) ; java.lang.String renderedText = text ; if ( ( getTooltipCaption ( ) ) != null ) { renderedText = ( ( getTooltipCaption ( ) ) + ": " ) + renderedText ; } tooltipPanel.setText ( renderedText ) ; }
Source:
public void testDoGetHttpServletRequestHttpServletResponseNoDispatcher ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getAttribute ( LocaleFilter.LOCALE ) ) . thenReturn ( java.util.Locale.JAPANESE ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( "localeKeys" , localeKeys ) ; org.mockito.Mockito.verify ( mockResponse ) . setContentType ( "text/html;charset=UTF-8" ) ; }

Target:
public void testDoGetHttpServletRequestHttpServletResponseNoDispatcher ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.when ( mockRequest.getAttribute ( LocaleFilter.LOCALE ) ) . thenReturn ( java.util.Locale.JAPANESE ) ; org.mockito.Mockito.when ( mockRequest.getParameter ( "user" ) ) . thenReturn ( "" ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( "localeKeys" , localeKeys ) ; org.mockito.Mockito.verify ( mockResponse ) . setContentType ( "text/html;charset=UTF-8" ) ; }
Source:
protected void executeCommand ( ) { try { addVmToDb ( ) ; processImages ( ) ; org.ovirt.engine.core.bll.VmHandler.addVmInitToDB ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.ImportVmCommandBase.getMacPool ( ) . freeMacs ( macsAdded ) ; throw e ; } org.ovirt.engine.core.bll.ImportVmCommandBase.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { try { addVmToDb ( ) ; processImages ( ) ; org.ovirt.engine.core.bll.VmHandler.addVmInitToDB ( getVm ( ) . getStaticData ( ) ) ; } catch ( java.lang.RuntimeException e ) { macPool.freeMacs ( macsAdded ) ; throw e ; } org.ovirt.engine.core.bll.ImportVmCommandBase.setSucceeded ( true ) ; }
Source:
public void testIncompleteExport ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.export ( new org.ovirt.engine.api.model.Action ( ) ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Action" , "export" , "storageDomain.id|name" ) ; } }

Target:
public void testIncompleteExport ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.export ( new org.ovirt.engine.api.model.Action ( ) ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Action" , "export" , "storageDomain.id|name" ) ; } }
Source:
public void getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
protected void endWithFailure ( ) { setIsVmRunningStateless ( ) ; if ( _isVmRunningStateless ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }

Target:
protected void endWithFailure ( ) { setIsVmRunningStateless ( ) ; if ( _isVmRunningStateless ) { org.ovirt.engine.core.common.action.CreateAllSnapshotsFromVmParameters createSnapshotParameters = buildCreateSnapshotParameters ( ) ; createSnapshotParameters.setImagesParameters ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getImagesParameters ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.RunVmCommand.getBackend ( ) . endAction ( VdcActionType.CreateAllSnapshotsFromVm , createSnapshotParameters , new org.ovirt.engine.core.bll.context.CommandContext ( org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) ) ) ; setSucceeded ( vdcReturnValue.getSucceeded ( ) ) ; } else { super . endWithFailure ( ) ; } }
Source:
protected org.ovirt.engine.core.dao.VdsStatisticsDAO getDao ( ) { return dao ; }

Target:
public void testSave ( ) { staticDao.save ( newStaticVds ) ; newStatistics.setId ( newStaticVds.getId ( ) ) ; dao.save ( newStatistics ) ; org.ovirt.engine.core.common.businessentities.VdsStatic staticResult = staticDao.get ( newStaticVds.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VdsStatistics statisticsResult = dao.get ( newStatistics.getId ( ) ) ; org.junit.Assert.assertNotNull ( staticResult ) ; org.junit.Assert.assertEquals ( newStaticVds , staticResult ) ; org.junit.Assert.assertNotNull ( statisticsResult ) ; org.junit.Assert.assertEquals ( newStatistics , statisticsResult ) ; }
Source:
public org.ovirt.engine.core.common.job.Job getJobWithSteps ( final org.ovirt.engine.core.compat.Guid jobId ) { org.ovirt.engine.core.common.job.Job job = jobDao.get ( jobId ) ; if ( job != null ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > jobSubjectEntity = jobSubjectEntityDao.getJobSubjectEntityByJobId ( jobId ) ; job.setJobSubjectEntities ( jobSubjectEntity ) ; } return job ; }

Target:
public org.ovirt.engine.core.common.job.Job getJob ( final org.ovirt.engine.core.compat.Guid jobId ) { return org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < org.ovirt.engine.core.common.job.Job > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.job.Job runInTransaction ( ) { org.ovirt.engine.core.common.job.Job job = jobDao.get ( jobId ) ; if ( job != null ) { job.getJobSubjectEntities ( ) ; } return job ; } } ) ; }
Source:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }
Source:
public void networksUsedByAVm ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network net = mockNetwork ( ) ; networksUsedTest ( false , true , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_PROVIDER_NETWORKS_USED_ONCE ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( net.getName ( ) ) ) ) ) ) ; }

Target:
public void networksUsedByAVm ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network net = mockNetwork ( ) ; networksUsedTest ( false , true , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_PROVIDER_NETWORKS_USED_ONCE ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( net.getName ( ) ) ) ) ) ) ; }
Source:
public boolean getIsQxlSupported ( ) { boolean isLinux = getIsLinuxOS ( ) ; boolean isQxl = ( extractSelectedDisplayTypeEntity ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ; boolean isSpice = ( getGraphicsType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.SPICE ) ; boolean clusterSupportsSinglePci = ( ( getSelectedCluster ( ) ) != null ) && ( ( Version.v3_3.compareTo ( getSelectedCluster ( ) . getcompatibility_version ( ) ) ) <= 0 ) ; return ( ( isLinux && isQxl ) && isSpice ) && clusterSupportsSinglePci ; }

Target:
public boolean getIsQxlSupported ( ) { boolean isLinux = getIsLinuxOS ( ) ; boolean isQxl = ( getDisplayType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ; boolean isSpice = ( getGraphicsType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes.SPICE ) ; boolean clusterSupportsSinglePci = ( ( getSelectedCluster ( ) ) != null ) && ( ( Version.v3_3.compareTo ( getSelectedCluster ( ) . getCompatibilityVersion ( ) ) ) <= 0 ) ; return ( ( isLinux && isQxl ) && isSpice ) && clusterSupportsSinglePci ; }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain initStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setstorage_pool_id ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain initStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; return storageDomain ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroup ( ) { if ( ( vdsGroup ) == null ) { vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setcompatibility_version ( Version.v3_3 ) ; } return vdsGroup ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroup ( ) { if ( ( vdsGroup ) == null ) { vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setvds_group_id ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vdsGroup.setcompatibility_version ( Version.v3_3 ) ; vdsGroup.setcpu_name ( "Intel Conroe Family" ) ; vdsGroup.setArchitecture ( ArchitectureType.x86_64 ) ; } return vdsGroup ; }
Source:
public void shouldValidateSingleNodePinning ( ) { vm.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 0 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.bll.numa.vm.NumaValidator.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }

Target:
public void shouldValidateSingleNodePinning ( ) { vm.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 0 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; vm.setNumaTuneMode ( NumaTuneMode.PREFERRED ) ; org.junit.Assert.assertTrue ( underTest.checkVmNumaNodesIntegrity ( vm , vm.getvNumaNodeList ( ) ) . isValid ( ) ) ; }
Source:
private void audit ( org.ovirt.engine.core.common.AuditLogType auditMessage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "Action" , getAction ( ) . name ( ) ) ; logable.addCustomValue ( "VdsName" , org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getName ( ) ) ; logable.setVdsId ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVdsId ( ) ) ; auditLogDirector.log ( logable , auditMessage ) ; }

Target:
private void audit ( org.ovirt.engine.core.common.AuditLogType auditMessage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "Action" , getAction ( ) . name ( ) . toLowerCase ( ) ) ; logable.addCustomValue ( "VdsName" , org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getName ( ) ) ; logable.setVdsId ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVdsId ( ) ) ; auditLogDirector.log ( logable , auditMessage ) ; }
Source:
public void testGetPermittedStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getPermittedStorageDomainsByStoragePool ( org.ovirt.engine.core.dao.StorageDomainDaoTest.EXISTING_USER_ID , ActionGroup.CONFIGURE_VM_STORAGE , new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( result.get ( 0 ) . getId ( ) , existingDomain.getId ( ) ) ; }

Target:
public void testGetNonePermittedStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getPermittedStorageDomainsByStoragePool ( FixturesTool.USER_EXISTING_ID , ActionGroup.CONSUME_QUOTA , FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertTrue ( result.isEmpty ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Permissions getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.Permissions permission = new org.ovirt.engine.core.common.businessentities.Permissions ( ) ; permission.setId ( GUIDS [ ( ( index + 1 ) % 3 ) ] ) ; permission.setad_element_id ( GUIDS [ 0 ] ) ; permission.setrole_id ( GUIDS [ index ] ) ; permission.setObjectType ( VdcObjectType.System ) ; return permission ; }

Target:
protected org.ovirt.engine.core.common.businessentities.Permissions getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.Permissions permission = new org.ovirt.engine.core.common.businessentities.Permissions ( ) ; permission.setId ( GUIDS [ ( ( index + 1 ) % 3 ) ] ) ; permission.setAdElementId ( GUIDS [ 0 ] ) ; permission.setRoleId ( GUIDS [ index ] ) ; permission.setObjectType ( VdcObjectType.System ) ; return permission ; }
Source:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public < T > T findResource ( org.ovirt.engine.core.utils.ejb.ContainerManagedResourceType resourceValue ) { java.lang.String jndiNameFromMap = getResourceJNDIName ( resourceValue ) ; if ( jndiNameFromMap == null ) { org.ovirt.engine.core.utils.ejb.EJBUtilsStrategy.log.error ( ( "No JNDI name for : " + resourceValue ) ) ; return null ; } try { javax.naming.InitialContext context = new javax.naming.InitialContext ( ) ; return ( ( T ) ( context.lookup ( jndiNameFromMap ) ) ) ; } catch ( javax.naming.NamingException ex ) { org.ovirt.engine.core.utils.ejb.EJBUtilsStrategy.log.error ( ( "Error looking up resource " + resourceValue ) ) ; return null ; } }

Target:
public < T > T findResource ( org.ovirt.engine.core.utils.ejb.ContainerManagedResourceType resourceValue ) { java.lang.String jndiNameFromMap = getResourceJNDIName ( resourceValue ) ; if ( jndiNameFromMap == null ) { org.ovirt.engine.core.utils.ejb.EJBUtilsStrategy.log.error ( ( "No JNDI name for : " + resourceValue ) ) ; return null ; } try { return getReference ( jndiNameFromMap ) ; } catch ( javax.naming.NamingException ex ) { org.ovirt.engine.core.utils.ejb.EJBUtilsStrategy.log.error ( ( "Error looking up resource " + resourceValue ) ) ; return null ; } }
Source:
protected void executeVmCommand ( ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retValue = runVdsCommand ( VDSCommandType.ConvertVm , buildConvertParameters ( ) ) ; if ( retValue.getSucceeded ( ) ) { getVdsManager ( ) . addV2VJobInfoForVm ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) , JobStatus.WAIT_FOR_START ) ; org.ovirt.engine.core.bll.ConvertVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" ) ; setCommandStatus ( CommandStatus.FAILED ) ; } } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" , e ) ; setCommandStatus ( CommandStatus.FAILED ) ; } }

Target:
protected void executeVmCommand ( ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retValue = runVdsCommand ( ) ; if ( retValue.getSucceeded ( ) ) { monitorV2VJob ( JobStatus.WAIT_FOR_START ) ; org.ovirt.engine.core.bll.ConvertVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" ) ; setCommandStatus ( CommandStatus.FAILED ) ; } } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" , e ) ; setCommandStatus ( CommandStatus.FAILED ) ; } }
Source:
private static org.ovirt.engine.api.model.Options parseOptions ( java.lang.String str , java.util.Map < java.lang.String , java.lang.String > types , boolean ignoreValues ) { org.ovirt.engine.api.model.Options ret = new org.ovirt.engine.api.model.Options ( ) ; for ( java.lang.String option : str.split ( "," , ( - 1 ) ) ) { if ( ! ( option.isEmpty ( ) ) ) { ret.getOptions ( ) . add ( org.ovirt.engine.api.restapi.util.FenceOptionsParser.parseOption ( option , types , ignoreValues ) ) ; } } return ret ; }

Target:
private static org.ovirt.engine.api.model.Options parseOptions ( java.lang.String str , java.util.Map < java.lang.String , java.lang.String > types , boolean ignoreValues ) { org.ovirt.engine.api.model.Options ret = new org.ovirt.engine.api.model.Options ( ) ; for ( java.lang.String option : str.split ( "," , ( - 1 ) ) ) { if ( ! ( option.isEmpty ( ) ) ) { org.ovirt.engine.api.model.Option parsedOption = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parseOption ( option , types , ignoreValues ) ; if ( parsedOption != null ) { ret.getOptions ( ) . add ( parsedOption ) ; } } } return ret ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < java.lang.String > nics = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > interfaceTypes = new java.util.ArrayList < > ( ) ; for ( java.lang.String nic : nics ) { try { interfaceTypes.add ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.valueOf ( nic ) ) ; } catch ( java.lang.IllegalArgumentException e ) { } } chainedCallback.onSuccess ( model , interfaceTypes ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > convert ( java.lang.Object returnValue ) { java.util.ArrayList < java.lang.String > nics = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmInterfaceType > interfaceTypes = new java.util.ArrayList < > ( ) ; for ( java.lang.String nic : nics ) { try { interfaceTypes.add ( org.ovirt.engine.core.common.businessentities.network.VmInterfaceType.valueOf ( nic ) ) ; } catch ( java.lang.IllegalArgumentException e ) { } } return interfaceTypes ; }