auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.common.businessentities.ad_groups mapRow ( final java.sql.ResultSet rs , final int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.ad_groups entity = new org.ovirt.engine.core.common.businessentities.ad_groups ( ) ; entity.setid ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "id" ) ) ) ; entity.setname ( rs.getString ( "name" ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.AdRefStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setdomain ( rs.getString ( "domain" ) ) ; entity.setDistinguishedName ( rs.getString ( "distinguishedname" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.LdapGroup mapRow ( final java.sql.ResultSet rs , final int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.LdapGroup entity = new org.ovirt.engine.core.common.businessentities.LdapGroup ( ) ; entity.setid ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "id" ) ) ) ; entity.setname ( rs.getString ( "name" ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.LdapRefStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setdomain ( rs.getString ( "domain" ) ) ; entity.setDistinguishedName ( rs.getString ( "distinguishedname" ) ) ; return entity ; }
Source:
public void canDoActionSameSourceAndDest ( ) throws java.lang.Exception { destStorageId = srcStorageId ; initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( ) ; initVmForFail ( ) ; initSrcStorageDomain ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString ( ) ) ) ; }

Target:
public void canDoActionWrongDiskImageTypeVm ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Copy ) ; initVmDiskImage ( false ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getTemplateForImage ( ) ; command.defineVmTemplate ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_IS_NOT_TEMPLATE_DISK.toString ( ) ) ) ; }
Source:
private void cleanConnection ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection , org.ovirt.engine.core.compat.Guid hostId ) { if ( ( ( connection.getid ( ) ) != null ) && ( ! ( connection.getid ( ) . equals ( "" ) ) ) ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveStorageServerConnection , new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) , null , this ) ; } }

Target:
private void cleanConnection ( org.ovirt.engine.core.common.businessentities.StorageServerConnections connection , org.ovirt.engine.core.compat.Guid hostId ) { if ( ( ( connection.getid ( ) ) != null ) && ( ! ( connection.getid ( ) . equals ( "" ) ) ) ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveStorageServerConnection , new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) , null , this ) ; } }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.hosts.VfsConfigModel model ) { driver.edit ( model ) ; networks.asEditor ( ) . edit ( model.getNetworks ( ) ) ; initNetworksTable ( ) ; updateAllowedNetworksPanelVisibility ( model ) ; model.getAllNetworksAllowed ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateAllowedNetworksPanelVisibility ( model ) ; } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.hosts.VfsConfigModel model ) { driver.edit ( model ) ; labelsWidget.edit ( model.getLabelsModel ( ) ) ; networks.asEditor ( ) . edit ( model.getNetworks ( ) ) ; initNetworksTable ( ) ; updateAllowedNetworksPanelVisibility ( model ) ; model.getAllNetworksAllowed ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateAllowedNetworksPanelVisibility ( model ) ; } } ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( org.ovirt.engine.core.compat.Guid storagePoolId , long sizeRequested ) { return org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( storagePoolId , sizeRequested , java.util.Collections.< org.ovirt.engine.core.common.businessentities.StorageDomain , java.lang.Integer > emptyMap ( ) ) ; }

Target:
public static java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionsNeededToChangeCluster ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid clusterId ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( vmId , org.ovirt.engine.core.common.VdcObjectType.VM , org.ovirt.engine.core.common.businessentities.ActionGroup.EDIT_VM_PROPERTIES ) ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( clusterId , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_VM ) ) ; return permissionList ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > GetLinuxOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > getLinuxOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; }
Source:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.column.Context context , org.ovirt.engine.core.common.businessentities.gluster.BrickProperties value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { setFreeSize ( value.getFreeSize ( ) ) ; setTotalSize ( value.getTotalSize ( ) ) ; setUsedSize ( ( ( value.getTotalSize ( ) ) - ( value.getFreeSize ( ) ) ) ) ; setInUnit ( SizeUnit.MB ) ; } super . render ( context , ( value == null ? null : value ) , sb ) ; }

