auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void validateSameSourceAndDest ( ) throws java.lang.Exception { destStorageId = srcStorageId ; initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString ( ) ) ) ; }

Target:
public void validateSameSourceAndDest ( ) throws java.lang.Exception { destStorageId = srcStorageId ; initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; command.getParameters ( ) . setStorageDomainId ( destStorageId ) ; command.setStorageDomainId ( destStorageId ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME.toString ( ) ) ) ; }
Source:
public void onSuccess ( java.util.List < java.lang.String > images ) { setImagesToModel ( getModel ( ) , images ) ; }

Target:
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 ) { boolean ha = getModel ( ) . getIsHighlyAvailable ( ) . getEntity ( ) ; getModel ( ) . getLease ( ) . setIsChangeable ( ha ) ; if ( ! ha ) { getModel ( ) . getLease ( ) . setSelectedItem ( null ) ; } }
Source:
public static java.util.Collection < org.ovirt.engine.core.aaa.DirectoryGroup > findDirectoryGroupsByQuery ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.lang.String query ) { return org.ovirt.engine.core.bll.aaa.DirectoryUtils.queryDirectoryGroups ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( query , Authz.QueryEntity.GROUP ) , false , false ) ; }

Target:
public static void flatGroups ( org.ovirt.engine.api.extensions.ExtMap principal ) { java.util.Map < java.lang.String , org.ovirt.engine.api.extensions.ExtMap > accumulator = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.bll.aaa.DirectoryUtils.flatGroups ( principal , PrincipalRecord.GROUPS , accumulator ) ; principal.put ( PrincipalRecord.GROUPS , new java.util.ArrayList ( accumulator.values ( ) ) ) ; }
Source:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( true , false ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( dbFacadeMock ) . getStoragePoolDao ( ) ; setupCpu ( ) ; canDoActionFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }

Target:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( true , false ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( dbFacadeMock ) . getStoragePoolDao ( ) ; setupCpu ( ) ; validateFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }
Source:
public java.lang.Void runInTransaction ( ) { addVmImagesAndSnapshots ( ) ; updateSnapshotsFromExport ( ) ; moveOrCopyAllImageGroups ( ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( getVm ( ) . getStaticData ( ) , getParameters ( ) . isImportAsNewEntity ( ) ) ; org.ovirt.engine.core.bll.VmHandler.lockVm ( getVm ( ) . getId ( ) ) ; if ( getParameters ( ) . isImportAsNewEntity ( ) ) { getParameters ( ) . setVm ( getVm ( ) ) ; setVmId ( getVm ( ) . getId ( ) ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { addVmImagesAndSnapshots ( ) ; updateSnapshotsFromExport ( ) ; if ( useCopyImages ) { moveOrCopyAllImageGroups ( ) ; } org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( getVm ( ) . getStaticData ( ) , getParameters ( ) . isImportAsNewEntity ( ) ) ; org.ovirt.engine.core.bll.VmHandler.lockVm ( getVm ( ) . getId ( ) ) ; if ( getParameters ( ) . isImportAsNewEntity ( ) ) { getParameters ( ) . setVm ( getVm ( ) ) ; setVmId ( getVm ( ) . getId ( ) ) ; } return null ; }
Source:
private void buildSmartcardDevice ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vm.getId ( ) , VmDeviceGeneralType.SMARTCARD , VmDeviceType.SMARTCARD.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { java.util.Map struct = new java.util.HashMap ( ) ; struct.put ( VdsProperties.Type , vmDevice.getType ( ) . getValue ( ) ) ; struct.put ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; addDevice ( struct , vmDevice , null ) ; } }

Target:
private void buildSmartcardDevice ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = dbFacade.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vm.getId ( ) , VmDeviceGeneralType.SMARTCARD , VmDeviceType.SMARTCARD.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { java.util.Map struct = new java.util.HashMap ( ) ; struct.put ( VdsProperties.Type , vmDevice.getType ( ) . getValue ( ) ) ; struct.put ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; addDevice ( struct , vmDevice , null ) ; } }
Source:
protected boolean entityExists ( ) { if ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . isVm ( ) ) { return ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getVmDAO ( ) . get ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . getId ( ) ) ) != null ; } else { return ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getVmTemplateDAO ( ) . get ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . getId ( ) ) ) != null ; } }

