auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void revertPreviousHandlers ( ) { getParameters ( ) . decrementExecutionIndex ( ) ; if ( ( getExecutionIndex ( ) ) >= 0 ) { log.errorFormat ( "Reverting task handler: {0}" , getCurrentTaskHandler ( ) . getClass ( ) . getName ( ) ) ; getParameters ( ) . setExecutionReason ( CommandExecutionReason.ROLLBACK_FLOW ) ; getCurrentTaskHandler ( ) . compensate ( ) ; if ( ! ( hasRevertTask ( ) ) ) { revertPreviousHandlers ( ) ; } } }

Target:
protected void logRollbackedTask ( ) { java.lang.String type = ( ( getCurrentTaskHandler ( ) . getRevertTaskType ( ) ) != null ) ? getCurrentTaskHandler ( ) . getRevertTaskType ( ) . name ( ) : AsyncTaskType.unknown.name ( ) ; log.errorFormat ( "Reverting task {0}, handler: {1}" , type , getCurrentTaskHandler ( ) . getClass ( ) . getName ( ) ) ; }
Source:
public void testRemoveByStorageDomain ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendTemplateDiskResource.STORAGE_DOMAIN , GUIDS [ 0 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemoveByStorageDomain ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( ActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendTemplateDiskResource.STORAGE_DOMAIN , GUIDS [ 0 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
private void postInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.Guid.Empty ) ) ) ) ; updateIsDisksAvailable ( ) ; }

