auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void shouldScheduleRegularInterval ( ) { org.mockito.Mockito.verify ( scheduler ) . scheduleAFixedDelayJob ( org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.eq ( "refresh" ) , org.mockito.Matchers.eq ( new java.lang.Class [ ] { } ) , org.mockito.Matchers.eq ( new java.lang.Object [ ] { } ) , org.mockito.Matchers.eq ( 1L ) , org.mockito.Matchers.anyLong ( ) , org.mockito.Matchers.eq ( java.util.concurrent.TimeUnit.MINUTES ) ) ; }

Target:
public void shouldScheduleRegularInterval ( ) { org.mockito.Mockito.verify ( scheduler ) . scheduleAFixedDelayJob ( org.mockito.ArgumentMatchers.anyObject ( ) , org.mockito.ArgumentMatchers.eq ( "refresh" ) , org.mockito.ArgumentMatchers.eq ( new java.lang.Class [ ] { } ) , org.mockito.ArgumentMatchers.eq ( new java.lang.Object [ ] { } ) , org.mockito.ArgumentMatchers.eq ( 1L ) , org.mockito.ArgumentMatchers.anyLong ( ) , org.mockito.ArgumentMatchers.eq ( java.util.concurrent.TimeUnit.MINUTES ) ) ; }
Source:
public void thpDefaultFalseTest ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setVersion ( new org.ovirt.engine.api.restapi.types.Version ( ) { { setMajor ( 2 ) ; setMinor ( 0 ) ; } } ) ; org.ovirt.engine.core.common.businessentities.Cluster transform = getMapper ( ) . map ( cluster , null ) ; assertFalse ( transform.getTransparentHugepages ( ) ) ; }

