auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean validateSuffix ( java.lang.String suffix , org.ovirt.engine.ui.uicommonweb.models.EntityModel entityModel ) { for ( java.lang.Object object : objectsInSetupMap.values ( ) ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( object ) ) ; if ( ! ( validateName ( ( ( vm.getvm_name ( ) ) + suffix ) , vm.getos ( ) , entityModel ) ) ) { return false ; } } return true ; }

Target:
protected boolean validateSuffix ( java.lang.String suffix , org.ovirt.engine.ui.uicommonweb.models.EntityModel entityModel ) { for ( java.lang.Object object : objectsInSetupMap.values ( ) ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( object ) ) ; if ( ! ( validateName ( ( ( vm.getvm_name ( ) ) + suffix ) , vm , entityModel ) ) ) { return false ; } } return true ; }
Source:
private void addPermissionOnNetwork ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.bll.PredefinedRoles role ) { org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; perms.setad_element_id ( userId ) ; perms.setObjectType ( VdcObjectType.Network ) ; perms.setObjectId ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getParameters ( ) . getNetwork ( ) . getId ( ) ) ; perms.setrole_id ( role.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }

Target:
private void addPermissionOnNetwork ( org.ovirt.engine.core.compat.Guid userId , org.ovirt.engine.core.bll.PredefinedRoles role ) { org.ovirt.engine.core.common.businessentities.permissions perms = new org.ovirt.engine.core.common.businessentities.permissions ( ) ; perms.setad_element_id ( userId ) ; perms.setObjectType ( VdcObjectType.Network ) ; perms.setObjectId ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) ) ; perms.setrole_id ( role.getId ( ) ) ; org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.addPermission ( perms ) ; }
Source:
private void doTestBadAddNetwork ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpVDSGroupExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AttachNetworkToVdsGroup , org.ovirt.engine.core.common.action.AttachNetworkToVdsGroupParameter.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , canDo , success ) ) ; org.ovirt.engine.api.model.Network model = getModel ( 0 ) ; try { ( ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResource ) ( collection ) ) . add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddNetwork ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpVDSGroupExpectations ( org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AttachNetworkToVdsGroup , org.ovirt.engine.core.common.action.AttachNetworkToVdsGroupParameter.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , canDo , success ) ) ; org.ovirt.engine.api.model.Network model = getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected void revertTasks ( ) { org.ovirt.engine.core.compat.Guid destImageId = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ; org.ovirt.engine.core.common.action.RemoveImageParameters p = new org.ovirt.engine.core.common.action.RemoveImageParameters ( destImageId ) ; p.setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , destImageId ) ) ; p.setParentParameters ( p ) ; p.setParentCommand ( VdcActionType.RemoveImage ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = checkAndPerformRollbackUsingCommand ( VdcActionType.RemoveImage , p ) ; if ( returnValue.getSucceeded ( ) ) { startPollingAsyncTasks ( returnValue.getInternalVdsmTaskIdList ( ) ) ; } }

Target:
protected void revertTasks ( ) { org.ovirt.engine.core.compat.Guid destImageId = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDestinationDiskImage ( ) . getImageId ( ) ; org.ovirt.engine.core.common.action.RemoveImageParameters p = new org.ovirt.engine.core.common.action.RemoveImageParameters ( destImageId ) ; p.setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , destImageId ) ) ; p.setParentParameters ( p ) ; p.setParentCommand ( VdcActionType.RemoveImage ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = checkAndPerformRollbackUsingCommand ( VdcActionType.RemoveImage , p , null ) ; if ( returnValue.getSucceeded ( ) ) { startPollingAsyncTasks ( returnValue.getInternalVdsmTaskIdList ( ) ) ; } }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.businessentities.ImageFileType.All } , setUpFiles ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetImagesList , org.ovirt.engine.core.common.queries.GetImagesListParameters.class , new java.lang.String [ ] { "StorageDomainId" , "ImageType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.businessentities.ImageFileType.All } , setUpFiles ( ) , failure ) ; control.replay ( ) ; }
Source:
private void setUpVlanQueryExpectations ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface hostNicModel ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > vlans = new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface vlan = new org.ovirt.engine.core.common.businessentities.VdsNetworkInterface ( ) ; vlan.setNetworkName ( "some network name" ) ; vlans.add ( vlan ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllChildVlanInterfaces , org.ovirt.engine.core.common.queries.GetAllChildVlanInterfacesQueryParameters.class , new java.lang.String [ ] { "VdsId" , "Interface" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID , hostNicModel } , vlans ) ; }