Target:
protected boolean entityExists ( ) { if ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . isVm ( ) ) { setVmId ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . getId ( ) ) ; return ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getVm ( ) ) != null ; } else { setVmTemplateId ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getParameters ( ) . getId ( ) ) ; return ( org.ovirt.engine.core.bll.AbstractVmWatchdogCommand.getVmTemplate ( ) ) != null ; } }
Source:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.aggregationtodaily_3_6.AggregationToDaily.disks_usage_dailyStruct.commonByteArrayLock_OVIRT_ENGINE_DWH_AggregationToDaily ) { try { int length = 0 ; this . history_datetime = readDate ( dis ) ; this . vm_id = ( ( java.lang.Object ) ( dis.readObject ( ) ) ) ; this . disks_usage = readString ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } catch ( java.lang.ClassNotFoundException eCNFE ) { throw new java.lang.RuntimeException ( eCNFE ) ; } } }

Target:
public void writeData ( java.io.ObjectOutputStream dos ) { try { writeDate ( this . history_datetime , dos ) ; dos.writeObject ( this . vm_id ) ; writeString ( this . disks_usage , dos ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "IsAvailable" . equals ( pcArgs.propertyName ) ) { boolean isAvailable = modelProvider.getModel ( ) . getIsAvailable ( ) ; setAccessible ( isAvailable ) ; } org.ovirt.engine.ui.common.widget.tab.TabAccessibleChangeEvent.fire ( this , this ) ; }

Target:
public void setAccessible ( boolean accessible ) { boolean wasAccessible = isAccessible ( ) ; super . setAccessible ( accessible ) ; if ( accessible != wasAccessible ) { org.ovirt.engine.ui.common.widget.tab.TabAccessibleChangeEvent.fire ( this , this ) ; } }
Source:
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.storage_domains ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void GetTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
public void onTimeout ( ) { if ( org.ovirt.engine.core.bll.storage.pool.StoragePoolStatusHandler.nonOperationalPools.containsKey ( poolId ) ) { try { org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( poolId ) ; if ( ( pool != null ) && ( ( pool.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational ) ) ) { org.ovirt.engine.core.bll.storage.pool.StoragePoolStatusHandler.nonOperationalPoolTreatment ( pool ) ; } } catch ( java.lang.Exception e ) { } } }

Target:
public void onTimeout ( ) { if ( org.ovirt.engine.core.bll.storage.pool.StoragePoolStatusHandler.nonOperationalPools.containsKey ( poolId ) ) { try { org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( poolId ) ; if ( ( pool != null ) && ( ( pool.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational ) ) ) { org.ovirt.engine.core.bll.storage.pool.StoragePoolStatusHandler.nonOperationalPoolTreatment ( pool ) ; } } catch ( java.lang.Exception ignore ) { } } }
Source:
public void testAllDomainsHaveSpaceForNewDisksFailure ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getSnappableVmDisks ( ) ; 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 ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }

Target:
public void testAllDomainsHaveSpaceForNewDisksFailure ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; 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 ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }
Source:
public void testListCrashClientLocale ( ) { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpHooksQueryExpectations ( t ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; locales.add ( org.ovirt.engine.api.restapi.resource.gluster.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpHooksQueryExpectations ( t ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.gluster.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }
Source:
private boolean canRemoveDiskBasedOnStorageTypeCheck ( ) { if ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return canRemoveDiskBasedOnImageStorageCheck ( ) ; } return true ; }

Target:
private boolean canRemoveDiskBasedOnStorageTypeCheck ( ) { if ( ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) || ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.CINDER ) ) ) { return canRemoveDiskBasedOnImageStorageCheck ( ) ; } return true ; }
Source:
protected boolean validateVM ( org.ovirt.engine.core.bll.validator.VmValidator vmValidator ) { org.ovirt.engine.core.bll.validator.LiveSnapshotValidator validator = new org.ovirt.engine.core.bll.validator.LiveSnapshotValidator ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getStoragePool ( ) . getcompatibility_version ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVds ( ) ) ; return ( ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . isDown ( ) ) || ( validate ( validator.canDoSnapshot ( ) ) ) ) && ( validate ( vmValidator.vmNotSavingRestoring ( ) ) ) ) && ( validate ( vmValidator.validateVmStatusUsingMatrix ( VdcActionType.CreateAllSnapshotsFromVm ) ) ) ; }

