auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGetStorageDomainIdWithPermissions ( ) { mockStoragePoolDAO ( new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ) ; org.ovirt.engine.core.dao.StorageDomainDAO storageDomainDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDAO.class ) ; org.mockito.Mockito.when ( storageDomainDAOMock.getIsoStorageDomainIdForPool ( getQueryParameters ( ) . getStoragePoolId ( ) ) ) . thenReturn ( storageDomainId ) ; org.mockito.Mockito.when ( getQuery ( ) . getDbFacade ( ) . getStorageDomainDAO ( ) ) . thenReturn ( storageDomainDAOMock ) ; org.junit.Assert.assertEquals ( "wrong storage domain id" , storageDomainId , getQuery ( ) . getStorageDomainId ( ) ) ; }

Target:
public void testGetStorageDomainIdWithPermissions ( ) { mockStoragePoolDAO ( new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ) ; org.ovirt.engine.core.dao.StorageDomainDAO storageDomainDAOMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StorageDomainDAO.class ) ; org.mockito.Mockito.when ( storageDomainDAOMock.getIsoStorageDomainIdForPool ( getQueryParameters ( ) . getStoragePoolId ( ) ) ) . thenReturn ( storageDomainId ) ; org.mockito.Mockito.when ( getQuery ( ) . getDbFacade ( ) . getStorageDomainDao ( ) ) . thenReturn ( storageDomainDAOMock ) ; org.junit.Assert.assertEquals ( "wrong storage domain id" , storageDomainId , getQuery ( ) . getStorageDomainId ( ) ) ; }
Source:
private void writeService ( org.ovirt.api.metamodel.concepts.Service service ) { writer.writeStartElement ( "service" ) ; writeCommon ( service ) ; service.methods ( ) . forEach ( this :: writeServiceMethod ) ; service.locators ( ) . forEach ( this :: writeServiceLocator ) ; writer.writeEndElement ( ) ; }

Target:
private void writeEnumValue ( org.ovirt.api.metamodel.concepts.EnumValue value ) { writer.writeStartElement ( "value" ) ; writeCommon ( value ) ; writer.writeEndElement ( ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.AuditLog log ) { switch ( log.getSeverity ( ) ) { case NORMAL : return getCommonResources ( ) . logNormalImage ( ) ; case WARNING : return getCommonResources ( ) . logWarningImage ( ) ; case ERROR : return getCommonResources ( ) . logErrorImage ( ) ; case ALERT : default : return getCommonResources ( ) . alertConfigureImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.AuditLog log ) { switch ( log.getSeverity ( ) ) { case NORMAL : return org.ovirt.engine.ui.common.widget.table.column.AuditLogSeverityColumn.resources.logNormalImage ( ) ; case WARNING : return org.ovirt.engine.ui.common.widget.table.column.AuditLogSeverityColumn.resources.logWarningImage ( ) ; case ERROR : return org.ovirt.engine.ui.common.widget.table.column.AuditLogSeverityColumn.resources.logErrorImage ( ) ; case ALERT : default : return org.ovirt.engine.ui.common.widget.table.column.AuditLogSeverityColumn.resources.alertConfigureImage ( ) ; } }
Source:
public boolean awaitVdsmResponse ( ) { final int checks = ( org.ovirt.engine.core.bll.network.NetworkConfigurator.VDSM_RESPONSIVENESS_PERIOD_IN_SECONDS ) / ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.SetupNetworksPollingTimeout ) ) ; for ( int i = 0 ; i < checks ; i ++ ) { if ( pollVds ( ) ) { org.ovirt.engine.core.bll.network.NetworkConfigurator.log.infoFormat ( "Engine managed to communicate with VDSM agent on host {0}" , host.getName ( ) , host.getId ( ) ) ; return true ; } else { delayPolling ( ) ; } } return false ; }

