auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testNetworkCanBeAttachedNetworkAttachmentCannotBeAddedOnBondSlave ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setBondName ( "bondName" ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . networkCanBeAttached ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.CANNOT_ADD_NETWORK_ATTACHMENT_ON_SLAVE_OR_VLAN ) ) ; }

Target:
public void testNetworkCanBeAttachedNetworkAttachmentCannotBeAddedOnBondSlave ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setBondName ( "bondName" ) ; java.lang.String networkName = "networkName" ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . networkCanBeAttached ( networkName ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.CANNOT_ADD_NETWORK_ATTACHMENT_ON_SLAVE_OR_VLAN , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_NETWORK_NAME , networkName ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_NIC_NAME , vdsNetworkInterface.getName ( ) ) ) ) ; }
Source:
private boolean isImagesExists ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : getDisksList ( ) ) { if ( ( diskImage.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { return true ; } } return false ; }

Target:
public boolean validateCinder ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = org.ovirt.engine.core.bll.ImagesHandler.filterDisksBasedOnCinder ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ) ; if ( ! ( cinderDisks.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.validator.storage.CinderDisksValidator cinderDisksValidator = getCinderDisksValidator ( cinderDisks ) ; return validate ( cinderDisksValidator.validateCinderDiskSnapshotsLimits ( ) ) ; } return true ; }
Source:
public void testValidate ( ) { org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter ( ) ; org.junit.Assert.assertTrue ( "1" , comp.validateFieldValue ( "SIZE" , "1" ) ) ; org.junit.Assert.assertTrue ( "123" , comp.validateFieldValue ( "SIZE" , "123" ) ) ; org.junit.Assert.assertFalse ( "JarJar" , comp.validateFieldValue ( "SIZE" , "JarJar" ) ) ; }

Target:
public void testValidate ( ) { org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.StorageDomainFieldAutoCompleter ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( comp.validateFieldValue ( "SIZE" , "1" ) , "1" ) ; org.junit.jupiter.api.Assertions.assertTrue ( comp.validateFieldValue ( "SIZE" , "123" ) , "123" ) ; org.junit.jupiter.api.Assertions.assertFalse ( comp.validateFieldValue ( "SIZE" , "JarJar" ) , "JarJar" ) ; }
Source:
public void generateDiskDescriptionWhenDescriptionIsTruncated ( ) throws java.io.IOException { disk.setDiskAlias ( "DiskAlias" ) ; java.lang.String diskDescription = org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.generateRandomString ( 170 ) ; disk.setDiskDescription ( diskDescription ) ; assertDiskDescriptionMap ( disk , org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.generateDiskAliasJsonEntry ( "DiskAlias" ) , org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.generateDiskDescriptionJsonEntry ( diskDescription.substring ( 0 , 164 ) ) ) ; }

