auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.FencingPolicy ) ) { return false ; } org.ovirt.engine.core.common.businessentities.FencingPolicy other = ( ( org.ovirt.engine.core.common.businessentities.FencingPolicy ) ( obj ) ) ; return ( skipFencingIfSDActive ) == ( other.skipFencingIfSDActive ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.FencingPolicy ) ) { return false ; } org.ovirt.engine.core.common.businessentities.FencingPolicy other = ( ( org.ovirt.engine.core.common.businessentities.FencingPolicy ) ( obj ) ) ; return ( ( ( skipFencingIfSDActive ) == ( other.skipFencingIfSDActive ) ) && ( ( skipFencingIfConnectivityBroken ) == ( other.skipFencingIfConnectivityBroken ) ) ) && ( ( hostsWithBrokenConnectivityThreshold ) == ( other.hostsWithBrokenConnectivityThreshold ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult notRemovingUsedPool ( ) { final int dcUsageCount = getMacPoolDao ( ) . getDcUsageCount ( macPool.getId ( ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_STILL_USED_MAC_POOL ) . when ( ( dcUsageCount != 0 ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult notRemovingUsedPool ( ) { final org.ovirt.engine.core.dao.StoragePoolDAO storagePoolDao = getDbFacade ( ) . getStoragePoolDao ( ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = storagePoolDao.getAllDataCentersByMacPoolId ( macPool.getId ( ) ) ; final java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "DATACENTERS_USING_MAC_POOL" , dataCenters ) ; replacements.add ( VdcBllMessages.VAR__ENTITIES__DATA_CENTERS.name ( ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_REMOVE_STILL_USED_MAC_POOL , replacements.toArray ( new java.lang.String [ 0 ] ) ) . when ( ( ( dataCenters.size ( ) ) != 0 ) ) ; }
Source:
private java.lang.String getResponseBodyType ( org.ovirt.engine.sdk.entities.DetailedLink dl ) { java.lang.String responseBodyType ; if ( ( dl.getResponse ( ) ) != null ) { responseBodyType = dl.getResponse ( ) . getType ( ) ; } else { responseBodyType = null ; } return responseBodyType ; }

Target:
private void generateCode ( org.ovirt.engine.sdk.codegen.utils.Tree < org.ovirt.engine.sdk.codegen.rsdl.Location > tree ) { if ( org.ovirt.engine.sdk.codegen.rsdl.LocationRules.isEntity ( tree ) ) { if ( org.ovirt.engine.sdk.codegen.rsdl.LocationRules.isSubEntity ( tree ) ) { addSubResource ( tree ) ; } else { addResource ( tree ) ; } } else if ( org.ovirt.engine.sdk.codegen.rsdl.LocationRules.isCollection ( tree ) ) { if ( org.ovirt.engine.sdk.codegen.rsdl.LocationRules.isSubCollection ( tree ) ) { addSubCollection ( tree ) ; } else { addCollection ( tree ) ; } } }
Source:
public java.lang.Void runInTransaction ( ) { if ( ( isNameChanged ( ) ) || ( isDescriptionChanged ( ) ) ) { getDbFacade ( ) . getIscsiBondDao ( ) . update ( getIscsiBond ( ) ) ; } updateNetworksIds ( ) ; updateConnectionsIds ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { if ( ( isNameChanged ( ) ) || ( isDescriptionChanged ( ) ) ) { getDbFacade ( ) . getIscsiBondDao ( ) . update ( getIscsiBond ( ) ) ; } removedNetworks = updateNetworksIds ( ) ; updateConnectionsIds ( ) ; return null ; }
Source:
private void updateNumOfMonitors ( ) { if ( isVncSelected ( ) ) { getNumOfMonitors ( ) . setSelectedItem ( 1 ) ; getNumOfMonitors ( ) . setIsChangable ( false ) ; } else { getNumOfMonitors ( ) . setIsChangable ( true ) ; } }

Target:
protected java.lang.String getIconToShow ( java.lang.String currentOsDefaultIcon ) { if ( ( getIcon ( ) . getEntity ( ) ) == null ) { return currentOsDefaultIcon ; } return getIcon ( ) . getEntity ( ) . isCustom ( ) ? getIcon ( ) . getEntity ( ) . getIcon ( ) : currentOsDefaultIcon ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkAttachmentById , org.ovirt.engine.core.common.queries.IdQueryParameters.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.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment model = createIncompleteNetworkAttachment ( ) ; setUriInfo ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.setUpBasicUriExpectations ( ) ) ; setUpVerifyHostExpectations ( ) ; control.replay ( ) ; try { collection.add ( model ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "NetworkAttachment" , "add" , getIncompleteFields ( ) ) ; } }
Source:
public void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
protected void setUpGetHostByNameExpectations ( int idx ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.setUpEntityExpectations ( org.mockito.Mockito.spy ( new org.ovirt.engine.core.common.businessentities.VDS ( ) ) , idx ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ idx ] } , host ) ; }

Target:
protected void setUpGetHostByNameExpectations ( int idx ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.setUpEntityExpectations ( org.mockito.Mockito.spy ( new org.ovirt.engine.core.common.businessentities.VDS ( ) ) , idx ) ; setUpGetEntityExpectations ( QueryType.GetVdsByName , org.ovirt.engine.core.common.queries.NameQueryParameters.class , new java.lang.String [ ] { "Name" } , new java.lang.Object [ ] { NAMES [ idx ] } , host ) ; }
Source:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.api.model.Disk entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetAllDisksByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.PARENT_ID } , entity ) ; } }

Target:
public void testMoveBySdId ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , getEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.MoveDisks , org.ovirt.engine.core.common.action.MoveDisksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } ) ) ; verifyActionResponse ( resource.move ( setUpMoveParams ( false ) ) ) ; }
Source:
private void maybeSetEntity ( org.ovirt.engine.ui.uicommonweb.models.EntityModel listModel , java.lang.Object value ) { if ( ( ( listModel != null ) && ( listModel.getIsChangable ( ) ) ) && ( listModel.getIsAvailable ( ) ) ) { listModel.setEntity ( value ) ; } }