Target:
public void render ( org.ovirt.engine.ui.webadmin.widget.table.column.Context context , org.ovirt.engine.core.common.businessentities.gluster.BrickProperties value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb , java.lang.String id ) { if ( value != null ) { setFreeSize ( value.getFreeSize ( ) ) ; setTotalSize ( value.getTotalSize ( ) ) ; setUsedSize ( ( ( value.getTotalSize ( ) ) - ( value.getFreeSize ( ) ) ) ) ; setInUnit ( SizeUnit.MiB ) ; } super . render ( context , ( value == null ? null : value ) , sb , id ) ; }
Source:
private void addFloppyDetails ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct struct ) { struct.add ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.add ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; struct.add ( VdsProperties.Index , "0" ) ; struct.add ( VdsProperties.Iface , VdsProperties.Fdc ) ; struct.add ( VdsProperties.ReadOnly , java.lang.String.valueOf ( vmDevice.getIsReadOnly ( ) ) ) ; }

Target:
private static void addFloppyDetails ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct struct ) { struct.add ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.add ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; struct.add ( VdsProperties.Index , "0" ) ; struct.add ( VdsProperties.Iface , VdsProperties.Fdc ) ; struct.add ( VdsProperties.ReadOnly , java.lang.String.valueOf ( vmDevice.getIsReadOnly ( ) ) ) ; struct.add ( VdsProperties.Shareable , java.lang.Boolean.FALSE.toString ( ) ) ; }
Source:
public void testAddingNewUnsuccessfulBackupEvent ( ) { existingEngineBackupLog = dao.getLastSuccessfulEngineBackup ( org.ovirt.engine.core.dao.EngineBackupLogDaoTest.DB_NAME ) ; org.ovirt.engine.core.common.businessentities.EngineBackupLog engineBackupLog = new org.ovirt.engine.core.common.businessentities.EngineBackupLog ( ) ; engineBackupLog.setDbName ( org.ovirt.engine.core.dao.EngineBackupLogDaoTest.DB_NAME ) ; engineBackupLog.setDoneAt ( java.util.Calendar.getInstance ( ) . getTime ( ) ) ; engineBackupLog.setPassed ( false ) ; engineBackupLog.setOutputMessage ( "backup failed" ) ; dao.save ( engineBackupLog ) ; org.ovirt.engine.core.common.businessentities.EngineBackupLog entry = dao.getLastSuccessfulEngineBackup ( org.ovirt.engine.core.dao.EngineBackupLogDaoTest.DB_NAME ) ; org.junit.Assert.assertNotNull ( entry ) ; org.junit.Assert.assertEquals ( entry , existingEngineBackupLog ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getEngineBackupLogDao ( ) ; existingEngineBackupLog = dao.getLastSuccessfulEngineBackup ( org.ovirt.engine.core.dao.EngineBackupLogDaoTest.DB_NAME ) ; newEntity = new org.ovirt.engine.core.common.businessentities.EngineBackupLog ( ) ; newEntity.setDbName ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 20 ) ) ; newEntity.setOutputMessage ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 20 ) ) ; newEntity.setDoneAt ( new java.util.Date ( ) ) ; newEntity.setPassed ( true ) ; }
Source:
public java.lang.String toString ( ) { if ( ! ( valid ) ) { return null ; } java.lang.String authority = new java.lang.String ( ) ; authority += host ; if ( ! ( port.isEmpty ( ) ) ) { authority += ':' + ( port ) ; } return authority ; }