Target:
public boolean awaitVdsmResponse ( ) { final int checks = ( org.ovirt.engine.core.bll.network.NetworkConfigurator.VDSM_RESPONSIVENESS_PERIOD_IN_SECONDS ) / ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.SetupNetworksPollingTimeout ) ) ; for ( int i = 0 ; i < checks ; i ++ ) { if ( pollVds ( ) ) { org.ovirt.engine.core.bll.network.NetworkConfigurator.log.info ( "Engine managed to communicate with VDSM agent on host '{}' ('{}')" , host.getName ( ) , host.getId ( ) ) ; return true ; } else { delayPolling ( ) ; } } return false ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.NetworkFilterParameter parameter ) { validateParameters ( parameter , "value" ) ; org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter vmNicFilterParameter = map ( parameter ) ; vmNicFilterParameter.setVmInterfaceId ( nicId ) ; return performCreate ( VdcActionType.AddVmNicFilterParameter , new org.ovirt.engine.core.common.action.VmNicFilterParameterParameters ( vmId , vmNicFilterParameter ) , new org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParametersResource.NicNetworkFilterParameterResolver ( parameter.getName ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.NetworkFilterParameter parameter ) { validateParameters ( parameter , "value" ) ; org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter vmNicFilterParameter = map ( parameter ) ; vmNicFilterParameter.setVmInterfaceId ( nicId ) ; return performCreate ( ActionType.AddVmNicFilterParameter , new org.ovirt.engine.core.common.action.VmNicFilterParameterParameters ( vmId , vmNicFilterParameter ) , new org.ovirt.engine.api.restapi.resource.BackendVmNicFilterParametersResource.NicNetworkFilterParameterResolver ( parameter.getName ( ) ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetTagByTagId , org.ovirt.engine.core.common.queries.GetTagByTagIdParameters.class , new java.lang.String [ ] { "TagId" } , new java.lang.Object [ ] { NON_EXISTANT_GUID } , null ) ; control.replay ( ) ; try { collection.remove ( org.ovirt.engine.api.restapi.resource.NON_EXISTANT_GUID.toString ( ) ) ; 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 { setUpGetEntityExpectations ( VdcQueryType.GetTagByTagId , 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 ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus storagePoolStatus , org.ovirt.engine.api.model.DataCenterStatus dataCenterStatus ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setStatus ( storagePoolStatus ) ; org.ovirt.engine.api.model.DataCenter dataCenter = org.ovirt.engine.api.restapi.types.DataCenterMapper.map ( storagePool , null ) ; assertEquals ( dataCenter.getStatus ( ) , dataCenterStatus ) ; }

Target:
private void testStatusMapping ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus storagePoolStatus , org.ovirt.engine.api.model.DataCenterStatus dataCenterStatus ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setStatus ( storagePoolStatus ) ; org.ovirt.engine.api.model.DataCenter dataCenter = org.ovirt.engine.api.restapi.types.DataCenterMapper.map ( storagePool , null ) ; org.junit.Assert.assertEquals ( dataCenter.getStatus ( ) , dataCenterStatus ) ; }
Source:
public void testNicLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Nic nic = new org.ovirt.engine.api.model.Nic ( ) ; nic.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.NIC_ID ) ; nic.setVm ( new org.ovirt.engine.api.model.VM ( ) ) ; nic.getVm ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , nic ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.NIC_HREF , nic.getHref ( ) ) ; }

Target:
public void testNicLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Nic nic = new org.ovirt.engine.api.model.Nic ( ) ; nic.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.NIC_ID ) ; nic.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; nic.getVm ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , nic ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.NIC_HREF , nic.getHref ( ) ) ; }
Source:
public void generateDiskDescriptionWhenAliasIsTruncated ( ) throws java.io.IOException { java.lang.String alias = org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.generateRandomString ( 200 ) ; disk.setDiskAlias ( alias ) ; disk.setDiskDescription ( "DiskDescription" ) ; assertDiskDescriptionMap ( disk , org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.generateDiskAliasJsonEntry ( alias.substring ( 0 , org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.DISK_ALIAS_MAX_LENGTH ) ) ) ; }