Target:
private void setUpVlanQueryExpectations ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface hostNicModel ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlans = new java.util.LinkedList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; vlan.setNetworkName ( "some network name" ) ; vlans.add ( vlan ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllChildVlanInterfaces , org.ovirt.engine.core.common.queries.GetAllChildVlanInterfacesQueryParameters.class , new java.lang.String [ ] { "VdsId" , "Interface" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID , hostNicModel } , vlans ) ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ! ( vds.getvds_group_id ( ) . equals ( getVm ( ) . getVdsGroupId ( ) ) ) ) || ( ( vds.getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { sb.append ( "is not in up status or belongs to the VM's cluster" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER ; } return null ; }

Target:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ! ( vds.getVdsGroupId ( ) . equals ( getVm ( ) . getVdsGroupId ( ) ) ) ) || ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { sb.append ( "is not in up status or belongs to the VM's cluster" ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER ; } return null ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Role > getAll ( ) { java.lang.Integer appMode = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ApplicationMode ) ; org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "app_mode" , appMode.intValue ( ) ) ; return getCallsHandler ( ) . executeReadList ( "GetAllFromRole" , org.ovirt.engine.core.dao.RoleDAODbFacadeImpl.RolesRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Role > getAll ( ) { java.lang.Integer appMode = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ApplicationMode ) ; org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "app_mode" , appMode ) ; return getCallsHandler ( ) . executeReadList ( "GetAllFromRole" , org.ovirt.engine.core.dao.RoleDAODbFacadeImpl.RolesRowMapper.instance , parameterSource ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getActionState ( ) ) { case EXECUTE : if ( ! ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getParameters ( ) . getTaskGroupSuccess ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_EXPORT_IMAGE_FINISHED_FAILURE ; } if ( ( ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getParameters ( ) . getExecutionIndex ( ) ) == 0 ) && ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getSucceeded ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_EXPORT_IMAGE ; } break ; case END_SUCCESS : return org.ovirt.engine.core.common.AuditLogType.USER_EXPORT_IMAGE_FINISHED_SUCCESS ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.USER_EXPORT_IMAGE_FINISHED_FAILURE ; } return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getActionState ( ) ) { case EXECUTE : return org.ovirt.engine.core.bll.ExportRepoImageCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_EXPORT_IMAGE : org.ovirt.engine.core.common.AuditLogType.USER_EXPORT_IMAGE_FINISHED_FAILURE ; case END_SUCCESS : return org.ovirt.engine.core.common.AuditLogType.USER_EXPORT_IMAGE_FINISHED_SUCCESS ; case END_FAILURE : return org.ovirt.engine.core.common.AuditLogType.USER_EXPORT_IMAGE_FINISHED_FAILURE ; } return org.ovirt.engine.core.common.AuditLogType.UNASSIGNED ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.TagsVmPoolMap other = ( ( org.ovirt.engine.core.common.businessentities.TagsVmPoolMap ) ( obj ) ) ; return ( java.util.Objects.equals ( id , other.id ) ) && ( java.util.Objects.equals ( created , other.created ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.TagsVmPoolMap ) ) { return false ; } org.ovirt.engine.core.common.businessentities.TagsVmPoolMap other = ( ( org.ovirt.engine.core.common.businessentities.TagsVmPoolMap ) ( obj ) ) ; return ( java.util.Objects.equals ( id , other.id ) ) && ( java.util.Objects.equals ( created , other.created ) ) ; }
Source:
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.VDSGroup > ( ) ; } final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; }