Target:
public java.lang.String getStringRepresentation ( ) { if ( ! ( valid ) ) { return null ; } java.lang.String authority = new java.lang.String ( ) ; authority += host ; if ( ! ( port.isEmpty ( ) ) ) { authority += ':' + ( port ) ; } return authority ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc hostdevChangeNumvfs ( java.lang.String deviceName , int numOfVfs ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.hostdevChangeNumvfs" ) . withParameter ( "deviceName" , deviceName ) . withParameter ( "numvfs" , numOfVfs ) . 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 hostdevChangeNumvfs ( java.lang.String deviceName , int numOfVfs ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.hostdevChangeNumvfs" ) . withParameter ( "deviceName" , deviceName ) . withParameter ( "numvfs" , numOfVfs ) . 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:
public void migrateVM ( java.util.List < org.ovirt.engine.core.compat.Guid > initialHosts , org.ovirt.engine.core.compat.Guid vmToMigrate ) { org.ovirt.engine.core.common.action.MigrateVmParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmParameters ( false , vmToMigrate ) ; parameters.setInitialHosts ( new java.util.ArrayList ( initialHosts ) ) ; backendInternal.runInternalAction ( VdcActionType.MigrateVm , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
public void migrateVM ( java.util.List < org.ovirt.engine.core.compat.Guid > initialHosts , org.ovirt.engine.core.compat.Guid vmToMigrate , java.lang.String reason ) { org.ovirt.engine.core.common.action.MigrateVmParameters parameters = new org.ovirt.engine.core.common.action.MigrateVmParameters ( false , vmToMigrate ) ; parameters.setInitialHosts ( new java.util.ArrayList ( initialHosts ) ) ; parameters.setReason ( reason ) ; backendInternal.runInternalAction ( VdcActionType.MigrateVm , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Cell.Context context , com.google.gwt.dom.client.Element parent , java.lang.Boolean value , com.google.gwt.safehtml.shared.SafeHtml tooltipContent , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < java.lang.Boolean > valueUpdater ) { super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Cell.Context context , com.google.gwt.dom.client.Element parent , java.lang.Boolean value , com.google.gwt.safehtml.shared.SafeHtml tooltipContent , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < java.lang.Boolean > valueUpdater ) { if ( tooltipContent == null ) { tooltipContent = getTooltip ( value ) ; } org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.handleTooltipEvent ( parent , tooltipContent , event ) ; super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; }
Source:
private org.ovirt.engine.core.common.asynctasks.AsyncTaskType internalGetTaskType ( ) { if ( hasTaskHandlers ( ) ) { if ( ( getParameters ( ) . getExecutionReason ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionParametersBase.CommandExecutionReason.REGULAR_FLOW ) ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; } return getCurrentTaskHandler ( ) . getRevertTaskType ( ) ; } return getTaskType ( ) ; }

Target:
protected org.ovirt.engine.core.bll.context.CommandContext cloneContext ( ) { return getContext ( ) . clone ( ) ; }
Source:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { nameEditor.setLabel ( constants.nameLabel ( ) ) ; descriptionEditor.setLabel ( constants.descriptionLabel ( ) ) ; commentEditor.setLabel ( constants.commentLabel ( ) ) ; storagePoolTypeEditor.setLabel ( constants.dataCenterPopupStorageTypeLabel ( ) ) ; versionEditor.setLabel ( constants.dataCenterPopupVersionLabel ( ) ) ; quotaEnforceTypeEditor.setLabel ( constants.dataCenterPopupQuotaEnforceTypeLabel ( ) ) ; }

Target:
void localize ( org.ovirt.engine.ui.webadmin.ApplicationConstants constants ) { nameEditor.setLabel ( constants.nameLabel ( ) ) ; descriptionEditor.setLabel ( constants.descriptionLabel ( ) ) ; commentEditor.setLabel ( constants.commentLabel ( ) ) ; storagePoolTypeEditor.setLabel ( constants.dataCenterPopupStorageTypeLabel ( ) ) ; versionEditor.setLabel ( constants.dataCenterPopupVersionLabel ( ) ) ; quotaEnforceTypeEditor.setLabel ( constants.dataCenterPopupQuotaEnforceTypeLabel ( ) ) ; macPoolListEditor.setLabel ( constants.dataCenterPopupMacPoolLabel ( ) ) ; }
Source:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public void recoverFromError ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( getVdsId ( ) ) ; if ( ( vds != null ) && ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Error ) ) ) { setStatus ( VDSStatus.Up , vds ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . updateStatus ( getVdsId ( ) , VDSStatus.Up ) ; org.ovirt.engine.core.vdsbroker.VdsManager.log.info ( "Settings host '{}' to up after failed attempts to run a VM" , vds.getName ( ) , mFailedToRunVmAttempts ) ; mFailedToRunVmAttempts.set ( 0 ) ; } }

Target:
public void recoverFromError ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = dbFacade.getVdsDao ( ) . get ( getVdsId ( ) ) ; if ( ( vds != null ) && ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Error ) ) ) { setStatus ( VDSStatus.Up , vds ) ; dbFacade.getVdsDynamicDao ( ) . updateStatus ( getVdsId ( ) , VDSStatus.Up ) ; org.ovirt.engine.core.vdsbroker.VdsManager.log.info ( "Settings host '{}' to up after failed attempts to run a VM" , vds.getName ( ) , mFailedToRunVmAttempts ) ; mFailedToRunVmAttempts.set ( 0 ) ; } }
Source:
public void refreshHeavyWeightData ( ) { log.debug ( "Refreshing Gluster Data [heavyweight]" ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : getClusterDao ( ) . getAll ( ) ) { if ( cluster.supportsGlusterService ( ) ) { try { refreshClusterHeavyWeightData ( cluster ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Error while refreshing Gluster heavyweight data of cluster {0}!" , cluster.getname ( ) , e ) ; } } } }

Target:
public void refreshHeavyWeightData ( ) { log.debug ( "Refreshing Gluster Data [heavyweight]" ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : getClusterDao ( ) . getAll ( ) ) { if ( ( org.ovirt.engine.core.common.gluster.GlusterFeatureSupported.refreshHeavyWeight ( cluster.getcompatibility_version ( ) ) ) && ( cluster.supportsGlusterService ( ) ) ) { try { refreshClusterHeavyWeightData ( cluster ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Error while refreshing Gluster heavyweight data of cluster {0}!" , cluster.getname ( ) , e ) ; } } } }
Source:
protected org.ovirt.engine.core.common.businessentities.VmDevice addManagedDeviceForDisk ( org.ovirt.engine.core.compat.Guid diskId ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( diskId , org.ovirt.engine.core.bll.AddDiskCommand.getVmId ( ) ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , null , shouldDiskBePlugged ( ) , java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getReadOnly ( ) ) , null ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmDevice addManagedDeviceForDisk ( org.ovirt.engine.core.compat.Guid diskId , java.lang.Boolean isUsingScsiReservation ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addDiskDevice ( org.ovirt.engine.core.bll.AddDiskCommand.getVmId ( ) , diskId , shouldDiskBePlugged ( ) , java.lang.Boolean.TRUE.equals ( org.ovirt.engine.core.bll.AddDiskCommand.getParameters ( ) . getDiskInfo ( ) . getReadOnly ( ) ) , java.lang.Boolean.TRUE.equals ( isUsingScsiReservation ) ) ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Host model = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityWithNoCertificateInfoExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Host model = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
private boolean isVMPartOfManualPool ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPoolId ( ) ) == null ) { return false ; } final org.ovirt.engine.core.common.businessentities.VmPool vmPool = org.ovirt.engine.core.bll.RunVmCommand.getDbFacade ( ) . getVmPoolDao ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPoolId ( ) ) ; return vmPool.getVmPoolType ( ) . equals ( VmPoolType.Manual ) ; }

Target:
protected boolean isVmPartOfManualPool ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPoolId ( ) ) == null ) { return false ; } final org.ovirt.engine.core.common.businessentities.VmPool vmPool = org.ovirt.engine.core.bll.RunVmCommand.getDbFacade ( ) . getVmPoolDao ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmPoolId ( ) ) ; return vmPool.getVmPoolType ( ) . equals ( VmPoolType.Manual ) ; }
Source:
public void validateFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) , null ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }

Target:
public void validateSucceedsWithForceOption ( ) throws java.lang.Exception { command.getParameters ( ) . setForceAction ( true ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public void testRemoveNonExistant ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , false ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , false ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void canDoActionFailsOnNullCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( null ) ) ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID.toString ( ) ) ) ; }

