auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepConfigReset ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey , java.lang.String userName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepConfigReset" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withParameter ( "optionName" , configKey ) . withOptionalParameter ( "remoteUserName" , userName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterVolumeGeoRepConfigReset ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey , java.lang.String userName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepConfigReset" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withParameter ( "optionName" , configKey ) . withOptionalParameter ( "remoteUserName" , userName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.ServerCpu getVdsGroupServerCpu ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel model , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup ) { org.ovirt.engine.core.common.businessentities.ServerCpu retVal = null ; for ( org.ovirt.engine.core.common.businessentities.ServerCpu cpu : model.getCPU ( ) . getItems ( ) ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( cpu.getCpuName ( ) , vdsGroup.getcpu_name ( ) ) ) { retVal = cpu ; break ; } } return retVal ; }

Target:
private org.ovirt.engine.core.common.businessentities.ServerCpu getVdsGroupServerCpu ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel model , org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup ) { org.ovirt.engine.core.common.businessentities.ServerCpu retVal = null ; for ( org.ovirt.engine.core.common.businessentities.ServerCpu cpu : model.getCPU ( ) . getItems ( ) ) { if ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( cpu.getCpuName ( ) , vdsGroup.getcpu_name ( ) ) ) { retVal = cpu ; break ; } } return retVal ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeProfileInfoReturnForXmlRpc glusterVolumeProfileInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeProfileInfo ( volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeProfileInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeProfileInfoReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeProfileInfoReturnForXmlRpc glusterVolumeProfileInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName , boolean nfs ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeProfileInfo ( volumeName , nfs ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeProfileInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeProfileInfoReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = ( ( java.lang.String ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; } else { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( model ) ) ; loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.Empty ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { if ( returnValue != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } else { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider._defaultConfigurationVersion = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GENERAL ; } org.ovirt.engine.ui.uicommonweb.models.LoginModel loginModel = ( ( org.ovirt.engine.ui.uicommonweb.models.LoginModel ) ( model ) ) ; loginModel.getLoggedInEvent ( ) . raise ( loginModel , EventArgs.EMPTY ) ; }
Source:
public void setRefreshRate ( int interval ) { if ( ( getRefreshRate ( ) ) == interval ) { return ; } reset ( ) ; org.ovirt.engine.ui.uicommonweb.models.GridTimer.logger.fine ( ( ( ( "GridTimer[" + ( name ) ) + "]: Refresh Rate set to: " ) + interval ) ) ; normalInterval = interval ; start ( ) ; }

Target:
public void setRefreshRate ( int interval ) { if ( ( getRefreshRate ( ) ) == interval ) { return ; } reset ( ) ; org.ovirt.engine.ui.uicommonweb.models.GridTimer.logger.fine ( ( ( ( "GridTimer[" + ( name ) ) + "]: Refresh Rate set to: " ) + interval ) ) ; normalInterval = interval ; com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( this , getRefreshRate ( ) ) ; }
Source:
protected void updateQuota ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { if ( isQuotaValidationNeeded ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) ; if ( ! ( java.util.Objects.equals ( oldDisk.getQuotaId ( ) , diskImage.getQuotaId ( ) ) ) ) { org.ovirt.engine.core.bll.UpdateVmDiskCommand.getImageStorageDomainMapDao ( ) . updateQuotaForImageAndSnapshots ( diskImage.getId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getQuotaId ( ) ) ; } } }

Target:
protected void updateDiskProfile ( ) { if ( isDiskImage ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) ; org.ovirt.engine.core.common.businessentities.DiskImage newDisk = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getNewDisk ( ) ) ) ; if ( ! ( java.util.Objects.equals ( oldDisk.getDiskProfileId ( ) , newDisk.getDiskProfileId ( ) ) ) ) { org.ovirt.engine.core.bll.UpdateVmDiskCommand.getImageStorageDomainMapDao ( ) . updateDiskProfileByImageGroupIdAndStorageDomainId ( newDisk.getId ( ) , newDisk.getStorageIds ( ) . get ( 0 ) , newDisk.getDiskProfileId ( ) ) ; } } }
Source:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DbUser > getUsers ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DbUser > users = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DbUser > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { users.add ( getUserByIdx ( i ) ) ; } return users ; }