Target:
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.VDSGroup > ( ) ; } final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; }
Source:
protected void init ( ) { resource = new org.ovirt.engine.api.restapi.resource.BackendHostResource ( GUIDS [ 0 ] . toString ( ) , new org.ovirt.engine.api.restapi.resource.BackendHostsResource ( ) ) ; resource.setBackend ( backend ) ; resource.setMappingLocator ( mapperLocator ) ; resource.setValidatorLocator ( validatorLocator ) ; resource.setMessageBundle ( messageBundle ) ; resource.setHttpHeaders ( httpHeaders ) ; }

Target:
protected void init ( ) { resource = new org.ovirt.engine.api.restapi.resource.BackendHostResource ( GUIDS [ 0 ] . toString ( ) , new org.ovirt.engine.api.restapi.resource.BackendHostsResource ( ) ) ; resource.setBackend ( backend ) ; resource.setMappingLocator ( mapperLocator ) ; resource.setMessageBundle ( messageBundle ) ; resource.setHttpHeaders ( httpHeaders ) ; }
Source:
public void validateSpaceAndThreshold ( ) { org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( storageDomainValidator ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.junit.Assert.assertTrue ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.times ( org.ovirt.engine.core.bll.TOTAL_NUM_DOMAINS ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void validateSpaceAndThreshold ( ) { org.junit.Assert.assertTrue ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.times ( org.ovirt.engine.core.bll.TOTAL_NUM_DOMAINS ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }
Source:
public boolean isSpiceProxyDefined ( org.ovirt.engine.core.common.businessentities.VM vm ) { return ( ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.SpiceProxyDefault ) ) ) ) ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.getVdsGroupSpiceProxy ( ) ) ) ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.getVmPoolSpiceProxy ( ) ) ) ) ; }

Target:
public boolean isSpiceProxyDefined ( org.ovirt.engine.core.common.businessentities.VM vm ) { return ( ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.SpiceProxyDefault ) ) ) ) ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.getVdsGroupSpiceProxy ( ) ) ) ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.getVmPoolSpiceProxy ( ) ) ) ) ; }
Source:
public void testValidateEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotValidator ) . vmSnapshotDisksNotDuringMerge ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > parentSnapshots = mockDisksList ( 2 ) ; org.mockito.Mockito.doReturn ( parentSnapshots ) . when ( cmd ) . getSourceImages ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }

Target:
public void testValidateEnoughSpace ( ) { prepareForVmValidatorTests ( ) ; spySdValidator ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotValidator ) . vmSnapshotDisksNotDuringMerge ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > parentSnapshots = mockDisksList ( 2 ) ; org.mockito.Mockito.doReturn ( parentSnapshots ) . when ( cmd ) . getSourceImages ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
public static void setGatewayIfNecessary ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String gateway ) { final org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil managementNetworkUtil = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getManagementNetworkUtil ( ) ; if ( ( ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( host.getClusterCompatibilityVersion ( ) ) ) || ( managementNetworkUtil.isManagementNetwork ( iface.getNetworkName ( ) , host.getClusterId ( ) ) ) ) || ( iface.getName ( ) . equals ( host.getActiveNic ( ) ) ) ) { iface.setGateway ( gateway ) ; } }

Target:
public static void setGatewayIfNecessary ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.lang.String gateway ) { iface.setGateway ( gateway ) ; }
Source:
private void fastForwardDisksToActiveSnapshot ( ) { if ( ( getParameters ( ) . getDisks ( ) ) != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImagesToUpdate = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.imagesSubtract ( getDiskImagesForVm ( ) , getParameters ( ) . getDisks ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskImagesToUpdate ) { org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getImageDao ( ) . updateImageVmSnapshotId ( diskImage.getImageId ( ) , newActiveSnapshotId ) ; } } }