Target:
public void encodeWhenAliasIsTruncated ( ) throws java.io.IOException { java.lang.String alias = org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.generateRandomString ( 200 ) ; disk.setDiskAlias ( alias ) ; disk.setDiskDescription ( "DiskDescription" ) ; assertDiskDescriptionMap ( disk , org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.generateDiskAliasJsonEntry ( alias.substring ( 0 , org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.DISK_ALIAS_MAX_LENGTH ) ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.MacPool macPool ) { validateParameters ( macPool , "name" ) ; final org.ovirt.engine.api.model.MacPool entity = map ( macPool ) ; return performCreate ( VdcActionType.AddMacPool , new org.ovirt.engine.core.common.action.MacPoolParameters ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetMacPoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.MacPool macPool ) { validateParameters ( macPool , "name" ) ; final org.ovirt.engine.api.model.MacPool entity = map ( macPool ) ; return performCreate ( ActionType.AddMacPool , new org.ovirt.engine.core.common.action.MacPoolParameters ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetMacPoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public static int maxMemorySizeWithHotplugInMb ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; if ( osRepository.get64bitOss ( ) . contains ( vm.getOs ( ) ) ) { org.ovirt.engine.core.common.config.ConfigValues config = ( ( vm.getClusterArch ( ) ) == ( org.ovirt.engine.core.common.businessentities.ArchitectureType.ppc64 ) ) ? org.ovirt.engine.core.common.config.ConfigValues.VMPpc64BitMaxMemorySizeInMB : org.ovirt.engine.core.common.config.ConfigValues.VM64BitMaxMemorySizeInMB ; return org.ovirt.engine.core.common.config.Config.getValue ( config , vm.getCompatibilityVersion ( ) . getValue ( ) ) ; } return org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.VM32BitMaxMemorySizeInMB ) ; }

Target:
public static int maxMemorySizeWithHotplugInMb ( org.ovirt.engine.core.common.businessentities.VM vm ) { return org.ovirt.engine.core.common.utils.VmCommonUtils.maxMemorySizeWithHotplugInMb ( vm.getOs ( ) , vm.getCompatibilityVersion ( ) ) ; }
Source:
protected void onReveal ( ) { super . onReveal ( ) ; roleModelProvider.getModel ( ) . search ( ) ; systemPermissionModelProvider.refresh ( ) ; systemPermissionModelProvider.getModel ( ) . search ( ) ; if ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.isModeSupported ( ApplicationMode.VirtOnly ) ) { clusterPolicyModelProvider.getModel ( ) . search ( ) ; } else { getView ( ) . hideClusterPolicyTab ( ) ; } instanceTypeModelProvider.getModel ( ) . search ( ) ; }

Target:
protected void onReveal ( ) { super . onReveal ( ) ; roleModelProvider.getModel ( ) . search ( ) ; systemPermissionModelProvider.refresh ( ) ; systemPermissionModelProvider.getModel ( ) . search ( ) ; if ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.isModeSupported ( ApplicationMode.VirtOnly ) ) { clusterPolicyModelProvider.getModel ( ) . search ( ) ; } else { getView ( ) . hideClusterPolicyTab ( ) ; } instanceTypeModelProvider.getModel ( ) . search ( ) ; sharedMacPoolModelProvider.getModel ( ) . search ( ) ; }
Source:
public boolean checkPermissions ( org.ovirt.engine.core.bll.CommandBase < ? > command , java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionCheckSubjects ) { final java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.bll.utils.PermissionSubject permSubject : permissionCheckSubjects ) { messages.clear ( ) ; if ( command.checkSinglePermission ( permSubject , messages ) ) { return true ; } } command.getReturnValue ( ) . getCanDoActionMessages ( ) . addAll ( messages ) ; return false ; }

