auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain initStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setStoragePoolId ( storagePoolId ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; return storageDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain initStorageDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( storageDomainId ) ; storageDomain.setStoragePoolId ( storagePoolId ) ; command.setStorageDomain ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( storageDomain ) ; org.mockito.Mockito.when ( storageDomainDao.getForStoragePool ( storageDomainId , storagePoolId ) ) . thenReturn ( storageDomain ) ; return storageDomain ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpGetPayloadExpectations ( 0 ) ; setUpGetBallooningExpectations ( ) ; setUpActionExpectations ( VdcActionType.RemoveVm , org.ovirt.engine.core.common.action.RemoveVmParameters.class , new java.lang.String [ ] { "VmId" , "Force" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
public org.ovirt.engine.api.model.Label get ( ) { org.ovirt.engine.api.model.Labels labels = parent.list ( ) ; if ( labels != null ) { for ( org.ovirt.engine.api.model.Label label : labels.getLabels ( ) ) { if ( label.getId ( ) . equals ( id ) ) { parent.addParents ( label ) ; return addLinks ( label ) ; } } } return notFound ( ) ; }

Target:
public org.ovirt.engine.api.model.NetworkLabel get ( ) { org.ovirt.engine.api.model.NetworkLabels labels = parent.list ( ) ; if ( labels != null ) { for ( org.ovirt.engine.api.model.NetworkLabel label : labels.getNetworkLabels ( ) ) { if ( label.getId ( ) . equals ( id ) ) { parent.addParents ( label ) ; return addLinks ( label ) ; } } } return notFound ( ) ; }
Source:
private void prepareCommand ( ) { parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; parameters.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand < org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase > ( parameters ) ) ; org.mockito.Mockito.doReturn ( storageConnDao ) . when ( command ) . getStorageConnDao ( ) ; org.mockito.Mockito.doReturn ( storageDomainDynamicDao ) . when ( command ) . getStorageDomainDynamicDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolIsoMapDAO ) . when ( command ) . getStoragePoolIsoMapDao ( ) ; }

Target:
private void prepareCommand ( ) { parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; parameters.setStoragePoolId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.UpdateStorageServerConnectionCommand < org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase > ( parameters ) ) ; org.mockito.Mockito.doReturn ( storageConnDao ) . when ( command ) . getStorageConnDao ( ) ; org.mockito.Mockito.doReturn ( storageDomainDynamicDao ) . when ( command ) . getStorageDomainDynamicDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolIsoMapDAO ) . when ( command ) . getStoragePoolIsoMapDao ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc sendHcCmdToDesktop ( java.lang.String vmId , java.lang.String hcCommand ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.sendHcCmdToDesktop ( vmId , hcCommand ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc desktopLogoff ( java.lang.String vmId , java.lang.String force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.desktopLogoff ( vmId , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { NON_EXISTANT_GUID } , null ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
protected void setUpCreationExpectations ( ) { setUpCreationExpectations ( VdcActionType.AddVmTemplate , org.ovirt.engine.core.common.action.AddVmTemplateParameters.class , new java.lang.String [ ] { "Name" , "Description" } , new java.lang.Object [ ] { NAMES [ 0 ] , DESCRIPTIONS [ 0 ] } , true , true , GUIDS [ 0 ] , asList ( GUIDS [ 2 ] ) , org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.asList ( new org.ovirt.engine.core.common.businessentities.AsyncTaskStatus ( org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.finished ) ) , VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , org.ovirt.engine.api.restapi.resource.BackendTemplatesBasedResourceTest.getEntity ( 0 ) ) ; }
Source:
public void setBreadCrumbs ( org.ovirt.engine.ui.common.widget.OvirtBreadCrumbs < T , ? > breadCrumbs ) { if ( ( breadCrumbsColumn ) != null ) { breadCrumbsColumn.clear ( ) ; breadCrumbsColumn.add ( breadCrumbs ) ; } }

Target:
public void setInSlot ( java.lang.Object slot , com.google.gwt.user.client.ui.IsWidget content ) { if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.TYPE_SetSearchPanel ) ) { if ( content != null ) { actionPanel.setSearchPanel ( content ) ; actionPanel.setVisible ( true ) ; } else { actionPanel.setVisible ( false ) ; } } else if ( slot == ( org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.TYPE_SetBreadCrumbs ) ) { breadCrumbsColumn.clear ( ) ; if ( content != null ) { breadCrumbsColumn.add ( content ) ; } } else { super . setInSlot ( slot , content ) ; } }
Source:
public static java.lang.Integer getMaxMemorySizeInMb ( org.ovirt.engine.core.common.businessentities.VmOsType osType , java.lang.String clusterVersion ) { if ( ( ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.Other ) ) || ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux ) ) ) || ( osType.name ( ) . toLowerCase ( ) . endsWith ( org.ovirt.engine.core.common.utils.VmValidationUtils.X64BIT ) ) ) { return org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VM64BitMaxMemorySizeInMB , clusterVersion ) ; } return org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VM32BitMaxMemorySizeInMB ) ; }