Target:
private void fastForwardDisksToActiveSnapshot ( ) { if ( ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getParameters ( ) . getDisks ( ) ) != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImagesToUpdate = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.imagesSubtract ( getDiskImagesForVm ( ) , org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getParameters ( ) . getDisks ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : diskImagesToUpdate ) { org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getImageDao ( ) . updateImageVmSnapshotId ( diskImage.getImageId ( ) , newActiveSnapshotId ) ; } } }
Source:
public void checkEmptyIdHost ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getid ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void checkEmptyIdHost ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; parameters.setVdsId ( Guid.Empty ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getId ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
protected void syncSearch ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getAllVmTemplates ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalTemplateListModel ) ( model ) ) . setItems ( ( ( java.util.Collection ) ( returnValue ) ) ) ; } } ) , getIsQueryFirstTime ( ) ) ; }

Target:
protected void syncSearch ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllVmTemplates ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { ( ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalTemplateListModel ) ( model ) ) . setItems ( ( ( java.util.Collection ) ( returnValue ) ) ) ; } } ) , getIsQueryFirstTime ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM getVmFromConfiguration ( ) { org.ovirt.engine.core.common.businessentities.VM result = null ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.GetVmConfigurationBySnapshotQueryParams ( snapshot.getId ( ) ) ) ; if ( queryReturnValue.getSucceeded ( ) ) { result = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( queryReturnValue.getReturnValue ( ) ) ) ; } return result ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM getVmFromConfiguration ( ) { org.ovirt.engine.core.common.businessentities.VM result = null ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshot.getId ( ) ) ) ; if ( queryReturnValue.getSucceeded ( ) ) { result = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( queryReturnValue.getReturnValue ( ) ) ) ; } return result ; }
Source:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "rollbackOnFailure" , isRollbackOnFailure ( ) ) . append ( "connectivityTimeout" , getConnectivityTimeout ( ) ) . append ( "hostNetworkQosSupported" , getHostNetworkQosSupported ( ) ) . append ( "networks" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getNetworks ( ) , "\t\t" ) ) . append ( "removedNetworks" , getRemovedNetworks ( ) ) . append ( "bonds" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getCreateOrUpdateBonds ( ) , "\t\t" ) ) . append ( "removedBonds" , getRemovedBonds ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "rollbackOnFailure" , isRollbackOnFailure ( ) ) . append ( "connectivityTimeout" , getConnectivityTimeout ( ) ) . append ( "networks" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getNetworks ( ) , "\t\t" ) ) . append ( "removedNetworks" , getRemovedNetworks ( ) ) . append ( "bonds" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getCreateOrUpdateBonds ( ) , "\t\t" ) ) . append ( "removedBonds" , getRemovedBonds ( ) ) ; }
Source:
public void setup ( ) { org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; initVm ( ) ; images = new java.util.ArrayList < > ( ) ; emulatedMachine = "pc" ; cpuId = "SandyBridge" ; underTest = new org.ovirt.engine.core.utils.ovf.HostedEngineOvfWriter ( vm , images , version , emulatedMachine , cpuId ) ; }

Target:
public void setup ( ) { org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; initVm ( ) ; images = new java.util.ArrayList < > ( ) ; emulatedMachine = "pc" ; cpuId = "SandyBridge" ; underTest = new org.ovirt.engine.core.utils.ovf.HostedEngineOvfWriter ( vm , images , version , emulatedMachine , cpuId , osRepository ) ; }
Source:
public static org.ovirt.engine.core.common.job.Step addTaskStep ( org.ovirt.engine.core.bll.job.ExecutionContext context , org.ovirt.engine.core.common.job.StepEnum stepName , java.lang.String description ) { if ( context == null ) { return null ; } org.ovirt.engine.core.common.job.Step step = null ; if ( context.isTasksMonitored ( ) ) { org.ovirt.engine.core.common.job.Step parentTaskStep = context.getParentTasksStep ( ) ; if ( parentTaskStep != null ) { step = org.ovirt.engine.core.bll.job.ExecutionHandler.addSubStep ( parentTaskStep , stepName , description ) ; } } return step ; }