Target:
public void thpDefaultTrueTest ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setVersion ( new org.ovirt.engine.api.restapi.types.Version ( ) { { setMajor ( 3 ) ; setMinor ( 0 ) ; } } ) ; org.ovirt.engine.core.common.businessentities.Cluster transform = getMapper ( ) . map ( cluster , null ) ; org.junit.Assert.assertTrue ( transform.getTransparentHugepages ( ) ) ; }
Source:
public void endSuccessfully ( ) { super . endSuccessfully ( ) ; if ( getEnclosingCommand ( ) . getParameters ( ) . getImportAsTemplate ( ) ) { org.ovirt.engine.core.compat.Guid newTemplateId = createTemplate ( ) ; if ( newTemplateId != null ) { attachDiskToTemplate ( newTemplateId ) ; } } getEnclosingCommand ( ) . getParameters ( ) . getDiskImage ( ) . setImageStatus ( ImageStatus.OK ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( getEnclosingCommand ( ) . getParameters ( ) . getDestinationImageId ( ) , ImageStatus.OK ) ; getEnclosingCommand ( ) . getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
public void endSuccessfully ( ) { super . endSuccessfully ( ) ; if ( getEnclosingCommand ( ) . getParameters ( ) . getImportAsTemplate ( ) ) { org.ovirt.engine.core.compat.Guid newTemplateId = createTemplate ( ) ; if ( newTemplateId != null ) { attachDiskToTemplate ( newTemplateId ) ; } } getEnclosingCommand ( ) . getParameters ( ) . getDiskImage ( ) . setImageStatus ( ImageStatus.OK ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateImageStatus ( getEnclosingCommand ( ) . getParameters ( ) . getDestinationImageId ( ) , ImageStatus.OK ) ; getEnclosingCommand ( ) . getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
public void setItems ( java.lang.Iterable value ) { if ( value != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > itemList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( value ) ) ; java.util.Collections.sort ( itemList , new java.util.Comparator < org.ovirt.engine.core.common.businessentities.VM > ( ) { @ java.lang.Override public int compare ( org.ovirt.engine.core.common.businessentities.VM paramT1 , org.ovirt.engine.core.common.businessentities.VM paramT2 ) { return paramT1.getName ( ) . compareTo ( paramT2.getName ( ) ) ; } } ) ; } super . setItems ( value ) ; }

Target:
public void setItems ( java.lang.Iterable value ) { if ( value != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > itemList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( value ) ) ; java.util.Collections.sort ( itemList , new org.ovirt.engine.ui.uicommonweb.Linq.VmComparator ( ) ) ; } super . setItems ( value ) ; }
Source:
private void setUpMocksForAdd ( boolean hookFound , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { setupMocks ( cmd , hookFound , hook ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( cmd ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getServer ( org.ovirt.engine.core.bll.gluster.AddGlusterHookCommandTest.SERVER_ID , "gfs1" , org.ovirt.engine.core.bll.gluster.CLUSTER_ID , status ) ) ; }

Target:
private void setUpMocksForAdd ( boolean hookFound , org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity hook , org.ovirt.engine.core.common.businessentities.VDSStatus status ) { setupMocks ( cmd , hookFound , hook ) ; org.mockito.Mockito.doReturn ( vdsDao ) . when ( cmd ) . getVdsDao ( ) ; org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getServer ( org.ovirt.engine.core.bll.gluster.AddGlusterHookCommandTest.SERVER_ID , "gfs1" , org.ovirt.engine.core.bll.gluster.CLUSTER_ID , status ) ) ; }
Source:
private boolean destinationHasSpace ( ) { if ( ! ( org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceChecker.hasSpaceForRequest ( org.ovirt.engine.core.bll.MoveVmCommand.getStorageDomain ( ) , ( ( int ) ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) . getActualDiskWithSnapshotsSize ( ) ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW ) ; return false ; } return true ; }

Target:
private boolean destinationHasSpace ( ) { return validate ( new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( org.ovirt.engine.core.bll.MoveVmCommand.getStorageDomain ( ) ) . isDomainHasSpaceForRequest ( ( ( long ) ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) . getActualDiskWithSnapshotsSize ( ) ) ) ) ) ; }
Source:
private void initServerUrl ( ) throws org.ovirt.engine.core.notifier.NotificationServiceException { org.ovirt.engine.core.utils.EngineLocalConfig config = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) ; try { if ( isHttpsProtocol ) { serverUrl = config.getExternalHttpsUrl ( org.ovirt.engine.core.notifier.EngineMonitorService.HEALTH_SERVLET_PATH ) ; } else { serverUrl = config.getExternalHttpUrl ( org.ovirt.engine.core.notifier.EngineMonitorService.HEALTH_SERVLET_PATH ) ; } org.ovirt.engine.core.notifier.EngineMonitorService.log.info ( ( ( "Engine health servlet URL is \"" + ( serverUrl ) ) + "\"." ) ) ; } catch ( java.net.MalformedURLException exception ) { throw new org.ovirt.engine.core.notifier.NotificationServiceException ( "Can't get engine health servlet URL." , exception ) ; } }

Target:
private void initServerUrl ( ) throws org.ovirt.engine.core.notifier.NotificationServiceException { org.ovirt.engine.core.utils.EngineLocalConfig config = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) ; try { if ( isHttpsProtocol ) { serverUrl = config.getExternalHttpsUrl ( org.ovirt.engine.core.notifier.EngineMonitorService.HEALTH_SERVLET_PATH ) ; } else { serverUrl = config.getExternalHttpUrl ( org.ovirt.engine.core.notifier.EngineMonitorService.HEALTH_SERVLET_PATH ) ; } org.ovirt.engine.core.notifier.EngineMonitorService.log.info ( "Engine health servlet URL is \"{}\"." , serverUrl ) ; } catch ( java.net.MalformedURLException exception ) { throw new org.ovirt.engine.core.notifier.NotificationServiceException ( "Can't get engine health servlet URL." , exception ) ; } }
Source:
public void testIsNetworkInSyncWhenBootProtocolEqual ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( true ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testReportConfigurationsOnHostWhenSwitchTypeIsOutOfSync ( ) throws java.lang.Exception { cluster.setRequiredSwitchTypeForCluster ( SwitchType.OVS ) ; org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations reportedConfigurations = createTestedInstance ( ) . reportConfigurationsOnHost ( ) ; org.junit.Assert.assertThat ( reportedConfigurations.isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration > reportedConfigurationList = reportedConfigurations.getReportedConfigurationList ( ) ; org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration expectedReportedConfiguration = new org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration ( org.ovirt.engine.core.common.businessentities.network.ReportedConfigurationType.SWITCH_TYPE , org.ovirt.engine.core.common.network.SwitchType.LEGACY , org.ovirt.engine.core.common.network.SwitchType.OVS , false ) ; org.junit.Assert.assertThat ( reportedConfigurationList.contains ( expectedReportedConfiguration ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public void isAnyHostUpInCluster ( 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 ) { if ( ( source != null ) && ( ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ) ) { return true ; } return false ; } } ; getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void testRemove ( ) { dao.save ( cpuProfile ) ; org.ovirt.engine.core.common.businessentities.profiles.CpuProfile result = dao.get ( cpuProfile.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; dao.remove ( cpuProfile.getId ( ) ) ; org.junit.Assert.assertNull ( dao.get ( cpuProfile.getId ( ) ) ) ; }

Target:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.profiles.CpuProfile result = dao.get ( FixturesTool.CPU_PROFILE_2 ) ; org.junit.Assert.assertNotNull ( result ) ; dao.remove ( FixturesTool.CPU_PROFILE_2 ) ; org.junit.Assert.assertNull ( dao.get ( FixturesTool.CPU_PROFILE_2 ) ) ; }
Source:
public void qosBondAndSlaveSpeedsMissing ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosBondSpeedSetup ( null , null ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_INVALID_INTERFACE_SPEED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME ) ; }

Target:
public void unmanagedVlanAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; java.lang.String networkName = "net" ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , createVlan ( nic , 100 , networkName ) ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORKS_DONT_EXIST_IN_CLUSTER , networkName ) ; }
Source:
private boolean isExceedMaxBlockDiskSize ( ) { org.ovirt.engine.core.common.businessentities.StorageType storageType = org.ovirt.engine.core.bll.AddDiskCommand.getStorageDomain ( ) . getstorage_type ( ) ; boolean isBlockStorageDomain = ( storageType == ( org.ovirt.engine.core.common.businessentities.StorageType.ISCSI ) ) || ( storageType == ( org.ovirt.engine.core.common.businessentities.StorageType.FCP ) ) ; boolean isRequestedLargerThanMaxSize = ( getRequestDiskSpace ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxBlockDiskSize ) ) ; return isBlockStorageDomain && isRequestedLargerThanMaxSize ; }