Target:
protected boolean validateVM ( org.ovirt.engine.core.bll.validator.VmValidator vmValidator ) { org.ovirt.engine.core.bll.validator.LiveSnapshotValidator validator = new org.ovirt.engine.core.bll.validator.LiveSnapshotValidator ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVds ( ) ) ; return ( ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . isDown ( ) ) || ( validate ( validator.canDoSnapshot ( ) ) ) ) && ( validate ( vmValidator.vmNotSavingRestoring ( ) ) ) ) && ( validate ( vmValidator.validateVmStatusUsingMatrix ( VdcActionType.CreateAllSnapshotsFromVm ) ) ) ; }
Source:
private void sendToDb ( org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryUnit discovery , org.ovirt.engine.core.compat.Guid policyUnitId , org.ovirt.engine.core.common.scheduling.PolicyUnitType type ) { org.ovirt.engine.core.common.scheduling.PolicyUnit policy = createFromDiscoveryUnit ( discovery , type ) ; if ( policyUnitId != null ) { policy.setId ( policyUnitId ) ; getPolicyUnitDao ( ) . update ( policy ) ; } else { policy.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getPolicyUnitDao ( ) . save ( policy ) ; } }

Target:
private void sendToDb ( org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryUnit discovery , org.ovirt.engine.core.compat.Guid policyUnitId , org.ovirt.engine.core.common.scheduling.PolicyUnitType type ) { org.ovirt.engine.core.common.scheduling.PolicyUnit policy = createFromDiscoveryUnit ( discovery , type ) ; if ( policyUnitId != null ) { policy.setId ( policyUnitId ) ; policyUnitDao.update ( policy ) ; } else { policy.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; policyUnitDao.save ( policy ) ; } }
Source:
public void testNonExistingStorageDomain ( ) { org.mockito.Mockito.when ( command.getStorageDomainStaticDAO ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( command ) . executeHSMGetStorageDomainsList ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainsListVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }

Target:
public void testNonExistingStorageDomain ( ) { org.mockito.Mockito.when ( command.getStorageDomainStaticDAO ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.HSMGetStorageDomainInfoVDSCommandParameters.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VM vm ) { final org.ovirt.engine.core.compat.Guid clusterId = vm.getVdsGroupId ( ) ; org.ovirt.engine.core.compat.Version clusterVersion = clusterVersions.get ( clusterId ) ; if ( clusterVersion == null ) { final org.ovirt.engine.core.common.businessentities.VDSGroup cluster = vdsGroupDao.get ( clusterId ) ; clusterVersion = cluster.getCompatibilityVersion ( ) ; clusterVersions.put ( clusterId , clusterVersion ) ; } return ! ( org.ovirt.engine.core.common.FeatureSupported.changeNetworkUsedByVmSupported ( clusterVersion ) ) ; }

Target:
public boolean test ( org.ovirt.engine.core.common.businessentities.VM vm ) { final org.ovirt.engine.core.compat.Guid clusterId = vm.getVdsGroupId ( ) ; org.ovirt.engine.core.compat.Version clusterVersion = clusterVersions.get ( clusterId ) ; if ( clusterVersion == null ) { final org.ovirt.engine.core.common.businessentities.VDSGroup cluster = vdsGroupDao.get ( clusterId ) ; clusterVersion = cluster.getCompatibilityVersion ( ) ; clusterVersions.put ( clusterId , clusterVersion ) ; } return ! ( org.ovirt.engine.core.common.FeatureSupported.changeNetworkUsedByVmSupported ( clusterVersion ) ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( java.lang.String userName , java.lang.String password , java.lang.String domain ) { org.ovirt.engine.core.common.action.LoginUserParameters params = new org.ovirt.engine.core.common.action.LoginUserParameters ( userName , password , domain , null , null , null ) ; params.setSessionId ( getSessionId ( ) ) ; params.setActionType ( VdcActionType.LoginAdminUser ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = getBackend ( ) . Login ( params ) ; return returnValue ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( java.lang.String userName , java.lang.String password , java.lang.String profileName , org.ovirt.engine.core.common.action.VdcActionType loginType ) { org.ovirt.engine.core.common.action.LoginUserParameters params = new org.ovirt.engine.core.common.action.LoginUserParameters ( profileName , userName , password ) ; params.setSessionId ( getSessionId ( ) ) ; params.setActionType ( loginType ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = getBackend ( ) . login ( params ) ; return returnValue ; }
Source:
public void serialize ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS qos ) { if ( qos != null ) { addQosData ( inboundEntry , qos.getInboundAverage ( ) , qos.getInboundPeak ( ) , qos.getInboundBurst ( ) ) ; addQosData ( outboundEntry , qos.getOutboundAverage ( ) , qos.getOutboundPeak ( ) , qos.getOutboundBurst ( ) ) ; } }

Target:
public void serialize ( org.ovirt.engine.core.common.businessentities.network.NetworkQoS qos ) { map.put ( inboundEntry , constructQosData ( qos.getInboundAverage ( ) , qos.getInboundPeak ( ) , qos.getInboundBurst ( ) ) ) ; map.put ( outboundEntry , constructQosData ( qos.getOutboundAverage ( ) , qos.getOutboundPeak ( ) , qos.getOutboundBurst ( ) ) ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Role role ) { switch ( role.getType ( ) ) { case ADMIN : return getApplicationResources ( ) . adminImage ( ) ; case USER : return getApplicationResources ( ) . userImage ( ) ; } return getApplicationResources ( ) . adminImage ( ) ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Role role ) { switch ( role.getType ( ) ) { case ADMIN : return org.ovirt.engine.ui.webadmin.widget.table.column.RoleTypeColumn.resources.adminImage ( ) ; case USER : return org.ovirt.engine.ui.webadmin.widget.table.column.RoleTypeColumn.resources.userImage ( ) ; } return org.ovirt.engine.ui.webadmin.widget.table.column.RoleTypeColumn.resources.adminImage ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStart" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , remoteHost ) . withParameter ( "remoteVolumeName" , remoteVolumeName ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionPause ( java.lang.String masterVolumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionPause" ) . withParameter ( "volumeName" , masterVolumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
protected void addCommands ( ) { org.ovirt.engine.ui.uicommonweb.UICommand tempVar = new org.ovirt.engine.ui.uicommonweb.UICommand ( "OnSave" , this ) ; tempVar.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . ok ( ) ) ; tempVar.setIsDefault ( true ) ; getCommands ( ) . add ( tempVar ) ; org.ovirt.engine.ui.uicommonweb.UICommand tempVar2 = new org.ovirt.engine.ui.uicommonweb.UICommand ( "Cancel" , this ) ; tempVar2.setTitle ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . cancel ( ) ) ; tempVar2.setIsCancel ( true ) ; getCommands ( ) . add ( tempVar2 ) ; }

Target:
public void syncWithBackend ( ) { super . syncWithBackend ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetClusterList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void OnSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { onGetClusterList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( ReturnValue ) ) ) ; } } ) , getSelectedDc ( ) . getId ( ) ) ; }
Source:
protected org.ovirt.engine.api.model.VM deprecatedPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { java.util.Set < org.ovirt.engine.api.common.util.DetailHelper.Detail > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( getHttpHeaders ( ) ) ; parent.addInlineDetails ( details , model ) ; addStatistics ( model , entity , uriInfo , httpHeaders ) ; parent.setPayload ( model ) ; parent.setBallooning ( model ) ; parent.setCertificateInfo ( model ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.VM doPopulate ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { parent.setConsoleDevice ( model ) ; parent.setVirtioScsiController ( model ) ; parent.setSoundcard ( model ) ; parent.setVmOvfConfiguration ( model , entity ) ; parent.setRngDevice ( model ) ; return model ; }
Source:
public void testRefreshUserSession ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , true ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return null since the session wasn't refresh" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; }

Target:
public void testRefreshUserSession ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , true ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return null since the session wasn't refresh" , container.getData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity getReplicatedVolume ( org.ovirt.engine.core.compat.Guid volumeId , int brickCount ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getVolume ( volumeId ) ; volume.setStatus ( GlusterVolumeStatus.UP ) ; volume.setBricks ( getBricks ( volumeId , "repl" , brickCount ) ) ; volume.setVolumeType ( GlusterVolumeType.REPLICATE ) ; volume.setReplicaCount ( brickCount ) ; volume.setClusterId ( clusterId ) ; return volume ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity getReplicatedVolume ( org.ovirt.engine.core.compat.Guid volumeId , int brickCount ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume = getVolume ( volumeId ) ; volume.setStatus ( GlusterStatus.UP ) ; volume.setBricks ( getBricks ( volumeId , "repl" , brickCount ) ) ; volume.setVolumeType ( GlusterVolumeType.REPLICATE ) ; volume.setReplicaCount ( brickCount ) ; volume.setClusterId ( clusterId ) ; return volume ; }
Source:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getGeoRepSession ( ) { if ( ( geoRepSession ) == null ) { geoRepSession = getGlusterGeoRepDao ( ) . getById ( org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getParameters ( ) . getGeoRepSessionId ( ) ) ; } return geoRepSession ; }

Target:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getGeoRepSession ( ) { if ( ( geoRepSession ) == null ) { if ( ( org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getParameters ( ) . getGeoRepSessionId ( ) ) != null ) { geoRepSession = getGlusterGeoRepDao ( ) . getById ( org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getParameters ( ) . getGeoRepSessionId ( ) ) ; } else { geoRepSession = getGlusterGeoRepDao ( ) . getGeoRepSession ( org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getGlusterVolumeId ( ) , org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getParameters ( ) . getSlaveHost ( ) , org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getParameters ( ) . getSlaveVolumeName ( ) ) ; } } return geoRepSession ; }
Source:
public void refreshHeavyWeightData ( ) { log.debug ( "Refreshing Gluster Data [heavyweight]" ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : getClusterDao ( ) . getAll ( ) ) { if ( ( org.ovirt.engine.core.common.gluster.GlusterFeatureSupported.refreshHeavyWeight ( cluster.getcompatibility_version ( ) ) ) && ( cluster.supportsGlusterService ( ) ) ) { try { refreshClusterHeavyWeightData ( cluster ) ; } catch ( java.lang.Exception e ) { log.error ( "Error while refreshing Gluster heavyweight data of cluster '{}': {}" , cluster.getName ( ) , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; } } } }

Target:
public void refreshHeavyWeightData ( ) { log.debug ( "Refreshing Gluster Data [heavyweight]" ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : getClusterDao ( ) . getAll ( ) ) { if ( ( org.ovirt.engine.core.common.gluster.GlusterFeatureSupported.refreshHeavyWeight ( cluster.getCompatibilityVersion ( ) ) ) && ( cluster.supportsGlusterService ( ) ) ) { try { refreshClusterHeavyWeightData ( cluster ) ; } catch ( java.lang.Exception e ) { log.error ( "Error while refreshing Gluster heavyweight data of cluster '{}': {}" , cluster.getName ( ) , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; } } } }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Role role ) { validateParameters ( role , "name" , "permits.id" ) ; validateEnums ( org.ovirt.engine.api.model.Role.class , role ) ; return performCreate ( VdcActionType.AddRoleWithActionGroups , new org.ovirt.engine.core.common.action.RoleWithActionGroupsParameters ( map ( role ) , mapPermits ( role.getPermits ( ) . getPermits ( ) ) ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetRoleById , org.ovirt.engine.core.common.queries.MultilevelAdministrationByRoleIdParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Role role ) { validateParameters ( role , "name" , "permits.id" ) ; validateEnums ( org.ovirt.engine.api.model.Role.class , role ) ; return performCreate ( VdcActionType.AddRoleWithActionGroups , new org.ovirt.engine.core.common.action.RoleWithActionGroupsParameters ( map ( role ) , mapPermits ( role.getPermits ( ) . getPermits ( ) ) ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetRoleById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
public void testGetValue ( ) throws java.lang.Exception { final java.lang.String key = "MaxNumberOfHostsInStoragePool" ; org.ovirt.engine.core.config.EngineConfigLogicTest.log.info ( ( "getValue: Testing fetch of " + key ) ) ; org.ovirt.engine.core.config.entity.ConfigKey configKey = org.ovirt.engine.core.config.EngineConfigLogicTest.engineConfigLogic.fetchConfigKey ( key , null ) ; org.ovirt.engine.core.config.EngineConfigLogicTest.log.info ( ( "getValue: got: " + configKey ) ) ; junit.framework.Assert.assertNotNull ( configKey.getValue ( ) ) ; }

Target:
public void testGetValue ( ) throws java.lang.Exception { final java.lang.String key = "MaxNumberOfHostsInStoragePool" ; org.ovirt.engine.core.config.EngineConfigLogicTest.log.info ( ( "getValue: Testing fetch of " + key ) ) ; org.ovirt.engine.core.config.entity.ConfigKey configKey = org.ovirt.engine.core.config.EngineConfigLogicTest.engineConfigLogic.fetchConfigKey ( key , null ) ; org.ovirt.engine.core.config.EngineConfigLogicTest.log.info ( ( "getValue: got: " + configKey ) ) ; org.junit.Assert.assertNotNull ( configKey.getValue ( ) ) ; }
Source:
private void clearCpuPinning ( ) { final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getWindow ( ) ) ) ; model.getCpuPinning ( ) . setEntity ( "" ) ; preSavePhase3 ( ) ; }

Target:
private void updateHaMaintenanceAvailability ( java.util.List items ) { if ( ( items == null ) || ( ( items.size ( ) ) != 1 ) ) { setHaMaintenanceAvailability ( false ) ; return ; } org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.getSelectedItem ( ) ; if ( ( vm == null ) || ( ! ( vm.isHostedEngine ( ) ) ) ) { setHaMaintenanceAvailability ( false ) ; } else { setHaMaintenanceAvailability ( true ) ; } }
Source:
public org.ovirt.engine.api.model.Hooks list ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > > hooksMap = getEntity ( java.util.HashMap.class , VdcQueryType.GetVdsHooksById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( hostId ) ) , null ) ; return mapCollection ( hooksMap ) ; }

Target:
public org.ovirt.engine.api.model.Hooks list ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.util.HashMap < java.lang.String , java.lang.String > > > hooksMap = getEntity ( java.util.HashMap.class , QueryType.GetVdsHooksById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( hostId ) ) , null ) ; return mapCollection ( hooksMap ) ; }
Source:
private boolean hasImages ( ) { return ( ( getDiskImageDao ( ) . getAllSnapshotsForStorageDomain ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getId ( ) ) . size ( ) ) != 0 ) || ( ( getImageStorageDomainMapDao ( ) . getAllByStorageDomainId ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getId ( ) ) . size ( ) ) != 0 ) ; }

Target:
private boolean hasImages ( ) { int allowedDisksNum = getOvfInfo ( ) . size ( ) ; return ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getDiskImageDao ( ) . getAllSnapshotsForStorageDomain ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getId ( ) ) . size ( ) ) > allowedDisksNum ) || ( ( getImageStorageDomainMapDao ( ) . getAllByStorageDomainId ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.getStorageDomain ( ) . getId ( ) ) . size ( ) ) > allowedDisksNum ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean authenticationRequired = requiresAuthentication.getEntity ( ) ; getUsername ( ) . setIsChangable ( authenticationRequired ) ; getPassword ( ) . setIsChangable ( authenticationRequired ) ; getTenantName ( ) . setIsChangable ( authenticationRequired ) ; }