Target:
public boolean checkPermissions ( org.ovirt.engine.core.bll.CommandBase < ? > command , java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionCheckSubjects ) { final java.util.List < java.lang.String > messages = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.bll.utils.PermissionSubject permSubject : permissionCheckSubjects ) { messages.clear ( ) ; if ( command.checkSinglePermission ( permSubject , messages ) ) { return true ; } } command.getReturnValue ( ) . getValidationMessages ( ) . addAll ( messages ) ; return false ; }
Source:
public org.ovirt.engine.core.common.businessentities.NonOperationalReason persistAndEnforceNetworkCompliance ( org.ovirt.engine.core.common.businessentities.VDS host , boolean skipManagementNetwork , org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredData ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbIfaces = interfaceDao.getAllInterfacesForVds ( host.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks = networkDao.getAllForCluster ( host.getVdsGroupId ( ) ) ; persistTopology ( host , dbIfaces , clusterNetworks , userConfiguredData ) ; org.ovirt.engine.core.common.businessentities.NonOperationalReason nonOperationalReason = enforceNetworkCompliance ( host , skipManagementNetwork , clusterNetworks ) ; auditNetworkCompliance ( host , dbIfaces , clusterNetworks ) ; return nonOperationalReason ; }

Target:
public org.ovirt.engine.core.common.businessentities.NonOperationalReason persistAndEnforceNetworkCompliance ( org.ovirt.engine.core.common.businessentities.VDS host , boolean skipManagementNetwork , org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredData ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbIfaces = interfaceDao.getAllInterfacesForVds ( host.getId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks = networkDao.getAllForCluster ( host.getClusterId ( ) ) ; persistTopology ( host , dbIfaces , clusterNetworks , userConfiguredData ) ; org.ovirt.engine.core.common.businessentities.NonOperationalReason nonOperationalReason = enforceNetworkCompliance ( host , skipManagementNetwork , clusterNetworks ) ; auditNetworkCompliance ( host , dbIfaces , clusterNetworks ) ; return nonOperationalReason ; }
Source:
public static boolean isLastSuperUserGroup ( org.ovirt.engine.core.compat.Guid groupId ) { boolean retValue = false ; java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > permissions = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getPermissionDAO ( ) . getAllForRole ( PredefinedRoles.SUPER_USER.getId ( ) ) ; if ( ( permissions.size ( ) ) <= 1 ) { permissions = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getPermissionDAO ( ) . getAllForAdElement ( groupId ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions permission : permissions ) { if ( permission.getrole_id ( ) . equals ( PredefinedRoles.SUPER_USER.getId ( ) ) ) { retValue = true ; break ; } } } return retValue ; }

Target:
public static boolean isLastSuperUserGroup ( org.ovirt.engine.core.compat.Guid groupId ) { boolean retValue = false ; java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > permissions = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getPermissionDAO ( ) . getAllForRole ( PredefinedRoles.SUPER_USER.getId ( ) ) ; if ( ( permissions.size ( ) ) <= 1 ) { permissions = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getPermissionDAO ( ) . getAllForAdElement ( groupId ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions permission : permissions ) { if ( permission.getRoleId ( ) . equals ( PredefinedRoles.SUPER_USER.getId ( ) ) ) { retValue = true ; break ; } } } return retValue ; }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( 50 ) ; builder.append ( "commandId: " ) ; builder.append ( getCommandId ( ) ) ; builder.append ( ", user: " ) ; if ( ( getParametersCurrentUser ( ) ) != null ) { builder.append ( getParametersCurrentUser ( ) . getLoginName ( ) ) ; } builder.append ( ", commandType: " ) ; builder.append ( getCommandType ( ) ) ; return builder.toString ( ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return tsb.append ( "commandId" , getCommandId ( ) ) . append ( "user" , ( ( getParametersCurrentUser ( ) ) == null ? null : getParametersCurrentUser ( ) . getLoginName ( ) ) ) . append ( "commandType" , getCommandType ( ) ) ; }
Source:
public void execute ( ) { org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.commonModel = null ; }

Target:
public static void init ( final com.google.gwt.event.shared.EventBus eventBus ) { org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.commonModel = org.ovirt.engine.ui.uicommonweb.models.CommonModel.newInstance ( ) ; org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.commonModel.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.common.uicommon.model.MainModelSelectionChangeEvent.fire ( eventBus , org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.commonModel.getSelectedItem ( ) ) ; } } ) ; }
Source:
public void vmNotRunningOnHostWithBalloonEnabled ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs data ) { initMocks ( data , false ) ; org.mockito.Mockito.when ( vdsManagerVds.isBalloonEnabled ( ) ) . thenReturn ( true ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) ) == null ) ) ; vmAnalyzer.analyze ( ) ; org.junit.Assert.assertTrue ( vmAnalyzer.isMovedToDown ( ) ) ; }