Target:
public org.ovirt.engine.core.common.job.Step addTaskStep ( org.ovirt.engine.core.bll.job.ExecutionContext context , org.ovirt.engine.core.common.job.StepEnum stepName , java.lang.String description ) { if ( context == null ) { return null ; } org.ovirt.engine.core.common.job.Step step = null ; if ( context.isTasksMonitored ( ) ) { org.ovirt.engine.core.common.job.Step parentTaskStep = context.getParentTasksStep ( ) ; if ( parentTaskStep != null ) { step = addSubStep ( parentTaskStep , stepName , description ) ; } } return step ; }
Source:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.when ( hostedEngineHelperInstance.get ( ) ) . thenReturn ( hostedEngineHelper ) ; org.mockito.Mockito.when ( hostedEngineHelper.getStorageDomainId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.hostedengine.HostedEngineConfigFetcherTest.DOMAIN_ID ) ; org.mockito.Mockito.when ( hostedEngineHelper.getStoragePoolId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.hostedengine.HostedEngineConfigFetcherTest.POOL_ID ) ; org.mockito.Mockito.when ( hostedEngineHelper.getRunningHostId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.hostedengine.HostedEngineConfigFetcherTest.HOST_ID ) ; org.mockito.Mockito.reset ( configFetcher ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { org.mockito.Mockito.when ( hostedEngineHelperInstance.get ( ) ) . thenReturn ( hostedEngineHelper ) ; org.mockito.Mockito.when ( hostedEngineHelper.getStorageDomainId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.hostedengine.HostedEngineConfigFetcherTest.DOMAIN_ID ) ; org.mockito.Mockito.when ( hostedEngineHelper.getStoragePoolId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.hostedengine.HostedEngineConfigFetcherTest.POOL_ID ) ; org.mockito.Mockito.when ( hostedEngineHelper.getRunningHostId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.hostedengine.HostedEngineConfigFetcherTest.HOST_ID ) ; }
Source:
private static void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.errors.VdcFault fault ) { if ( ( org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) ) != null ) { java.lang.String translatedMessage = org.ovirt.engine.ui.frontend.Frontend.translateVdcFault ( fault ) ; fault.setMessage ( translatedMessage ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runActionExecutionFailed ( actionType , fault ) ; } }

Target:
private void runActionExecutionFailed ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final org.ovirt.engine.core.common.errors.VdcFault fault ) { if ( ( getEventsHandler ( ) ) != null ) { java.lang.String translatedMessage = translateVdcFault ( fault ) ; fault.setMessage ( translatedMessage ) ; getEventsHandler ( ) . runActionExecutionFailed ( actionType , fault ) ; } }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmId ( ) ) != null ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return null ; }
Source:
public org.springframework.jdbc.core.namedparam.MapSqlParameterSource map ( org.ovirt.engine.core.common.businessentities.VmDevice entity ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource paramValue = new org.springframework.jdbc.core.namedparam.MapSqlParameterSource ( ) . addValue ( "device_id" , entity.getDeviceId ( ) ) . addValue ( "vm_id" , entity.getVmId ( ) ) . addValue ( "boot_order" , entity.getBootOrder ( ) ) ; return paramValue ; }

Target:
public org.springframework.jdbc.core.namedparam.MapSqlParameterSource map ( org.ovirt.engine.core.common.businessentities.VmDevice entity ) { return new org.springframework.jdbc.core.namedparam.MapSqlParameterSource ( ) . addValue ( "device_id" , entity.getDeviceId ( ) ) . addValue ( "vm_id" , entity.getVmId ( ) ) . addValue ( "boot_order" , entity.getBootOrder ( ) ) ; }
Source:
protected void onSelectedItemChanged ( ) { super . onSelectedItemChanged ( ) ; updateActionAvailability ( ) ; if ( ( getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = ( ( org.ovirt.engine.core.common.businessentities.Snapshot ) ( getSelectedItem ( ) ) ) ; updateVmConfigurationBySnapshot ( snapshot.getId ( ) ) ; } }

Target:
protected void onSelectedItemChanged ( ) { super . onSelectedItemChanged ( ) ; updateActionAvailability ( ) ; }
Source:
public void testEmpty ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AdGroupConditionFieldAutoCompleter ( ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "" ) ) ; java.lang.System.out.println ( comps ) ; org.junit.Assert.assertTrue ( "name" , comps.contains ( "name" ) ) ; org.junit.Assert.assertFalse ( "False" , comps.contains ( "False" ) ) ; }