Target:
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 ) { boolean authenticationRequired = requiresAuthentication.getEntity ( ) ; getUsername ( ) . setIsChangeable ( authenticationRequired ) ; getPassword ( ) . setIsChangeable ( authenticationRequired ) ; getTenantName ( ) . setIsChangeable ( authenticationRequired ) ; getAuthUrl ( ) . setIsChangeable ( authenticationRequired ) ; }
Source:
public void testUpdateDnsResolverConfiguration ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic before = dao.get ( getExistingEntityId ( ) ) ; before.getReportedDnsResolverConfiguration ( ) . setNameServers ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "1.1.1.1" ) ) ) ; dao.updateDnsResolverConfiguration ( before.getId ( ) , before.getReportedDnsResolverConfiguration ( ) ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic after = dao.get ( getExistingEntityId ( ) ) ; org.junit.Assert.assertEquals ( before.getReportedDnsResolverConfiguration ( ) , after.getReportedDnsResolverConfiguration ( ) ) ; }

Target:
public void testUpdateDnsResolverConfiguration ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic before = dao.get ( getExistingEntityId ( ) ) ; before.getReportedDnsResolverConfiguration ( ) . setNameServers ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "1.1.1.1" ) ) ) ; dao.updateDnsResolverConfiguration ( before.getId ( ) , before.getReportedDnsResolverConfiguration ( ) ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic after = dao.get ( getExistingEntityId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( before.getReportedDnsResolverConfiguration ( ) , after.getReportedDnsResolverConfiguration ( ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.StopGlusterVolume , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeActionVDSParameters ( upServer.getId ( ) , getGlusterVolumeName ( ) , getParameters ( ) . isForceAction ( ) ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( getSucceeded ( ) ) { updateVolumeStatusInDb ( getParameters ( ) . getVolumeId ( ) ) ; } else { handleVdsError ( AuditLogType.GLUSTER_VOLUME_STOP_FAILED , returnValue.getVdsError ( ) . getMessage ( ) ) ; return ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = runVdsCommand ( VDSCommandType.StopGlusterVolume , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeActionVDSParameters ( upServer.getId ( ) , getGlusterVolumeName ( ) , getParameters ( ) . isForceAction ( ) ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( getSucceeded ( ) ) { org.ovirt.engine.core.bll.utils.GlusterUtils.getInstance ( ) . updateVolumeStatus ( getParameters ( ) . getVolumeId ( ) , GlusterStatus.DOWN ) ; } else { handleVdsError ( AuditLogType.GLUSTER_VOLUME_STOP_FAILED , returnValue.getVdsError ( ) . getMessage ( ) ) ; return ; } }
Source:
protected void fillMacAddressIfMissing ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( iface.getMacAddress ( ) ) ) && ( ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . getavailableMacsCount ( ) ) >= 1 ) ) { iface.setMacAddress ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . allocateNewMac ( ) ) ; } }

Target:
protected void fillMacAddressIfMissing ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { if ( ( org.apache.commons.lang.StringUtils.isEmpty ( iface.getMacAddress ( ) ) ) && ( ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . getavailableMacsCount ( ) ) >= 1 ) ) { iface.setMacAddress ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . allocateNewMac ( ) ) ; } }
Source:
public void testCanDoSuccessOnAddFloatingDiskWithPlugUnset ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = org.ovirt.engine.core.bll.AddDiskCommandTest.createDiskImage ( 1 ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; parameters.setVmId ( Guid.Empty ) ; parameters.setPlugDiskToVm ( false ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void testCanDoFailOnAddFloatingDiskWithPlugSet ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = org.ovirt.engine.core.bll.AddDiskCommandTest.createDiskImage ( 1 ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; parameters.setVmId ( Guid.Empty ) ; parameters.setPlugDiskToVm ( true ) ; initializeCommand ( null , parameters ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.CANNOT_ADD_FLOATING_DISK_WITH_PLUG_VM_SET ) ; }
Source:
public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > allClusters = returnValue.getReturnValue ( ) ; clusterArchitecturesInDataCenters = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : allClusters ) { if ( ( cluster.supportsVirtService ( ) ) && ( ( cluster.getArchitecture ( ) ) != null ) ) { addArchitecture ( cluster.getStoragePoolId ( ) , cluster.getArchitecture ( ) ) ; } } }