Target:
public void vmNotRunningOnHostWithBalloonEnabled ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs data ) { initMocks ( data , false ) ; org.mockito.Mockito.when ( vdsManagerVds.isBalloonEnabled ( ) ) . thenReturn ( true ) ; org.junit.jupiter.api.Assumptions.assumeTrue ( ( ( data.vdsmVm ( ) ) == null ) ) ; vmAnalyzer.analyze ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( vmAnalyzer.isMovedToDown ( ) ) ; }
Source:
public static void setRngDevice ( org.ovirt.engine.api.restapi.resource.BackendResource resouce , org.ovirt.engine.api.model.Vm vm ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > rngDevices = resouce.getEntity ( java.util.List.class , VdcQueryType.GetRngDevice , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( vm.getId ( ) ) ) , "GetRngDevice" , true ) ; if ( ( rngDevices != null ) && ( ! ( rngDevices.isEmpty ( ) ) ) ) { vm.setRngDevice ( org.ovirt.engine.api.restapi.types.RngDeviceMapper.map ( rngDevices.get ( 0 ) , null ) ) ; } }

Target:
public static void setRngDevice ( org.ovirt.engine.api.restapi.resource.BackendResource resouce , org.ovirt.engine.api.model.Vm vm ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > rngDevices = resouce.getEntity ( java.util.List.class , QueryType.GetRngDevice , new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( vm.getId ( ) ) ) , "GetRngDevice" , true ) ; if ( ( rngDevices != null ) && ( ! ( rngDevices.isEmpty ( ) ) ) ) { vm.setRngDevice ( org.ovirt.engine.api.restapi.types.RngDeviceMapper.map ( rngDevices.get ( 0 ) , null ) ) ; } }
Source:
private void updateTimer ( ) { final org.ovirt.engine.ui.uicommonweb.models.GridTimer modelTimer = getModelTimer ( ) ; if ( ( statusUpdateHandlerRegistration ) != null ) { statusUpdateHandlerRegistration.removeHandler ( ) ; } statusUpdateHandlerRegistration = modelTimer.addValueChangeHandler ( new com.google.gwt.event.logical.shared.ValueChangeHandler < java.lang.Integer > ( ) { @ java.lang.Override public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.lang.Integer > event ) { onRefresh ( modelTimer.getTimerRefreshStatus ( ) ) ; } } ) ; modelTimer.resume ( ) ; }