Target:
public static java.lang.Integer getMaxMemorySizeInMb ( org.ovirt.engine.core.common.businessentities.VmOsType osType , java.lang.String clusterVersion ) { if ( ( ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.Other ) ) || ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux ) ) ) || ( osType.name ( ) . toLowerCase ( ) . endsWith ( org.ovirt.engine.core.bll.validator.VmValidationUtils.X64BIT ) ) ) { return org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VM64BitMaxMemorySizeInMB , clusterVersion ) ; } return org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VM32BitMaxMemorySizeInMB ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VM readVmFromOvf ( java.lang.String ovf ) { try { return new org.ovirt.engine.core.bll.OvfHelper ( ) . readVmFromOvf ( ovf ) ; } catch ( org.ovirt.engine.core.utils.ovf.OvfReaderException e ) { org.ovirt.engine.core.bll.ConvertVmCommand.log.debug ( ( "failed to parse a given ovf configuration: \n " + ovf ) , e ) ; auditLog ( this , AuditLogType.IMPORTEXPORT_INVALID_OVF ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( ) ; } }

Target:
private org.ovirt.engine.core.common.businessentities.VM readVmFromOvf ( java.lang.String ovf ) { try { return new org.ovirt.engine.core.bll.storage.ovfstore.OvfHelper ( ) . readVmFromOvf ( ovf ) ; } catch ( org.ovirt.engine.core.utils.ovf.OvfReaderException e ) { org.ovirt.engine.core.bll.ConvertVmCommand.log.debug ( ( "failed to parse a given ovf configuration: \n " + ovf ) , e ) ; auditLog ( this , AuditLogType.IMPORTEXPORT_INVALID_OVF ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( ) ; } }
Source:
private static boolean isVnicProfilePermitted ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user , org.ovirt.engine.core.common.businessentities.network.VnicProfile profile , boolean portMirroringRequired ) { return ( portMirroringRequired == ( profile.isPortMirroring ( ) ) ) && ( ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.getPermissionDAO ( ) . getEntityPermissions ( user.getId ( ) , ActionGroup.CONFIGURE_VM_NETWORK , profile.getId ( ) , VdcObjectType.VnicProfile ) ) != null ) ; }

Target:
private static boolean isVnicProfilePermitted ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user , org.ovirt.engine.core.common.businessentities.network.VnicProfile profile , boolean portMirroringRequired ) { return ( portMirroringRequired == ( profile.isPortMirroring ( ) ) ) && ( ( org.ovirt.engine.core.bll.network.vm.VnicProfileHelper.getPermissionDao ( ) . getEntityPermissions ( user.getId ( ) , ActionGroup.CONFIGURE_VM_NETWORK , profile.getId ( ) , VdcObjectType.VnicProfile ) ) != null ) ; }
Source:
protected void perform ( ) { if ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . isRunningOrPaused ( ) ) { setActionReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ChangeFloppy , new org.ovirt.engine.core.common.vdscommands.ChangeDiskVDSCommandParameters ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . getId ( ) , mCdImagePath ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.ChangeFloppyCommand.setSucceeded ( true ) ; } }