Target:
private < T > void maybeSetEntity ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < T > listModel , T value ) { if ( ( ( listModel != null ) && ( listModel.getIsChangable ( ) ) ) && ( listModel.getIsAvailable ( ) ) ) { listModel.setEntity ( value ) ; } }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.quota.QuotaModel object ) { this . model = object ; if ( ! ( firstTime ) ) { registerHandlers ( ) ; firstTime = true ; updateSliders ( ) ; } quotaClusterTable.edit ( object.getQuotaClusters ( ) ) ; quotaStorageTable.edit ( object.getQuotaStorages ( ) ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.QuotaPopupView.Driver.driver.edit ( object ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.quota.QuotaModel object ) { this . model = object ; if ( ! ( firstTime ) ) { registerHandlers ( ) ; firstTime = true ; updateSliders ( ) ; if ( object.isClusterQuota ( ) ) { quotaStoragePanel.setVisible ( false ) ; } else { quotaClusterPanel.setVisible ( false ) ; } } quotaClusterTable.edit ( object.getQuotaClusters ( ) ) ; quotaStorageTable.edit ( object.getQuotaStorages ( ) ) ; org.ovirt.engine.ui.webadmin.section.main.view.popup.quota.QuotaPopupView.Driver.driver.edit ( object ) ; }
Source:
private void initGeneralForm ( ) { org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel , org.ovirt.engine.ui.uicommonweb.models.vms.VmImportGeneralModel > modelProvider = new org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel , org.ovirt.engine.ui.uicommonweb.models.vms.VmImportGeneralModel > ( ) { @ java.lang.Override public org.ovirt.engine.ui.uicommonweb.models.vms.VmImportGeneralModel getModel ( ) { return getVmGeneralModel ( ) ; } @ java.lang.Override public void onSubTabSelected ( ) { } @ java.lang.Override public void onSubTabDeselected ( ) { } @ java.lang.Override public void activateDetailModel ( ) { } } ; generalView = new org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmGeneralSubTabView ( modelProvider ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmModel getMainModel ( ) { return null ; }
Source:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.common.job.Step step : job.getSteps ( ) ) { if ( ( step.getStatus ( ) ) == ( org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ) ) { step.setStatus ( job.getStatus ( ) ) ; step.setEndTime ( job.getEndTime ( ) ) ; } } jobDao.update ( job ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { jobDao.update ( job ) ; stepDao.updateJobStepsCompleted ( job.getId ( ) , job.getStatus ( ) , job.getEndTime ( ) ) ; return null ; }
Source:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password , org.ovirt.engine.core.common.businessentities.OriginType originType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , originType , vdsId , dataCenterId ) , aQuery ) ; }
Source:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network.Network before = dao.getByNameAndCluster ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 , FixturesTool.CLUSTER ) ; before.setDescription ( "This is a completely changed description" ) ; before.getDnsResolverConfiguration ( ) . getNameServers ( ) . add ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "1.1.1.1" ) ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network.Network after = dao.getByNameAndCluster ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 , FixturesTool.CLUSTER ) ; org.junit.Assert.assertNotNull ( after ) ; org.junit.Assert.assertEquals ( before , after ) ; }