Target:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.aaa.DbUser > getUsers ( ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.aaa.DbUser > users = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.aaa.DbUser > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { users.add ( getUserByIdx ( i ) ) ; } return users ; }
Source:
public void getEngineSshPublicKey ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetEngineSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
private void calculateNetworkImplementationDetailsAndAssertSync ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , boolean expectSync , java.lang.String networkName , boolean vmNet , int mtu , int vlanId , org.ovirt.engine.core.common.businessentities.network.NetworkQoS qos ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( networkName , vmNet , mtu , vlanId ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails = org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( network , qos , iface ) ; org.junit.Assert.assertNotNull ( "Network implementation details should be filled." , networkImplementationDetails ) ; org.junit.Assert.assertEquals ( ( ( "Network implementation details should be " + ( expectSync ? "in" : "out of" ) ) + " sync." ) , expectSync , networkImplementationDetails.isInSync ( ) ) ; }

Target:
private void calculateNetworkImplementationDetailsAndAssertSync ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , boolean expectSync , java.lang.String networkName , boolean vmNet , int mtu , int vlanId , org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( networkName , vmNet , mtu , vlanId ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails networkImplementationDetails = org.ovirt.engine.core.utils.NetworkUtils.calculateNetworkImplementationDetails ( network , qos , iface ) ; org.junit.Assert.assertNotNull ( "Network implementation details should be filled." , networkImplementationDetails ) ; org.junit.Assert.assertEquals ( ( ( "Network implementation details should be " + ( expectSync ? "in" : "out of" ) ) + " sync." ) , expectSync , networkImplementationDetails.isInSync ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.ui.uicommonweb.Linq.VmComparator ( ) ) ; setItems ( vms ) ; setIsEmpty ( ( ( vms.size ( ) ) == 0 ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( vms , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator ( ) ) ; setItems ( vms ) ; setIsEmpty ( ( ( vms.size ( ) ) == 0 ) ) ; }
Source:
private void addBondToUpdateList ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { for ( java.util.Iterator < org.ovirt.engine.core.common.businessentities.network.Bond > iter = hostSetupNetworksParametersData.newOrModifiedBonds.iterator ( ) ; iter.hasNext ( ) ; ) { org.ovirt.engine.core.common.businessentities.network.Bond oldModifiedBond = iter.next ( ) ; if ( oldModifiedBond.getName ( ) . equals ( bond.getName ( ) ) ) { iter.remove ( ) ; break ; } } hostSetupNetworksParametersData.newOrModifiedBonds.add ( bond ) ; }

Target:
private void onBondEditUpdateParams ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { for ( java.util.Iterator < org.ovirt.engine.core.common.businessentities.network.Bond > iter = hostSetupNetworksParametersData.newOrModifiedBonds.iterator ( ) ; iter.hasNext ( ) ; ) { org.ovirt.engine.core.common.businessentities.network.Bond oldModifiedBond = iter.next ( ) ; if ( oldModifiedBond.getName ( ) . equals ( bond.getName ( ) ) ) { iter.remove ( ) ; break ; } } hostSetupNetworksParametersData.newOrModifiedBonds.add ( bond ) ; }
Source:
private boolean checkExceedingMaxBlockDiskSize ( ) { if ( isExceedMaxBlockDiskSize ( ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_MAX_SIZE_EXCEEDED ) ; org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$max_disk_size %1$s" , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxBlockDiskSize ) ) ) ; return false ; } return true ; }

Target:
private boolean checkExceedingMaxBlockDiskSize ( ) { if ( isExceedMaxBlockDiskSize ( ) ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_DISK_MAX_SIZE_EXCEEDED ) ; org.ovirt.engine.core.bll.AddDiskCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$max_disk_size %1$s" , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.MaxBlockDiskSize ) ) ) ; return false ; } return true ; }
Source:
public java.lang.StringBuilder getTagNameAndChildrenNames ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "'" ) . append ( gettag_name ( ) ) . append ( "'" ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : _children ) { builder.append ( ( "," + ( tag.getTagNameAndChildrenNames ( ) ) ) ) ; } return builder ; }

Target:
public java.lang.StringBuilder getTagNameAndChildrenNames ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "'" ) . append ( getTagName ( ) ) . append ( "'" ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tag : _children ) { builder.append ( ( "," + ( tag.getTagNameAndChildrenNames ( ) ) ) ) ; } return builder ; }
Source:
public org.ovirt.engine.core.common.businessentities.vds_spm_id_map mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.vds_spm_id_map entity = new org.ovirt.engine.core.common.businessentities.vds_spm_id_map ( ) ; entity.setstorage_pool_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "storage_pool_id" ) ) ) ; entity.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "vds_id" ) ) ) ; entity.setvds_spm_id ( rs.getInt ( "vds_spm_id" ) ) ; return entity ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.vds_spm_id_map > getAll ( org.ovirt.engine.core.compat.Guid storagePoolId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "storage_pool_id" , storagePoolId ) ; return getCallsHandler ( ) . executeReadList ( "Getvds_spm_id_mapBystorage_pool_id" , org.ovirt.engine.core.dao.VdsSpmIdMapDAODbFacadeImpl.VdsSpmIdMapRowMapper.instance , parameterSource ) ; }
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.RunQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.api.model.VM getEntity ( int index ) { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; return org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.setUpEntityExpectations ( vm , vm.getStatisticsData ( ) , index ) ; }