Target:
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 ) { providerChanged ( ) ; }
Source:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmInterfaceFilterParameterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { entity.getId ( ) } , entity ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( QueryType.GetVmInterfaceFilterParameterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { entity.getId ( ) } , entity ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > getAllByType ( org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { return getCallsHandler ( ) . executeReadList ( "GetAllFromProvidersByType" , org.ovirt.engine.core.dao.provider.ProviderDaoImpl.ProviderRowMapper.INSTANCE , getCustomMapSqlParameterSource ( ) . addValue ( "provider_type" , providerType.toString ( ) ) ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > getAllByTypes ( org.ovirt.engine.core.common.businessentities.ProviderType ... providerTypes ) { if ( providerTypes == null ) { return java.util.Collections.emptyList ( ) ; } return getCallsHandler ( ) . executeReadList ( "GetAllFromProvidersByTypes" , org.ovirt.engine.core.dao.provider.ProviderDaoImpl.ProviderRowMapper.INSTANCE , getCustomMapSqlParameterSource ( ) . addValue ( "provider_types" , createArrayOf ( "varchar" , java.util.Arrays.stream ( providerTypes ) . map ( ProviderType :: name ) . toArray ( ) ) ) ) ; }
Source:
public void modifyPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock lock = writeLockResource ( ) ) { if ( ! ( macPools.containsKey ( macPool.getId ( ) ) ) ) { throw new java.lang.IllegalStateException ( org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.INEXISTENT_POOL_EXCEPTION_MESSAGE ) ; } removeWithoutLocking ( macPool.getId ( ) ) ; initializeMacPool ( macPool ) ; } }

Target:
public void modifyPool ( org.ovirt.engine.core.bll.network.macpool.MacPool macPool ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock lock = writeLockResource ( ) ) { org.ovirt.engine.core.compat.Guid macPoolId = macPool.getId ( ) ; if ( ! ( macPools.containsKey ( macPoolId ) ) ) { throw new java.lang.IllegalStateException ( createExceptionMessageMacPoolHavingIdDoesNotExist ( macPoolId ) ) ; } org.ovirt.engine.core.bll.network.macpool.MacPoolPerCluster.log.debug ( "Updating pool {}. (old will be deleted and new initialized from db entity)" , macPool ) ; removeWithoutLocking ( macPoolId ) ; initializeMacPool ( macPool ) ; } }
Source:
protected void executeValidatedCommand ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { if ( ( ( executionContext ) == null ) || ( executionContext.isMonitored ( ) ) ) { org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , command.isInternalExecution ( ) ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setCorrelationId ( command.getCorrelationId ( ) ) ; command.executeAction ( ) ; }

Target:
protected void executeValidatedCommand ( org.ovirt.engine.core.bll.CommandBase < ? > command ) { if ( ( ( executionContext ) == null ) || ( executionContext.isMonitored ( ) ) ) { org.ovirt.engine.core.bll.job.ExecutionHandler.prepareCommandForMonitoring ( command , command.getActionType ( ) , command.isInternalExecution ( ) ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setCorrelationId ( command.getCorrelationId ( ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; command.executeAction ( ) ; }
Source:
public void setDisplay ( com.google.gwt.user.cellview.client.CellTree display ) { this . display = display ; expandTree ( ) ; }

Target:
public < T > org.ovirt.engine.ui.webadmin.uicommon.model.NodeInfo < ? > getNodeInfo ( T parent ) { if ( parent != null ) { org.ovirt.engine.ui.uicommonweb.models.tags.TagModel parentModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagModel ) ( parent ) ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > children = parentModel.getChildren ( ) ; return new org.ovirt.engine.ui.webadmin.uicommon.model.DefaultNodeInfo < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > ( new com.google.gwt.view.client.ListDataProvider < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > ( children ) , cell , selectionModel , selectionManager , null ) ; } else { return new org.ovirt.engine.ui.webadmin.uicommon.model.DefaultNodeInfo < org.ovirt.engine.ui.uicommonweb.models.tags.TagModel > ( getDataProvider ( ) , cell , selectionModel , selectionManager , null ) ; } }