Target:
public void testUpdate ( ) { org.ovirt.engine.core.common.businessentities.network.Network before = dao.getByNameAndCluster ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 , FixturesTool.CLUSTER ) ; before.setDescription ( "This is a completely changed description" ) ; before.getDnsResolverConfiguration ( ) . getNameServers ( ) . add ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "1.1.1.1" ) ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.network.Network after = dao.getByNameAndCluster ( org.ovirt.engine.core.dao.network.NetworkDaoTest.EXISTING_NETWORK_NAME1 , FixturesTool.CLUSTER ) ; org.junit.jupiter.api.Assertions.assertNotNull ( after ) ; org.junit.jupiter.api.Assertions.assertEquals ( before , after ) ; }
Source:
private static java.util.Map < java.lang.String , java.lang.Object > getMemExpr ( int numOfMonitors , boolean singleQxlPci ) { int heads = ( singleQxlPci ) ? numOfMonitors : 1 ; java.util.Map < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.HEADS , java.lang.String.valueOf ( heads ) ) ; specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.VRAM , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.singlePciVRamByHeads ( heads ) ) ; if ( singleQxlPci ) { specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.RAM , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.singlePciRamByHeads ( heads ) ) ; } return specParams ; }

Target:
private static java.util.Map < java.lang.String , java.lang.Object > getVideoDeviceSpecParams ( int numOfMonitors , boolean singleQxlPci ) { int heads = ( singleQxlPci ) ? numOfMonitors : 1 ; java.util.Map < java.lang.String , java.lang.Object > specParams = new java.util.HashMap < > ( ) ; specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.HEADS , java.lang.String.valueOf ( heads ) ) ; specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.VRAM , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.singlePciVRamByHeads ( heads ) ) ; if ( singleQxlPci ) { specParams.put ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.RAM , org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.singlePciRamByHeads ( heads ) ) ; } return specParams ; }
Source:
public void mapWatchdog ( ) { org.ovirt.engine.api.model.Watchdog model = new org.ovirt.engine.api.model.Watchdog ( ) ; model.setAction ( WatchdogAction.RESET ) ; model.setModel ( WatchdogModel.I6300ESB ) ; model.setId ( Guid.Empty.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VmWatchdog entity = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model , null ) ; org.junit.Assert.assertNotNull ( entity ) ; org.junit.Assert.assertEquals ( VmWatchdogAction.RESET , entity.getAction ( ) ) ; org.junit.Assert.assertEquals ( VmWatchdogType.i6300esb , entity.getModel ( ) ) ; }