Target:
protected void verifyModelOnNewCluster ( org.ovirt.engine.api.model.Vm model , int index ) { assertNotNull ( model.getCluster ( ) . getId ( ) ) ; assertEquals ( GUIDS [ 1 ] . toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyModel ( model , index ) ; }
Source:
private java.lang.String getManagementUser ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { java.lang.String managementUser = "" ; if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Primary ) ) { managementUser = _vds.getpm_user ( ) ; } else if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Secondary ) ) { managementUser = _vds.getPmSecondaryuser ( ) ; } return managementUser ; }

Target:
private java.lang.String getManagementUser ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { java.lang.String managementUser = "" ; if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Primary ) ) { managementUser = _vds.getPmUser ( ) ; } else if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Secondary ) ) { managementUser = _vds.getPmSecondaryUser ( ) ; } return managementUser ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ! ( sameEntity ( listModel.getSelectedItem ( ) , model ) ) ) { getView ( ) . setNotSelected ( model.IsVmUp ( ) ) ; } else { getView ( ) . setSelected ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ! ( sameEntity ( listModel.getSelectedItem ( ) , model ) ) ) { getView ( ) . setNotSelected ( model.isVmUp ( ) ) ; } else { getView ( ) . setSelected ( ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.CommandEntity buildGetCommandEntity ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.compat.Guid parentCommandId , org.ovirt.engine.core.bll.tasks.SPMAsyncTask task ) { org.ovirt.engine.core.common.businessentities.CommandEntity entity = new org.ovirt.engine.core.common.businessentities.CommandEntity ( ) ; entity.setId ( commandId ) ; entity.setParentCommandId ( parentCommandId ) ; org.ovirt.engine.core.bll.tasks.CommandEntityUtils.setParameters ( entity , task.getParameters ( ) . getDbAsyncTask ( ) . getActionParameters ( ) ) ; return entity ; }

Target:
private org.ovirt.engine.core.common.businessentities.CommandEntity buildCommandEntity ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.compat.Guid rootCommandId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.core.compat.CommandStatus status ) { org.ovirt.engine.core.common.businessentities.CommandEntity entity = new org.ovirt.engine.core.common.businessentities.CommandEntity ( ) ; entity.setId ( commandId ) ; entity.setRootCommandId ( rootCommandId ) ; entity.setCommandType ( actionType ) ; entity.setActionParameters ( params ) ; entity.setCommandStatus ( status ) ; return entity ; }
Source:
public void rollbackQuota ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > list = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; list.add ( getQuotaId ( ) ) ; org.ovirt.engine.core.bll.RunVmCommand.getQuotaManager ( ) . rollbackQuota ( org.ovirt.engine.core.bll.RunVmCommand.getStoragePool ( ) , list ) ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaVdsConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; list.add ( new org.ovirt.engine.core.bll.quota.QuotaVdsGroupConsumptionParameter ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getvds_group_id ( ) , ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getcpu_per_socket ( ) ) * ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getnum_of_sockets ( ) ) ) , org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getmem_size_mb ( ) ) ) ; return list ; }
Source:
protected org.ovirt.engine.core.compat.Guid removeConfImage ( java.util.List < org.ovirt.engine.core.compat.Guid > guids ) { org.ovirt.engine.core.compat.Guid taskId2 = enclosingCommand.persistAsyncTaskPlaceHolder ( VmCommand.DELETE_SECONDARY_IMAGES_TASK_KEY ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsRetValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DeleteImageGroup , buildDeleteMemoryConfParams ( guids ) ) ; if ( ! ( vdsRetValue.getSucceeded ( ) ) ) { return null ; } org.ovirt.engine.core.compat.Guid guid2 = enclosingCommand.createTask ( taskId2 , vdsRetValue.getCreationInfo ( ) , enclosingCommand.getActionType ( ) ) ; enclosingCommand.getTaskIdList ( ) . add ( guid2 ) ; return guid2 ; }