Target:
private void updateTimer ( ) { final org.ovirt.engine.ui.uicommonweb.models.GridTimer modelTimer = getModelTimer ( ) ; modelTimer.setRefreshRate ( readRefreshRate ( ) ) ; if ( ( statusUpdateHandlerRegistration ) != null ) { statusUpdateHandlerRegistration.removeHandler ( ) ; } statusUpdateHandlerRegistration = modelTimer.addGridTimerStateChangeEventHandler ( new org.ovirt.engine.ui.uicommonweb.models.GridTimerStateChangeEvent.GridTimerStateChangeEventHandler ( ) { @ java.lang.Override public void onGridTimerStateChange ( org.ovirt.engine.ui.uicommonweb.models.GridTimerStateChangeEvent event ) { onRefresh ( modelTimer.getTimerRefreshStatus ( ) ) ; } } ) ; modelTimer.resume ( ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.VmTemplate readVmTemplateFromOvf ( java.lang.String ovf ) throws org.ovirt.engine.core.utils.ovf.OvfReaderException { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = new java.util.ArrayList < > ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; ovfManager.ImportTemplate ( ovf , template , diskImages , interfaces ) ; template.setInterfaces ( interfaces ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : diskImages ) { template.getDiskTemplateMap ( ) . put ( disk.getId ( ) , disk ) ; } return template ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmTemplate readVmTemplateFromOvf ( java.lang.String ovf ) throws org.ovirt.engine.core.utils.ovf.OvfReaderException { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = new java.util.ArrayList < > ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > interfaces = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; ovfManager.importTemplate ( ovf , template , diskImages , interfaces ) ; template.setInterfaces ( interfaces ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : diskImages ) { template.getDiskTemplateMap ( ) . put ( disk.getId ( ) , disk ) ; } return template ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; }

Target:
public void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { getWindow ( ) . stopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = result.getReturnValue ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { setWindow ( null ) ; setGuideContext ( returnValue.getActionReturnValue ( ) ) ; updateActionAvailability ( ) ; getGuideCommand ( ) . execute ( ) ; } else { cancel ( ) ; } super . executed ( result ) ; }

Target:
private boolean isConsoleEditEnabled ( ) { return ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getSelectedItem ( ) ) != null ) && ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getSelectedItem ( ) . isRunningOrPaused ( ) ) ; }
Source:
public void executeCommandWhenFailed ( ) { setUpMocksForAdd ( ) ; mockBackend ( false , EngineError.GlusterHookAddFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . removeGlusterServerHook ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_ADD_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommandWhenFailed ( ) { setUpMocksForAdd ( ) ; mockBackend ( false , EngineError.GlusterHookAddFailed ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.never ( ) ) . removeGlusterServerHook ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_ADD_FAILED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
public org.ovirt.engine.core.dal.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { java.lang.Integer cores = org.ovirt.engine.core.bll.VdsSelector.getEffectiveCpuCores ( vds ) ; if ( ( cores != null ) && ( ( getVm ( ) . getNumOfCpus ( ) ) > cores ) ) { sb.append ( "has less cores(" ) . append ( cores ) . append ( ") than " ) . append ( getVm ( ) . getNumOfCpus ( ) ) ; return org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }

Target:
public org.ovirt.engine.core.common.errors.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { java.lang.Integer cores = org.ovirt.engine.core.bll.VdsSelector.getEffectiveCpuCores ( vds ) ; if ( ( cores != null ) && ( ( getVm ( ) . getNumOfCpus ( ) ) > cores ) ) { sb.append ( "has less cores(" ) . append ( cores ) . append ( ") than " ) . append ( getVm ( ) . getNumOfCpus ( ) ) ; return org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS ; } return null ; }
Source:
private void sendTicket ( ) { final org.ovirt.engine.core.common.users.VdcUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; final boolean sent = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVmTicket , new org.ovirt.engine.core.common.vdscommands.SetVmTicketVDSCommandParameters ( org.ovirt.engine.core.bll.SetVmTicketCommand.getVdsId ( ) , org.ovirt.engine.core.bll.SetVmTicketCommand.getVmId ( ) , mTicket , mValidTime , user.getUserName ( ) , user.getUserId ( ) ) ) . getSucceeded ( ) ; if ( sent ) { org.ovirt.engine.core.bll.SetVmTicketCommand.setActionReturnValue ( mTicket ) ; } org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( sent ) ; }

Target:
private void sendTicket ( ) { final org.ovirt.engine.core.common.businessentities.DbUser user = org.ovirt.engine.core.bll.SetVmTicketCommand.getCurrentUser ( ) ; final boolean sent = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVmTicket , new org.ovirt.engine.core.common.vdscommands.SetVmTicketVDSCommandParameters ( org.ovirt.engine.core.bll.SetVmTicketCommand.getVdsId ( ) , org.ovirt.engine.core.bll.SetVmTicketCommand.getVmId ( ) , mTicket , mValidTime , user.getLoginName ( ) , user.getId ( ) ) ) . getSucceeded ( ) ; if ( sent ) { org.ovirt.engine.core.bll.SetVmTicketCommand.setActionReturnValue ( mTicket ) ; } org.ovirt.engine.core.bll.SetVmTicketCommand.setSucceeded ( sent ) ; }
Source:
public void testGetByExternalId ( ) { org.ovirt.engine.core.common.utils.ExternalId externalId = new org.ovirt.engine.core.common.utils.ExternalId ( 179 , 153 , 148 , 74 , 129 , 171 , 78 , 197 , 130 , 102 , 225 , 155 , 167 , 195 , 201 , 209 ) ; org.ovirt.engine.core.common.businessentities.DbGroup result = dao.getByExternalId ( "rhel" , externalId ) ; org.junit.Assert.assertNotNull ( result ) ; }

Target:
public void testGetByExternalId ( ) { org.ovirt.engine.core.common.businessentities.DbGroup result = dao.getByExternalId ( "rhel" , "a" ) ; org.junit.Assert.assertNotNull ( result ) ; }
Source:
public void getDataCenterMaxNameLength ( 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.Integer ) ( source ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public static void GetDiskMaxSize ( 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.Integer ) ( source ) ) . intValue ( ) : 2047 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxDiskSize ) , aQuery ) ; }