Target:
public void testEmpty ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AdGroupConditionFieldAutoCompleter ( ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "" ) ) ; org.junit.Assert.assertTrue ( "name" , comps.contains ( "name" ) ) ; org.junit.Assert.assertFalse ( "False" , comps.contains ( "False" ) ) ; }
Source:
public void onSuccess ( java.lang.Object nothing , java.lang.Object returnValue ) { org.ovirt.engine.core.common.businessentities.ArchitectureType architecture = ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( returnValue ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > filteredClusters = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : clusters ) { if ( ( ( architecture == ( org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ) ) || ( ( cluster.getArchitecture ( ) ) == ( org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ) ) ) || ( ( cluster.getArchitecture ( ) ) == architecture ) ) { filteredClusters.add ( cluster ) ; } } updateClusterList ( this , filteredClusters ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.businessentities.ArchitectureType architecture ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > filteredClusters = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : clusters ) { if ( ( ( architecture == ( org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ) ) || ( ( cluster.getArchitecture ( ) ) == ( org.ovirt.engine.core.common.businessentities.ArchitectureType.undefined ) ) ) || ( ( cluster.getArchitecture ( ) ) == architecture ) ) { filteredClusters.add ( cluster ) ; } } updateClusterList ( this , filteredClusters ) ; }
Source:
public void testKDCLocator ( ) { org.ovirt.engine.core.utils.kerberos.KDCLocator locator = new org.ovirt.engine.core.utils.kerberos.KDCLocator ( ) ; java.lang.String [ ] recordsList = new java.lang.String [ ] { "0 100 88 example.com." , "0 100 88 comp1.example.com" , "1 100 88 comp1.example.com." } ; org.ovirt.engine.core.utils.dns.DnsSRVLocator.DnsSRVResult result = locator.getKdc ( recordsList , "example.com" ) ; int numOfEntries = result.getNumOfValidAddresses ( ) ; junit.framework.Assert.assertEquals ( numOfEntries , 3 ) ; java.lang.String [ ] entries = result.getAddresses ( ) ; for ( java.lang.String entry : entries ) { java.lang.System.out.println ( entry ) ; } }