Target:
public void encodeWhenDescriptionIsTruncated ( ) throws java.io.IOException { disk.setDiskAlias ( "DiskAlias" ) ; java.lang.String diskDescription = org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.generateRandomString ( 170 ) ; disk.setDiskDescription ( diskDescription ) ; assertDiskDescriptionMap ( disk , org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.generateDiskAliasJsonEntry ( "DiskAlias" ) , org.ovirt.engine.core.bll.MetadataDiskDescriptionHandlerTest.generateDiskDescriptionJsonEntry ( diskDescription.substring ( 0 , 164 ) ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : org.ovirt.engine.core.bll.AddVmTemplateCommand.getVm ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( getQuotaIdForDisk ( disk ) , null , QuotaStorageConsumptionParameter.QuotaAction.CONSUME , disk.getStorageIds ( ) . get ( 0 ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : org.ovirt.engine.core.bll.AddVmTemplateCommand.getVm ( ) . getDiskList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( getQuotaIdForDisk ( disk ) , null , QuotaStorageConsumptionParameter.QuotaAction.CONSUME , disk.getStorageIds ( ) . get ( 0 ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } return list ; }
Source:
public java.lang.String load ( java.io.File file ) { try ( java.io.InputStream is = new java.io.FileInputStream ( file ) ; java.io.Reader reader = new java.io.InputStreamReader ( is , java.nio.charset.Charset.forName ( "UTF-8" ) ) ) { java.util.Properties props = new java.util.Properties ( ) ; props.load ( reader ) ; return loadImpl ( props , file ) ; } catch ( java.io.IOException exception ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( java.lang.String.format ( "Can't load object configuration file '%1$s': %2$s" , file.getAbsolutePath ( ) , exception.getMessage ( ) ) , exception ) ; } }

Target:
public java.lang.String load ( java.io.File file ) { try ( java.io.InputStream is = new java.io.FileInputStream ( file ) ; java.io.Reader reader = new java.io.InputStreamReader ( is , java.nio.charset.StandardCharsets.UTF_8 ) ) { java.util.Properties props = new java.util.Properties ( ) ; props.load ( reader ) ; return loadImpl ( props , file ) ; } catch ( java.io.IOException exception ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( java.lang.String.format ( "Can't load object configuration file '%1$s': %2$s" , file.getAbsolutePath ( ) , exception.getMessage ( ) ) , exception ) ; } }
Source:
public void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getVmById ( 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.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public static void getMinimalVmMemSize ( 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.VMMinMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isModelCompatibleWithOs ( ) { java.util.Set < org.ovirt.engine.core.common.businessentities.VmWatchdogType > vmWatchdogTypes = getOsRepository ( ) . getVmWatchdogTypes ( osId , version ) ; return ! ( vmWatchdogTypes.contains ( vmWatchdog.getModel ( ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_WATCHDOG_MODEL_IS_NOT_SUPPORTED_BY_OS ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isModelCompatibleWithOs ( ) { java.util.Set < org.ovirt.engine.core.common.businessentities.VmWatchdogType > vmWatchdogTypes = getOsRepository ( ) . getVmWatchdogTypes ( osId , version ) ; return ! ( vmWatchdogTypes.contains ( vmWatchdog.getModel ( ) ) ) ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_WATCHDOG_MODEL_IS_NOT_SUPPORTED_BY_OS ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void init ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) == null ) { return ; } super . init ( ) ; setStoragePoolId ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getStoragePoolId ( ) ) ; loadPayloadDevice ( ) ; needsHostDevices = hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) ; loadVmInit ( ) ; fetchVmDisksFromDb ( ) ; org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setBootSequence ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDefaultBootSequence ( ) ) ; org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setRunOnce ( false ) ; }

Target:
protected void init ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) == null ) { return ; } super . init ( ) ; setStoragePoolId ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getStoragePoolId ( ) ) ; loadPayload ( ) ; needsHostDevices = hostDeviceManager.checkVmNeedsDirectPassthrough ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) ; loadVmInit ( ) ; fetchVmDisksFromDb ( ) ; org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setBootSequence ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDefaultBootSequence ( ) ) ; org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setRunOnce ( false ) ; }
Source:
public void setUp ( ) { mockVm ( ) ; org.ovirt.engine.core.bll.validator.VmValidator vmValidator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.VmValidator ( cmd.getVm ( ) ) ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( vmValidator ) . vmNotHavingDeviceSnapshotsAttachedToOtherVms ( org.mockito.Matchers.anyBoolean ( ) ) ; org.mockito.Mockito.doReturn ( vmValidator ) . when ( cmd ) . createVmValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.RemoveSnapshotCommandTest.STORAGE_POOL_ID ) . when ( cmd ) . getStoragePoolId ( ) ; mockSnapshot ( SnapshotType.REGULAR ) ; spySdValidator ( ) ; }

Target:
public void setUp ( ) { mockVm ( ) ; org.ovirt.engine.core.bll.validator.VmValidator vmValidator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.VmValidator ( cmd.getVm ( ) ) ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( vmValidator ) . vmNotHavingDeviceSnapshotsAttachedToOtherVms ( org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.mockito.Mockito.doReturn ( vmValidator ) . when ( cmd ) . createVmValidator ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.RemoveSnapshotCommandTest.STORAGE_POOL_ID ) . when ( cmd ) . getStoragePoolId ( ) ; mockSnapshot ( SnapshotType.REGULAR ) ; spySdValidator ( ) ; }
Source:
protected void updateInputTitle ( java.util.ArrayList < java.lang.String > grayOutReasons , com.google.gwt.dom.client.Element input ) { java.lang.StringBuilder title = new java.lang.StringBuilder ( org.ovirt.engine.ui.common.widget.uicommon.storage.AbstractSanStorageList.constants.empty ( ) ) ; for ( java.lang.String reason : grayOutReasons ) { title.append ( reason ) . append ( org.ovirt.engine.ui.common.widget.uicommon.storage.AbstractSanStorageList.constants.space ( ) ) ; } org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipToElement ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( title.toString ( ) ) , input ) ; }