Target:
protected void perform ( ) { if ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . isRunningOrPaused ( ) ) { setActionReturnValue ( runVdsCommand ( VDSCommandType.ChangeFloppy , new org.ovirt.engine.core.common.vdscommands.ChangeDiskVDSCommandParameters ( org.ovirt.engine.core.bll.ChangeFloppyCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ChangeFloppyCommand.getVm ( ) . getId ( ) , mCdImagePath ) ) . getReturnValue ( ) ) ; org.ovirt.engine.core.bll.ChangeFloppyCommand.setSucceeded ( true ) ; } }
Source:
public static void getRedirectServletReportsPage ( 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.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase runCanDoActionOnly ( final int currentCanDoActionId , final int totalSize ) { org.ovirt.engine.core.bll.CommandBase < ? > command = getCommands ( ) . get ( currentCanDoActionId ) ; java.lang.String actionType = command.getActionType ( ) . toString ( ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setCorrelationId ( command.getCorrelationId ( ) ) ; try { org.ovirt.engine.core.bll.MultipleActionsRunner.log.infoFormat ( "Start running CanDoAction for command number {0}/{1} (Command type: {2})" , ( currentCanDoActionId + 1 ) , totalSize , actionType ) ; return command.canDoActionOnly ( ) ; } finally { org.ovirt.engine.core.bll.MultipleActionsRunner.log.infoFormat ( "Finish handling CanDoAction for command number {0}/{1} (Command type: {2})" , ( currentCanDoActionId + 1 ) , totalSize , actionType ) ; } }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase runCanDoActionOnly ( final int currentCanDoActionId , final int totalSize ) { org.ovirt.engine.core.bll.CommandBase < ? > command = getCommands ( ) . get ( currentCanDoActionId ) ; java.lang.String actionType = command.getActionType ( ) . toString ( ) ; org.ovirt.engine.core.utils.CorrelationIdTracker.setCorrelationId ( command.getCorrelationId ( ) ) ; try { org.ovirt.engine.core.bll.MultipleActionsRunner.log.infoFormat ( "Start running CanDoAction for command number {0}/{1} (Command type: {2})" , ( currentCanDoActionId + 1 ) , totalSize , actionType ) ; return command.canDoActionOnly ( ) ; } finally { org.ovirt.engine.core.bll.MultipleActionsRunner.log.infoFormat ( "Finish handling CanDoAction for command number {0}/{1} (Command type: {2})" , ( currentCanDoActionId + 1 ) , totalSize , actionType ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.VDSGroup getByName ( java.lang.String name ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vds_group_name" , name ) . addValue ( "is_case_sensitive" , true ) ; return ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( org.ovirt.engine.core.dal.dbbroker.DbFacadeUtils.asSingleResult ( getCallsHandler ( ) . executeReadList ( "GetVdsGroupByVdsGroupName" , org.ovirt.engine.core.dao.VdsGroupDAODbFacadeImpl.VdsGroupRowMapper.instance , parameterSource ) ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > getClustersByServiceAndCompatibilityVersion ( boolean glusterService , boolean virtService , java.lang.String compatibilityVersion ) { return getCallsHandler ( ) . executeReadList ( "GetVdsGroupsByServiceAndCompatibilityVersion" , org.ovirt.engine.core.dao.VdsGroupDAODbFacadeImpl.VdsGroupRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "gluster_service" , glusterService ) . addValue ( "virt_service" , virtService ) . addValue ( "compatibility_version" , compatibilityVersion ) ) ; }
Source:
public void testGetDiskHotpluggableInterfaces ( ) { java.util.Set < java.lang.String > diskHotpluggableInterfaces = OsRepositoryImpl.INSTANCE.getDiskHotpluggableInterfaces ( 777 , null ) ; org.junit.Assert.assertEquals ( 2 , diskHotpluggableInterfaces.size ( ) ) ; for ( java.lang.String diskHotpluggableInterface : org.ovirt.engine.core.utils.OsRepositoryImplTest.DISK_HOTPLUGGABLE_INTERFACES.split ( "," ) ) { org.junit.Assert.assertTrue ( diskHotpluggableInterfaces.contains ( diskHotpluggableInterface.trim ( ) ) ) ; } }

Target:
public void testGetDiskHotpluggableInterfaces ( ) { java.util.Set < java.lang.String > diskHotpluggableInterfaces = OsRepositoryImpl.INSTANCE.getDiskHotpluggableInterfaces ( 777 , null ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , diskHotpluggableInterfaces.size ( ) ) ; for ( java.lang.String diskHotpluggableInterface : org.ovirt.engine.core.utils.OsRepositoryImplTest.DISK_HOTPLUGGABLE_INTERFACES.split ( "," ) ) { org.junit.jupiter.api.Assertions.assertTrue ( diskHotpluggableInterfaces.contains ( diskHotpluggableInterface.trim ( ) ) ) ; } }
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 ( ) ) ; macPoolListEditor.setLabel ( constants.dataCenterPopupMacPoolLabel ( ) ) ; }

Target:
void localize ( ) { nameEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.datacenter.DataCenterPopupView.constants.nameLabel ( ) ) ; descriptionEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.datacenter.DataCenterPopupView.constants.descriptionLabel ( ) ) ; commentEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.datacenter.DataCenterPopupView.constants.commentLabel ( ) ) ; storagePoolTypeEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.datacenter.DataCenterPopupView.constants.dataCenterPopupStorageTypeLabel ( ) ) ; versionEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.datacenter.DataCenterPopupView.constants.dataCenterPopupVersionLabel ( ) ) ; quotaEnforceTypeEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.datacenter.DataCenterPopupView.constants.dataCenterPopupQuotaEnforceTypeLabel ( ) ) ; macPoolListEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.datacenter.DataCenterPopupView.constants.dataCenterPopupMacPoolLabel ( ) ) ; }
Source:
private org.mockito.ArgumentMatcher < org.ovirt.engine.core.common.vdscommands.VDSParametersBase > vdsServer1 ( ) { return new org.mockito.ArgumentMatcher < org.ovirt.engine.core.common.vdscommands.VDSParametersBase > ( ) { @ java.lang.Override public boolean matches ( java.lang.Object argument ) { if ( ! ( argument instanceof org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ) ) { return false ; } return ( ( org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ) ( argument ) ) . getVdsId ( ) . equals ( org.ovirt.engine.core.bll.gluster.GlusterHookSyncJobTest.SERVER_GUIDS [ 0 ] ) ; } } ; }

