auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void reportInvalidInterfacesForNetwork ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces , org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( interfaces.size ( ) ) != 1 ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVdsId ( vds.getId ( ) ) ; logable.AddCustomValue ( "NetworkName" , network.getName ( ) ) ; logable.AddCustomValue ( "Interfaces" , org.apache.commons.lang.StringUtils.join ( org.ovirt.engine.core.common.businessentities.Entities.objectNames ( interfaces ) , "," ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.BRIDGED_NETWORK_OVER_MULTIPLE_INTERFACES ) ; } }

Target:
private static void reportInvalidInterfacesForNetwork ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces , org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( interfaces.size ( ) ) != 1 ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( vds.getId ( ) ) ; logable.addCustomValue ( "NetworkName" , network.getName ( ) ) ; logable.addCustomValue ( "Interfaces" , org.apache.commons.lang.StringUtils.join ( org.ovirt.engine.core.common.businessentities.Entities.objectNames ( interfaces ) , "," ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.BRIDGED_NETWORK_OVER_MULTIPLE_INTERFACES ) ; } }
Source:
public void run ( ) { int val = counter.incrementAndGet ( ) ; org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( ( "tag" + val ) , ( "desc" + val ) ) ; dao.save ( tag ) ; org.ovirt.engine.core.common.businessentities.Tags fromDb = dao.get ( tag.gettag_id ( ) ) ; org.junit.Assert.assertEquals ( tag , fromDb ) ; dao.remove ( tag.gettag_id ( ) ) ; fromDb = dao.get ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNull ( fromDb ) ; }

Target:
public void run ( ) { int val = counter.incrementAndGet ( ) ; org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( ( "tag" + val ) , ( "desc" + val ) ) ; dao.save ( tag ) ; org.ovirt.engine.core.common.businessentities.Tags fromDb = dao.get ( tag.getTagId ( ) ) ; org.junit.Assert.assertEquals ( tag , fromDb ) ; dao.remove ( tag.getTagId ( ) ) ; fromDb = dao.get ( tag.getTagId ( ) ) ; org.junit.Assert.assertNull ( fromDb ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "isSelectionAvailable" . equals ( propName ) ) { isSelectionAvailable = listModel.getIsSelectionAvailable ( ) ; if ( ( listModel.getItems ( ) ) != null ) { showModels ( ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel > ) ( listModel.getItems ( ) ) ) ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . propertyName ; if ( "isSelectionAvailable" . equals ( propName ) ) { isSelectionAvailable = listModel.getIsSelectionAvailable ( ) ; if ( ( listModel.getItems ( ) ) != null ) { showModels ( ( ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.HostInterfaceLineModel > ) ( listModel.getItems ( ) ) ) ) ; } } }
Source:
private void init ( ) { initAutoStartVmsToRestart ( ) ; int autoStartVmsRunnerIntervalInSeconds = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AutoStartVmsRunnerIntervalInSeconds ) ; schedulerUtil.scheduleAFixedDelayJob ( this , "startFailedAutoStartVms" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , autoStartVmsRunnerIntervalInSeconds , autoStartVmsRunnerIntervalInSeconds , java.util.concurrent.TimeUnit.SECONDS ) ; }

Target:
private void init ( ) { autoStartVmsToRestart = new java.util.concurrent.CopyOnWriteArraySet < > ( getInitialVmsToStart ( ) ) ; int autoStartVmsRunnerIntervalInSeconds = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AutoStartVmsRunnerIntervalInSeconds ) ; schedulerUtil.scheduleAFixedDelayJob ( this , "startFailedAutoStartVms" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , autoStartVmsRunnerIntervalInSeconds , autoStartVmsRunnerIntervalInSeconds , java.util.concurrent.TimeUnit.SECONDS ) ; }
Source:
public void testAddTag ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.Tags tagFromDirector = tagsDirector.getTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNull ( tagFromDirector ) ; tagsDirector.addTag ( tag ) ; tagFromDirector = tagsDirector.getTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNotNull ( tagFromDirector ) ; org.junit.Assert.assertEquals ( tag , tagFromDirector ) ; }