Target:
protected org.ovirt.engine.core.compat.Guid removeImage ( java.lang.String taskKey , org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters parameters ) { org.ovirt.engine.core.compat.Guid taskId = enclosingCommand.persistAsyncTaskPlaceHolder ( taskKey ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsRetValue = removeImage ( parameters ) ; if ( vdsRetValue.getSucceeded ( ) ) { org.ovirt.engine.core.compat.Guid guid = enclosingCommand.createTask ( taskId , vdsRetValue.getCreationInfo ( ) , enclosingCommand.getActionType ( ) ) ; enclosingCommand.getTaskIdList ( ) . add ( guid ) ; return guid ; } return ( vdsRetValue.getVdsError ( ) . getCode ( ) ) == ( org.ovirt.engine.core.common.errors.VdcBllErrors.ImageDoesNotExistInDomainError ) ? org.ovirt.engine.core.compat.Guid.Empty : null ; }
Source:
private void portMirroringTest ( org.ovirt.engine.core.bll.ValidationResult expected , java.lang.String networkName , boolean portMirroring ) { org.mockito.Mockito.when ( nic.getNetworkName ( ) ) . thenReturn ( networkName ) ; org.mockito.Mockito.when ( nic.isPortMirroring ( ) ) . thenReturn ( portMirroring ) ; org.junit.Assert.assertEquals ( expected , validator.networkProvidedForPortMirroring ( ) ) ; }

Target:
private void portMirroringTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher , java.lang.String networkName , boolean portMirroring ) { org.mockito.Mockito.when ( nic.getNetworkName ( ) ) . thenReturn ( networkName ) ; org.mockito.Mockito.when ( nic.isPortMirroring ( ) ) . thenReturn ( portMirroring ) ; org.junit.Assert.assertThat ( validator.networkProvidedForPortMirroring ( ) , matcher ) ; }
Source:
public void calculateNetworkImplementationDetailsNetworkVmNetworkOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , iface.getMtu ( ) , iface.getVlanId ( ) , null ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkMtuOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , iface.isBridged ( ) , ( ( iface.getMtu ( ) ) + 1 ) , iface.getVlanId ( ) , createQos ( ) ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getNewCommand ( ) ) ) { return newNetworkPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getEditCommand ( ) ) ) { return editNetworkPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public void setItem ( ) { tested.setLocalItem ( "LocalKey" , "LocalValue" ) ; org.mockito.Mockito.verify ( tested ) . setLocalItemImpl ( ( ( org.ovirt.engine.ui.common.system.ClientStorageImplTest.KEY_PREFIX ) + "_LocalKey" ) , "LocalValue" ) ; tested.setSessionItem ( "SessionKey" , "SessionValue" ) ; org.mockito.Mockito.verify ( tested ) . setSessionItemImpl ( ( ( org.ovirt.engine.ui.common.system.ClientStorageImplTest.KEY_PREFIX ) + "_SessionKey" ) , "SessionValue" ) ; }

Target:
public void setItem ( ) { tested.setLocalItem ( "LocalKey" , "LocalValue" ) ; org.mockito.Mockito.verify ( tested ) . setLocalItemImpl ( ( ( ClientStorageImpl.CLIENT_STORAGE_KEY_PREFIX ) + "LocalKey" ) , "LocalValue" ) ; tested.setSessionItem ( "SessionKey" , "SessionValue" ) ; org.mockito.Mockito.verify ( tested ) . setSessionItemImpl ( ( ( ClientStorageImpl.CLIENT_STORAGE_KEY_PREFIX ) + "SessionKey" ) , "SessionValue" ) ; }
Source:
public org.ovirt.engine.core.common.errors.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ( getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ! ( memoryChecker.evaluate ( vds , getVm ( ) ) ) ) ) { sb.append ( "has insufficient memory to run the VM" ) ; return org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_MEMORY ; } return null ; }