Target:
private org.mockito.ArgumentMatcher < org.ovirt.engine.core.common.vdscommands.VDSParametersBase > vdsServerWithGuid ( int index ) { return new org.mockito.ArgumentMatcher < org.ovirt.engine.core.common.vdscommands.VDSParametersBase > ( ) { @ java.lang.Override public boolean matches ( java.lang.Object argument ) { if ( ! ( argument instanceof org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ) ) { return false ; } return ( ( org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase ) ( argument ) ) . getVdsId ( ) . equals ( org.ovirt.engine.core.bll.gluster.GlusterHookSyncJobTest.SERVER_GUIDS [ index ] ) ; } } ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; setUriInfo ( setUpGetMatrixConstraintsExpectations ( BackendHostResource.FORCE_CONSTRAINT , false , null ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public boolean equals ( java.lang.Object obj ) { if ( obj instanceof org.ovirt.api.metamodel.concepts.Name ) { org.ovirt.api.metamodel.concepts.Name that = ( ( org.ovirt.api.metamodel.concepts.Name ) ( obj ) ) ; return this . words.equals ( that.words ) ; } return false ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.api.metamodel.concepts.Name ) ) { return false ; } org.ovirt.api.metamodel.concepts.Name other = ( ( org.ovirt.api.metamodel.concepts.Name ) ( obj ) ) ; return java.util.Objects.equals ( words , other.words ) ; }
Source:
private boolean getQuotaExceeded ( org.ovirt.engine.core.common.businessentities.QuotaStorage quota ) { if ( ( quota.getStorageSizeGB ( ) ) == null ) { return false ; } return ( ( quota.getStorageSizeGB ( ) ) != ( org.ovirt.engine.core.common.businessentities.QuotaStorage.UNLIMITED ) ) && ( ( quota.getStorageSizeGB ( ) ) < ( quota.getStorageSizeGBUsage ( ) ) ) ; }

Target:
private boolean getQuotaExceeded ( org.ovirt.engine.core.common.businessentities.QuotaStorage quota ) { if ( ( quota.getStorageSizeGB ( ) ) == null ) { return false ; } return ( ( quota.getStorageSizeGB ( ) . longValue ( ) ) != ( QuotaStorage.UNLIMITED.longValue ( ) ) ) && ( ( quota.getStorageSizeGB ( ) ) < ( quota.getStorageSizeGBUsage ( ) ) ) ; }
Source:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getSnapshotDescriptionColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) . getVmSnapshotDescription ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > getSnapshotDescriptionColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) . getVmSnapshotDescription ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
public void testChangeQuotaForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.ovirt.engine.core.compat.Guid quotaId = imageStorageDomainMap.getQuotaId ( ) ; if ( quotaId.equals ( FixturesTool.DEFAULT_QUOTA_GENERAL ) ) { org.junit.Assert.fail ( "Same source and dest quota id, cannot perform test" ) ; } dao.updateQuotaForImageAndSnapshots ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DISK_ID , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID , FixturesTool.DEFAULT_QUOTA_GENERAL ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; quotaId = imageStorageDomainMap.getQuotaId ( ) ; org.junit.Assert.assertEquals ( "quota wasn't changed" , FixturesTool.DEFAULT_QUOTA_GENERAL , quotaId ) ; }