Target:
public void testAddTag ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.Tags tagFromDirector = tagsDirector.getTagById ( tag.getTagId ( ) ) ; org.junit.Assert.assertNull ( tagFromDirector ) ; tagsDirector.addTag ( tag ) ; tagFromDirector = tagsDirector.getTagById ( tag.getTagId ( ) ) ; org.junit.Assert.assertNotNull ( tagFromDirector ) ; org.junit.Assert.assertEquals ( tag , tagFromDirector ) ; }
Source:
private void addIsPluggedEntityChangedListener ( ) { org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > entityChangedListener = new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateWarningLabel ( ) ; } } ; getIsPlugged ( ) . getEntityChangedEvent ( ) . addListener ( entityChangedListener ) ; }

Target:
private void addSelectedItemsChangedListener ( ) { org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > selectionChangedListener = new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateWarningLabel ( ) ; } } ; attachableDisksMap.get ( DiskStorageType.IMAGE ) . getSelectedItemsChangedEvent ( ) . addListener ( selectionChangedListener ) ; attachableDisksMap.get ( DiskStorageType.CINDER ) . getSelectedItemsChangedEvent ( ) . addListener ( selectionChangedListener ) ; attachableDisksMap.get ( DiskStorageType.LUN ) . getSelectedItemsChangedEvent ( ) . addListener ( selectionChangedListener ) ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getStoragePool ( ) . getcompatibility_version ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.RegisterDiskCommand.getParameters ( ) . getDiskImage ( ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.RegisterDiskCommand.getCurrentUser ( ) ) ) ; }
Source:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.EntityIdResolver resolver = new org.ovirt.engine.api.restapi.resource.EntityIdResolver ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.VdsNetworkInterface lookupEntity ( org.ovirt.engine.core.compat.Guid guid ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { return parent.lookupInterface ( id ) ; } } ; org.ovirt.engine.api.restapi.resource.HostNicStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.HostNicStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.HostNIC , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( entityType , guid , query ) ) ; }

Target:
public org.ovirt.engine.api.resource.StatisticsResource getStatisticsResource ( ) { org.ovirt.engine.api.restapi.resource.AbstractBackendResource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > resolver = new org.ovirt.engine.api.restapi.resource.AbstractBackendResource.EntityIdResolver < org.ovirt.engine.core.compat.Guid > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.VdsNetworkInterface lookupEntity ( org.ovirt.engine.core.compat.Guid guid ) throws org.ovirt.engine.api.restapi.resource.BackendFailureException { return parent.lookupInterface ( id ) ; } } ; org.ovirt.engine.api.restapi.resource.HostNicStatisticalQuery query = new org.ovirt.engine.api.restapi.resource.HostNicStatisticalQuery ( resolver , newModel ( id ) ) ; return inject ( new org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.HostNIC , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( entityType , guid , query ) ) ; }
Source:
private void setVisibilityToHotChanges ( org.ovirt.engine.ui.uicommonweb.models.vms.VmNextRunConfigurationModel object ) { hotplugPanel.setVisible ( ( ( ( object.isCpuPluggable ( ) ) || ( object.isMemoryPluggable ( ) ) ) || ( object.isVmLeaseUpdated ( ) ) ) ) ; applyNowCpuMessage.setVisible ( object.isCpuPluggable ( ) ) ; applyNowMemoryMessage.setVisible ( object.isMemoryPluggable ( ) ) ; applyNowVmLeaseMessage.setVisible ( object.isVmLeaseUpdated ( ) ) ; }