Target:
public org.ovirt.engine.core.common.errors.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate , java.util.List < org.ovirt.engine.core.compat.Guid > vdsBlackList ) { if ( ( ( getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) && ( ! ( memoryChecker.evaluate ( vds , getVm ( ) ) ) ) ) { sb.append ( "has insufficient memory to run the VM" ) ; return org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_MEMORY ; } return null ; }
Source:
public java.util.Map < java.lang.String , java.lang.Object > getSpecParams ( ) { java.util.Map < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; java.util.Map < java.lang.String , java.lang.Object > fileTypeList = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; java.util.Map < java.lang.String , java.lang.Object > fileList = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; specParams.put ( org.ovirt.engine.core.common.businessentities.VmPayload.SpecParamsPayload , fileTypeList ) ; fileTypeList.put ( org.ovirt.engine.core.common.businessentities.VmPayload.SpecParamsFileType , fileList ) ; fileList.put ( this . fileName , this . content ) ; return specParams ; }

Target:
public java.util.Map < java.lang.String , java.lang.Object > getSpecParams ( ) { java.util.Map < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; java.util.Map < java.lang.String , java.lang.Object > fileTypeList = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; specParams.put ( org.ovirt.engine.core.common.businessentities.VmPayload.SpecParamsPayload , fileTypeList ) ; fileTypeList.put ( org.ovirt.engine.core.common.businessentities.VmPayload.SpecParamsFileType , files ) ; return specParams ; }
Source:
public java.lang.Boolean call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Cluster cluster = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getClusterDao ( ) . get ( _deploy.getVds ( ) . getClusterId ( ) ) ; java.lang.String tunedProfile = ( cluster.supportsGlusterService ( ) ) ? cluster.getGlusterTunedProfile ( ) : null ; if ( ( tunedProfile == null ) || ( tunedProfile.isEmpty ( ) ) ) { _deploy.getParser ( ) . cliNoop ( ) ; } else { _deploy.getParser ( ) . cliEnvironmentSet ( TuneEnv.TUNED_PROFILE , tunedProfile ) ; } return true ; }

Target:
public java.lang.Boolean call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Cluster cluster = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.dao.ClusterDao.class ) . get ( _deploy.getVds ( ) . getClusterId ( ) ) ; java.lang.String tunedProfile = ( cluster.supportsGlusterService ( ) ) ? cluster.getGlusterTunedProfile ( ) : null ; if ( ( tunedProfile == null ) || ( tunedProfile.isEmpty ( ) ) ) { _deploy.getParser ( ) . cliNoop ( ) ; } else { _deploy.getParser ( ) . cliEnvironmentSet ( TuneEnv.TUNED_PROFILE , tunedProfile ) ; } return true ; }
Source:
private static int setNetworkBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( ( ( device.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType.INTERFACE ) ) && ( device.getDevice ( ) . equals ( VmDeviceType.BRIDGE.getName ( ) ) ) ) { if ( device.getIsPlugged ( ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } } } return bootOrder ; }