Target:
public void testChangeQuotaForDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; org.ovirt.engine.core.compat.Guid quotaId = imageStorageDomainMap.getQuotaId ( ) ; if ( quotaId.equals ( FixturesTool.DEFAULT_QUOTA_GENERAL ) ) { org.junit.Assert.fail ( "Same source and dest quota id, cannot perform test" ) ; } dao.updateQuotaForImageAndSnapshots ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DISK_ID , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , FixturesTool.DEFAULT_QUOTA_GENERAL ) ; imageStorageDomainMap = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID ) . get ( 0 ) ; quotaId = imageStorageDomainMap.getQuotaId ( ) ; org.junit.Assert.assertEquals ( "quota wasn't changed" , FixturesTool.DEFAULT_QUOTA_GENERAL , quotaId ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc createVolumeContainer ( java.lang.String sdUUID , java.lang.String imgGUID , java.lang.String size , int volFormat , int diskType , java.lang.String volUUID , java.lang.String descr , java.lang.String srcImgGUID , java.lang.String srcVolUUID ) { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.createVolumeContainer ( sdUUID , imgGUID , size , volFormat , diskType , volUUID , descr , srcImgGUID , srcVolUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc add_image_ticket ( java.lang.String ticketId , java.lang.String [ ] ops , long timeout , long size , java.lang.String url ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.add_image_ticket ( ticketId , ops , timeout , size , url ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public static void serialize ( com.google.gwt.user.client.rpc.SerializationStreamWriter writer , org.ovirt.engine.core.aaa.DirectoryGroup group ) throws com.google.gwt.user.client.rpc.SerializationException { writer.writeObject ( group.getDirectoryName ( ) ) ; writer.writeObject ( group.getId ( ) ) ; writer.writeString ( group.getName ( ) ) ; }

Target:
public static void serialize ( com.google.gwt.user.client.rpc.SerializationStreamWriter writer , org.ovirt.engine.core.aaa.DirectoryGroup group ) throws com.google.gwt.user.client.rpc.SerializationException { writer.writeObject ( group.getDirectoryName ( ) ) ; writer.writeObject ( group.getNamespace ( ) ) ; writer.writeObject ( group.getId ( ) ) ; writer.writeString ( group.getName ( ) ) ; }
Source:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( UpgradeError.VM_NUMA_PINNED ) ; }

Target:
public void shouldDetectCpuPinning ( ) { invalidVM.setCpuPinning ( "i am pinned" ) ; org.assertj.core.api.Assertions.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) ) . contains ( EngineMessage.CLUSTER_UPGRADE_DETAIL_VM_CPUS_PINNED.name ( ) ) ; }
Source:
private java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > getDiskMap ( ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > map = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getEntity ( i ) ) ) ; map.put ( disk.getId ( ) , disk ) ; } return map ; }