Target:
public static void GetDiskMaxSize ( 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.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxBlockDiskSize ) , aQuery ) ; }
Source:
protected void onSelectedItemChanged ( ) { super . onSelectedItemChanged ( ) ; UpdateActionAvailability ( ) ; if ( ( ( getSelectedItem ( ) ) != null ) && ( ! ( getIsBookmarkInitiated ( ) ) ) ) { setIsBookmarkInitiated ( true ) ; getNavigatedEvent ( ) . raise ( this , new org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkEventArgs ( ( ( org.ovirt.engine.core.common.businessentities.Bookmark ) ( getSelectedItem ( ) ) ) ) ) ; setIsBookmarkInitiated ( false ) ; } }

Target:
protected void onSelectedItemChanged ( ) { super . onSelectedItemChanged ( ) ; updateActionAvailability ( ) ; if ( ( ( getSelectedItem ( ) ) != null ) && ( ! ( getIsBookmarkInitiated ( ) ) ) ) { setIsBookmarkInitiated ( true ) ; getNavigatedEvent ( ) . raise ( this , new org.ovirt.engine.ui.uicommonweb.models.bookmarks.BookmarkEventArgs ( ( ( org.ovirt.engine.core.common.businessentities.Bookmark ) ( getSelectedItem ( ) ) ) ) ) ; setIsBookmarkInitiated ( false ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.event_notification_hist geteventNotificationHist ( org.ovirt.engine.core.common.businessentities.EventAuditLogSubscriber eals , boolean isNotified , java.lang.String reason ) { org.ovirt.engine.core.common.businessentities.event_notification_hist eventHistory = new org.ovirt.engine.core.common.businessentities.event_notification_hist ( ) ; eventHistory.setaudit_log_id ( eals.getaudit_log_id ( ) ) ; eventHistory.setevent_name ( eals.getevent_up_name ( ) ) ; eventHistory.setmethod_type ( eals.getEventNotificationMethod ( ) . name ( ) ) ; eventHistory.setreason ( reason ) ; eventHistory.setsent_at ( new java.util.Date ( ) ) ; eventHistory.setstatus ( isNotified ) ; eventHistory.setsubscriber_id ( eals.getsubscriber_id ( ) ) ; return eventHistory ; }

Target:
private void distributeEvents ( java.util.List < org.ovirt.engine.core.common.businessentities.AuditLogEvent > events , java.util.List < org.ovirt.engine.core.common.businessentities.AuditLogEventSubscriber > eventSubscribers ) throws java.sql.SQLException { for ( org.ovirt.engine.core.common.businessentities.AuditLogEvent event : events ) { distributeEvent ( eventSubscribers , event ) ; } }
Source:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.aggregationtodaily_3_4.AggregationToDaily.row11Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_AggregationToDaily ) { try { int length = 0 ; this . var_name = readString ( dis ) ; this . var_value = readString ( dis ) ; this . var_datetime = readDate ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }

Target:
public void copyKeysDataTo ( ovirt_engine_dwh.aggregationtodaily_3_4.AggregationToDaily.row11Struct other ) { other.var_name = this . var_name ; }
Source:
private void applyNetworkChangesToHosts ( ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand < T > . SyncNetworkParametersBuilder builder = new SyncNetworkParametersBuilder ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) , getOldNetwork ( ) ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.NetworkParametersBuilder.updateParametersSequencing ( parameters ) ; runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , parameters ) ; } }