Target:
protected void updateInputTitle ( java.util.ArrayList < java.lang.String > grayOutReasons , com.google.gwt.dom.client.Element input ) { java.lang.StringBuilder title = new java.lang.StringBuilder ( org.ovirt.engine.ui.common.widget.uicommon.storage.AbstractSanStorageList.constants.empty ( ) ) ; for ( java.lang.String reason : grayOutReasons ) { title.append ( reason ) . append ( org.ovirt.engine.ui.common.widget.uicommon.storage.AbstractSanStorageList.constants.space ( ) ) ; } org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipToElement ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( title.toString ( ) ) , input , Placement.LEFT ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid lookupClusterId ( org.ovirt.engine.api.model.Vm vm ) { return vm.getCluster ( ) . isSetId ( ) ? asGuid ( vm.getCluster ( ) . getId ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , VdcQueryType.GetClusterByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( vm.getCluster ( ) . getName ( ) ) , ( "Cluster: name=" + ( vm.getCluster ( ) . getName ( ) ) ) ) . getId ( ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid lookupClusterId ( org.ovirt.engine.api.model.Vm vm ) { return vm.getCluster ( ) . isSetId ( ) ? asGuid ( vm.getCluster ( ) . getId ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , QueryType.GetClusterByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( vm.getCluster ( ) . getName ( ) ) , ( "Cluster: name=" + ( vm.getCluster ( ) . getName ( ) ) ) ) . getId ( ) ; }
Source:
private org.ovirt.engine.api.model.Vm createModel ( org.ovirt.engine.api.model.Disks disks ) { org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 2 ) ; model.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; model.getTemplate ( ) . setId ( GUIDS [ 1 ] . toString ( ) ) ; model.setCluster ( new org.ovirt.engine.api.model.Cluster ( ) ) ; model.getCluster ( ) . setId ( GUIDS [ 2 ] . toString ( ) ) ; if ( disks != null ) { model.setDisks ( disks ) ; } return model ; }

Target:
private org.ovirt.engine.api.model.Vm createModel ( org.ovirt.engine.api.model.Disks disks ) { org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 2 ) ; model.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; model.getTemplate ( ) . setId ( GUIDS [ 1 ] . toString ( ) ) ; model.setCluster ( new org.ovirt.engine.core.common.businessentities.Cluster ( ) ) ; model.getCluster ( ) . setId ( GUIDS [ 2 ] . toString ( ) ) ; if ( disks != null ) { model.setDisks ( disks ) ; } return model ; }
Source:
public void testGetAllForUserAndActionGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForUserAndActionGroup ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , ActionGroup.CONNECT_TO_SERIAL_CONSOLE ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( 6 , result.size ( ) ) ; }

Target:
public void testGetAllForUserAndActionGroup ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > result = dao.getAllForUserAndActionGroup ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , ActionGroup.CONNECT_TO_SERIAL_CONSOLE ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 6 , result.size ( ) ) ; }
Source:
private void RemoveChildren ( org.ovirt.engine.core.compat.Guid snapshot ) { java.util.List < org.ovirt.engine.core.compat.Guid > children = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; GetImageChildren ( snapshot , children ) ; java.util.Collections.reverse ( children ) ; for ( org.ovirt.engine.core.compat.Guid child : children ) { RemoveSnapshot ( org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImageDao ( ) . getSnapshotById ( child ) ) ; } }

Target:
private void removeChildren ( org.ovirt.engine.core.compat.Guid snapshot ) { java.util.List < org.ovirt.engine.core.compat.Guid > children = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; getImageChildren ( snapshot , children ) ; java.util.Collections.reverse ( children ) ; for ( org.ovirt.engine.core.compat.Guid child : children ) { removeSnapshot ( org.ovirt.engine.core.bll.RemoveImageCommand.getDiskImageDao ( ) . getSnapshotById ( child ) ) ; } }
Source:
private org.ovirt.engine.core.bll.interfaces.BackendCommandObjectsHandler getBackendCommandObjectsHandler ( ) { try { javax.naming.InitialContext ctx = new javax.naming.InitialContext ( ) ; return ( ( org.ovirt.engine.core.bll.interfaces.BackendCommandObjectsHandler ) ( ctx.lookup ( org.ovirt.engine.core.bll.CommandBase.BACKEND_COMMAND_OBJECTS_HANDLER_JNDI_NAME ) ) ) ; } catch ( javax.naming.NamingException e ) { log.error ( ( "Getting backend command objects handler failed" + ( e.getMessage ( ) ) ) ) ; log.debug ( "" , e ) ; return null ; } }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase runInternalAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , org.ovirt.engine.core.bll.context.CommandContext context ) { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( actionType , parameters , context ) ; }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedBonds ( org.ovirt.engine.core.compat.Guid ... ids ) { if ( emptyParameters ( ids ) ) { return this ; } if ( ( parameters.getRemovedBonds ( ) ) == null ) { parameters.setRemovedBonds ( new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ) ; } parameters.getRemovedBonds ( ) . addAll ( java.util.Arrays.asList ( ids ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedLabels ( java.lang.String ... removedLabels ) { if ( nullParameters ( removedLabels ) ) { return this ; } if ( ( parameters.getRemovedLabels ( ) ) == null ) { parameters.setRemovedLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; } parameters.getRemovedLabels ( ) . addAll ( java.util.Arrays.asList ( removedLabels ) ) ; return this ; }
Source:
public org.ovirt.engine.core.common.job.JobExecutionStatus getJobExecutionStatus ( ) { switch ( this ) { case COMPLETED : return org.ovirt.engine.core.common.job.JobExecutionStatus.FINISHED ; case STARTED : return org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ; case STOPPED : return org.ovirt.engine.core.common.job.JobExecutionStatus.ABORTED ; case FAILED : return org.ovirt.engine.core.common.job.JobExecutionStatus.FAILED ; case UNKNOWN : case NOT_STARTED : default : return org.ovirt.engine.core.common.job.JobExecutionStatus.UNKNOWN ; } }

Target:
public org.ovirt.engine.core.common.job.JobExecutionStatus getJobExecutionStatus ( ) { switch ( this ) { case COMPLETED : return org.ovirt.engine.core.common.job.JobExecutionStatus.FINISHED ; case STARTED : case IN_PROGRESS : return org.ovirt.engine.core.common.job.JobExecutionStatus.STARTED ; case STOPPED : return org.ovirt.engine.core.common.job.JobExecutionStatus.ABORTED ; case FAILED : return org.ovirt.engine.core.common.job.JobExecutionStatus.FAILED ; case UNKNOWN : case NOT_STARTED : default : return org.ovirt.engine.core.common.job.JobExecutionStatus.UNKNOWN ; } }
Source:
private void setupExpectations ( org.ovirt.engine.core.common.mode.ApplicationMode appMode , java.lang.String [ ] relationships ) { org.easymock.EasyMock.expect ( current.get ( org.ovirt.engine.core.common.mode.ApplicationMode.class ) ) . andReturn ( appMode ) . anyTimes ( ) ; resource.setUriInfo ( setUpUriInfo ( ( ( org.ovirt.engine.api.restapi.resource.BackendApiResourceTest.URI_BASE ) + "/" ) , relationships ) ) ; setUpGetSystemVersionExpectations ( ) ; setUpGetSystemStatisticsExpectations ( ) ; }

Target:
private void setupExpectations ( org.ovirt.engine.core.common.mode.ApplicationMode appMode , java.lang.String [ ] relationships ) { current.setApplicationMode ( appMode ) ; resource.setUriInfo ( setUpUriInfo ( ( ( org.ovirt.engine.api.restapi.resource.BackendApiResourceTest.URI_BASE ) + "/" ) , relationships ) ) ; setUpGetSystemVersionExpectations ( ) ; setUpGetSystemStatisticsExpectations ( ) ; }
Source:
private void runVm ( org.ovirt.engine.core.compat.Guid vmId ) { final org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RunVm , new org.ovirt.engine.core.common.action.RunVmParams ( vmId ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase event = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; event.setVmId ( vmId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( event , AuditLogType.HA_VM_RESTART_FAILED ) ; } }

Target:
private boolean runVm ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.utils.lock.EngineLock lock ) { boolean succeeded = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RunVm , new org.ovirt.engine.core.common.action.RunVmParams ( vmId ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( lock ) ) . getSucceeded ( ) ; if ( ! succeeded ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase event = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; event.setVmId ( vmId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( event , AuditLogType.HA_VM_RESTART_FAILED ) ; } return succeeded ; }
Source:
public void diskInterfaceSupportedByOs ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; initializeOsRepository ( vm.getOs ( ) , DiskInterface.VirtIO ) ; org.junit.Assert.assertThat ( validator.isDiskInterfaceSupported ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void diskInterfaceSupportedByOs ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; initializeOsRepository ( vm.getOs ( ) , DiskInterface.VirtIO ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( ) ; dve.setDiskInterface ( DiskInterface.VirtIO ) ; org.junit.Assert.assertThat ( validator.isDiskInterfaceSupported ( vm , dve ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testGetBoolean ( ) throws java.lang.Exception { java.io.File file = writeConf ( "true=true" , "TRUE=TRUE" , "false=false" , "FALSE=FALSE" ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; junit.framework.Assert.assertNotNull ( config ) ; junit.framework.Assert.assertTrue ( config.getBoolean ( "true" ) ) ; junit.framework.Assert.assertTrue ( config.getBoolean ( "TRUE" ) ) ; junit.framework.Assert.assertFalse ( config.getBoolean ( "false" ) ) ; junit.framework.Assert.assertFalse ( config.getBoolean ( "FALSE" ) ) ; }

Target:
public void testGetBoolean ( ) throws java.lang.Exception { java.io.File file = writeConf ( "true=true" , "TRUE=TRUE" , "false=false" , "FALSE=FALSE" ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.Assert.assertNotNull ( config ) ; org.junit.Assert.assertTrue ( config.getBoolean ( "true" ) ) ; org.junit.Assert.assertTrue ( config.getBoolean ( "TRUE" ) ) ; org.junit.Assert.assertFalse ( config.getBoolean ( "false" ) ) ; org.junit.Assert.assertFalse ( config.getBoolean ( "FALSE" ) ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.utils.pm.VdsFenceOptions options = new org.ovirt.engine.core.utils.pm.VdsFenceOptions ( ) ; java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > map = options.getFencingOptionMappingMap ( ) ; org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getQueryReturnValue ( ) . setReturnValue ( map ) ; org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getQueryReturnValue ( ) . setSucceeded ( ( ( map.size ( ) ) > 0 ) ) ; }

Target:
protected void executeQueryCommand ( ) { java.lang.String version = org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getParameters ( ) . getVersion ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions options = new org.ovirt.engine.core.utils.pm.VdsFenceOptions ( version ) ; java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > map = options.getFencingOptionMappingMap ( ) ; org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getQueryReturnValue ( ) . setReturnValue ( map ) ; org.ovirt.engine.core.bll.GetAgentFenceOptionsQuery.getQueryReturnValue ( ) . setSucceeded ( ( ( map.size ( ) ) > 0 ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < java.lang.Integer > nums = new java.util.ArrayList < > ( ) ; if ( source != null ) { java.lang.Iterable numEnumerable = ( ( java.lang.Iterable ) ( source ) ) ; java.util.Iterator numIterator = numEnumerable.iterator ( ) ; while ( numIterator.hasNext ( ) ) { nums.add ( java.lang.Integer.parseInt ( numIterator.next ( ) . toString ( ) ) ) ; } } return nums ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < java.lang.Integer > nums = new java.util.ArrayList < > ( ) ; if ( source != null ) { java.lang.Iterable numEnumerable = ( ( java.lang.Iterable ) ( source ) ) ; java.util.Iterator numIterator = numEnumerable.iterator ( ) ; while ( numIterator.hasNext ( ) ) { nums.add ( java.lang.Integer.parseInt ( numIterator.next ( ) . toString ( ) ) ) ; } } return nums ; }
Source:
static org.ovirt.engine.api.model.Disk setUpStatisticalEntityExpectations ( org.ovirt.engine.core.common.businessentities.DiskImage entity ) { entity.setReadRate ( 1 ) ; entity.setWriteRate ( 2 ) ; entity.setReadLatency ( 3.0 ) ; entity.setWriteLatency ( 4.0 ) ; entity.setFlushLatency ( 5.0 ) ; return entity ; }

Target:
static org.ovirt.engine.api.model.Disk setUpStatisticalEntityExpectations ( org.ovirt.engine.core.common.businessentities.storage.DiskImage entity ) { entity.setReadRate ( 1 ) ; entity.setWriteRate ( 2 ) ; entity.setReadLatency ( 3.0 ) ; entity.setWriteLatency ( 4.0 ) ; entity.setFlushLatency ( 5.0 ) ; return entity ; }
Source:
public void testAllocateMacFromRequestForNonStatelessVmWhenMacDiffers ( ) { nicBeingUpdated.setMacAddress ( org.ovirt.engine.core.bll.network.vm.OLD_MAC ) ; updatingNic.setMacAddress ( org.ovirt.engine.core.bll.network.vm.NEW_MAC ) ; org.mockito.Mockito.when ( macPool.addMac ( updatingNic.getMacAddress ( ) ) ) . thenReturn ( true ) ; underTest.initMacPoolData ( ) ; org.junit.Assert.assertThat ( "There's no snapshot, new mac of updated nic must be allocated in mac pool" , underTest.allocateMacFromRequest ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testAllocateMacFromRequestForNonStatelessVmWhenMacDiffers ( ) { nicBeingUpdated.setMacAddress ( org.ovirt.engine.core.bll.network.vm.OLD_MAC ) ; updatingNic.setMacAddress ( org.ovirt.engine.core.bll.network.vm.NEW_MAC ) ; org.mockito.Mockito.when ( macPool.addMac ( updatingNic.getMacAddress ( ) ) ) . thenReturn ( true ) ; underTest.initMacPoolData ( ) ; org.hamcrest.MatcherAssert.assertThat ( "There's no snapshot, new mac of updated nic must be allocated in mac pool" , underTest.allocateMacFromRequest ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getBehavior ( ) . updateTimeZone ( ) ; }

Target:
private void WatchdogModel_EntityChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "" . equals ( getWatchdogModel ( ) . getEntity ( ) ) ) { getWatchdogAction ( ) . setIsChangable ( false ) ; getWatchdogAction ( ) . setSelectedItem ( "" ) ; } else { getWatchdogAction ( ) . setIsChangable ( true ) ; } }
Source:
public static void copy ( java.io.InputStream input , java.io.OutputStream output ) throws java.io.IOException { try { byte [ ] buffer = new byte [ org.ovirt.engine.api.rsdl.RsdlIOManager.DEFAULT_BUFFER_SIZE ] ; int n = 0 ; while ( ( - 1 ) != ( n = input.read ( buffer ) ) ) { output.write ( buffer , 0 , n ) ; } } finally { if ( input != null ) { input.close ( ) ; } if ( output != null ) { output.close ( ) ; } } }

Target:
private static void exportResource ( java.lang.String apiVersion , java.lang.String resourceName , java.io.File outputDirectory ) throws java.io.IOException { java.lang.String resourcePath = java.lang.String.format ( "/v%s/%s" , apiVersion , resourceName ) ; java.io.InputStream inputResource = org.ovirt.engine.api.rsdl.RsdlIOManager.class . getResourceAsStream ( resourcePath ) ; java.io.File outputFile = new java.io.File ( outputDirectory , resourceName ) ; java.lang.System.out.printf ( "Copying resource \"%s\" to file \"%s\"\n" , resourcePath , outputFile.getAbsolutePath ( ) ) ; org.apache.commons.io.FileUtils.copyInputStreamToFile ( inputResource , outputFile ) ; }
Source:
public static void addBondToParams ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel , org.ovirt.engine.core.common.businessentities.network.Bond bond ) { for ( java.util.Iterator < org.ovirt.engine.core.common.businessentities.network.Bond > iter = dataFromHostSetupNetworksModel.removedBonds.iterator ( ) ; iter.hasNext ( ) ; ) { org.ovirt.engine.core.common.businessentities.network.Bond removedBond = iter.next ( ) ; if ( removedBond.getName ( ) . equals ( bond.getName ( ) ) ) { iter.remove ( ) ; break ; } } dataFromHostSetupNetworksModel.newOrModifiedBonds.add ( bond ) ; }

Target:
public static void addBondToParams ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel , org.ovirt.engine.core.common.businessentities.network.Bond bond ) { for ( java.util.Iterator < org.ovirt.engine.core.common.businessentities.network.Bond > iterator = dataFromHostSetupNetworksModel.removedBonds.iterator ( ) ; iterator.hasNext ( ) ; ) { org.ovirt.engine.core.common.businessentities.network.Bond removedBond = iterator.next ( ) ; if ( removedBond.getName ( ) . equals ( bond.getName ( ) ) ) { iterator.remove ( ) ; break ; } } dataFromHostSetupNetworksModel.newOrModifiedBonds.add ( bond ) ; }
Source:
private static boolean isVlanInterfaceUp ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces ) { if ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( vlan ) ) ) { return true ; } java.lang.String ifaceName = vlan.getBaseInterface ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface : interfaces ) { if ( iface.getName ( ) . equals ( ifaceName ) ) { return ( iface.getStatistics ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.InterfaceStatus.UP ) ; } } return false ; }

Target:
private static boolean isBaseInterfaceDown ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces ) { if ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isVlan ( iface ) ) ) { return ( iface.getStatistics ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.InterfaceStatus.UP ) ; } java.lang.String baseIfaceName = iface.getBaseInterface ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface tmpIface : interfaces ) { if ( tmpIface.getName ( ) . equals ( baseIfaceName ) ) { return ( tmpIface.getStatistics ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.InterfaceStatus.UP ) ; } } return false ; }
Source:
private void updateOriginalTemplateNameOnDerivedVms ( ) { boolean templateNameChanged = ! ( org.apache.commons.lang.ObjectUtils.equals ( oldTemplate.getName ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getName ( ) ) ) ; if ( templateNameChanged ) { org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmDao ( ) . updateOriginalTemplateName ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getId ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getName ( ) ) ; } }

Target:
private void updateOriginalTemplateNameOnDerivedVms ( ) { boolean templateNameChanged = ! ( java.util.Objects.equals ( oldTemplate.getName ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getName ( ) ) ) ; if ( templateNameChanged ) { org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmDao ( ) . updateOriginalTemplateName ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getId ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getName ( ) ) ; } }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetStorageDomainsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ ( ( NAMES.length ) - 1 ) ] } , setUpStorageDomains ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetStorageDomainsByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ ( ( NAMES.length ) - 1 ) ] } , setUpStorageDomains ( ) , failure ) ; }
Source:
private void testIsBackedByHudepagesHugePage ( java.lang.String customProperties , boolean expected ) { org.ovirt.engine.core.common.utils.HugePageUtils utils = new org.ovirt.engine.core.common.utils.HugePageUtils ( ) ; org.ovirt.engine.core.common.businessentities.VmBase base = new org.ovirt.engine.core.common.businessentities.VmBase ( ) ; base.setCustomProperties ( customProperties ) ; org.hamcrest.MatcherAssert.assertThat ( utils.isBackedByHudepages ( base ) , org.hamcrest.core.Is.is ( expected ) ) ; }

Target:
private void testIsBackedByHudepagesHugePage ( java.lang.String customProperties , boolean expected ) { org.ovirt.engine.core.common.businessentities.VmBase base = new org.ovirt.engine.core.common.businessentities.VmBase ( ) ; base.setCustomProperties ( customProperties ) ; org.hamcrest.MatcherAssert.assertThat ( org.ovirt.engine.core.common.utils.HugePageUtils.isBackedByHugepages ( base ) , org.hamcrest.core.Is.is ( expected ) ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.models.vms.ImportNetworkData getNetworkImportData ( java.lang.String macAddr ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportNetworkData importData = networkImportDataMap.get ( macAddr ) ; return importData ; }

Target:
protected void updateNetworkInterfacesForVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : vm.getInterfaces ( ) ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportNetworkData importNetworkData = getNetworkImportData ( iface ) ; org.ovirt.engine.core.common.businessentities.network.VnicProfileView profile = importNetworkData.getSelectedNetworkProfile ( ) ; if ( profile != null ) { iface.setNetworkName ( profile.getNetworkName ( ) ) ; iface.setVnicProfileName ( profile.getName ( ) ) ; } } }
Source:
private void runThreads ( final int threadsNumber , org.ovirt.engine.core.utils.thread.LatchedRunnableWrapperTest.RunnableCreator runnableCreator ) { java.util.concurrent.ExecutorService fixedThreadPool = java.util.concurrent.Executors.newFixedThreadPool ( threadsNumber ) ; java.util.concurrent.CountDownLatch latch = new java.util.concurrent.CountDownLatch ( threadsNumber ) ; for ( int index = 0 ; index < threadsNumber ; index ++ ) { fixedThreadPool.execute ( new org.ovirt.engine.core.utils.thread.LatchedRunnableWrapper ( runnableCreator.createRunnable ( ) , latch ) ) ; } try { latch.await ( ) ; } catch ( java.lang.InterruptedException e ) { e.printStackTrace ( ) ; } }

Target:
public java.lang.Void answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { if ( ( executedRunnables.size ( ) ) < countToExecute ) { threadPool.execute ( toReturn ) ; executedRunnables.add ( toReturn ) ; } else { throw new java.util.concurrent.RejectedExecutionException ( ) ; } return null ; }
Source:
public void start ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.FenceActionType.Start ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.StartVds , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
public void start ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.pm.FenceActionType.START ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.StartVds , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { setTitle ( ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.LUN ) ? getDefaultTitle ( ) : null ) ) ; return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.LUN ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.externalDiskIcon ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { setTitle ( ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ? getDefaultTitle ( ) : null ) ) ; return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.externalDiskIcon ( ) : null ; }
Source:
private void UpdateActionAvailability ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( getSelectedItem ( ) ) ) ; getSetAsDisplayCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) == 1 ) ) && ( network != null ) ) && ( ! ( network.getCluster ( ) . getis_display ( ) ) ) ) && ( ( network.getCluster ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.NonOperational ) ) ) ) ; }

Target:
private void UpdateActionAvailability ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( getSelectedItem ( ) ) ) ; getSetAsDisplayCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) . size ( ) ) == 1 ) ) && ( network != null ) ) && ( ! ( network.getCluster ( ) . getis_display ( ) ) ) ) && ( ( network.getCluster ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.NON_OPERATIONAL ) ) ) ) ; }
Source:
protected boolean canDoAction ( ) { disk = org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getParameters ( ) . getDiskId ( ) ) ; return ( ( ( ( ( ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmInUpPausedDownStatus ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.canRunActionOnNonManagedVm ( ) ) ) && ( isDiskExist ( disk ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmNotInPreviewSnapshot ( ) ) ) && ( imageStorageValidation ( ) ) ; }

Target:
protected boolean canDoAction ( ) { return ( ( ( ( ( ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmExist ( ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmInUpPausedDownStatus ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.canRunActionOnNonManagedVm ( ) ) ) && ( isDiskExist ( getDisk ( ) ) ) ) && ( checkCanPerformPlugUnPlugDisk ( ) ) ) && ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.isVmNotInPreviewSnapshot ( ) ) ) && ( imageStorageValidation ( ) ) ; }
Source:
public void validateSlaveHasNoLabelsHasOldLabel ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; slave.setLabels ( java.util.Collections.singleton ( "lbl1" ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) . setExistingInterfaces ( java.util.Arrays.asList ( slave ) ) . setHost ( host ) . build ( ) ; assertValidateSlaveHasNoLabelsFailed ( validator , slave.getName ( ) ) ; }

Target:
public void validateSlaveHasNoLabelsHasNoOldNorNewLabelsValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface slave = createNic ( "slave" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) . setExistingInterfaces ( java.util.Collections.singletonList ( slave ) ) . setHost ( host ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateSlaveHasNoLabels ( slave.getName ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected boolean hostToRunExist ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > dedicatedHostsList = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVdsList ( ) ; if ( dedicatedHostsList.isEmpty ( ) ) { return true ; } for ( org.ovirt.engine.core.compat.Guid candidateHostGuid : dedicatedHostsList ) { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( candidateHostGuid ) ) == null ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; return false ; } } return true ; }

Target:
protected boolean hostToRunExist ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > dedicatedHostsList = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVdsList ( ) ; if ( dedicatedHostsList.isEmpty ( ) ) { return true ; } for ( org.ovirt.engine.core.compat.Guid candidateHostGuid : dedicatedHostsList ) { if ( ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( candidateHostGuid ) ) == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; return false ; } } return true ; }