Target:
public void mapWatchdog ( ) { org.ovirt.engine.api.model.Watchdog model = new org.ovirt.engine.api.model.Watchdog ( ) ; model.setAction ( WatchdogAction.RESET ) ; model.setModel ( WatchdogModel.I6300ESB ) ; model.setId ( Guid.Empty.toString ( ) ) ; org.ovirt.engine.core.common.businessentities.VmWatchdog entity = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model , null ) ; org.junit.jupiter.api.Assertions.assertNotNull ( entity ) ; org.junit.jupiter.api.Assertions.assertEquals ( VmWatchdogAction.RESET , entity.getAction ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( VmWatchdogType.i6300esb , entity.getModel ( ) ) ; }
Source:
private void editNetworkThreadCompat ( org.ovirt.engine.core.common.vdscommands.NetworkVdsmVDSCommandParameters parameters ) { try { retVal = runVdsCommand ( VDSCommandType.EditNetwork , parameters ) ; editNetworkDone = true ; } catch ( java.lang.RuntimeException e ) { if ( e instanceof org.ovirt.engine.core.common.errors.EngineException ) { org.ovirt.engine.core.bll.network.host.UpdateNetworkToVdsInterfaceCommand.getReturnValue ( ) . setFault ( new org.ovirt.engine.core.common.errors.VdcFault ( e , ( ( org.ovirt.engine.core.common.errors.EngineException ) ( e ) ) . getVdsError ( ) . getCode ( ) ) ) ; } } catch ( java.lang.Exception e ) { } finally { editNetworkThreadFinish = true ; } }

Target:
private void editNetworkThreadCompat ( org.ovirt.engine.core.common.vdscommands.NetworkVdsmVDSCommandParameters parameters ) { try { retVal = runVdsCommand ( VDSCommandType.EditNetwork , parameters ) ; editNetworkDone = true ; } catch ( java.lang.RuntimeException e ) { if ( e instanceof org.ovirt.engine.core.common.errors.EngineException ) { org.ovirt.engine.core.bll.network.host.UpdateNetworkToVdsInterfaceCommand.getReturnValue ( ) . setFault ( new org.ovirt.engine.core.common.errors.EngineFault ( e , ( ( org.ovirt.engine.core.common.errors.EngineException ) ( e ) ) . getVdsError ( ) . getCode ( ) ) ) ; } } catch ( java.lang.Exception e ) { } finally { editNetworkThreadFinish = true ; } }
Source:
public void onSuccess ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from Logoff." ) ; callback.asyncCallback.OnSuccess ( callback.getModel ( ) , result ) ; }

Target:
public void onSuccess ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from Logoff." ) ; callback.asyncCallback.OnSuccess ( callback.getModel ( ) , result ) ; if ( ( org.ovirt.engine.ui.frontend.Frontend.getLoginHandler ( ) ) != null ) { org.ovirt.engine.ui.frontend.Frontend.getLoginHandler ( ) . onLogout ( ) ; } }
Source:
private org.ovirt.engine.ui.common.widget.label.LabelWithCustomToolTip createInterfaceLabel ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { boolean hasLabels = ( ( iface.getLabels ( ) ) != null ) && ( ! ( iface.getLabels ( ) . isEmpty ( ) ) ) ; org.ovirt.engine.ui.common.widget.label.LabelWithCustomToolTip interfaceNameWithLabel = new org.ovirt.engine.ui.common.widget.label.LabelWithCustomToolTip ( ( hasLabels ? org.ovirt.engine.ui.webadmin.widget.host.InterfaceLabel.templates.textImageLabels ( iface.getName ( ) , org.ovirt.engine.ui.webadmin.widget.host.InterfaceLabel.labelImage ) : com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( iface.getName ( ) ) ) ) ; interfaceNameWithLabel.setTitle ( createLabelToolTip ( iface.getLabels ( ) ) ) ; return interfaceNameWithLabel ; }