Target:
private static int setNetworkBootOrder ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices , int bootOrder ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isBridge ( device ) ) { if ( device.getIsPlugged ( ) ) { device.setBootOrder ( ( ++ bootOrder ) ) ; } } } return bootOrder ; }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsType > getGraphicsTypesForEntity ( org.ovirt.engine.api.restapi.resource.BackendResource backendResource , org.ovirt.engine.core.compat.Guid id ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypes = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = backendResource.getEntity ( java.util.List.class , VdcQueryType.GetGraphicsDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , "GetGraphicsDevices" , true ) ; if ( graphicsDevices != null ) { for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice graphicsDevice : graphicsDevices ) { graphicsTypes.add ( graphicsDevice.getGraphicsType ( ) ) ; } } return graphicsTypes ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsType > getGraphicsTypesForEntity ( org.ovirt.engine.api.restapi.resource.BackendResource backendResource , org.ovirt.engine.core.compat.Guid id ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypes = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = org.ovirt.engine.api.restapi.util.DisplayHelper.getGraphicsDevicesForEntity ( backendResource , id ) ; if ( graphicsDevices != null ) { for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice graphicsDevice : graphicsDevices ) { graphicsTypes.add ( graphicsDevice.getGraphicsType ( ) ) ; } } return graphicsTypes ; }
Source:
protected void postSaveAction ( boolean succeeded ) { if ( succeeded ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qosItems = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ( getQos ( ) . getItems ( ) ) ; qosItems.add ( 1 , networkQoS ) ; getQos ( ) . setItems ( qosItems ) ; getQos ( ) . setSelectedItem ( networkQoS ) ; } super . postSaveAction ( succeeded ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qos = ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( returnValue ) ) ; getQos ( ) . setItems ( qos ) ; getQos ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.findNetworkQosById ( qos , getNetwork ( ) . getQosId ( ) ) ) ; }
Source:
private java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration > prepareMapOfExistingConfigs ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration > existingConfigs ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration > keyConfigMap = new java.util.HashMap < > ( ) ; if ( existingConfigs != null ) { for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration config : existingConfigs ) { keyConfigMap.put ( config.getKey ( ) , config ) ; } } return keyConfigMap ; }

Target:
private java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration > prepareMapOfGeoRepSessionConfigs ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration > existingConfigs ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration > keyConfigMap = new java.util.HashMap < > ( ) ; if ( existingConfigs != null ) { for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionConfiguration config : existingConfigs ) { keyConfigMap.put ( config.getKey ( ) , config ) ; } } return keyConfigMap ; }
Source:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public void RemoveTag ( org.ovirt.engine.core.compat.Guid tagId ) { if ( tagsMapByID.containsKey ( tagId ) ) { org.ovirt.engine.core.common.businessentities.Tags tag = tagsMapByID.get ( tagId ) ; RemoveTagAndChildren ( tag ) ; org.ovirt.engine.core.common.businessentities.Tags parent = tagsMapByID.get ( tag.getparent_id ( ) ) ; parent.getChildren ( ) . remove ( tag ) ; addTagToHash ( parent ) ; } else { org.ovirt.engine.core.bll.TagsDirector.log.warn ( "Trying to remove tag, not exists in Data Structure - '{}'" , tagId ) ; } }

Target:
public void removeTag ( org.ovirt.engine.core.compat.Guid tagId ) { if ( tagsMapByID.containsKey ( tagId ) ) { org.ovirt.engine.core.common.businessentities.Tags tag = tagsMapByID.get ( tagId ) ; removeTagAndChildren ( tag ) ; org.ovirt.engine.core.common.businessentities.Tags parent = tagsMapByID.get ( tag.getparent_id ( ) ) ; parent.getChildren ( ) . remove ( tag ) ; addTagToHash ( parent ) ; } else { org.ovirt.engine.core.bll.TagsDirector.log.warn ( "Trying to remove tag, not exists in Data Structure - '{}'" , tagId ) ; } }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.permissions > setUpPermissions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.permissions > perms = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { perms.add ( getEntity ( i ) ) ; } return perms ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > setUpPermissions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > perms = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { perms.add ( getEntity ( i ) ) ; } return perms ; }
Source:
public void testMacPoolExistsEntityDoesExist ( ) throws java.lang.Exception { org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.MacPoolValidator ( macPool ) . macPoolExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotRemovingUsedPoolRecordNotUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( storagePoolDao.getAllDataCentersByMacPoolId ( macPool.getId ( ) ) ) . thenReturn ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.StoragePool > emptyList ( ) ) ; org.junit.Assert.assertThat ( macPoolValidator.notRemovingUsedPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void qosValidCommitmentReportedBondSpeed ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosCommitmentReportedBondSpeed ( ( ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) / 2 ) ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlan ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseNic , int vlanId , java.lang.String networkName ) { java.lang.String baseIfaceName = baseNic.getName ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , ( ( baseIfaceName + "." ) + vlanId ) , false , null , baseIfaceName , vlanId , networkName , true , null , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; mockCalculateBaseNicWhenVlanNicIsPassed ( baseNic , nic ) ; return nic ; }
Source:
private void updateDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalActionWithTasksContext ( VdcActionType.UpdateVolume , buildUpdateVolumeCommandParameters ( diskImage ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getFault ( ) . getError ( ) , returnValue.getFault ( ) . getMessage ( ) ) ; } }

Target:
private void updateDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalActionWithTasksContext ( ActionType.UpdateVolume , buildUpdateVolumeCommandParameters ( diskImage ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getFault ( ) . getError ( ) , returnValue.getFault ( ) . getMessage ( ) ) ; } }
Source:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v4_0 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( new java.util.ArrayList < > ( java.util.Arrays.asList ( "VirtIO" ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }

Target:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v4_0 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( "VirtIO" ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }
Source:
public java.lang.String getVdsDestination ( ) { if ( ( getDestinationVds ( ) ) != null ) { return getDestinationVds ( ) . getName ( ) ; } else { return null ; } }

Target:
private java.lang.Boolean isTunnelMigrationUsed ( ) { if ( org.ovirt.engine.core.common.FeatureSupported.tunnelMigration ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) { return ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getTunnelMigration ( ) ) != null ? org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getTunnelMigration ( ) : org.ovirt.engine.core.bll.MigrateVmCommand.getVdsGroup ( ) . isTunnelMigration ( ) ; } return null ; }
Source:
protected java.io.File determineActualFile ( final javax.servlet.http.HttpServletRequest request , java.util.Locale locale ) { java.io.File file = org.ovirt.engine.core.utils.servlet.ServletUtils.makeFileFromSanePath ( request.getPathInfo ( ) , base ) ; if ( ( file != null ) && ( ! ( org.ovirt.engine.core.utils.servlet.ServletUtils.canReadFile ( file ) ) ) ) { file = org.ovirt.engine.core.utils.servlet.ServletUtils.makeFileFromSanePath ( replaceLocaleWithUSLocale ( request.getPathInfo ( ) , locale ) , base ) ; } return file ; }

Target:
protected java.io.File determineActualFile ( final javax.servlet.http.HttpServletRequest request , java.util.Locale locale ) { java.io.File file = org.ovirt.engine.core.utils.servlet.ServletUtils.makeFileFromSanePath ( replaceLocaleWithOtherLocale ( request.getPathInfo ( ) , locale , locale ) , base ) ; if ( ( file != null ) && ( ! ( org.ovirt.engine.core.utils.servlet.ServletUtils.canReadFile ( file ) ) ) ) { file = org.ovirt.engine.core.utils.servlet.ServletUtils.makeFileFromSanePath ( replaceLocaleWithUSLocale ( request.getPathInfo ( ) , locale ) , base ) ; } return file ; }
Source:
protected boolean validate ( ) { if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { return org.ovirt.engine.core.bll.VmSlaPolicyCommand.failVmStatusIllegal ( ) ; } if ( ! ( org.ovirt.engine.core.common.FeatureSupported.vmSlaPolicy ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getClusterCompatibilityVersion ( ) ) ) ) { return failValidation ( EngineMessage.VM_SLA_POLICY_NOT_SUPPORTED ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { return org.ovirt.engine.core.bll.VmSlaPolicyCommand.failVmStatusIllegal ( ) ; } if ( ! ( org.ovirt.engine.core.common.FeatureSupported.vmSlaPolicy ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getCompatibilityVersion ( ) ) ) ) { return failValidation ( EngineMessage.VM_SLA_POLICY_NOT_SUPPORTED ) ; } return true ; }