Target:
public void validateFailsOnNullCluster ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterClusterParameters ( null ) ) ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID.toString ( ) ) ) ; }
Source:
protected void verify ( org.ovirt.engine.api.model.Filter model , org.ovirt.engine.api.model.Filter transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.Assert.assertEquals ( model.getSchedulingPolicyUnit ( ) . getId ( ) , transform.getSchedulingPolicyUnit ( ) . getId ( ) ) ; org.junit.Assert.assertEquals ( model.getPosition ( ) , transform.getPosition ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.Filter model , org.ovirt.engine.api.model.Filter transform ) { org.junit.jupiter.api.Assertions.assertNotNull ( transform ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getSchedulingPolicyUnit ( ) . getId ( ) , transform.getSchedulingPolicyUnit ( ) . getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getPosition ( ) , transform.getPosition ( ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getAddParameters ( network , entity ) ; return performCreate ( addAction , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , getRequiredAddFields ( ) ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters params = getAddParameters ( network , entity ) ; return performCreate ( ( network.isSetExternalProvider ( ) ? org.ovirt.engine.core.common.action.ActionType.AddNetworkOnProvider : addAction ) , params , new org.ovirt.engine.api.restapi.resource.DataCenterNetworkIdResolver ( network.getName ( ) , params.getStoragePoolId ( ) . toString ( ) ) ) ; }
Source:
public void addMonitoring ( org.ovirt.engine.core.vdsbroker.VmsMonitoring vmsMonitoring ) { this . monitoring.addVmsMonitoring ( vmsMonitoring ) ; }

Target:
public void vmsMonitoring ( ) { if ( isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = ( getRefreshStatistics ( ) ) ? new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( this ) : new org.ovirt.engine.core.vdsbroker.VmsListFetcher ( this ) ; fetcher.fetch ( ) ; new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( this , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , auditLogDirector ) . perform ( ) ; } }
Source:
public void AddTag ( org.ovirt.engine.core.common.businessentities.Tags tag ) { if ( tagsMapByID.containsKey ( tag.getparent_id ( ) ) ) { org.ovirt.engine.core.common.businessentities.Tags parent = tagsMapByID.get ( tag.getparent_id ( ) ) ; parent.getChildren ( ) . add ( tag ) ; AddTagToHash ( tag ) ; AddTagToHash ( parent ) ; } else { org.ovirt.engine.core.bll.TagsDirector.log.errorFormat ( "Trying to add tag {0}, parent doesn't exist in Data Structure - {1}" , tag.gettag_name ( ) , tag.getparent_id ( ) ) ; } }

Target:
public void addTag ( org.ovirt.engine.core.common.businessentities.Tags tag ) { if ( tagsMapByID.containsKey ( tag.getparent_id ( ) ) ) { org.ovirt.engine.core.common.businessentities.Tags parent = tagsMapByID.get ( tag.getparent_id ( ) ) ; parent.getChildren ( ) . add ( tag ) ; addTagToHash ( tag ) ; addTagToHash ( parent ) ; } else { org.ovirt.engine.core.bll.TagsDirector.log.errorFormat ( "Trying to add tag {0}, parent doesn't exist in Data Structure - {1}" , tag.gettag_name ( ) , tag.getparent_id ( ) ) ; } }
Source:
private java.util.Set < java.lang.String > getRemovedBonds ( ) { if ( ( removedBonds ) == null ) { removedBonds = new java.util.HashSet ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) . size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Bond bond : org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedBonds ( ) ) { removedBonds.add ( bond.getName ( ) ) ; } } return removedBonds ; }

Target:
private java.util.Set < java.lang.String > getRemovedNetworks ( ) { if ( ( removedNetworks ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > removedNetworkAttachments = org.ovirt.engine.core.common.businessentities.Entities.filterEntitiesByRequiredIds ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getRemovedNetworkAttachments ( ) , existingAttachments ) ; removedNetworks = new java.util.HashSet ( removedNetworkAttachments.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment : removedNetworkAttachments ) { removedNetworks.add ( existingNetworkRelatedToAttachment ( attachment ) . getName ( ) ) ; } } return removedNetworks ; }
Source:
public void canDoActionThinProvisioningSpaceCheckSucceeds ( ) throws java.lang.Exception { final int availableSize = 6 ; final int usedSize = 4 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionThinProvisioningSpaceCheckSucceeds ( ) throws java.lang.Exception { final int availableSize = 6 ; final int usedSize = 4 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Sparse ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
Source:
public synchronized void cancelTask ( org.ovirt.engine.core.compat.Guid vdsmTaskId ) { if ( _tasks.containsKey ( vdsmTaskId ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.infoFormat ( "Attempting to cancel task '{0}'." , vdsmTaskId ) ; _tasks.get ( vdsmTaskId ) . stopTask ( ) ; _tasks.get ( vdsmTaskId ) . ConcreteStartPollingTask ( ) ; } }

Target:
public synchronized void cancelTask ( org.ovirt.engine.core.compat.Guid vdsmTaskId ) { if ( _tasks.containsKey ( vdsmTaskId ) ) { org.ovirt.engine.core.bll.tasks.AsyncTaskManager.log.infoFormat ( "Attempting to cancel task '{0}'." , vdsmTaskId ) ; _tasks.get ( vdsmTaskId ) . stopTask ( ) ; _tasks.get ( vdsmTaskId ) . concreteStartPollingTask ( ) ; } }
Source:
public boolean RunForSingleConnectionInHost ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain , org.ovirt.engine.core.compat.Guid storagePoolId , int type ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.storage_pool pool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( storagePoolId ) ; org.ovirt.engine.core.compat.Guid vdsId = ( ( pool.getspm_vds_id ( ) ) != null ) ? pool.getspm_vds_id ( ) . getValue ( ) : org.ovirt.engine.core.compat.Guid.Empty ; if ( ! ( vdsId.equals ( Guid.Empty ) ) ) { returnValue = RunConnectionStorageToDomain ( storageDomain , vdsId , type ) ; } return returnValue ; }

Target:
public boolean runForSingleConnectionInHost ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain , org.ovirt.engine.core.compat.Guid storagePoolId , int type ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.storage_pool pool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( storagePoolId ) ; org.ovirt.engine.core.compat.Guid vdsId = ( ( pool.getspm_vds_id ( ) ) != null ) ? pool.getspm_vds_id ( ) . getValue ( ) : org.ovirt.engine.core.compat.Guid.Empty ; if ( ! ( vdsId.equals ( Guid.Empty ) ) ) { returnValue = RunConnectionStorageToDomain ( storageDomain , vdsId , type ) ; } return returnValue ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Network incoming , org.ovirt.engine.api.model.Network entity ) { org.ovirt.engine.api.model.Network updated = getMapper ( modelType , org.ovirt.engine.api.model.Network.class ) . map ( incoming , entity ) ; return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getstorage_pool_id ( ) . getValue ( ) , updated ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.Network incoming , org.ovirt.engine.api.model.Network entity ) { org.ovirt.engine.api.model.Network updated = getMapper ( modelType , org.ovirt.engine.api.model.Network.class ) . map ( incoming , entity ) ; return new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( entity.getDataCenterId ( ) . getValue ( ) , updated ) ; }
Source:
private javax.naming.directory.Attributes query ( java.lang.String name , java.lang.String [ ] attrs ) throws javax.naming.NamingException { if ( org.ovirt.engineextensions.aaa.ldap.Resolver.log.isDebugEnabled ( ) ) { org.ovirt.engineextensions.aaa.ldap.Resolver.log.debug ( "Entry: name='{}', attrs=%s" , name , java.util.Arrays.asList ( attrs ) ) ; } javax.naming.directory.Attributes ret = ctx.getAttributes ( name , attrs ) ; org.ovirt.engineextensions.aaa.ldap.Resolver.log.debug ( "Return: {}" , ret ) ; return ret ; }

Target:
private javax.naming.directory.Attributes query ( java.lang.String name , java.lang.String [ ] attrs ) throws javax.naming.NamingException { if ( org.ovirt.engineextensions.aaa.ldap.Resolver.log.isDebugEnabled ( ) ) { org.ovirt.engineextensions.aaa.ldap.Resolver.log.debug ( "Entry: name='{}', attrs={}" , name , java.util.Arrays.asList ( attrs ) ) ; } javax.naming.directory.Attributes ret = ctx.getAttributes ( name , attrs ) ; org.ovirt.engineextensions.aaa.ldap.Resolver.log.debug ( "Return: {}" , ret ) ; return ret ; }
Source:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { 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.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }

Target:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
public void test1 ( ) throws java.lang.Exception { java.security.KeyStore.PrivateKeyEntry entry = org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecryptTest.getPrivateKeyEntry ( org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecryptTest.getKeyStore ( "PKCS12" , "key.p12" , "NoSoup4U" ) , "1" , "NoSoup4U" ) ; byte [ ] test = "testing 1 2 3 4" . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ; org.junit.Assert.assertArrayEquals ( test , org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecrypt.decrypt ( entry , org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecrypt.encrypt ( "AES/OFB/PKCS5Padding" , 256 , entry.getCertificate ( ) , 100 , test ) ) ) ; }

Target:
public void test1 ( ) throws java.lang.Exception { java.security.KeyStore.PrivateKeyEntry entry = org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecryptTest.getPrivateKeyEntry ( org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecryptTest.getKeyStore ( "PKCS12" , "key.p12" , "NoSoup4U" ) , "1" , "NoSoup4U" ) ; byte [ ] test = "testing 1 2 3 4" . getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ; org.junit.jupiter.api.Assertions.assertArrayEquals ( test , org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecrypt.decrypt ( entry , org.ovirt.engine.core.uutils.crypto.EnvelopeEncryptDecrypt.encrypt ( "AES/OFB/PKCS5Padding" , 256 , entry.getCertificate ( ) , 100 , test ) ) ) ; }
Source:
public void run ( ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmIds ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.ProcessDownVmParameters ( vmId ) ) ; } }

Target:
public void run ( ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmIds ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.ProcessDownVmParameters ( vmId , true ) ) ; } org.ovirt.engine.core.bll.hostdev.HostDeviceManager hostDeviceManager = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.hostdev.HostDeviceManager.class ) ; hostDeviceManager.refreshHostIfAnyVmHasHostDevices ( vmIds , hostId ) ; }
Source:
public void testListFailure ( ) { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpHooksQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( mockl10n ( org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) , ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) . getDetail ( ) ) ; } }

Target:
public void testListFailure ( ) { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpHooksQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae ) ; } }
Source:
public org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue ; returnValue = runVdsCommand ( VDSCommandType.UpdateGlusterHook , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterHookVDSParameters ( serverHook.getServerId ( ) , entity.getGlusterCommand ( ) , entity.getStage ( ) , entity.getName ( ) , hookContent , hookChecksum ) ) ; return new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > ( serverHook , returnValue ) ; }

Target:
public org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > call ( ) throws java.lang.Exception { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue ; returnValue = runVdsCommand ( VDSCommandType.UpdateGlusterHook , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterHookVDSParameters ( serverId , entity.getGlusterCommand ( ) , entity.getStage ( ) , entity.getName ( ) , hookContent , hookChecksum ) ) ; return new org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.vdscommands.VDSReturnValue > ( serverId , returnValue ) ; }
Source:
private void dontSendTicket ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.SetVmTicketCommand.getVm ( ) ; final org.ovirt.engine.core.common.users.VdcUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.log.warnFormat ( "Can\'t give console of virtual machine \"{0}\" to user \"{1}\", it has probably been taken by another user." , vm.getId ( ) , user.getUserId ( ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_USE_BY_OTHER_USER ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( false ) ; }

Target:
private void dontSendTicket ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.SetVmTicketCommand.getVm ( ) ; final org.ovirt.engine.core.common.businessentities.DbUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.log.warnFormat ( "Can\'t give console of virtual machine \"{0}\" to user \"{1}\", it has probably been taken by another user." , vm.getId ( ) , user.getId ( ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IN_USE_BY_OTHER_USER ) ; org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( false ) ; }
Source:
protected final java.util.Collection < T > sortItems ( java.util.Collection < T > items ) { if ( ( items == null ) || ( ( comparator ) == null ) ) { return items ; } java.util.SortedSet < T > sortedItems = new java.util.TreeSet < T > ( comparator ) ; sortedItems.addAll ( items ) ; return sortedItems ; }

Target:
protected final java.util.Collection < T > sortItems ( java.util.Collection < T > items ) { if ( ( items == null ) || ( ( comparator ) == null ) ) { return items ; } java.util.List < T > sortedList = new java.util.ArrayList < T > ( items ) ; java.util.Collections.sort ( sortedList , comparator ) ; return sortedList ; }
Source:
public boolean validateCustomProperties ( java.util.List < java.lang.String > messages ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDbFacade ( ) . getStoragePoolDao ( ) . get ( getNetwork ( ) . getDataCenterId ( ) ) ; java.util.List < org.ovirt.engine.core.common.utils.customprop.ValidationError > errors = org.ovirt.engine.core.utils.customprop.DevicePropertiesUtils.getInstance ( ) . validateProperties ( dataCenter.getCompatibilityVersion ( ) , VmDeviceGeneralType.INTERFACE , vnicProfile.getCustomProperties ( ) ) ; if ( ! ( errors.isEmpty ( ) ) ) { org.ovirt.engine.core.utils.customprop.DevicePropertiesUtils.getInstance ( ) . handleCustomPropertiesError ( errors , messages ) ; return false ; } return true ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult passthroughProfileIsSupported ( ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dcDao.get ( getNetwork ( ) . getDataCenterId ( ) ) ; org.ovirt.engine.core.compat.Version dcCompatibilityVersion = dataCenter.getCompatibilityVersion ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_PASSTHROUGH_PROFILE_NOT_SUPPORTED ) . when ( ( ( vnicProfile.isPassthrough ( ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.sriov ( dcCompatibilityVersion ) ) ) ) ) ; }
Source:
private void handleFinalizingFailure ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { log.error ( "Finalizing failed transfer. {}" , getTransferDescription ( ) ) ; stopImageTransferSession ( context.entity ) ; setImageStatus ( ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Upload ) ? org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL : org.ovirt.engine.core.common.businessentities.storage.ImageStatus.OK ) ) ; updateEntityPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; }

Target:
private void handleFinalizingFailure ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { log.error ( "Finalizing failed transfer. {}" , getTransferDescription ( ) ) ; stopImageTransferSession ( context.entity ) ; setImageStatus ( ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Upload ) ? org.ovirt.engine.core.common.businessentities.storage.ImageStatus.ILLEGAL : org.ovirt.engine.core.common.businessentities.storage.ImageStatus.OK ) ) ; updateEntityPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; setAuditLogTypeFromPhase ( ImageTransferPhase.FINISHED_FAILURE ) ; }