Target:
private boolean isExceedMaxBlockDiskSize ( ) { org.ovirt.engine.core.common.businessentities.StorageType storageType = org.ovirt.engine.core.bll.AddDiskCommand.getStorageDomain ( ) . getStorageType ( ) ; boolean isBlockStorageDomain = ( storageType == ( org.ovirt.engine.core.common.businessentities.StorageType.ISCSI ) ) || ( storageType == ( org.ovirt.engine.core.common.businessentities.StorageType.FCP ) ) ; boolean isRequestedLargerThanMaxSize = ( getRequestDiskSpace ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.MaxBlockDiskSize ) ) ; return isBlockStorageDomain && isRequestedLargerThanMaxSize ; }
Source:
private void decrementVdsPendingVmsCount ( ) { synchronized ( _vds_pending_vm_count ) { int i = _vds_pending_vm_count.get ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) ) ; _vds_pending_vm_count.put ( org.ovirt.engine.core.bll.RunVmCommand.getVdsId ( ) , ( i - 1 ) ) ; } }

Target:
protected boolean acquireLockInternal ( ) { final boolean acquireLock = super . acquireLockInternal ( ) ; if ( ( ( ! acquireLock ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) != null ) ) && ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isAutoStartup ( ) ) ) { org.ovirt.engine.core.bll.AutoStartVmsRunner.getInstance ( ) . addVmToRun ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getVmId ( ) ) ; } return acquireLock ; }
Source:
public void testIsNetworkInSyncWhenBootProtocolDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4BootProtocolDifferent ( ) throws java.lang.Exception { initIpv4ConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
public void canDoActionVirtOnlySucceeds ( ) throws java.lang.Exception { setupVirtMock ( ) ; org.junit.Assert.assertTrue ( commandMock.canDoAction ( ) ) ; }

Target:
public void provisioningValidated ( ) throws java.lang.Exception { setupVirtMock ( ) ; org.junit.Assert.assertTrue ( commandMock.validate ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningComputeResourceValid ( org.mockito.Matchers.any ( java.lang.Boolean.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ExternalComputeResource.class ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningHostGroupValid ( org.mockito.Matchers.any ( java.lang.Boolean.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ExternalHostGroup.class ) ) ; }
Source:
private void doTestBadAddNic ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddVmTemplateInterface , org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { PARENT_ID } , canDo , success ) ) ; org.ovirt.engine.api.model.Nic model = getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > getEntityList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > entities = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } return entities ; }
Source:
public static boolean vmDeviceChanged ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType deviceType , java.lang.String device , boolean deviceEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = ( device != null ) ? org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmIdTypeAndDevice ( vmId , deviceType , device ) : org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmIdAndType ( vmId , deviceType ) ; return deviceEnabled == ( vmDevices.isEmpty ( ) ) ; }