Target:
private com.google.gwt.user.client.ui.HTML createInterfaceLabel ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { boolean hasLabels = ( ( iface.getLabels ( ) ) != null ) && ( ! ( iface.getLabels ( ) . isEmpty ( ) ) ) ; com.google.gwt.user.client.ui.HTML interfaceNameWithLabel = new com.google.gwt.user.client.ui.HTML ( ( hasLabels ? org.ovirt.engine.ui.webadmin.widget.host.InterfaceLabel.templates.textImageLabels ( iface.getName ( ) , org.ovirt.engine.ui.webadmin.widget.host.InterfaceLabel.labelImage ) : com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( iface.getName ( ) ) ) ) ; return interfaceNameWithLabel ; }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainsByIds ( java.util.List < org.ovirt.engine.core.compat.Guid > storageIds , java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > list = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid storageId : storageIds ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.ui.uicommonweb.Linq.getStorageById ( storageId , storageDomains ) ; if ( storageDomain != null ) { list.add ( storageDomain ) ; } } return list ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainsByIds ( java.util.List < org.ovirt.engine.core.compat.Guid > storageIds , java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { return org.ovirt.engine.ui.uicommonweb.Linq.where ( storageDomains , new org.ovirt.engine.ui.uicommonweb.Linq.IdsPredicate ( storageIds ) ) ; }
Source:
public org.ovirt.engine.core.bll.tasks.SPMAsyncTask concreteCreateTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.bll.CommandBase command , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , getAsyncTask ( taskId , command , asyncTaskCreationInfo , parentCommand ) ) ; p.setEntityInfo ( command.getParameters ( ) . getEntityInfo ( ) ) ; return createTask ( internalGetTaskType ( command ) , p ) ; }

Target:
public org.ovirt.engine.core.bll.tasks.SPMAsyncTask createTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType taskType , org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters taskParameters ) { return coCoAsyncTaskHelper.createTask ( taskType , taskParameters ) ; }
Source:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpUriExpectations ( null ) ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpQueryExpectations ( "" ) ; java.util.List < org.ovirt.engine.api.model.HostNIC > nics = getCollection ( ) ; assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testActionsInList ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpActionsUriExpectations ( ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; verifyActions ( collection.list ( ) ) ; }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters params = new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( ) ; params.setFilterOutExistingHosts ( filterOutExistingHosts ) ; params.setProviderId ( providerId ) ; params.setSearchFilter ( searchFilter ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , params , 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:
private java.lang.String prepareEntityNamesForMessage ( java.util.List < java.lang.String > entityNames ) { java.lang.StringBuilder domainNamesForMessage = new java.lang.StringBuilder ( ) ; for ( java.lang.String domainName : entityNames ) { domainNamesForMessage.append ( domainName ) ; domainNamesForMessage.append ( "," ) ; } domainNamesForMessage.deleteCharAt ( ( ( domainNamesForMessage.length ( ) ) - 1 ) ) ; return domainNamesForMessage.toString ( ) ; }

Target:
private java.lang.String prepareEntityNamesForMessage ( java.util.List < java.lang.String > entityNames ) { return org.apache.commons.lang.StringUtils.join ( entityNames , "," ) ; }
Source:
public void generateVersion ( ) { java.lang.String moduleName = rubyNames.getModuleName ( ) ; java.lang.String version = rubyNames.getVersion ( ) ; buffer.beginModule ( moduleName ) ; buffer.addLine ( "VERSION = '%1$s'" , version.toLowerCase ( ) ) ; buffer.endModule ( moduleName ) ; }

Target:
public void generateVersion ( ) { java.lang.String moduleName = rubyNames.getModuleName ( ) ; java.lang.String version = rubyNames.getVersion ( ) ; buffer.beginModule ( moduleName ) ; buffer.addLine ( "VERSION = '%1$s'.freeze" , version.toLowerCase ( ) ) ; buffer.endModule ( moduleName ) ; }
Source:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
public void testCleanNotExpiredUsersSessionsNoUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }

Target:
public void testRefreshUserSession ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , true ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return null since the session wasn't refresh" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateRequiredSpace ( double availableSize , double requiredSize ) { if ( availableSize >= requiredSize ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN , storageName ( ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateRequiredSpace ( java.lang.Long availableSize , double requiredSize ) { if ( ( availableSize == null ) || ( ( availableSize.doubleValue ( ) ) >= requiredSize ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN , storageName ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult qosExistsInDc ( ) { org.ovirt.engine.core.bll.validator.NetworkQosValidator qosValidator = new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( getDbFacade ( ) . getQosDao ( ) . get ( network.getQosId ( ) ) ) ; org.ovirt.engine.core.bll.ValidationResult res = qosValidator.qosExists ( ) ; return res == ( org.ovirt.engine.core.bll.ValidationResult.VALID ) ? qosValidator.consistentDataCenter ( ) : res ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult qosExistsInDc ( ) { org.ovirt.engine.core.bll.validator.NetworkQosValidator qosValidator = new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( getDbFacade ( ) . getNetworkQosDao ( ) . get ( network.getQosId ( ) ) ) ; org.ovirt.engine.core.bll.ValidationResult res = qosValidator.qosExists ( ) ; return res == ( org.ovirt.engine.core.bll.ValidationResult.VALID ) ? qosValidator.consistentDataCenter ( ) : res ; }
Source:
public void testRemoveVmsFromExistingAffinityGroup ( ) { org.ovirt.engine.core.common.scheduling.AffinityGroup existing = dao.get ( FixturesTool.EXISTING_AFFINITY_GROUP_ID ) ; org.junit.Assert.assertFalse ( existing.getEntityNames ( ) . isEmpty ( ) ) ; existing.getEntityIds ( ) . clear ( ) ; dao.update ( existing ) ; org.ovirt.engine.core.common.scheduling.AffinityGroup fetched = dao.get ( existing.getId ( ) ) ; org.junit.Assert.assertTrue ( fetched.getEntityNames ( ) . isEmpty ( ) ) ; }

Target:
public void testRemoveVmsFromExistingAffinityGroup ( ) { org.ovirt.engine.core.common.scheduling.AffinityGroup existing = dao.get ( FixturesTool.EXISTING_AFFINITY_GROUP_ID ) ; org.junit.Assert.assertFalse ( existing.getVmEntityNames ( ) . isEmpty ( ) ) ; existing.getVmIds ( ) . clear ( ) ; dao.update ( existing ) ; org.ovirt.engine.core.common.scheduling.AffinityGroup fetched = dao.get ( existing.getId ( ) ) ; org.junit.Assert.assertTrue ( fetched.getVmEntityNames ( ) . isEmpty ( ) ) ; }
Source:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmsWithNumaByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }

Target:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmsWithNumaByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }
Source:
public static void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret entity ) { return createIdParameterMapper ( entity.getId ( ) ) . addValue ( "secret_value" , org.ovirt.engine.core.dal.dbbroker.DbFacadeUtils.encryptPassword ( entity.getValue ( ) ) ) . addValue ( "secret_usage_type" , entity.getUsageType ( ) ) . addValue ( "secret_description" , entity.getDescription ( ) ) . addValue ( "provider_id" , entity.getProviderId ( ) ) . addValue ( "creation_date" , entity.getCreationDate ( ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.storage.LibvirtSecret entity ) { return createIdParameterMapper ( entity.getId ( ) ) . addValue ( "secret_value" , org.ovirt.engine.core.dal.dbbroker.DbFacadeUtils.encryptPassword ( entity.getValue ( ) ) ) . addValue ( "secret_usage_type" , entity.getUsageType ( ) ) . addValue ( "secret_description" , entity.getDescription ( ) ) . addValue ( "provider_id" , entity.getProviderId ( ) ) . addValue ( "_create_date" , entity.getCreationDate ( ) ) ; }
Source:
public void testExistingPassDiscardFunctionalityIsPreservedNoDiskRequiresPassDiscardFunctionality ( ) { setSdFullDiscardSupport ( ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( true , false ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { storageDomain.setSupportsDiscard ( true ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.junit.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardSupport ( 0L ) , createLunWithDiscardSupport ( 2048L ) ) , storageDomain ) ) ; }
Source:
protected void updateIsHotPlugAvailable ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = ( ( vm.getvds_group_compatibility_version ( ) ) != null ) ? vm.getvds_group_compatibility_version ( ) : new org.ovirt.engine.core.compat.Version ( ) ; isHotPlugSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.HotPlugEnabled , clusterCompatibilityVersion.toString ( ) ) ) ) ; }