Target:
private void setVisibilityToHotChanges ( org.ovirt.engine.ui.uicommonweb.models.vms.VmNextRunConfigurationModel object ) { hotplugPanel.setVisible ( ( ( ( object.isCpuPluggable ( ) ) || ( object.isMemoryPluggable ( ) ) ) || ( object.isVmLeaseUpdated ( ) ) ) ) ; applyNowCpuMessage.setVisible ( object.isCpuPluggable ( ) ) ; applyNowMemoryMessage.setVisible ( object.isMemoryPluggable ( ) ) ; applyNowMinAllocatedMemoryMessage.setVisible ( object.isMinAllocatedMemoryPluggable ( ) ) ; applyNowVmLeaseMessage.setVisible ( object.isVmLeaseUpdated ( ) ) ; }
Source:
public void lowThresholdStorageSpace ( ) { org.ovirt.engine.core.common.action.ImportVmParameters parameters = createParameters ( ) ; org.ovirt.engine.core.bll.validator.ImportValidator validator = setupDiskSpaceTest ( parameters ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.junit.Assert.assertThat ( validator.validateSpaceRequirements ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; }

Target:
public void lowThresholdStorageSpace ( ) { org.ovirt.engine.core.common.action.ImportVmParameters parameters = createParameters ( ) ; org.ovirt.engine.core.bll.validator.ImportValidator validator = setupDiskSpaceTest ( parameters ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.hamcrest.MatcherAssert.assertThat ( validator.validateSpaceRequirements ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) ; }
Source:
private void runSetup ( java.lang.String testCidr , boolean isValidFormat , boolean isCidrNetworkAddressValid , java.lang.String errorMessage ) { org.mockito.Mockito.when ( mockCidrValidator.isCidrFormatValid ( testCidr ) ) . thenReturn ( isValidFormat ) ; org.mockito.Mockito.when ( mockCidrValidator.isCidrNetworkAddressValid ( testCidr ) ) . thenReturn ( isCidrNetworkAddressValid ) ; org.mockito.Mockito.when ( contextMock.buildConstraintViolationWithTemplate ( errorMessage ) ) . thenReturn ( mockConstraintViolationBuilder ) ; org.mockito.Mockito.when ( mockConstraintViolationBuilder.addNode ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( mockNodeBuilderDefinedContext ) ; }

Target:
private void runSetup ( java.lang.String testCidr , boolean isValidFormat , boolean isCidrNetworkAddressValid , java.lang.String errorMessage ) { org.mockito.Mockito.when ( mockCidrValidator.isCidrFormatValid ( testCidr ) ) . thenReturn ( isValidFormat ) ; org.mockito.Mockito.when ( mockCidrValidator.isCidrNetworkAddressValid ( testCidr ) ) . thenReturn ( isCidrNetworkAddressValid ) ; org.mockito.Mockito.when ( contextMock.buildConstraintViolationWithTemplate ( errorMessage ) ) . thenReturn ( mockConstraintViolationBuilder ) ; org.mockito.Mockito.when ( mockConstraintViolationBuilder.addNode ( org.mockito.ArgumentMatchers.anyString ( ) ) ) . thenReturn ( mockNodeBuilderDefinedContext ) ; }
Source:
private void addVideoCardByDisplayType ( org.ovirt.engine.core.common.businessentities.DisplayType displayType ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; struct.put ( VdsProperties.Type , VmDeviceGeneralType.VIDEO.getValue ( ) ) ; struct.put ( VdsProperties.Device , displayType.getVmDeviceType ( ) . getName ( ) ) ; struct.put ( VdsProperties.SpecParams , org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.getNewMonitorSpecParams ( ) ) ; struct.put ( VdsProperties.DeviceId , java.lang.String.valueOf ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ; devices.add ( struct ) ; }

Target:
private void addVideoCardByDisplayType ( org.ovirt.engine.core.common.businessentities.DisplayType displayType , int numOfMonitors ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ; struct.put ( VdsProperties.Type , VmDeviceGeneralType.VIDEO.getValue ( ) ) ; struct.put ( VdsProperties.Device , displayType.getVmDeviceType ( ) . getName ( ) ) ; struct.put ( VdsProperties.SpecParams , org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.getNewMonitorSpecParams ( displayType , numOfMonitors ) ) ; struct.put ( VdsProperties.DeviceId , java.lang.String.valueOf ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ; devices.add ( struct ) ; }
Source:
public org.ovirt.engine.core.common.job.Job getJob ( final org.ovirt.engine.core.compat.Guid jobId ) { return org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < org.ovirt.engine.core.common.job.Job > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.job.Job runInTransaction ( ) { org.ovirt.engine.core.common.job.Job job = jobDao.get ( jobId ) ; if ( job != null ) { job.getJobSubjectEntities ( ) ; } return job ; } } ) ; }

Target:
public java.lang.Void runInTransaction ( ) { jobDao.save ( job ) ; java.util.Set < java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > > entrySet = job.getJobSubjectEntities ( ) . entrySet ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entry : entrySet ) { jobSubjectEntityDao.save ( job.getId ( ) , entry.getKey ( ) , entry.getValue ( ) ) ; } return null ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } else if ( obj == null ) { return false ; } else if ( ( this . getClass ( ) ) != ( obj.getClass ( ) ) ) { return false ; } org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginData other = ( ( org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginData ) ( obj ) ) ; return ( this . getOrder ( ) ) == ( other.getOrder ( ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginData ) ) { return false ; } org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginData other = ( ( org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginData ) ( obj ) ) ; return java.util.Objects.equals ( getOrder ( ) , other.getOrder ( ) ) ; }
Source:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.bll.context.CommandContext cmdContext , boolean enableCallBack ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity.buildCommandEntity ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus , enableCallBack , getReturnValue ( ) ) , cmdContext ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }

Target:
public void setCommandExecuted ( ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.getCommandEntity ( getCommandId ( ) ) ; if ( cmdEntity != null ) { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.persistCommand ( buildCommandEntity ( cmdEntity.getRootCommandId ( ) , cmdEntity.isCallbackEnabled ( ) ) , getContext ( ) ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.updateCommandExecuted ( getCommandId ( ) ) ; } } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }
Source:
public static void GetExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }

Target:
public static void GetStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
private void updateDiskSize ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { long sizeToAddInGigabytes = java.lang.Long.valueOf ( getSizeExtend ( ) . getEntity ( ) ) ; if ( sizeToAddInGigabytes > 0 ) { diskImage.setSizeInGigabytes ( ( ( diskImage.getSizeInGigabytes ( ) ) + sizeToAddInGigabytes ) ) ; } }

Target:
private void updateDiskSize ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { long sizeToAddInGigabytes = java.lang.Long.parseLong ( getSizeExtend ( ) . getEntity ( ) ) ; if ( sizeToAddInGigabytes > 0 ) { diskImage.setSizeInGigabytes ( ( ( diskImage.getSizeInGigabytes ( ) ) + sizeToAddInGigabytes ) ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.VDSStatus ShutDownVDS ( int vdsId ) { return org.ovirt.engine.core.common.businessentities.VDSStatus.Down ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase notAllowedInPrepForMaintMode ( org.ovirt.engine.core.common.action.VdcActionType action ) { java.lang.Class < org.ovirt.engine.core.bll.CommandBase < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > > clazz = org.ovirt.engine.core.bll.CommandsFactory.getCommandClass ( action.name ( ) ) ; if ( clazz.isAnnotationPresent ( org.ovirt.engine.core.bll.DisableInPrepareMode.class ) ) { return getErrorCommandReturnValue ( VdcBllMessages.ENGINE_IS_RUNNING_IN_PREPARE_MODE ) ; } return null ; }
Source:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }

Target:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public static void IsHotPlugAvailable ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.HotPlugEnabled ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; getDataCenters ( ) . setItems ( dataCenters ) ; getDataCenters ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCenters ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetExternalNetworkList ( networkQuery , provider.getId ( ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; java.util.Collections.sort ( dataCenters , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; getDataCenters ( ) . setItems ( dataCenters ) ; getDataCenters ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCenters ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetExternalNetworkList ( networkQuery , provider.getId ( ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( getStoragePool ( ) ) == null ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST ) ; return false ; } if ( ( getQuotaId ( ) ) == null ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID ) ; return false ; } if ( ( getDbFacade ( ) . getQuotaDao ( ) . getById ( getQuotaId ( ) ) ) == null ) { addCanDoActionMessage ( EngineMessage.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST ) ; return false ; } return true ; }

Target:
protected boolean validate ( ) { if ( ( getStoragePool ( ) ) == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_NOT_EXIST ) ; return false ; } if ( ( getQuotaId ( ) ) == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID ) ; return false ; } if ( ( getDbFacade ( ) . getQuotaDao ( ) . getById ( getQuotaId ( ) ) ) == null ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST ) ; return false ; } return true ; }
Source:
public void updateRepository_MIGRATION_FROM ( org.ovirt.engine.core.vdsbroker.VmTestPairs data ) { initMocks ( data , true ) ; org.junit.Assume.assumeNotNull ( data.dbVm ( ) , data.vdsmVm ( ) ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) . getVmDynamic ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) ) ; junit.framework.Assert.assertTrue ( vmAnalyzer.isClientIpChanged ( ) ) ; org.mockito.Mockito.verify ( vmsMonitoring.getResourceManager ( ) , org.mockito.Mockito.never ( ) ) . InternalSetVmStatus ( data.dbVm ( ) , VMStatus.MigratingTo ) ; }

Target:
public void updateRepository_MIGRATION_FROM ( org.ovirt.engine.core.vdsbroker.VmTestPairs data ) { initMocks ( data , true ) ; org.junit.Assume.assumeNotNull ( data.dbVm ( ) , data.vdsmVm ( ) ) ; org.junit.Assume.assumeTrue ( ( ( data.vdsmVm ( ) . getVmDynamic ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) ) ; junit.framework.Assert.assertTrue ( vmAnalyzer.isClientIpChanged ( ) ) ; org.mockito.Mockito.verify ( vmsMonitoring.getResourceManager ( ) , org.mockito.Mockito.never ( ) ) . internalSetVmStatus ( data.dbVm ( ) , VMStatus.MigratingTo ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetCertuficateExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM response = resource.get ( ) ; verifyModel ( response , 0 ) ; verifyCertificate ( response ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetCertuficateExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.VM response = resource.get ( ) ; verifyModel ( response , 0 ) ; verifyCertificate ( response ) ; }
Source:
public void testDiskAttachedToVMFailWithCorrectReplacements ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; vm.setName ( "MyVm" ) ; disk.setDiskAlias ( "MyDisk" ) ; java.lang.String [ ] expectedReplacements = new java.lang.String [ ] { org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( DiskValidator.DISK_NAME_VARIABLE , disk.getDiskAlias ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( DiskValidator.VM_NAME_VARIABLE , vm.getName ( ) ) } ; org.junit.Assert.assertThat ( validator.isDiskAttachedToVm ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_ATTACHED_TO_VM , expectedReplacements ) ) ; }

Target:
public void testDiskAttachedToVMFailWithCorrectReplacements ( ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.validator.storage.DiskValidatorTest.createVM ( ) ; vm.setName ( "MyVm" ) ; disk.setDiskAlias ( "MyDisk" ) ; java.lang.String [ ] expectedReplacements = new java.lang.String [ ] { org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( DiskValidator.DISK_NAME_VARIABLE , disk.getDiskAlias ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( DiskValidator.VM_NAME_VARIABLE , vm.getName ( ) ) } ; org.hamcrest.MatcherAssert.assertThat ( validator.isDiskAttachedToVm ( vm ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_ATTACHED_TO_VM , expectedReplacements ) ) ; }
Source:
protected void log ( ) { final javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { try { auditLogDirector.log ( this ) ; } catch ( final java.lang.RuntimeException ex ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.log.error ( "Error during log command: {}. Exception {}" , getClass ( ) . getName ( ) , ex.getMessage ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.log.debug ( "Exception" , ex ) ; } } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }

Target:
protected void log ( ) { final javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { try { auditLogDirector.log ( this , getAuditLogTypeValue ( ) ) ; } catch ( final java.lang.RuntimeException ex ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.log.error ( "Error during log command: {}. Exception {}" , getClass ( ) . getName ( ) , ex.getMessage ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.log.debug ( "Exception" , ex ) ; } } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }
Source:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.aggregationtohourly_3_4.AggregationToHourly.row11Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_AggregationToHourly ) { try { int length = 0 ; this . var_name = readString ( dis ) ; this . var_value = readString ( dis ) ; this . var_datetime = readDate ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }

Target:
public java.lang.String getKey ( ) { return this . key ; }
Source:
private void doTestBadAdd ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpNetworkQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AddBond , org.ovirt.engine.core.common.action.AddBondParameters.class , new java.lang.String [ ] { "VdsId" , "BondName" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME } , canDo , success ) ) ; org.ovirt.engine.api.model.HostNIC model = getBondEntity ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAdd ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpNetworkQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AddBond , org.ovirt.engine.core.common.action.AddBondParameters.class , new java.lang.String [ ] { "VdsId" , "BondName" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID , org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.MASTER_NAME } , canDo , success ) ) ; org.ovirt.engine.api.model.HostNic model = getBondEntity ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void testUpdateReadOnly ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "VmId" , "DiskInfo.ReadOnly" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.TRUE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }

Target:
public void testUpdateReadOnly ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpDiskVmElementExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "VmId" , "DiskInfo.ReadOnly" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.TRUE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . getId ( ) ) == null ) || ( ! ( entityExists ( ) ) ) ) { return failCanDoAction ( ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . isVm ( ) ? org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND : org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST ) ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ( ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . getId ( ) ) == null ) || ( ! ( entityExists ( ) ) ) ) { return failCanDoAction ( ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . isVm ( ) ? org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND : org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST ) ) ; } return true ; }
Source:
private void mockVMPoolDao ( ) { org.mockito.Mockito.doReturn ( vmPoolDao ) . when ( command ) . getVmPoolDao ( ) ; }

Target:
protected void setUpCommand ( ) { org.mockito.Mockito.doNothing ( ) . when ( command ) . initTemplate ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areTemplateImagesInStorageReady ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . verifyAddVm ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateDiskProfiles ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . setAndValidateCpuProfile ( ) ; }
Source:
public void buildNetwork ( ) { _writer.WriteStartElement ( "Section" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.XSI_URI , "type" , ( ( OVF_PREFIX ) + ":NetworkSection_Type" ) ) ; _writer.WriteStartElement ( "Info" ) ; _writer.WriteRaw ( "List of networks" ) ; _writer.WriteEndElement ( ) ; _writer.WriteStartElement ( "Network" ) ; _writer.WriteAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "name" , "Network 1" ) ; _writer.WriteEndElement ( ) ; _writer.WriteEndElement ( ) ; }