Target:
private java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskMap ( ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > map = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getEntity ( i ) ) ) ; map.put ( disk.getId ( ) , disk ) ; } return map ; }
Source:
private void takeVm ( ) { org.ovirt.engine.core.common.businessentities.VmPool entity = ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( getItem ( ) . getEntity ( ) ) ) ; org.ovirt.engine.core.common.action.VmPoolUserParameters params = new org.ovirt.engine.core.common.action.VmPoolUserParameters ( entity.getVmPoolId ( ) , org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoggedInUser ( ) , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.AttachUserToVmFromPoolAndRun , params , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { return ; } } } , this ) ; }

Target:
private void takeVm ( ) { org.ovirt.engine.core.common.businessentities.VmPool entity = ( ( org.ovirt.engine.core.common.businessentities.VmPool ) ( getItem ( ) . getEntity ( ) ) ) ; org.ovirt.engine.core.common.action.VmPoolUserParameters params = new org.ovirt.engine.core.common.action.VmPoolUserParameters ( entity.getVmPoolId ( ) , org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoggedInUser ( ) , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.AttachUserToVmFromPoolAndRun , params , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { if ( ! ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { return ; } } } , this ) ; }
Source:
protected org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao getVmNetworkInterfaceDao ( ) { return new org.ovirt.engine.core.dao.network.VmNetworkInterfaceDaoDbFacadeImpl ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > getAllForVm ( org.ovirt.engine.core.compat.Guid id ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; }

Target:
public void testNoDiskBootFromIsoDomain ( ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer mock = mockIsoDomainListSyncronizer ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.compat.Guid ( ) ) . when ( mock ) . findActiveISODomain ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.CD , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , true , null ) ; }
Source:
public void BuildNetwork ( ) { _writer.WriteStartElement ( "Section" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.XSI_URI , "type" , ( ( OVF_PREFIX ) + ":NetworkSection_Type" ) ) ; _writer.WriteStartElement ( "Info" ) ; _writer.WriteRaw ( "List of networks" ) ; _writer.WriteEndElement ( ) ; _writer.WriteStartElement ( "Network" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "name" , "Network 1" ) ; _writer.WriteEndElement ( ) ; _writer.WriteEndElement ( ) ; }

Target:
public void buildNetwork ( ) { _writer.WriteStartElement ( "Section" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.XSI_URI , "type" , ( ( OVF_PREFIX ) + ":NetworkSection_Type" ) ) ; _writer.WriteStartElement ( "Info" ) ; _writer.WriteRaw ( "List of networks" ) ; _writer.WriteEndElement ( ) ; _writer.WriteStartElement ( "Network" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "name" , "Network 1" ) ; _writer.WriteEndElement ( ) ; _writer.WriteEndElement ( ) ; }
Source:
public static void GetExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
protected void verifyCollection ( java.util.List < R > collection ) throws java.lang.Exception { super . verifyCollection ( collection ) ; java.util.List < java.lang.String > populateHeader = httpHeaders.getRequestHeader ( BackendResource.POPULATE ) ; boolean populated = ( populateHeader != null ) ? populateHeader.contains ( "true" ) : false ; for ( R template : collection ) { org.junit.Assert.assertTrue ( ( populated ? template.isSetConsole ( ) : ! ( template.isSetConsole ( ) ) ) ) ; } }