Target:
protected void updateIsHotPlugAvailable ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; org.ovirt.engine.core.compat.Version clusterCompatibilityVersion = ( ( vm.getVdsGroupCompatibilityVersion ( ) ) != null ) ? vm.getVdsGroupCompatibilityVersion ( ) : new org.ovirt.engine.core.compat.Version ( ) ; isHotPlugSupported = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.HotPlugEnabled , clusterCompatibilityVersion.toString ( ) ) ) ) ; }
Source:
private boolean serverExists ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > serversList , org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo glusterServer ) { for ( org.ovirt.engine.core.common.businessentities.VDS server : serversList ) { java.lang.String serverHostnameOrIp = ( server.gethost_name ( ) . isEmpty ( ) ) ? server.getManagmentIp ( ) : server.gethost_name ( ) ; if ( serverHostnameOrIp.equalsIgnoreCase ( glusterServer.getHostnameOrIp ( ) ) ) { return true ; } } return false ; }

Target:
private boolean serverExists ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > serversList , org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo glusterServer ) { for ( org.ovirt.engine.core.common.businessentities.VDS server : serversList ) { java.lang.String serverHostnameOrIp = ( server.getHostName ( ) . isEmpty ( ) ) ? server.getManagmentIp ( ) : server.getHostName ( ) ; if ( serverHostnameOrIp.equalsIgnoreCase ( glusterServer.getHostnameOrIp ( ) ) ) { return true ; } } return false ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > map ( java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostWrapper > foremanHosts ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( foremanHosts.size ( ) ) ; for ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHostWrapper host : foremanHosts ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; java.lang.String hostName = host.getHost ( ) . getName ( ) ; vds.setVdsName ( hostName ) ; vds.setHostName ( hostName ) ; hosts.add ( vds ) ; } return hosts ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VDS > mapHosts ( java.util.List < org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost > foremanHosts ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( foremanHosts.size ( ) ) ; for ( org.ovirt.engine.core.bll.host.provider.foreman.ForemanHost host : foremanHosts ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsName ( host.getName ( ) ) ; vds.setHostName ( host.getIp ( ) ) ; hosts.add ( vds ) ; } return hosts ; }
Source:
public void testHotsetUpdateableWhenHotsetRequestedWithStatus ( ) { org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; oic.addField ( VMStatus.Down , "name" ) ; oic.addHotsetField ( "name" , java.util.EnumSet.of ( VMStatus.Up ) ) ; org.junit.Assert.assertTrue ( "hot set requested for hot set fields should be true" , oic.isFieldUpdatable ( VMStatus.Down , "name" , null , true ) ) ; }

Target:
public void testHotsetUpdateableWhenHotsetRequestedWithStatus ( ) { org.ovirt.engine.core.utils.ObjectIdentityChecker oic = new org.ovirt.engine.core.utils.ObjectIdentityChecker ( org.ovirt.engine.core.utils.Jedi.class ) ; oic.addField ( VMStatus.Down , "name" ) ; oic.addHotsetField ( "name" , java.util.EnumSet.of ( VMStatus.Up ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( oic.isFieldUpdatable ( VMStatus.Down , "name" , null , true ) , "hot set requested for hot set fields should be true" ) ; }
Source:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . update ( numOfVmsEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.hiddenField ( ) ) . update ( newPoolEditVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.hiddenField ( ) ) . update ( newPoolEditMaxAssignedVmsPerUserPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.hiddenField ( ) ) . update ( editPoolEditVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.simpleField ( ) ) . update ( editPoolIncraseNumOfVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.simpleField ( ) ) . update ( editPoolEditMaxAssignedVmsPerUserPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmPopupWidgetConfig.simpleField ( ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { return super . createWidgetConfiguration ( ) . update ( numOfVmsEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( newPoolEditVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( newPoolEditMaxAssignedVmsPerUserPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( editPoolEditVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) ) . update ( editPoolIncraseNumOfVmsPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) ) . update ( editPoolEditMaxAssignedVmsPerUserPanel , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.simpleField ( ) ) ; }
Source:
private void send ( org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse response , java.lang.String method ) { if ( org.ovirt.vdsmfake.rpc.json.JsonRpcServer.log.isInfoEnabled ( ) ) { org.ovirt.vdsmfake.rpc.json.JsonRpcServer.log.info ( ( ( ( "Request is " + method ) + " got response " ) + ( new java.lang.String ( response.toByteArray ( ) ) ) ) ) ; } try { client.sendMessage ( response.toByteArray ( ) ) ; } catch ( org.ovirt.vdsm.jsonrpc.client.ClientConnectionException e ) { org.ovirt.vdsmfake.rpc.json.JsonRpcServer.log.error ( "Failure in sending response" , e ) ; } }

Target:
private void send ( org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse response , java.lang.String method ) { if ( org.ovirt.vdsmfake.rpc.json.JsonRpcServer.log.isDebugEnabled ( ) ) { org.ovirt.vdsmfake.rpc.json.JsonRpcServer.log.debug ( ( ( ( "Request is " + method ) + " got response " ) + ( new java.lang.String ( response.toByteArray ( ) ) ) ) ) ; } try { client.sendMessage ( response.toByteArray ( ) ) ; } catch ( org.ovirt.vdsm.jsonrpc.client.ClientConnectionException e ) { org.ovirt.vdsmfake.rpc.json.JsonRpcServer.log.error ( "Error in sending" , e ) ; client.close ( ) ; } }
Source:
public int getavailableMacsCount ( ) { return availableMacs.size ( ) ; }

Target:
public int getavailableMacsCount ( ) { org.ovirt.engine.core.bll.network.MacPoolManager.log.infoFormat ( "MacPoolManager::getAvailableMacsCount - entered" ) ; lockObj.readLock ( ) . lock ( ) ; try { if ( ! ( initialized ) ) { logInitializationError ( "Failed to get available Macs count." ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_NOT_INITIALIZED ) ; } int availableMacsSize = availableMacs.size ( ) ; org.ovirt.engine.core.bll.network.MacPoolManager.log.infoFormat ( "MacPoolManager:: AvailableMacsCount = {0}" , availableMacsSize ) ; return availableMacsSize ; } finally { lockObj.readLock ( ) . unlock ( ) ; } }
Source:
protected java.util.List < org.ovirt.engine.api.model.VM > setUpVms ( boolean notFound ) { java.util.List < org.ovirt.engine.api.model.VM > ret = new java.util.ArrayList < org.ovirt.engine.api.model.VM > ( ) ; if ( notFound ) { return ret ; } for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { ret.add ( getEntity ( i ) ) ; } return ret ; }

Target:
protected java.util.List < org.ovirt.engine.api.restapi.resource.VM > setUpVms ( boolean notFound ) { java.util.List < org.ovirt.engine.api.restapi.resource.VM > ret = new java.util.ArrayList < org.ovirt.engine.api.restapi.resource.VM > ( ) ; if ( notFound ) { return ret ; } for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { ret.add ( getEntity ( i ) ) ; } return ret ; }