Target:
private void postInitTemplate ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > baseTemplates = filterNotBaseTemplates ( templates ) ; org.ovirt.engine.core.common.businessentities.VmTemplate prevBaseTemplate = getModel ( ) . getBaseTemplate ( ) . getSelectedItem ( ) ; getModel ( ) . getBaseTemplate ( ) . setItems ( baseTemplates ) ; getModel ( ) . getBaseTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( baseTemplates , new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( ( prevBaseTemplate != null ? prevBaseTemplate.getId ( ) : org.ovirt.engine.core.compat.Guid.Empty ) ) ) ) ; updateIsDisksAvailable ( ) ; }
Source:
protected void setUpGetGraphicsMultipleExpectations ( int times ) throws java.lang.Exception { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > > vmDevices = new java.util.HashMap < > ( ) ; for ( int i = 0 ; i < times ; i ++ ) { vmDevices.put ( GUIDS [ i ] , java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } setUpGetEntityExpectations ( VdcQueryType.GetGraphicsDevicesMultiple , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , vmDevices ) ; }

Target:
protected void setUpGetGraphicsMultipleExpectations ( int times ) throws java.lang.Exception { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > > vmDevices = new java.util.HashMap < > ( ) ; for ( int i = 0 ; i < times ; i ++ ) { vmDevices.put ( GUIDS [ i ] , java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } setUpGetEntityExpectations ( VdcQueryType.GetGraphicsDevicesMultiple , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , vmDevices ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeRemoveBricksStop ( java.lang.String volumeName , java.lang.String [ ] brickList , int replicaCount ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.removeBrickStop" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "brickList" , new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( brickList ) ) ) . withParameter ( "replicaCount" , replicaCount ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturnForXmlRpc glusterVolumeRemoveBricksStop ( java.lang.String volumeName , java.lang.String [ ] brickList , int replicaCount ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.removeBrickStop" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "brickList" , new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( brickList ) ) ) . withParameter ( "replicaCount" , replicaCount ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeTaskReturnForXmlRpc ( response ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { buildVmData ( ) ; logCommandInfo ( ) ; vmReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.getBroker ( ) . create ( createInfo ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vm.getDynamicData ( ) , vmReturn.vm , org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.getVds ( ) ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { buildVmData ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.log.info ( "VM {}" , createInfo ) ; vmReturn = org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.getBroker ( ) . create ( createInfo ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vm.getDynamicData ( ) , vmReturn.vm , org.ovirt.engine.core.vdsbroker.vdsbroker.CreateVDSCommand.getVds ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( "Message" . equals ( propName ) ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( disk.getMessage ( ) ) ) ) { disableWidget ( getWidget ( ) ) ; disk.getDefaultCommand ( ) . setIsExecutionAllowed ( false ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { revealStorageView ( disk ) ; }
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 ( ) ; rollbackQuota ( ) ; 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 ( ) ; } }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }

Target:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return org.ovirt.engine.core.bll.tasks.TaskManagerUtil.createAsyncTask ( this , asyncTaskCreationInfo , parentCommand ) ; }
Source:
public void testRemove ( ) { super . testRemove ( ) ; java.util.List < org.ovirt.engine.core.compat.Guid > networks = dao.getNetworkIdsByIscsiBondId ( getExistingEntityId ( ) ) ; java.util.List < java.lang.String > connections = dao.getStorageConnectionIdsByIscsiBondId ( getExistingEntityId ( ) ) ; org.junit.Assert.assertTrue ( networks.isEmpty ( ) ) ; org.junit.Assert.assertTrue ( connections.isEmpty ( ) ) ; }

Target:
public void testRemove ( ) { super . testRemove ( ) ; java.util.List < org.ovirt.engine.core.compat.Guid > networks = dao.getNetworkIdsByIscsiBondId ( getExistingEntityId ( ) ) ; java.util.List < java.lang.String > connections = dao.getStorageConnectionIdsByIscsiBondId ( getExistingEntityId ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( networks.isEmpty ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( connections.isEmpty ( ) ) ; }
Source:
private void addVnicProfile ( org.ovirt.engine.core.common.businessentities.network.Network network , boolean publicUse ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; vnicProfile.setName ( network.getName ( ) ) ; vnicProfile.setNetworkId ( network.getId ( ) ) ; org.ovirt.engine.core.common.action.VnicProfileParameters parameters = new org.ovirt.engine.core.common.action.VnicProfileParameters ( vnicProfile ) ; parameters.setPublicUse ( publicUse ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.AddVnicProfile , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { sourceListModel.getSearchCommand ( ) . execute ( ) ; } } ) ; }

Target:
private void addVnicProfile ( org.ovirt.engine.core.common.businessentities.network.Network network , boolean publicUse ) { org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile = new org.ovirt.engine.core.common.businessentities.network.VnicProfile ( ) ; vnicProfile.setName ( network.getName ( ) ) ; vnicProfile.setNetworkId ( network.getId ( ) ) ; org.ovirt.engine.core.common.action.AddVnicProfileParameters parameters = new org.ovirt.engine.core.common.action.AddVnicProfileParameters ( vnicProfile ) ; parameters.setPublicUse ( publicUse ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.AddVnicProfile , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { sourceListModel.getSearchCommand ( ) . execute ( ) ; } } ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = super . getPermissionCheckSubjects ( ) ; org.ovirt.engine.core.compat.Guid networkId = ( ( getNetworkCluster ( ) ) == null ) ? null : getNetworkCluster ( ) . getNetworkId ( ) ; permissions.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( networkId , org.ovirt.engine.core.common.VdcObjectType.Network , org.ovirt.engine.core.common.businessentities.ActionGroup.ASSIGN_CLUSTER_NETWORK ) ) ; return permissions ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = super . getPermissionCheckSubjects ( ) ; org.ovirt.engine.core.compat.Guid networkId = ( ( org.ovirt.engine.core.bll.network.cluster.UpdateNetworkOnClusterCommand.getNetworkCluster ( ) ) == null ) ? null : org.ovirt.engine.core.bll.network.cluster.UpdateNetworkOnClusterCommand.getNetworkCluster ( ) . getNetworkId ( ) ; permissions.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( networkId , org.ovirt.engine.core.common.VdcObjectType.Network , org.ovirt.engine.core.common.businessentities.ActionGroup.ASSIGN_CLUSTER_NETWORK ) ) ; return permissions ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , 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 { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
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 java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > GetWindowsOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmOsType type : org.ovirt.engine.core.common.businessentities.VmOsType.values ( ) ) { if ( type.isWindows ( ) ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes.add ( type ) ; } } return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.AddEventSubscriptionCommand.getParameters ( ) . getEventSubscriber ( ) . gettag_name ( ) ) == null ) { org.ovirt.engine.core.bll.AddEventSubscriptionCommand.getParameters ( ) . getEventSubscriber ( ) . settag_name ( "" ) ; } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getEventDao ( ) . subscribe ( org.ovirt.engine.core.bll.AddEventSubscriptionCommand.getParameters ( ) . getEventSubscriber ( ) ) ; org.ovirt.engine.core.bll.AddEventSubscriptionCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { if ( ( org.ovirt.engine.core.bll.AddEventSubscriptionCommand.getParameters ( ) . getEventSubscriber ( ) . getTagName ( ) ) == null ) { org.ovirt.engine.core.bll.AddEventSubscriptionCommand.getParameters ( ) . getEventSubscriber ( ) . setTagName ( "" ) ; } org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getEventDao ( ) . subscribe ( org.ovirt.engine.core.bll.AddEventSubscriptionCommand.getParameters ( ) . getEventSubscriber ( ) ) ; org.ovirt.engine.core.bll.AddEventSubscriptionCommand.setSucceeded ( true ) ; }
Source:
public static void GetUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
public void testDiskAttachedToAnyVM ( ) { org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.isDiskAttachedToAnyVm ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testDiskAttachedToAnyVM ( ) { org.mockito.Mockito.when ( vmDao.getVmsListForDisk ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ) . thenReturn ( java.util.Collections.emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.isDiskAttachedToAnyVm ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void setActionMessageParameters ( ) { cmd.setActionMessageParameters ( ) ; java.util.List < java.lang.String > messages = cmd.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertTrue ( "action name not in messages" , messages.remove ( EngineMessage.VAR__ACTION__UPDATE.name ( ) ) ) ; org.junit.Assert.assertTrue ( "type not in messages" , messages.remove ( EngineMessage.VAR__TYPE__STORAGE__DOMAIN.name ( ) ) ) ; org.junit.Assert.assertTrue ( ( "redundant messages " + messages ) , messages.isEmpty ( ) ) ; }

Target:
public void setActionMessageParameters ( ) { cmd.setActionMessageParameters ( ) ; java.util.List < java.lang.String > messages = cmd.getReturnValue ( ) . getValidationMessages ( ) ; org.junit.Assert.assertTrue ( "action name not in messages" , messages.remove ( EngineMessage.VAR__ACTION__UPDATE.name ( ) ) ) ; org.junit.Assert.assertTrue ( "type not in messages" , messages.remove ( EngineMessage.VAR__TYPE__STORAGE__DOMAIN.name ( ) ) ) ; org.junit.Assert.assertTrue ( ( "redundant messages " + messages ) , messages.isEmpty ( ) ) ; }
Source:
public static < T extends java.lang.Comparable < T > > java.util.ArrayList < T > OrderByDescending ( java.util.List < T > source ) { java.util.ArrayList < T > list = new java.util.ArrayList < T > ( ) ; java.util.ArrayList < T > sorted = new java.util.ArrayList < T > ( source ) ; java.util.Collections.sort ( sorted ) ; for ( int i = sorted.size ( ) ; i > 0 ; i -- ) { list.add ( sorted.get ( ( i - 1 ) ) ) ; } return list ; }

Target:
private static final java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Provider > filterProvidersByProvidedType ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Provider > source , final org.ovirt.engine.core.common.VdcObjectType type ) { return org.ovirt.engine.ui.uicommonweb.Linq.where ( source , new org.ovirt.engine.ui.uicommonweb.Linq.IPredicate < org.ovirt.engine.core.common.businessentities.Provider > ( ) { @ java.lang.Override public boolean match ( org.ovirt.engine.core.common.businessentities.Provider provider ) { return provider.getType ( ) . getProvidedTypes ( ) . contains ( type ) ; } } ) ; }
Source:
void testIsManagementNetworkNameInGivenClusterCommon ( java.lang.String managementNetworkName , boolean expected ) { if ( managementNetworkName != null ) { org.mockito.Mockito.when ( mockNetwork.getName ( ) ) . thenReturn ( managementNetworkName ) ; org.mockito.Mockito.when ( mockNetworkDao.getManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_CLUSTER_ID ) ) . thenReturn ( mockNetwork ) ; } final boolean actual = underTest.isManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_NETWORK_NAME , org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_CLUSTER_ID ) ; org.mockito.Mockito.verify ( mockNetworkDao ) . getManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_CLUSTER_ID ) ; org.junit.Assert.assertEquals ( expected , actual ) ; }

Target:
private void testIsManagementNetworkNameInGivenClusterCommon ( java.lang.String networkName , org.ovirt.engine.core.compat.Guid clusterId , boolean expected ) { org.mockito.Mockito.when ( mockNetworkDao.getManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_CLUSTER_ID ) ) . thenReturn ( mockNetwork ) ; org.mockito.Mockito.when ( mockNetwork.getName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtilImplTest.TEST_NETWORK_NAME ) ; final boolean actual = underTest.isManagementNetwork ( networkName , clusterId ) ; org.mockito.Mockito.verify ( mockNetworkDao ) . getManagementNetwork ( clusterId ) ; org.junit.Assert.assertEquals ( expected , actual ) ; }
Source:
public void setEntity ( java.lang.Boolean value ) { super . setEntity ( value ) ; if ( getIsToSync ( ) . getIsChangable ( ) ) { if ( ! value ) { revertChanges ( ) ; } setBootProtocolsAvailable ( value ) ; updateQosChangeability ( ) ; getCustomPropertiesModel ( ) . setIsChangable ( value ) ; } }

Target:
public void setEntity ( java.lang.Boolean value ) { super . setEntity ( value ) ; if ( getIsToSync ( ) . getIsChangable ( ) ) { if ( ! value ) { revertChanges ( ) ; } setBootProtocolsAvailable ( value ) ; updateQosChangeability ( ) ; getCustomPropertiesModel ( ) . setIsChangeable ( value ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterSnapshotInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.info" ) . withOptionalParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionList" ) . withParameter ( "volName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolName" , slaveVolumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( id ) ; java.lang.String host = org.ovirt.engine.api.common.util.QueryHelper.getMatrixConstraint ( uriInfo , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionResource.HOST ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( host != null ) { hostId = getHostId ( host ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( id ) ; java.lang.String host = org.ovirt.engine.api.common.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionResource.HOST ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( host != null ) { hostId = getHostId ( host ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }
Source:
java.lang.String getFormattedNote ( ) { java.lang.String formattedNote = constants.empty ( ) ; for ( int i = 0 ; i < ( notes.size ( ) ) ; i ++ ) { java.lang.String note = notes.get ( i ) ; formattedNote += constants.lineBreak ( ) ; formattedNote += constants.htmlTab ( ) ; formattedNote += note ; } return formattedNote ; }

Target:
java.lang.String getFormattedNote ( ) { java.lang.StringBuilder formattedNote = new java.lang.StringBuilder ( constants.empty ( ) ) ; for ( int i = 0 ; i < ( notes.size ( ) ) ; i ++ ) { java.lang.String note = notes.get ( i ) ; formattedNote.append ( constants.lineBreak ( ) ) . append ( constants.htmlTab ( ) ) . append ( note ) ; } return formattedNote.toString ( ) ; }
Source:
private void registerListeners ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager.ManagedFieldsManager managedFieldsManager = new org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager.ManagedFieldsManager ( ) ; model.getInstanceTypes ( ) . getSelectedItemChangedEvent ( ) . addListener ( managedFieldsManager ) ; model.getTemplateWithVersion ( ) . getSelectedItemChangedEvent ( ) . addListener ( managedFieldsManager ) ; }

Target:
private void registerListeners ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager.ManagedFieldsManager managedFieldsManager = new org.ovirt.engine.ui.uicommonweb.models.vms.instancetypes.InstanceTypeManager.ManagedFieldsManager ( ) ; model.getInstanceTypes ( ) . getSelectedItemChangedEvent ( ) . addListener ( managedFieldsManager ) ; model.getTemplateWithVersion ( ) . getSelectedItemChangedEvent ( ) . addListener ( managedFieldsManager ) ; model.getOSType ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { } } ) ; }
Source:
private void setTestResultValue ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { java.lang.String errorMessage = org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.EMPTY_ERROR_MESSAGE ; if ( ( result == null ) || ( ! ( result.getSucceeded ( ) ) ) ) { if ( result != null ) { errorMessage = org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . translateVdcFault ( result.getFault ( ) ) ; } else { errorMessage = org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . testFailedUnknownErrorMsg ( ) ; } } getTestResult ( ) . setEntity ( errorMessage ) ; }

Target:
private void setTestResultValue ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { java.lang.String errorMessage = org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.EMPTY_ERROR_MESSAGE ; if ( ( result == null ) || ( ! ( result.getSucceeded ( ) ) ) ) { if ( result != null ) { errorMessage = org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . translateEngineFault ( result.getFault ( ) ) ; } else { errorMessage = org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . testFailedUnknownErrorMsg ( ) ; } } getTestResult ( ) . setEntity ( errorMessage ) ; }
Source:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.api.restapi.resource.HostStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.HostStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Host , org.ovirt.engine.core.common.businessentities.VDS > ( entityType , guid , query ) ) ; }

Target:
public javax.ws.rs.core.Response enrollCertificate ( org.ovirt.engine.api.model.Action action ) { return doAction ( VdcActionType.HostEnrollCertificate , new org.ovirt.engine.core.common.action.VdsActionParameters ( guid ) , action ) ; }
Source:
private void updateReportsAvailability ( ) { if ( org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . isReportsEnabled ( ) ) { java.util.List < org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < org.ovirt.engine.core.common.businessentities.VDS > > resourceSubActions = org.ovirt.engine.ui.webadmin.uicommon.ReportActionsHelper.getInstance ( ) . getResourceSubActions ( "Host" , getModelProvider ( ) ) ; if ( ( resourceSubActions != null ) && ( ( resourceSubActions.size ( ) ) > 0 ) ) { getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminMenuBarButtonDefinition < org.ovirt.engine.core.common.businessentities.VDS > ( constants.showReportHost ( ) , resourceSubActions ) ) ; } } }

Target:
private void updateReportsAvailability ( ) { if ( org.ovirt.engine.ui.uicommonweb.ReportInit.getInstance ( ) . isReportsEnabled ( ) ) { java.util.List < org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < org.ovirt.engine.core.common.businessentities.VDS > > resourceSubActions = org.ovirt.engine.ui.webadmin.uicommon.ReportActionsHelper.getInstance ( ) . getResourceSubActions ( "Host" , getModelProvider ( ) ) ; if ( ( resourceSubActions != null ) && ( ( resourceSubActions.size ( ) ) > 0 ) ) { getTable ( ) . addActionButton ( new org.ovirt.engine.ui.webadmin.widget.action.WebAdminMenuBarButtonDefinition < org.ovirt.engine.core.common.businessentities.VDS > ( org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabHostView.constants.showReportHost ( ) , resourceSubActions ) ) ; } } }
Source:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void testIsNetworkInSyncWhenIpv4StaticBootProtocolAddressEqual ( ) throws java.lang.Exception { initIpv4ConfigurationBootProtocolAddress ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL , true ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4BootProtocolDifferent ( ) { initIpv4ConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
private boolean isMoveDiskInDbSucceded ( org.ovirt.engine.core.compat.Guid targetStorageDomainId ) { org.ovirt.engine.core.compat.Guid destinationImageId = org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getParameters ( ) . getDestinationImageId ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getDiskImageDao ( ) . get ( destinationImageId ) ; return ( diskImage != null ) && ( targetStorageDomainId.equals ( diskImage.getStorageIds ( ) . get ( 0 ) ) ) ; }

Target:
private boolean isMoveDiskInDbSucceded ( org.ovirt.engine.core.compat.Guid targetStorageDomainId ) { org.ovirt.engine.core.compat.Guid destinationImageId = org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getParameters ( ) . getDestinationImageId ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = diskImageDao.get ( destinationImageId ) ; return ( diskImage != null ) && ( targetStorageDomainId.equals ( diskImage.getStorageIds ( ) . get ( 0 ) ) ) ; }
Source:
public void testNetworksOnNicMatchMtu ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = java.util.Collections.singletonList ( createNetwork ( 1 , false , "netA" ) ) ; java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > networksOnNics = java.util.Collections.singletonMap ( "nicName" , networks ) ; org.ovirt.engine.core.bll.network.host.NetworkMtuValidator networkMtuValidator = new org.ovirt.engine.core.bll.network.host.NetworkMtuValidator ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networks ) ) ; org.junit.Assert.assertThat ( networkMtuValidator.validateMtu ( networksOnNics ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworksOnNicMatchMtu ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = java.util.Collections.singletonList ( createNetwork ( 1 , false , "netA" ) ) ; java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > networksOnNics = java.util.Collections.singletonMap ( "nicName" , networks ) ; org.ovirt.engine.core.bll.network.host.NetworkMtuValidator networkMtuValidator = new org.ovirt.engine.core.bll.network.host.NetworkMtuValidator ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networks ) ) ; org.hamcrest.MatcherAssert.assertThat ( networkMtuValidator.validateMtu ( networksOnNics ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
public void testGetAllWithPermissionsPrivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.StorageDomainDaoTest.NUMBER_OF_STORAGE_DOMAINS_FOR_PRIVELEGED_USER , result.size ( ) ) ; org.junit.Assert.assertEquals ( result.iterator ( ) . next ( ) , existingDomain ) ; }

Target:
public void testGetAllWithPermissionsPrivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.StorageDomainDaoTest.NUMBER_OF_STORAGE_DOMAINS_FOR_PRIVELEGED_USER , result.size ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = result.get ( 0 ) ; org.junit.Assert.assertEquals ( existingDomain , domain ) ; org.junit.Assert.assertEquals ( "Wrong committed disk size" , 8 , domain.getCommittedDiskSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong actual disk size" , 4 , domain.getActualImagesSize ( ) ) ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.log.infoFormat ( "-- SPMGetAllTasksInfoVDSCommand::ExecuteIrsBrokerCommand: Attempting on storage pool '{0}'" , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMGetAllTasksInfo , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ) . getReturnValue ( ) ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.log.infoFormat ( "-- executeIrsBrokerCommand: Attempting on storage pool '{0}'" , org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ; setReturnValue ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.HSMGetAllTasksInfo , new org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ( org.ovirt.engine.core.vdsbroker.irsbroker.SPMGetAllTasksInfoVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) ) ) . getReturnValue ( ) ) ; }
Source:
public void OnSuccess ( org.ovirt.engine.ui.uicompat.FrontendQueryAsyncResult result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > permissions = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ) ( result.getReturnValue ( ) . getReturnValue ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.permissions permission : permissions ) { if ( ( ( permission.getObjectType ( ) ) == ( org.ovirt.engine.core.common.VdcObjectType.System ) ) && ( ( permission.getRoleType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) ) { hasAdminSystemPermission = true ; break ; } } UpdateConfigureLocalStorageCommandAvailability1 ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel ) ( ev.getContext ( ) ) ) ; model.StopProgress ( ) ; Cancel ( ) ; }