Target:
protected void verifyCollection ( java.util.List < R > collection ) throws java.lang.Exception { super . verifyCollection ( collection ) ; java.util.List < java.lang.String > populateHeader = httpHeaders.getRequestHeader ( BackendResource.POPULATE ) ; boolean populated = ( populateHeader != null ) ? populateHeader.contains ( "true" ) : false ; for ( R template : collection ) { org.junit.jupiter.api.Assertions.assertTrue ( ( populated ? template.isSetConsole ( ) : ! ( template.isSetConsole ( ) ) ) ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( new org.ovirt.engine.core.compat.Guid ( ) ) ; vds.setVdsName ( "gfs1" ) ; vds.setVdsGroupId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQueryTest.CLUSTER_ID ) ; vds.setStatus ( status ) ; return vds ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vds.setVdsName ( "gfs1" ) ; vds.setVdsGroupId ( org.ovirt.engine.core.bll.gluster.GetGlusterVolumeProfileInfoQueryTest.CLUSTER_ID ) ; vds.setStatus ( status ) ; return vds ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { this . stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; hosts.add ( 0 , null ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ) { if ( ( host.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { hosts.add ( host ) ; } } proxyHosts.setItems ( hosts ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > filterUpHosts ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDS host : hosts ) { if ( ( host.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { result.add ( host ) ; } } return result ; }
Source:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getSelectableModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > cast ( getModel ( ) . getItems ( ) ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > filterredItems = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : items ) { if ( ( ( org.ovirt.engine.ui.uicommonweb.models.Model ) ( model ) ) . getIsSelectable ( ) ) { filterredItems.add ( model ) ; } } return filterredItems ; }

Target:
public java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getSelectableModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > cast ( getModel ( ) . getStorageModels ( ) ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > filterredItems = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : items ) { if ( ( ( org.ovirt.engine.ui.uicommonweb.models.Model ) ( model ) ) . getIsSelectable ( ) ) { filterredItems.add ( model ) ; } } return filterredItems ; }
Source:
private void initSorting ( ) { vmStatusColumn.makeSortable ( ) ; nameColumn.makeSortable ( ) ; clusterColumn.makeSortable ( ) ; ipColumn.makeSortable ( ) ; fqdnColumn.makeSortable ( ) ; nicActivateStatusColumn.makeSortable ( ) ; vnicNameColumn.makeSortable ( ) ; descriptionColumn.makeSortable ( ) ; }

Target:
private void initSorting ( ) { vmStatusColumn.makeSortable ( ) ; nameColumn.makeSortable ( ) ; clusterColumn.makeSortable ( ) ; ipColumn.makeSortable ( ) ; fqdnColumn.makeSortable ( ) ; nicActivateStatusColumn.makeSortable ( ) ; vnicNameColumn.makeSortable ( ) ; rxColumn.makeSortable ( ) ; txColumn.makeSortable ( ) ; descriptionColumn.makeSortable ( ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { boolean detachOnly = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendDiskAttachmentResource.DETACH_ONLY , true , true ) ; if ( detachOnly ) { return performAction ( VdcActionType.DetachDiskFromVm , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( guid , vmId ) ) ) ; } else { return performAction ( VdcActionType.RemoveDisk , new org.ovirt.engine.core.common.action.RemoveDiskParameters ( guid ) ) ; } }

Target:
public javax.ws.rs.core.Response remove ( ) { boolean detachOnly = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendDiskAttachmentResource.DETACH_ONLY , true , true ) ; if ( detachOnly ) { return performAction ( ActionType.DetachDiskFromVm , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( guid , vmId ) ) ) ; } else { return performAction ( ActionType.RemoveDisk , new org.ovirt.engine.core.common.action.RemoveDiskParameters ( guid ) ) ; } }
Source:
public void scheduleAJob ( ) throws java.lang.InterruptedException , org.quartz.SchedulerException { org.ovirt.engine.core.utils.timer.DummyJob dummyJob = new org.ovirt.engine.core.utils.timer.DummyJob ( ) ; java.lang.String jobName = org.ovirt.engine.core.utils.timer.DBSchedulerUtilQuartzImplTest.scheduler.scheduleAOneTimeJob ( dummyJob , "dummyScheduleMethod" , new java.lang.Class [ ] { java.lang.String.class } , new java.lang.Object [ ] { "scheduleAJob" } , 1 , java.util.concurrent.TimeUnit.MILLISECONDS ) ; java.lang.Thread.sleep ( 10 ) ; try { org.quartz.JobDetail job = org.ovirt.engine.core.utils.timer.DBSchedulerUtilQuartzImplTest.scheduler.getRawScheduler ( ) . getJobDetail ( org.quartz.JobKey.jobKey ( jobName ) ) ; org.junit.Assert.assertNotNull ( job ) ; } finally { org.ovirt.engine.core.utils.timer.DBSchedulerUtilQuartzImplTest.scheduler.deleteJob ( jobName ) ; } }

Target:
public void scheduleAJob ( ) throws java.lang.InterruptedException , org.quartz.SchedulerException { org.ovirt.engine.core.utils.timer.DBSchedulerUtilQuartzImplTest.DummyJob dummyJob = new org.ovirt.engine.core.utils.timer.DBSchedulerUtilQuartzImplTest.DummyJob ( ) ; java.lang.String jobName = org.ovirt.engine.core.utils.timer.DBSchedulerUtilQuartzImplTest.scheduler.scheduleAOneTimeJob ( dummyJob , "dummyScheduleMethod" , new java.lang.Class [ ] { java.lang.String.class } , new java.lang.Object [ ] { "scheduleAJob" } , 1 , java.util.concurrent.TimeUnit.MILLISECONDS ) ; java.lang.Thread.sleep ( 10 ) ; try { org.quartz.JobDetail job = org.ovirt.engine.core.utils.timer.DBSchedulerUtilQuartzImplTest.scheduler.getRawScheduler ( ) . getJobDetail ( org.quartz.JobKey.jobKey ( jobName ) ) ; org.junit.Assert.assertNotNull ( job ) ; } finally { org.ovirt.engine.core.utils.timer.DBSchedulerUtilQuartzImplTest.scheduler.deleteJob ( jobName ) ; } }
Source:
public static boolean isSane ( java.lang.String path ) { final int length = path.length ( ) ; if ( length > ( org.ovirt.engine.core.utils.servlet.ServletUtils.PATH_MAX ) ) { org.ovirt.engine.core.utils.servlet.ServletUtils.log.error ( ( ( ( ( "The path is " + length ) + " characters long, which is longer than the maximum allowed " ) + ( org.ovirt.engine.core.utils.servlet.ServletUtils.PATH_MAX ) ) + "." ) ) ; return false ; } if ( ( ( path.contains ( ".." ) ) || ( path.contains ( "//" ) ) ) || ( path.contains ( "./" ) ) ) { org.ovirt.engine.core.utils.servlet.ServletUtils.log.error ( "The path contains potentially dangerous directory navigation sequences." ) ; return false ; } return true ; }

Target:
public static java.io.File makeFileFromSanePath ( java.lang.String path , java.io.File base ) { java.io.File file = null ; if ( path == null ) { file = base ; } else if ( ! ( org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( path ) ) ) { org.ovirt.engine.core.utils.servlet.ServletUtils.log.error ( "The path '{}' is not sane, will return null." , path ) ; } else { file = new java.io.File ( base , path ) ; } return file ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroup ( ) { if ( ( vdsGroup ) == null ) { vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setvds_group_id ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vdsGroup.setcompatibility_version ( Version.v3_3 ) ; vdsGroup.setcpu_name ( "Intel Conroe Family" ) ; vdsGroup.setArchitecture ( ArchitectureType.x86_64 ) ; } return vdsGroup ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroup ( ) { if ( ( vdsGroup ) == null ) { vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vdsGroup.setCompatibilityVersion ( Version.v3_3 ) ; vdsGroup.setCpuName ( "Intel Conroe Family" ) ; vdsGroup.setArchitecture ( ArchitectureType.x86_64 ) ; } return vdsGroup ; }