Target:
public static void addImportedDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , boolean isImportAsNewEntity ) { if ( isImportAsNewEntity ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.setNewIdInImportedCollections ( vmBase ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevicesToAdd = new java.util.ArrayList < > ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevicesToUpdate = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDiskDevices ( vmBase , vmDevicesToUpdate ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedInterfaces ( vmBase , vmDevicesToUpdate ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedOtherDevices ( vmBase , vmDevicesToAdd ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.saveAll ( vmDevicesToAdd ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.updateAll ( vmDevicesToUpdate ) ; }
Source:
private void initCheckBoxEditors ( ) { importGlusterConfigurationEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; countThreadsAsCoresEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableTrustedServiceEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableHaReservationEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableBallooning = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableBallooning.getContentWidgetContainer ( ) . setWidth ( "350px" ) ; }

Target:
private void initCheckBoxEditors ( ) { importGlusterConfigurationEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; countThreadsAsCoresEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableTrustedServiceEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableHaReservationEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableKsm = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableKsm.getContentWidgetContainer ( ) . setWidth ( "350px" ) ; enableBallooning = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; enableBallooning.getContentWidgetContainer ( ) . setWidth ( "350px" ) ; }
Source:
private void handleHostsWithVmsWithPluggedDiskSnapshots ( java.util.List < java.lang.String > hostsWithVmsWithPluggedDiskSnapshots ) { if ( ! ( hostsWithVmsWithPluggedDiskSnapshots.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$HostsList %1$s" , org.apache.commons.lang.StringUtils.join ( hostsWithVmsWithPluggedDiskSnapshots , "," ) ) ) ; } }

Target:
private void handleNonResponsiveHosts ( java.util.List < java.lang.String > hostNotRespondingList ) { if ( ! ( hostNotRespondingList.isEmpty ( ) ) ) { addValidationMessage ( EngineMessage.VDS_CANNOT_MAINTENANCE_VDS_IS_NOT_RESPONDING_WITH_VMS ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getValidationMessages ( ) . add ( java.lang.String.format ( "$HostNotResponding %1$s" , org.apache.commons.lang.StringUtils.join ( hostNotRespondingList , "," ) ) ) ; } }
Source:
public static boolean isBondVlan ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface ) { if ( org.ovirt.engine.core.common.utils.NetworkCommonUtils.isVlan ( iface ) ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : interfaces ) { if ( ( java.lang.Boolean.TRUE.equals ( i.getBonded ( ) ) ) && ( i.getName ( ) . equals ( iface.getBaseInterface ( ) ) ) ) { return true ; } } } return false ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.IPv4Address createIpv4FromNic ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address iPv4Address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; if ( ( nic.getIpv4BootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) { iPv4Address.setAddress ( nic.getIpv4Address ( ) ) ; iPv4Address.setNetmask ( nic.getIpv4Subnet ( ) ) ; iPv4Address.setGateway ( nic.getIpv4Gateway ( ) ) ; } iPv4Address.setBootProtocol ( nic.getIpv4BootProtocol ( ) ) ; return iPv4Address ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > result = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDAO ( ) . getAllForStorageDomain ( org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getParameters ( ) . getStorageDomainId ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > temp = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( result ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains domain : temp ) { if ( ( domain.getstorage_domain_shared_status ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) { result.remove ( domain ) ; } } org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > result = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStorageDomain ( org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getParameters ( ) . getStorageDomainId ( ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > temp = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( result ) ; for ( org.ovirt.engine.core.common.businessentities.storage_domains domain : temp ) { if ( ( domain.getstorage_domain_shared_status ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Unattached ) ) { result.remove ( domain ) ; } } org.ovirt.engine.core.bll.storage.GetStorageDomainListByIdQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.NonOperationalReason persistAndEnforceNetworkCompliance ( org.ovirt.engine.core.common.businessentities.VDS host , boolean skipManagementNetwork , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > userConfiguredNics ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbIfaces = interfaceDao.getAllInterfacesForVds ( host.getId ( ) ) ; persistTopology ( host.getInterfaces ( ) , dbIfaces , userConfiguredNics ) ; return enforceNetworkCompliance ( host , skipManagementNetwork , dbIfaces ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.NonOperationalReason persistAndEnforceNetworkCompliance ( org.ovirt.engine.core.common.businessentities.VDS host , boolean skipManagementNetwork , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > userConfiguredNics ) { 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.getInterfaces ( ) , dbIfaces , userConfiguredNics ) ; org.ovirt.engine.core.common.businessentities.NonOperationalReason nonOperationalReason = enforceNetworkCompliance ( host , skipManagementNetwork , clusterNetworks ) ; auditNetworkCompliance ( host , dbIfaces , clusterNetworks ) ; return nonOperationalReason ; }
Source:
protected void initializeModelHandlers ( ) { popupHandler.addDialogModelListener ( org.ovirt.engine.ui.common.uicommon.model.TabModelProvider.getModel ( ) ) ; org.ovirt.engine.ui.common.uicommon.model.TabModelProvider.getModel ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( "WidgetModel" . equals ( propName ) ) { modelBoundWidgetChange ( ) ; } } } ) ; if ( ! ( reusesModel ( ) ) ) { org.ovirt.engine.ui.common.uicommon.model.TabModelProvider.getModel ( ) . setEventBus ( getEventBus ( ) ) ; } }

Target:
protected void initializeModelHandlers ( M model ) { popupHandler.addDialogModelListener ( model ) ; model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.String propName = args.propertyName ; if ( "WidgetModel" . equals ( propName ) ) { modelBoundWidgetChange ( ) ; } } } ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > generateDisksList ( int size ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < size ; ++ i ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = org.ovirt.engine.core.bll.AddVmCommandTest.createDiskImage ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) ; disksList.add ( diskImage ) ; } return disksList ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > generateDisksList ( int size ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < size ; ++ i ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = org.ovirt.engine.core.bll.AddVmCommandTest.createDiskImage ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) ; disksList.add ( diskImage ) ; } return disksList ; }
Source:
protected void verifyAddDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface , org.mockito.verification.VerificationMode addMacVerification ) { org.mockito.Mockito.verify ( macPoolManager , addMacVerification ) . forceAddMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNetworkInterfaceDAO ) . save ( iface ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . save ( iface.getStatistics ( ) ) ; }

Target:
protected void verifyAddDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface , org.mockito.verification.VerificationMode addMacVerification ) { org.mockito.Mockito.verify ( macPoolManager , addMacVerification ) . forceAddMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNicDao ) . save ( iface ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . save ( iface.getStatistics ( ) ) ; }
Source:
public java.lang.Object runInTransaction ( ) { getStoragePool ( ) . setstatus ( StoragePoolStatus.Maintanance ) ; getStoragePool ( ) . setStoragePoolFormatType ( masterStorageDomain.getStorageFormat ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( getStoragePool ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.PoolStatusChanged ( getStoragePool ( ) . getId ( ) , getStoragePool ( ) . getstatus ( ) ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { getStoragePool ( ) . setstatus ( StoragePoolStatus.Maintenance ) ; getStoragePool ( ) . setStoragePoolFormatType ( masterStorageDomain.getStorageFormat ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( getStoragePool ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.PoolStatusChanged ( getStoragePool ( ) . getId ( ) , getStoragePool ( ) . getstatus ( ) ) ; return null ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity getBrick ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( volumeId , new org.ovirt.engine.core.common.businessentities.VdsStatic ( serverName , "127.0.0.1" , "0934390834" , 20 , new org.ovirt.engine.core.compat.Guid ( ) , serverId , serverName , true , org.ovirt.engine.core.common.businessentities.VDSType.oVirtNode ) , org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.BRICK_DIRECTORY , org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ; return brick ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity getBrick ( org.ovirt.engine.core.compat.Guid volumeId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( volumeId , new org.ovirt.engine.core.common.businessentities.VdsStatic ( serverName , "127.0.0.1" , "0934390834" , 20 , 22 , "root" , org.ovirt.engine.core.compat.Guid.newGuid ( ) , serverId , serverName , true , org.ovirt.engine.core.common.businessentities.VDSType.oVirtNode ) , org.ovirt.engine.core.bll.gluster.AddBricksToGlusterVolumeCommandTest.BRICK_DIRECTORY , org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ; return brick ; }
Source:
public boolean hasMethod ( org.ovirt.api.metamodel.concepts.Name name ) { for ( org.ovirt.api.metamodel.concepts.Method method : methods ) { if ( java.util.Objects.equals ( method.getName ( ) , name ) ) { return true ; } } if ( ( base ) != null ) { return base.hasMethod ( name ) ; } return false ; }

Target:
public java.util.stream.Stream < org.ovirt.api.metamodel.concepts.Method > methods ( ) { java.util.stream.Stream < org.ovirt.api.metamodel.concepts.Method > result = declaredMethods ( ) ; if ( ( base ) != null ) { result = java.util.stream.Stream.concat ( base.methods ( ) , result ) ; } return result ; }
Source:
private void updateVmsOfInstanceType ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getTemplateType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsToUpdate = org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmDAO ( ) . getVmsListByInstanceType ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsToUpdate ) { runInternalAction ( VdcActionType.UpdateVm , new org.ovirt.engine.core.common.action.VmManagementParametersBase ( vm ) ) ; } }

Target:
private void updateVmsOfInstanceType ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getTemplateType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsToUpdate = org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmDAO ( ) . getVmsListByInstanceType ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsToUpdate ) { org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( vm ) ; params.setApplyChangesLater ( true ) ; runInternalAction ( VdcActionType.UpdateVm , params ) ; } }
Source:
public static 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 ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }
Source:
public static java.util.Map < java.lang.String , java.lang.Object > getPayloadForAuthCode ( java.lang.String authCode , java.lang.String scope , java.lang.String redirectUri ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.Object > response = org.ovirt.engine.core.aaa.SSOOAuthServiceUtils.getToken ( "authorization_code" , authCode , scope , redirectUri ) ; org.ovirt.engine.core.aaa.filters.FiltersHelper.isStatusOk ( response ) ; return org.ovirt.engine.core.aaa.filters.FiltersHelper.getPayloadForToken ( ( ( java.lang.String ) ( response.get ( "access_token" ) ) ) ) ; }

Target:
public static java.util.Map < java.lang.String , java.lang.Object > getPayloadForAuthCode ( java.lang.String authCode , java.lang.String scope , java.lang.String redirectUri ) throws java.lang.Exception { java.util.Map < java.lang.String , java.lang.Object > response = org.ovirt.engine.core.aaa.SsoOAuthServiceUtils.getToken ( "authorization_code" , authCode , scope , redirectUri ) ; org.ovirt.engine.core.aaa.filters.FiltersHelper.isStatusOk ( response ) ; return org.ovirt.engine.core.aaa.filters.FiltersHelper.getPayloadForToken ( ( ( java.lang.String ) ( response.get ( "access_token" ) ) ) ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveVmCommand.getActionState ( ) ) { case EXECUTE : if ( hasImages ) { return org.ovirt.engine.core.bll.RemoveVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_VM : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_REMOVE_VM ; } else { return org.ovirt.engine.core.bll.RemoveVmCommand.getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_VM_FINISHED : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_REMOVE_VM ; } case END_FAILURE : case END_SUCCESS : default : return disksLeftInVm.isEmpty ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_VM_FINISHED : org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { switch ( org.ovirt.engine.core.bll.RemoveVmCommand.getActionState ( ) ) { case EXECUTE : return org.ovirt.engine.core.bll.RemoveVmCommand.getSucceeded ( ) ? disksLeftInVm.isEmpty ( ) ? org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_VM_FINISHED : org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_REMOVE_VM ; case END_FAILURE : case END_SUCCESS : default : return disksLeftInVm.isEmpty ( ) ? org.ovirt.engine.core.common.AuditLogType.UNASSIGNED : org.ovirt.engine.core.common.AuditLogType.USER_REMOVE_VM_FINISHED_WITH_ILLEGAL_DISKS ; } }
Source:
private org.ovirt.engine.core.bll.network.macpool.MacPool createPoolInternal ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { if ( macPools.containsKey ( macPool.getId ( ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST ) ; } org.ovirt.engine.core.bll.network.macpool.MacPool poolForScope = new org.ovirt.engine.core.bll.network.macpool.MacPoolUsingRanges ( macPoolToRanges ( macPool ) , macPool.isAllowDuplicateMacAddresses ( ) ) ; macPools.put ( macPool.getId ( ) , new org.ovirt.engine.core.bll.network.macpool.MacPoolLockingProxy ( poolForScope ) ) ; return poolForScope ; }

Target:
private org.ovirt.engine.core.bll.network.macpool.MacPool createPoolInternal ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { if ( macPools.containsKey ( macPool.getId ( ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerDc.UNABLE_TO_CREATE_MAC_POOL_IT_ALREADY_EXIST ) ; } org.ovirt.engine.core.bll.network.macpool.MacPool poolForScope = new org.ovirt.engine.core.bll.network.macpool.MacPoolUsingRanges ( macPoolToRanges ( macPool ) , macPool.isAllowDuplicateMacAddresses ( ) ) ; macPools.put ( macPool.getId ( ) , lockedObjectFactory.createLockingInstance ( poolForScope , org.ovirt.engine.core.bll.network.macpool.MacPool.class ) ) ; return poolForScope ; }
Source:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getDiskList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
protected boolean updateVmInSpm ( ) { return org.ovirt.engine.core.bll.VmCommand.updateVmInSpm ( getVm ( ) . getStoragePoolId ( ) , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VM [ ] { getVm ( ) } ) ) ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsFromExportDomain ( ) { org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters p = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( getParameters ( ) . getStoragePoolId ( ) , getParameters ( ) . getSourceDomainId ( ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue qRetVal = getBackend ( ) . runInternalQuery ( VdcQueryType.GetVmsFromExportDomain , p ) ; if ( ! ( qRetVal.getSucceeded ( ) ) ) { return null ; } return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( qRetVal.getReturnValue ( ) ) ) ; }
Source:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }

Target:
public void disableVirtWhenVmsExist ( ) { createCommandWithGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createDefaultVdsGroup ( ) ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; clusterHasVMs ( ) ; canDoActionFailedWithReason ( EngineMessage.VDS_GROUP_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }
Source:
private boolean verifyImage ( org.ovirt.engine.core.compat.Guid transferingVdsId ) { org.ovirt.engine.core.common.vdscommands.ImageActionsVDSCommandParameters parameters = new org.ovirt.engine.core.common.vdscommands.ImageActionsVDSCommandParameters ( transferingVdsId , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getImage ( ) . getImage ( ) . getDiskId ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getImage ( ) . getImageId ( ) ) ; try { org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.getBackend ( ) . getResourceManager ( ) . runVdsCommand ( VDSCommandType.VerifyUntrustedVolume , parameters ) ; } catch ( java.lang.RuntimeException e ) { log.error ( "Failed to verify uploaded image: {}" , e ) ; return false ; } return true ; }

Target:
private boolean verifyImage ( org.ovirt.engine.core.compat.Guid transferingVdsId ) { org.ovirt.engine.core.common.vdscommands.ImageActionsVDSCommandParameters parameters = new org.ovirt.engine.core.common.vdscommands.ImageActionsVDSCommandParameters ( transferingVdsId , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getImage ( ) . getImage ( ) . getDiskId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getImage ( ) . getImageId ( ) ) ; try { org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getBackend ( ) . getResourceManager ( ) . runVdsCommand ( VDSCommandType.VerifyUntrustedVolume , parameters ) ; } catch ( java.lang.RuntimeException e ) { log.error ( "Failed to verify transferred image: {}" , e ) ; return false ; } return true ; }