Target:
public void testKDCLocator ( ) { org.ovirt.engine.core.utils.kerberos.KDCLocator locator = new org.ovirt.engine.core.utils.kerberos.KDCLocator ( ) ; java.lang.String [ ] recordsList = new java.lang.String [ ] { "0 100 88 example.com." , "0 100 88 comp1.example.com" , "1 100 88 comp1.example.com." } ; org.ovirt.engine.core.utils.dns.DnsSRVLocator.DnsSRVResult result = locator.getKdc ( recordsList , "example.com" ) ; int numOfEntries = result.getNumOfValidAddresses ( ) ; junit.framework.Assert.assertEquals ( numOfEntries , 3 ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.NameServer > getExpectedNameServers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NameServer > nameServersOfNetworkAttachment = getNameServers ( networkAttachment.getDnsResolverConfiguration ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NameServer > nameServersOfNetwork = getNameServers ( network.getDnsResolverConfiguration ( ) ) ; return nameServersOfNetworkAttachment != null ? nameServersOfNetworkAttachment : nameServersOfNetwork ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.NameServer > getExpectedNameServers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NameServer > nameServersOfNetworkAttachment = getNameServers ( networkAttachment.getDnsResolverConfiguration ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NameServer > nameServersOfNetwork = getNameServers ( network.getDnsResolverConfiguration ( ) ) ; return nameServersOfNetworkAttachment.isEmpty ( ) ? nameServersOfNetwork : nameServersOfNetworkAttachment ; }
Source:
private org.ovirt.engine.core.searchbackend.PagingType getPagingType ( ) { java.lang.String val = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.DBPagingType ) ; org.ovirt.engine.core.searchbackend.PagingType type = null ; try { type = org.ovirt.engine.core.searchbackend.PagingType.valueOf ( val ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.searchbackend.SyntaxChecker.log.error ( ( "Unknown paging type " + val ) ) ; } return type ; }

Target:
private org.ovirt.engine.core.searchbackend.PagingType getPagingType ( ) { java.lang.String val = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.DBPagingType ) ; org.ovirt.engine.core.searchbackend.PagingType type = null ; try { type = org.ovirt.engine.core.searchbackend.PagingType.valueOf ( val ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.searchbackend.SyntaxChecker.log.error ( ( "Unknown paging type " + val ) ) ; } return type ; }
Source:
public java.lang.String load ( java.io.File file ) { try ( java.io.FileInputStream inputStream = new java.io.FileInputStream ( file ) ) { java.util.Properties props = new java.util.Properties ( ) ; props.load ( inputStream ) ; return loadImpl ( props , file ) ; } catch ( java.io.IOException exception ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( java.lang.String.format ( "Can't load object configuration file '%1$s'" , file.getAbsolutePath ( ) ) ) ; } }

Target:
public java.lang.String load ( java.io.File file ) { try ( java.io.FileInputStream inputStream = new java.io.FileInputStream ( file ) ) { java.util.Properties props = new java.util.Properties ( ) ; props.load ( inputStream ) ; return loadImpl ( props , file ) ; } catch ( java.io.IOException exception ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( java.lang.String.format ( "Can't load object configuration file '%1$s'" , file.getAbsolutePath ( ) ) , exception ) ; } }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain2 ) { java.lang.Long numOfVmDisksInStorageDomain = numOfVmDisksInStorageDomains.getOrDefault ( storageDomain.getId ( ) , 0L ) ; java.lang.Long numOfVmDisksInStorageDomain2 = numOfVmDisksInStorageDomains.getOrDefault ( storageDomain2.getId ( ) , 0L ) ; return numOfVmDisksInStorageDomain.compareTo ( numOfVmDisksInStorageDomain2 ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain2 ) { java.lang.Long numOfVmDisksInStorageDomain = numOfVmDisksInStorageDomains.getOrDefault ( storageDomain.getId ( ) , 0L ) ; java.lang.Long numOfVmDisksInStorageDomain2 = numOfVmDisksInStorageDomains.getOrDefault ( storageDomain2.getId ( ) , 0L ) ; return ( - 1 ) * ( numOfVmDisksInStorageDomain.compareTo ( numOfVmDisksInStorageDomain2 ) ) ; }
Source:
public void testDoGet_ExtraAttributes_WithoutUserInfoObject ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.doReturn ( mockApplicationModeObject ) . when ( testServlet ) . getApplicationModeObject ( org.mockito.ArgumentMatchers.nullable ( java.lang.Integer.class ) ) ; org.mockito.Mockito.doReturn ( mockPluginDefinitionsArray ) . when ( testServlet ) . getPluginDefinitionsArray ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginData.class ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_APPLICATION_MODE , mockApplicationModeObject ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_PLUGIN_DEFS , mockPluginDefinitionsArray ) ; }

Target:
public void testDoGet_ExtraAttributes_WithoutUserInfoObject ( ) throws java.io.IOException , javax.servlet.ServletException { org.mockito.Mockito.doReturn ( mockApplicationModeObject ) . when ( testServlet ) . getApplicationModeObject ( org.mockito.ArgumentMatchers.nullable ( java.lang.Integer.class ) ) ; org.mockito.Mockito.doReturn ( mockPluginDefinitionsArray ) . when ( testServlet ) . getPluginDefinitionsArray ( org.mockito.ArgumentMatchers.anyListOf ( org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginData.class ) ) ; testServlet.doGet ( mockRequest , mockResponse ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_APPLICATION_MODE , mockApplicationModeObject ) ; org.mockito.Mockito.verify ( mockRequest ) . setAttribute ( WebAdminHostPageServlet.ATTR_PLUGIN_DEFS , mockPluginDefinitionsArray ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.EditProviderModel.CMD_APPROVE ) ) { cancel ( ) ; actualSave ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.EditProviderModel.CMD_CANCEL ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.ui.uicommonweb.models.providers.EditProviderModel.CMD_APPROVE.equals ( command.getName ( ) ) ) { cancel ( ) ; actualSave ( ) ; } else if ( org.ovirt.engine.ui.uicommonweb.models.providers.EditProviderModel.CMD_CANCEL.equals ( command.getName ( ) ) ) { cancel ( ) ; } }
Source:
private void setCorrelationId ( org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { java.util.List < java.lang.String > correlationIds = httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.BackendResource.CORRELATION_ID ) ; if ( ( correlationIds != null ) && ( ( correlationIds.size ( ) ) > 0 ) ) { params.setCorrelationId ( correlationIds.get ( 0 ) ) ; } }