Target:
private void applyNetworkChangesToHosts ( ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand < T > . SyncNetworkParametersBuilder builder = new SyncNetworkParametersBuilder ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getContext ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) , getOldNetwork ( ) ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.NetworkParametersBuilder.updateParametersSequencing ( parameters ) ; runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , parameters ) ; } }
Source:
public void testValidateQosOverriddenInterfacesWhenAttachmentDoesNotHaveQosOverridden ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = java.util.Collections.singletonList ( networkAttachment ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworkValidator ( networkAttachments ) ; org.junit.Assert.assertThat ( validator.validateQosOverriddenInterfaces ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateQosOverriddenInterfacesWhenNoAttachmentsPassed ( ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateQosOverriddenInterfaces ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void initialize ( ) { super . initialize ( ) ; getStorageDomain ( ) . setIsChangeable ( false ) ; getHost ( ) . setIsChangeable ( false ) ; getStorageType ( ) . setIsChangeable ( false ) ; getDataCenter ( ) . setIsChangeable ( false ) ; }

Target:
public void initialize ( ) { super . initialize ( ) ; getStorageDomain ( ) . setIsChangeable ( ( limitToStorageDomainId == null ) ) ; getDataCenter ( ) . setIsChangeable ( ( limitToStorageDomainId == null ) ) ; getHost ( ) . setIsChangeable ( false ) ; getStorageType ( ) . setIsChangeable ( false ) ; }
Source:
public void testValues ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "C" ) ) ; org.junit.Assert.assertTrue ( "cluster" , comps.contains ( "Cluster" ) ) ; org.junit.Assert.assertEquals ( 0 , comp.getCompletion ( "Z" ) . length ) ; }

Target:
public void testValues ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "C" ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( comps.contains ( "Cluster" ) , "cluster" ) ; org.junit.jupiter.api.Assertions.assertEquals ( 0 , comp.getCompletion ( "Z" ) . length ) ; }
Source:
public static void getMaxNumOfCPUsPerSocket ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { 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.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.scheduling.AffinityGroup > setsToAffinityGroups ( java.util.Set < java.util.Set < org.ovirt.engine.core.compat.Guid > > uag ) { java.util.List < org.ovirt.engine.core.common.scheduling.AffinityGroup > output = new java.util.ArrayList < > ( ) ; for ( java.util.Set < org.ovirt.engine.core.compat.Guid > s : uag ) { org.ovirt.engine.core.common.scheduling.AffinityGroup temp = new org.ovirt.engine.core.common.scheduling.AffinityGroup ( ) ; temp.setPositive ( true ) ; java.util.List < org.ovirt.engine.core.compat.Guid > entities = new java.util.ArrayList < > ( ) ; entities.addAll ( s ) ; temp.setEntityIds ( entities ) ; output.add ( temp ) ; } return output ; }

Target:
public void setSchedulingManager ( org.ovirt.engine.core.bll.scheduling.SchedulingManager schedulingManager ) { this . schedulingManager = schedulingManager ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VmDevice watchdogDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; watchdogDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.Empty , getParameters ( ) . getId ( ) ) ) ; watchdogDevice.setDevice ( VmDeviceType.WATCHDOG.getName ( ) ) ; watchdogDevice.setType ( VmDeviceGeneralType.WATCHDOG ) ; watchdogDevice.setAddress ( StringUtils.EMPTY ) ; watchdogDevice.setSpecParams ( getSpecParams ( ) ) ; getVmDeviceDao ( ) . save ( watchdogDevice ) ; setSucceeded ( true ) ; setActionReturnValue ( watchdogDevice.getId ( ) . getDeviceId ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.VmDevice watchdogDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; watchdogDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.Empty , getParameters ( ) . getId ( ) ) ) ; watchdogDevice.setDevice ( VmDeviceType.WATCHDOG.getName ( ) ) ; watchdogDevice.setType ( VmDeviceGeneralType.WATCHDOG ) ; watchdogDevice.setAddress ( StringUtils.EMPTY ) ; watchdogDevice.setSpecParams ( getSpecParams ( ) ) ; vmDeviceDao.save ( watchdogDevice ) ; setSucceeded ( true ) ; setActionReturnValue ( watchdogDevice.getId ( ) . getDeviceId ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosCommitmentSetup ( boolean constructBond , int totalCommitment , java.lang.Integer slaveSpeed , java.lang.Integer masterSpeed , java.lang.String bondOptions ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; qos.setOutAverageLinkshare ( 10 ) ; qos.setOutAverageRealtime ( ( totalCommitment / 3 ) ) ; return constructBond ? setupCompositeQosConfiguration ( true , qos , slaveSpeed , masterSpeed , bondOptions ) : setupCompositeQosConfiguration ( false , true , qos , masterSpeed ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) ) { return failCanDoAction ( EngineMessage.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }

Target:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.ImportVmCommand.getEffectiveCompatibilityVersion ( ) ) ) ) ) { return failCanDoAction ( EngineMessage.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }