auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc glusterVolumeSnapshotConfigGet ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.configGet" ) . withOptionalParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc ( clusterId , response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterSnapshotConfigSet ( java.lang.String configName , java.lang.String configValue ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.configSet" ) . withParameter ( "option" , configName ) . withParameter ( "value" , configValue ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void rollback ( ) { log.error ( "Transaction rolled-back for command '{}'." , this . getClass ( ) . getName ( ) ) ; try { if ( isQuotaDependant ( ) ) { rollbackQuota ( ) ; } } catch ( java.lang.NullPointerException e ) { log.error ( "RollbackQuota: failed (may be because quota is disabled)" , e ) ; } cancelTasks ( ) ; }

Target:
public void onRollback ( ) { log.error ( "Transaction rolled-back for command '{}'." , this . getClass ( ) . getName ( ) ) ; try { if ( isQuotaDependant ( ) ) { rollbackQuota ( ) ; } } catch ( java.lang.NullPointerException e ) { log.error ( "RollbackQuota: failed (may be because quota is disabled)" , e ) ; } cancelTasks ( ) ; }
Source:
protected void gatherChangedVms ( org.ovirt.engine.core.common.businessentities.VM dbVm , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vdsmVm ) { changedVms.add ( new org.ovirt.engine.core.common.utils.Pair ( dbVm , vdsmVm ) ) ; if ( org.ovirt.engine.core.vdsbroker.monitoring.VmsStatisticsFetcher.log.isDebugEnabled ( ) ) { logBuilder.append ( java.lang.String.format ( "%s:%s " , vdsmVm.getVmDynamic ( ) . getId ( ) . toString ( ) . substring ( 0 , 8 ) , vdsmVm.getVmDynamic ( ) . getStatus ( ) ) ) ; } }

Target:
protected void gatherChangedVms ( org.ovirt.engine.core.common.businessentities.VM dbVm , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VdsmVm vdsmVm ) { changedVms.add ( new org.ovirt.engine.core.common.utils.Pair ( dbVm , vdsmVm ) ) ; if ( org.ovirt.engine.core.vdsbroker.monitoring.VmsStatisticsFetcher.log.isDebugEnabled ( ) ) { logBuilder.append ( java.lang.String.format ( "%s:%s " , vdsmVm.getVmDynamic ( ) . getId ( ) . toString ( ) . substring ( 0 , 8 ) , vdsmVm.getVmDynamic ( ) . getStatus ( ) ) ) ; } }
Source:
protected void executeCommand ( ) { boolean succeeded = false ; try { succeeded = runVdsCommand ( VDSCommandType.SetMOMPolicyParameters , new org.ovirt.engine.core.common.vdscommands.MomPolicyVDSParameters ( getVds ( ) , getVdsGroup ( ) . isEnableBallooning ( ) , getVdsGroup ( ) . isEnableKsm ( ) ) ) . getSucceeded ( ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.errorFormat ( "Could not update MoM policy on host {0}" , getVdsName ( ) ) ; } getReturnValue ( ) . setSucceeded ( succeeded ) ; }

Target:
protected void executeCommand ( ) { boolean succeeded = false ; try { succeeded = runVdsCommand ( VDSCommandType.SetMOMPolicyParameters , new org.ovirt.engine.core.common.vdscommands.MomPolicyVDSParameters ( getVds ( ) , getVdsGroup ( ) . isEnableBallooning ( ) , getVdsGroup ( ) . isEnableKsm ( ) ) ) . getSucceeded ( ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.error ( "Could not update MoM policy on host '{}': {}" , getVdsName ( ) , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; } getReturnValue ( ) . setSucceeded ( succeeded ) ; }
Source:
public void vdsGroupWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDAO.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }

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 ( VdcBllMessages.VDS_GROUP_CANNOT_DISABLE_VIRT_WHEN_CLUSTER_CONTAINS_VMS ) ; }
Source:
public void writeData ( java.io.ObjectOutputStream dos ) { try { writeString ( this . var_name , dos ) ; writeString ( this . var_value , dos ) ; writeDate ( this . var_datetime , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
public void copyDataTo ( ovirt_engine_dwh.aggregationtodaily_3_4.AggregationToDaily.row11Struct other ) { other.var_name = this . var_name ; other.var_datetime = this . var_datetime ; }
Source:
private void verifyUnsetStoragePoolIdAndNameOnQos ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment entity ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos hostNetworkQos = entity.getHostNetworkQos ( ) ; if ( ( hostNetworkQos != null ) && ( ( ( hostNetworkQos.getStoragePoolId ( ) ) != null ) || ( ( hostNetworkQos.getName ( ) ) != null ) ) ) { throw new java.lang.IllegalArgumentException ( "When persisting overriding qos instance, there must not be storagePoolId nor name set." ) ; } }

Target:
public void update ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment entity ) { verifyRelationWithHostNetworkQos ( entity ) ; hostNetworkQosDao.persistQosChanges ( entity.getId ( ) , entity.getHostNetworkQos ( ) ) ; super . update ( entity ) ; }
Source:
public void testIsNetworkInSyncWhenIpv4StaticBootProtocolAddressDifferent ( ) { initIpv4ConfigurationBootProtocolAddress ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL , 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 ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4StaticBootProtocolAddressDifferent ( ) { initIpv4ConfigurationBootProtocolAddress ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL , 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.hamcrest.MatcherAssert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.storage_domains createDomain ( org.ovirt.engine.core.common.businessentities.storage_domain_static staticPart ) { org.ovirt.engine.core.common.businessentities.storage_domains result = null ; if ( staticPart != null ) { org.ovirt.engine.core.common.businessentities.storage_domain_dynamic dynamicPart = dynamicDAO.get ( staticPart.getId ( ) ) ; if ( dynamicPart != null ) { result = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; result.setStorageStaticData ( staticPart ) ; result.setStorageDynamicData ( dynamicPart ) ; fillInDetails ( result ) ; } } return result ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage_domains createDomain ( org.ovirt.engine.core.common.businessentities.storage_domain_static staticPart ) { org.ovirt.engine.core.common.businessentities.storage_domains result = null ; if ( staticPart != null ) { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic dynamicPart = dynamicDAO.get ( staticPart.getId ( ) ) ; if ( dynamicPart != null ) { result = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; result.setStorageStaticData ( staticPart ) ; result.setStorageDynamicData ( dynamicPart ) ; fillInDetails ( result ) ; } } return result ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmDiskListModel ) ( target ) ) ; model.setIsScanAlignmentEnabled ( ( ( java.lang.Boolean ) ( returnValue ) ) ) ; }

Target:
private boolean isDiskOnBlockDevice ( org.ovirt.engine.core.common.businessentities.Disk disk ) { if ( disk instanceof org.ovirt.engine.core.common.businessentities.DiskImage ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageType > diskStorageTypes = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getStorageTypes ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageType type : diskStorageTypes ) { if ( ! ( type.isBlockDomain ( ) ) ) { return false ; } } return true ; } return false ; }
Source:
protected void executeCommand ( ) { if ( shouldSkipCommandExecutionCached ( ) ) { org.ovirt.engine.core.bll.VmCommand.setSucceeded ( true ) ; return ; } executeVmCommand ( ) ; }

Target:
protected void executeCommand ( ) { if ( shouldSkipCommandExecutionCached ( ) ) { org.ovirt.engine.core.bll.VmCommand.setSucceeded ( true ) ; return ; } executeVmCommand ( ) ; if ( ( ( shouldUpdateHostedEngineOvf ( ) ) && ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) . isHostedEngine ( ) ) ) && ( org.ovirt.engine.core.bll.VmCommand.getSucceeded ( ) ) ) { updateHeOvf ( ) ; } }
Source:
protected void executeValidatedCommands ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { if ( command.getReturnValue ( ) . getCanDoAction ( ) ) { if ( ( ( executionContext ) == null ) || ( executionContext.isMonitored ( ) ) ) { org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , command.isInternalExecution ( ) , new java.lang.Boolean ( hasCorrelationIdMap.get ( command.getCommandId ( ) ) ) ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setCorrelationId ( command.getCorrelationId ( ) ) ; command.executeAction ( ) ; } }

Target:
protected void RunCommands ( ) { for ( org.ovirt.engine.core.bll.CommandBase < ? > command : getCommands ( ) ) { if ( command.getReturnValue ( ) . getCanDoAction ( ) ) { executeValidatedCommand ( command ) ; } } }
Source:
protected org.ovirt.engine.core.common.businessentities.DbUser getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DbUser entity = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( new org.ovirt.engine.core.common.utils.ExternalId ( GUIDS [ index ] . toByteArray ( ) ) ) ; entity.setFirstName ( NAMES [ index ] ) ; entity.setGroupNames ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.GROUPS ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.DbUser getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DbUser entity = new org.ovirt.engine.core.common.businessentities.DbUser ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setFirstName ( NAMES [ index ] ) ; entity.setGroupNames ( org.ovirt.engine.api.restapi.resource.BackendUsersResourceTest.GROUPS ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; return entity ; }
Source:
public void onSuccess ( java.lang.Object model1 , java.lang.Object result1 ) { getProfile ( ) . setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ) ( result1 ) ) ) ; profileBehavior.initSelectedProfile ( getProfile ( ) , getNic ( ) ) ; updateProfileChangability ( ) ; okCommand.setIsExecutionAllowed ( true ) ; }

Target:
public void onSuccess ( java.lang.Object model1 , java.lang.Object result1 ) { getProfile ( ) . setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ) ( result1 ) ) ) ; profileBehavior.initSelectedProfile ( getProfile ( ) , getNic ( ) ) ; updateProfileChangability ( ) ; okCommand.setIsExecutionAllowed ( true ) ; initSelectedType ( ) ; }
Source:
public static void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance , "PerformLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }

Target:
public static void enableLoadBalancer ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.EnableVdsLoadBalancing ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Start scheduling to enable vds load balancer" ) ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAFixedDelayJob ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance , "performLoadBalancing" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VdsLoadBalancingeIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Finished scheduling to enable vds load balancer" ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareLocalStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( status , name , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( localDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return localDomain ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageDomain prepareLocalStorageDomainForElection ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status , java.lang.String name ) { final org.ovirt.engine.core.common.businessentities.StorageDomain localDomain = createDataStorageDomain ( status , name , LOCAL_SD_ID ) ; localDomain.setStorageType ( StorageType.LOCALFS ) ; org.mockito.Mockito.when ( storageDomainDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( localDomain ) ) ; cmd.setStoragePool ( new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ) ; return localDomain ; }
Source:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.common.eventqueue.EventResult result = null ; if ( _domainsInProblem.containsKey ( domainId ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.info ( ( "starting ProcessDomainRecovery for domain " + ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData.getDomainIdTuple ( domainId ) ) ) ) ; result = ProcessDomainRecovery ( domainId ) ; } _timers.remove ( domainId ) ; return result ; }

Target:
public org.ovirt.engine.core.common.eventqueue.EventResult call ( ) { org.ovirt.engine.core.common.eventqueue.EventResult result = null ; if ( _domainsInProblem.containsKey ( domainId ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.log.info ( ( "starting processDomainRecovery for domain " + ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData.getDomainIdTuple ( domainId ) ) ) ) ; result = processDomainRecovery ( domainId ) ; } _timers.remove ( domainId ) ; return result ; }
Source:
public void testGetDeviceListWithNoDeviceList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > deviceList = new java.util.LinkedList ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ) ) ; org.mockito.Mockito.doReturn ( deviceList ) . when ( command ) . runGetDeviceList ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( deviceList , command.getDeviceList ( ) ) ; }

Target:
public void testGetDeviceListWithNoDeviceList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > deviceList = new java.util.LinkedList ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ) ) ; org.mockito.Mockito.doReturn ( deviceList ) . when ( command ) . runGetDeviceList ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( deviceList , command.getDeviceList ( ) ) ; }
Source:
private void endCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { removeImageFromDB ( true ) ; } else { org.ovirt.engine.core.bll.RemoveImageCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map_id ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.RemoveImageCommand.UnLockImage ( ) ; } org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }

Target:
private void endCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { removeImageFromDB ( true ) ; } else { org.ovirt.engine.core.bll.RemoveImageCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map_id ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.RemoveImageCommand.unLockImage ( ) ; } org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }
Source:
public static java.lang.String map ( org.ovirt.engine.api.model.StorageDomainType storageDomainType , java.lang.String template ) { switch ( storageDomainType ) { case Master : return StorageDomainType.DATA.value ( ) ; case Data : return StorageDomainType.DATA.value ( ) ; case ISO : return StorageDomainType.ISO.value ( ) ; case ImportExport : return StorageDomainType.EXPORT.value ( ) ; case Image : return StorageDomainType.IMAGE.value ( ) ; case Unknown : default : return null ; } }

Target:
public static java.lang.String map ( org.ovirt.engine.api.model.StorageDomainType storageDomainType , java.lang.String template ) { switch ( storageDomainType ) { case Master : return StorageDomainType.DATA.value ( ) ; case Data : return StorageDomainType.DATA.value ( ) ; case ISO : return StorageDomainType.ISO.value ( ) ; case ImportExport : return StorageDomainType.EXPORT.value ( ) ; case Image : return StorageDomainType.IMAGE.value ( ) ; case Volume : return StorageDomainType.VOLUME.value ( ) ; case Unknown : default : return null ; } }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateRequiredSpace ( java.lang.Long availableSize , double requiredSize ) { if ( ( availableSize == null ) || ( ( availableSize.doubleValue ( ) ) >= requiredSize ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN , storageName ( ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateRequiredSpace ( java.lang.Long availableSize , double requiredSize ) { if ( ( availableSize == null ) || ( ( availableSize.doubleValue ( ) ) >= requiredSize ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN , storageName ( ) ) ; }
Source:
public java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getForDisk ( org.ovirt.engine.core.compat.Guid id ) { java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > result = new java.util.HashMap < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > ( ) ; java.util.List < org.ovirt.engine.core.dao.VmDAODbFacadeImpl.VMWithPlugInfo > vms = getVmsWithPlugInfo ( id ) ; for ( org.ovirt.engine.core.dao.VmDAODbFacadeImpl.VMWithPlugInfo vm : vms ) { org.ovirt.engine.core.utils.MultiValueMapUtils.addToMap ( vm.isPlugged ( ) , vm.getVM ( ) , result ) ; } return result ; }

Target:
public java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > getForDisk ( org.ovirt.engine.core.compat.Guid id ) { java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > result = new java.util.HashMap < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > ( ) ; java.util.List < org.ovirt.engine.core.dao.VmDAODbFacadeImpl.VMWithPlugInfo > vms = getVmsWithPlugInfo ( id ) ; for ( org.ovirt.engine.core.dao.VmDAODbFacadeImpl.VMWithPlugInfo vm : vms ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( vm.isPlugged ( ) , vm.getVM ( ) , result ) ; } return result ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveAuditLogById , org.ovirt.engine.core.common.action.RemoveAuditLogByIdParameters.class , new java.lang.String [ ] { "AuditLogId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendEventResourceTest.LOG_IDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveAuditLogById , org.ovirt.engine.core.common.action.RemoveAuditLogByIdParameters.class , new java.lang.String [ ] { "AuditLogId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendEventResourceTest.LOG_IDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public static void getStorageDomainById ( 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkQosExistsOrNull ( ) { return ( ( vnicProfile.getNetworkQosId ( ) ) == null ) || ( ( getDbFacade ( ) . getNetworkQosDao ( ) . get ( vnicProfile.getNetworkQosId ( ) ) ) != null ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_EXISTS ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkQosExistsOrNull ( ) { return ( ( vnicProfile.getNetworkQosId ( ) ) == null ) || ( ( getDbFacade ( ) . getNetworkQosDao ( ) . get ( vnicProfile.getNetworkQosId ( ) ) ) != null ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_EXISTS ) ; }
Source:
protected void verifyCollection ( java.util.List < R > collection ) throws java.lang.Exception { super . verifyCollection ( collection ) ; java.util.List < java.lang.String > populateHeader = httpHeaders.getRequestHeader ( BackendResource.POPULATE ) ; boolean populated = ( populateHeader != null ) ? populateHeader.contains ( "true" ) : false ; for ( R template : collection ) { assertTrue ( ( populated ? template.isSetConsole ( ) : ! ( template.isSetConsole ( ) ) ) ) ; } }

Target:
protected void verifyCollection ( java.util.List < R > collection ) throws java.lang.Exception { super . verifyCollection ( collection ) ; java.util.List < java.lang.String > populateHeader = httpHeaders.getRequestHeader ( BackendResource.POPULATE ) ; boolean populated = ( populateHeader != null ) ? populateHeader.contains ( "true" ) : false ; for ( R template : collection ) { org.junit.Assert.assertTrue ( ( populated ? template.isSetConsole ( ) : ! ( template.isSetConsole ( ) ) ) ) ; } }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VmPoolMap other = ( ( org.ovirt.engine.core.common.businessentities.VmPoolMap ) ( obj ) ) ; return ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( vmId , other.vmId ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( vmPoolId , other.vmPoolId ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VmPoolMap other = ( ( org.ovirt.engine.core.common.businessentities.VmPoolMap ) ( obj ) ) ; return ( java.util.Objects.equals ( vmId , other.vmId ) ) && ( java.util.Objects.equals ( vmPoolId , other.vmPoolId ) ) ; }
Source:
public int getAvailableMacsCount ( ) { int availableMacsSize = macsStorage.getAvailableMacsCount ( ) ; org.ovirt.engine.core.bll.network.macpool.MacPoolUsingRanges.log.debug ( "Number of available Mac addresses = {}" , availableMacsSize ) ; return availableMacsSize ; }

Target:
public java.util.List < java.lang.String > addMacs ( java.util.List < java.lang.String > macs ) { java.util.List < java.lang.String > notAddedMacs = new java.util.ArrayList < > ( macs.size ( ) ) ; for ( java.lang.String mac : macs ) { if ( ! ( addMac ( mac ) ) ) { notAddedMacs.add ( mac ) ; } } return notAddedMacs ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.FileStatsReturnForXmlRpc getIsoList ( java.lang.String spUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getIsoList ( spUUID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.FileStatsReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.FileStatsReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc extend_image_ticket ( java.lang.String ticketId , long timeout ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.extend_image_ticket ( ticketId , timeout ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; }

Target:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; if ( getIsShareable ( ) . getIsChangable ( ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; } }
Source:
public void testCanDoActionWithAttachedStorageDomainAndNoFormat ( ) { storageDomain.setStorageType ( StorageType.NFS ) ; storageDomain.setStorageDomainType ( StorageDomainType.Data ) ; org.mockito.Mockito.doReturn ( java.lang.Boolean.TRUE ) . when ( command ) . isStorageDomainAttached ( storageDomain ) ; command.getParameters ( ) . setDoFormat ( false ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void testValidateWithAttachedStorageDomainAndNoFormat ( ) { storageDomain.setStorageType ( StorageType.NFS ) ; storageDomain.setStorageDomainType ( StorageDomainType.Data ) ; org.mockito.Mockito.doReturn ( java.lang.Boolean.TRUE ) . when ( command ) . isStorageDomainAttached ( storageDomain ) ; command.getParameters ( ) . setDoFormat ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
private boolean hotPlugNic ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic ) { if ( ! ( org.ovirt.engine.core.bll.AddVmInterfaceCommand.canPerformHotPlug ( ) ) ) { return false ; } else { return runVdsCommand ( VDSCommandType.HotPlugNic , new org.ovirt.engine.core.common.vdscommands.HotPlugUnplgNicVDSParameters ( vmDynamic.getrun_on_vds ( ) . getValue ( ) , vmDynamic.getId ( ) , org.ovirt.engine.core.bll.AddVmInterfaceCommand.getParameters ( ) . getInterface ( ) , vmDevice ) ) . getSucceeded ( ) ; } }

Target:
private void addInterfaceToDb ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface vmNetworkInterface ) { org.ovirt.engine.core.dal.dbbroker.DbFacade dbFacade = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) ; dbFacade.getVmNetworkInterfaceDAO ( ) . save ( vmNetworkInterface ) ; org.ovirt.engine.core.bll.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface ) ; dbFacade.getVmNetworkStatisticsDAO ( ) . save ( vmNetworkInterface.getStatistics ( ) ) ; org.ovirt.engine.core.bll.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmNetworkInterface.getStatistics ( ) ) ; }
Source:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , java.lang.Boolean returnNull ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.roles role = null ; if ( ! returnNull ) { role = new org.ovirt.engine.core.common.businessentities.roles ( ) ; role.setId ( entityId ) ; } setUpGetEntityExpectations ( VdcQueryType.GetRoleById , org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters.class , new java.lang.String [ ] { "RoleId" } , new java.lang.Object [ ] { entityId } , role ) ; }

Target:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , java.lang.Boolean returnNull ) throws java.lang.Exception { org.ovirt.engine.api.model.Role role = null ; if ( ! returnNull ) { role = new org.ovirt.engine.api.model.Role ( ) ; role.setId ( entityId ) ; } setUpGetEntityExpectations ( VdcQueryType.GetRoleById , org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters.class , new java.lang.String [ ] { "RoleId" } , new java.lang.Object [ ] { entityId } , role ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } oldMacPool = getMacPoolDao ( ) . get ( getMacPoolId ( ) ) ; final org.ovirt.engine.core.bll.MacPoolValidator validator = new org.ovirt.engine.core.bll.MacPoolValidator ( oldMacPool , getMacPool ( ) ) ; return ( ( validate ( validator.macPoolExists ( ) ) ) && ( validate ( validator.hasUniqueName ( ) ) ) ) && ( validate ( validator.defaultFlagIsNotChanged ( ) ) ) ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( getSucceeded ( ) ) { return org.ovirt.engine.core.common.AuditLogType.MAC_POOL_EDIT_SUCCESS ; } else { return org.ovirt.engine.core.common.AuditLogType.MAC_POOL_EDIT_FAILED ; } }
Source:
public void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getEngineSshPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetEngineSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { customizeAgentTab ( model ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( "IsAvailable" . equals ( ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ) ) { getView ( ) . setAgentTabVisibility ( model.getNeutronAgentModel ( ) . getIsAvailable ( ) ) ; } }
Source:
public static void getGlusterSwiftServerServices ( 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.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.getStaticData ( ) . setDomain ( "domain_name" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; vm.setArchitecture ( ArchitectureType.x86_64 ) ; org.ovirt.engine.core.utils.ovf.OvfManagerTest.initInterfaces ( vm ) ; return vm ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.getStaticData ( ) . setDomain ( "domain_name" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; vm.setSingleQxlPci ( false ) ; vm.setClusterArch ( ArchitectureType.x86_64 ) ; org.ovirt.engine.core.utils.ovf.OvfManagerTest.initInterfaces ( vm ) ; return vm ; }
Source:
public void setup ( ) { org.ovirt.engine.core.CommandMocks.mockDbFacade ( cmd , dbFacade ) ; org.mockito.Mockito.when ( dbFacade.getStoragePoolDao ( ) ) . thenReturn ( storagePoolDAO ) ; org.mockito.Mockito.when ( dbFacade.getStorageDomainDao ( ) ) . thenReturn ( storageDomainDAO ) ; }

Target:
public void setup ( ) { org.ovirt.engine.core.CommandMocks.mockDbFacade ( cmd , dbFacade ) ; org.mockito.Mockito.when ( dbFacade.getStoragePoolDao ( ) ) . thenReturn ( storagePoolDAO ) ; org.mockito.Mockito.when ( dbFacade.getStorageDomainDao ( ) ) . thenReturn ( storageDomainDAO ) ; org.mockito.Mockito.doReturn ( eventQueue ) . when ( cmd ) . getEventQueue ( ) ; }
Source:
public javax.ws.rs.core.Response toResponse ( org.ovirt.engine.api.restapi.utils.MalformedIdException exception ) { return javax.ws.rs.core.Response.status ( Status.BAD_REQUEST ) . entity ( exception.getCause ( ) . getMessage ( ) ) . build ( ) ; }

Target:
public javax.ws.rs.core.Response toResponse ( org.ovirt.engine.api.restapi.utils.MalformedIdException exception ) { org.ovirt.engine.api.restapi.resource.validation.MalformedIdExceptionMapper.log.error ( "Malformed id detected while processing \"{}\" request for path \"{}\"" , request.getMethod ( ) , uriInfo.getPath ( ) ) ; org.ovirt.engine.api.restapi.resource.validation.MalformedIdExceptionMapper.log.error ( "Exception" , exception ) ; return javax.ws.rs.core.Response.status ( Status.BAD_REQUEST ) . entity ( exception.getCause ( ) . getMessage ( ) ) . build ( ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( sender == ( getPlugged ( ) ) ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs propArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( propArgs.PropertyName.equals ( "Entity" ) ) { onPlugChange ( ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( sender == ( getPlugged ( ) ) ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs propArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( propArgs.propertyName.equals ( "Entity" ) ) { onPlugChange ( ) ; } } }
Source:
void addTab ( com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.RequestTabsHandler > requestTabsEventType , com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.proxy.RevealContentHandler < ? > > revealContentEventType , java.lang.String label , java.lang.String historyToken , boolean isMainTab , java.lang.String contentUrl , org.ovirt.engine.ui.webadmin.plugin.api.TabOptions options ) { dynamicUrlContentTabProxyFactory.create ( requestTabsEventType , revealContentEventType , label , historyToken , isMainTab , contentUrl , ( options.getAlignRight ( ) ? org.ovirt.engine.ui.common.widget.Align.RIGHT : org.ovirt.engine.ui.common.widget.Align.LEFT ) ) ; org.ovirt.engine.ui.common.presenter.RedrawDynamicTabContainerEvent.fire ( this , requestTabsEventType ) ; }

Target:
void addTab ( com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.RequestTabsHandler > requestTabsEventType , com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.ChangeTabHandler > changeTabEventType , com.google.gwt.event.shared.GwtEvent.Type < com.gwtplatform.mvp.client.proxy.RevealContentHandler < ? > > slot , java.lang.String label , java.lang.String historyToken , boolean isMainTab , java.lang.String contentUrl , org.ovirt.engine.ui.webadmin.plugin.api.TabOptions options ) { dynamicUrlContentTabProxyFactory.create ( requestTabsEventType , changeTabEventType , slot , label , historyToken , isMainTab , contentUrl , ( options.getAlignRight ( ) ? org.ovirt.engine.ui.common.widget.Align.RIGHT : org.ovirt.engine.ui.common.widget.Align.LEFT ) ) ; org.ovirt.engine.ui.common.presenter.RedrawDynamicTabContainerEvent.fire ( this , requestTabsEventType ) ; }
Source:
public void create ( ) { log.info ( "oVirt optimizer service starting" ) ; threads = new java.util.HashSet < > ( ) ; discoveryTimer = scheduler.createTimer ( 120 , org.ovirt.optimizer.service.DiscoveryTimeout.class ) ; }

Target:
public void create ( ) { log.info ( "oVirt optimizer service starting" ) ; threads = new java.util.HashSet < > ( ) ; int refresh = java.lang.Integer.valueOf ( configProvider.load ( ) . getConfig ( ) . getProperty ( ConfigProvider.SOLVER_CLUSTER_REFRESH ) ) ; discoveryTimer = scheduler.createTimer ( refresh , org.ovirt.optimizer.service.DiscoveryTimeout.class ) ; }
Source:
public void moveShareableDisk ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; initVmDiskImage ( true ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }

Target:
public void moveShareableDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; diskImage.setShareable ( true ) ; initializeCommand ( diskImage , VmEntityType.VM ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.junit.Assert.assertTrue ( command.validate ( ) ) ; }
Source:
public static org.ovirt.engine.core.bll.CommandBase < ? > buildCommand ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , org.ovirt.engine.core.bll.job.ExecutionContext executionContext , org.ovirt.engine.core.compat.CommandStatus cmdStatus ) { org.ovirt.engine.core.bll.job.ExecutionContext cmdExecutionContext = ( executionContext == null ) ? new org.ovirt.engine.core.bll.job.ExecutionContext ( ) : executionContext ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters , new org.ovirt.engine.core.bll.context.CommandContext ( new org.ovirt.engine.core.bll.context.EngineContext ( ) ) . withExecutionContext ( cmdExecutionContext ) ) ; command.setCommandStatus ( cmdStatus , false ) ; return command ; }

Target:
public static org.ovirt.engine.core.bll.CommandBase < ? > buildCommand ( org.ovirt.engine.core.common.action.ActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , org.ovirt.engine.core.bll.job.ExecutionContext executionContext , org.ovirt.engine.core.compat.CommandStatus cmdStatus ) { org.ovirt.engine.core.bll.job.ExecutionContext cmdExecutionContext = ( executionContext == null ) ? new org.ovirt.engine.core.bll.job.ExecutionContext ( ) : executionContext ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters , new org.ovirt.engine.core.bll.context.CommandContext ( new org.ovirt.engine.core.bll.context.EngineContext ( ) ) . withExecutionContext ( cmdExecutionContext ) ) ; command.setCommandStatus ( cmdStatus , false ) ; return command ; }