Target:
private void setCorrelationId ( org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { if ( ( httpHeaders ) == null ) { return ; } java.util.List < java.lang.String > correlationIds = httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.BackendResource.CORRELATION_ID ) ; if ( ( correlationIds != null ) && ( ( correlationIds.size ( ) ) > 0 ) ) { params.setCorrelationId ( correlationIds.get ( 0 ) ) ; } }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > diskList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; diskList.addAll ( disks ) ; java.util.Collections.sort ( diskList , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( diskList ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > diskList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; diskList.addAll ( disks ) ; java.util.Collections.sort ( diskList , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( diskList ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregisteredDisks = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( unregisteredDisks , new org.ovirt.engine.core.common.businessentities.comparators.UnregisteredDiskByDiskAliasComparator ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > diskItems = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk unregisteredDisk : unregisteredDisks ) { diskItems.add ( unregisteredDisk.getDiskImage ( ) ) ; } setItems ( diskItems ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregisteredDisks = returnValue.getReturnValue ( ) ; java.util.Collections.sort ( unregisteredDisks , new org.ovirt.engine.core.common.businessentities.comparators.UnregisteredDiskByDiskAliasComparator ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > diskItems = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk unregisteredDisk : unregisteredDisks ) { diskItems.add ( unregisteredDisk.getDiskImage ( ) ) ; } setItems ( diskItems ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < java.lang.String > domains = org.ovirt.engine.core.bll.adbroker.LdapBrokerUtils.getDomainsList ( org.ovirt.engine.core.bll.GetDomainListQuery.getParameters ( ) . getFilterInternalDomain ( ) ) ; java.lang.String internalDomainName = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.AdminDomain ) ; java.util.Collections.sort ( domains , new org.ovirt.engine.core.bll.LoginDomainComparator ( internalDomainName ) ) ; org.ovirt.engine.core.bll.GetDomainListQuery.getQueryReturnValue ( ) . setReturnValue ( domains ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < java.lang.String > domains = org.ovirt.engine.core.bll.adbroker.LdapBrokerUtils.getDomainsList ( org.ovirt.engine.core.bll.GetDomainListQuery.getParameters ( ) . getFilterInternalDomain ( ) ) ; java.lang.String internalDomainName = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.AdminDomain ) ; java.util.Collections.sort ( domains , new org.ovirt.engine.core.bll.LoginDomainComparator ( internalDomainName ) ) ; org.ovirt.engine.core.bll.GetDomainListQuery.getQueryReturnValue ( ) . setReturnValue ( domains ) ; }