Target:
public void buildNetwork ( ) { _writer.writeStartElement ( "Section" ) ; _writer.writeAttributeString ( org.ovirt.engine.core.utils.ovf.XSI_URI , "type" , ( ( OVF_PREFIX ) + ":NetworkSection_Type" ) ) ; _writer.writeStartElement ( "Info" ) ; _writer.writeRaw ( "List of networks" ) ; _writer.writeEndElement ( ) ; _writer.writeStartElement ( "Network" ) ; _writer.writeAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "name" , "Network 1" ) ; _writer.writeEndElement ( ) ; _writer.writeEndElement ( ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.Map < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > templateMap = org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getDbFacade ( ) . getVmTemplateDao ( ) . getAllForImage ( org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getParameters ( ) . getId ( ) ) ; if ( ! ( templateMap.values ( ) . isEmpty ( ) ) ) { updateDisksFromDb ( templateMap.values ( ) . iterator ( ) . next ( ) ) ; } org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getQueryReturnValue ( ) . setReturnValue ( templateMap ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.Map < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > templateMap = vmTemplateDao.getAllForImage ( org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getParameters ( ) . getId ( ) ) ; if ( ! ( templateMap.values ( ) . isEmpty ( ) ) ) { updateDisksFromDb ( templateMap.values ( ) . iterator ( ) . next ( ) ) ; } org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getQueryReturnValue ( ) . setReturnValue ( templateMap ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { if ( user.isAdmin ( ) ) { return getApplicationResources ( ) . adminImage ( ) ; } if ( user.isGroup ( ) ) { return getApplicationResources ( ) . userGroupImage ( ) ; } return getApplicationResources ( ) . userImage ( ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { if ( user.isAdmin ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.webadmin.widget.table.column.UserStatusColumn.constants.admin ( ) ) ; } if ( user.isGroup ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.webadmin.widget.table.column.UserStatusColumn.constants.group ( ) ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.webadmin.widget.table.column.UserStatusColumn.constants.user ( ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( schedulingManager.getPolicyUnitsMap ( ) . containsKey ( getPolicyUnitId ( ) ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_POLICY_UNKNOWN_POLICY_UNIT ) ; } java.util.List < java.lang.String > clusterPoliciesNames = schedulingManager.getClusterPoliciesNamesByPolicyUnitId ( getPolicyUnitId ( ) ) ; if ( ( clusterPoliciesNames != null ) && ( ( clusterPoliciesNames.size ( ) ) > 0 ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_REMOVE_POLICY_UNIT_ATTACHED_TO_CLUSTER_POLICY , java.lang.String.format ( "$cpNames %1$s" , org.apache.commons.lang.StringUtils.join ( clusterPoliciesNames , ',' ) ) ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( schedulingManager.getPolicyUnitsMap ( ) . containsKey ( getPolicyUnitId ( ) ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_POLICY_UNKNOWN_POLICY_UNIT ) ; } java.util.List < java.lang.String > clusterPoliciesNames = schedulingManager.getClusterPoliciesNamesByPolicyUnitId ( getPolicyUnitId ( ) ) ; if ( ( clusterPoliciesNames != null ) && ( ( clusterPoliciesNames.size ( ) ) > 0 ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_REMOVE_POLICY_UNIT_ATTACHED_TO_CLUSTER_POLICY , java.lang.String.format ( "$cpNames %1$s" , org.apache.commons.lang.StringUtils.join ( clusterPoliciesNames , ',' ) ) ) ; } return true ; }
Source:
private void UpdateDestinationVdsThreaded ( org.ovirt.engine.core.compat.Guid dstVdsId , org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.vdsbroker.VdsManager vdsManager = org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( dstVdsId ) ; if ( vdsManager != null ) { java.lang.Class < ? > [ ] inputTypes = new java.lang.Class [ ] { org.ovirt.engine.core.vdsbroker.VdsManager.class , org.ovirt.engine.core.common.businessentities.VM.class } ; java.lang.Object [ ] inputParams = new java.lang.Object [ ] { vdsManager , vm } ; org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . scheduleAOneTimeJob ( this , "UpdateDestinationVdsOnTimer" , inputTypes , inputParams , 0 , java.util.concurrent.TimeUnit.MILLISECONDS ) ; } }

Target:
public void run ( ) { updateDestinationVdsOnTimer ( vdsManager , vm ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VM > getAllForVdsGroup ( org.ovirt.engine.core.compat.Guid vds_group_id ) { return getCallsHandler ( ) . executeReadList ( "GetVmsByVdsGroupId" , org.ovirt.engine.core.dao.VmDaoImpl.VMRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "vds_group_id" , vds_group_id ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VM > getAllForUserAndActionGroup ( org.ovirt.engine.core.compat.Guid userID , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { return getCallsHandler ( ) . executeReadList ( "GetAllFromVmsForUserAndActionGroup" , org.ovirt.engine.core.dao.VmDaoImpl.VMRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "user_id" , userID ) . addValue ( "action_group_id" , actionGroup.getId ( ) ) ) ; }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , false ) ; org.ovirt.engine.api.model.CpuProfile model = org.ovirt.engine.api.restapi.resource.BackendCpuProfileResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , false ) ; org.ovirt.engine.api.model.CpuProfile model = org.ovirt.engine.api.restapi.resource.BackendCpuProfileResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
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 readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.aggregationtohourly_3_4.AggregationToHourly.row11Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_AggregationToHourly ) { try { int length = 0 ; this . key = readString ( dis ) ; this . value = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }
Source:
private java.util.Map < java.lang.String , java.lang.Object > executeImpl ( java.lang.String procedureName , org.springframework.jdbc.core.namedparam.MapSqlParameterSource paramsSource , org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.CallCreator callCreator ) { org.springframework.jdbc.core.simple.SimpleJdbcCall call = callsMap.get ( procedureName ) ; if ( call == null ) { call = callCreator.createCall ( ) ; call.compile ( ) ; callsMap.putIfAbsent ( procedureName , call ) ; } return call.execute ( paramsSource ) ; }

Target:
protected org.springframework.jdbc.core.simple.SimpleJdbcCall getCall ( java.lang.String procedureName , org.ovirt.engine.core.dal.dbbroker.SimpleJdbcCallsHandler.CallCreator callCreator ) { org.springframework.jdbc.core.simple.SimpleJdbcCall call = callsMap.get ( procedureName ) ; if ( call == null ) { call = callCreator.createCall ( ) ; call.compile ( ) ; callsMap.putIfAbsent ( procedureName , call ) ; } return call ; }
Source:
private void assertDiscardAfterDeleteUpdate ( boolean discardAfterDelete , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , boolean supportsDiscard , org.ovirt.engine.core.bll.ValidationResult result ) { domain.setDiscardAfterDelete ( discardAfterDelete ) ; domain.setStorageType ( storageType ) ; domain.setSupportsDiscard ( supportsDiscard ) ; org.junit.Assert.assertEquals ( validator.isDiscardAfterDeleteLegal ( ( ) -> supportsDiscard ) , result ) ; }

Target:
private void assertDiscardAfterDeleteUpdate ( boolean discardAfterDelete , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , boolean supportsDiscard , org.ovirt.engine.core.bll.ValidationResult result ) { domain.setDiscardAfterDelete ( discardAfterDelete ) ; domain.setStorageType ( storageType ) ; domain.setSupportsDiscard ( supportsDiscard ) ; org.junit.jupiter.api.Assertions.assertEquals ( validator.isDiscardAfterDeleteLegal ( ( ) -> supportsDiscard ) , result ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStoragePool ( storagePoolId ) ; return org.ovirt.engine.core.bll.VmHandler.findStorageDomainForMemory ( domainsInPool , disksList ) ; }

Target:
public static void updateOperationProgress ( final org.ovirt.engine.core.common.businessentities.VM vm ) { vm.setBackgroundOperationDescription ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getVmManager ( vm.getId ( ) ) . getConvertOperationDescription ( ) ) ; vm.setBackgroundOperationProgress ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getVmManager ( vm.getId ( ) ) . getConvertOperationProgress ( ) ) ; }