auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidateModifiedBondSlaves ( bond , null , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , false , VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
protected boolean hasVmInit ( ) { org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getStaticData ( ) , false ) ; return ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmInit ( ) ) != null ; }

Target:
protected void loadVmInit ( ) { if ( ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVmInit ( ) ) == null ) ) { org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getStaticData ( ) , false ) ; } }
Source:
public void failWhenNoAgentsExist ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setPmEnabled ( true ) ; java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; boolean result = validator.isPowerManagementEnabledAndLegal ( vds , null , messages ) ; org.junit.Assert.assertFalse ( result ) ; org.junit.Assert.assertEquals ( 2 , messages.size ( ) ) ; org.junit.Assert.assertTrue ( messages.contains ( "ACTION_TYPE_FAILED_PM_ENABLED_WITHOUT_AGENT" ) ) ; org.junit.Assert.assertTrue ( messages.contains ( "VDS_FENCE_DISABLED" ) ) ; }

Target:
public void failWhenNoAgentsExist ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setPmEnabled ( true ) ; java.util.List < java.lang.String > messages = new java.util.LinkedList < > ( ) ; boolean result = validator.isPowerManagementEnabledAndLegal ( vds , null , messages ) ; org.junit.jupiter.api.Assertions.assertFalse ( result ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , messages.size ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( messages.contains ( "ACTION_TYPE_FAILED_PM_ENABLED_WITHOUT_AGENT" ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( messages.contains ( "VDS_FENCE_DISABLED" ) ) ; }
Source:
com.google.gwt.http.client.RequestBuilder createRequest ( ) { com.google.gwt.http.client.RequestBuilder builder = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , restApiBaseUrl ) ; builder.setHeader ( "Session-TTL" , java.lang.String.valueOf ( restApiSessionTimeout ) ) ; builder.setHeader ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.PREFER_HEADER , "persistent-auth, csrf-protection" ) ; boolean isAdmin = org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoggedInUser ( ) . isAdmin ( ) ; builder.setHeader ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.FILTER_HEADER , java.lang.String.valueOf ( ( ! isAdmin ) ) ) ; if ( ( restApiSessionId ) != null ) { builder.setHeader ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.CSRF_HEADER , restApiSessionId ) ; } return builder ; }

Target:
com.google.gwt.http.client.RequestBuilder createRequest ( ) { com.google.gwt.http.client.RequestBuilder builder = new com.google.gwt.http.client.RequestBuilder ( com.google.gwt.http.client.RequestBuilder.GET , restApiBaseUrl ) ; builder.setHeader ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.VERSION_HEADER , org.ovirt.engine.ui.common.restapi.RestApiSessionManager.VERSION_VALUE ) ; builder.setHeader ( "Session-TTL" , java.lang.String.valueOf ( restApiSessionTimeout ) ) ; builder.setHeader ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.PREFER_HEADER , "persistent-auth, csrf-protection" ) ; boolean isAdmin = org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoggedInUser ( ) . isAdmin ( ) ; builder.setHeader ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.FILTER_HEADER , java.lang.String.valueOf ( ( ! isAdmin ) ) ) ; if ( ( restApiSessionId ) != null ) { builder.setHeader ( org.ovirt.engine.ui.common.restapi.RestApiSessionManager.CSRF_HEADER , restApiSessionId ) ; } return builder ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . setDiskProfileId ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getDiskProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getCurrentUser ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . setDiskProfileId ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getDiskProfileId ( ) ) ; return validate ( diskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getStoragePool ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getCurrentUser ( ) ) ) ; }
Source:
protected static boolean isLegalClusterId ( org.ovirt.engine.core.compat.Guid clusterId , java.util.List < java.lang.String > reasons ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . get ( clusterId ) ; boolean legalClusterId = vdsGroup != null ; if ( ! legalClusterId ) { reasons.add ( VdcBllErrors.VM_INVALID_SERVER_CLUSTER_ID.toString ( ) ) ; } return legalClusterId ; }

Target:
protected static boolean isLegalClusterId ( org.ovirt.engine.core.compat.Guid clusterId , java.util.List < java.lang.String > reasons ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsGroupDao ( ) . get ( clusterId ) ; boolean legalClusterId = vdsGroup != null ; if ( ! legalClusterId ) { reasons.add ( EngineError.VM_INVALID_SERVER_CLUSTER_ID.toString ( ) ) ; } return legalClusterId ; }
Source:
private boolean isLocalDataCenterEmpty ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter ) { if ( ( ( dataCenter != null ) && ( ( dataCenter.getstorage_pool_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) && ( ( dataCenter.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Uninitialized ) ) ) { return true ; } return false ; }

Target:
private boolean isLocalDataCenterEmpty ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter ) { if ( ( ( dataCenter != null ) && ( ( dataCenter.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) && ( ( dataCenter.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Uninitialized ) ) ) { return true ; } return false ; }
Source:
private void updateNumOfMonitors ( ) { if ( isVncSelected ( ) ) { getNumOfMonitors ( ) . setSelectedItem ( 1 ) ; getNumOfMonitors ( ) . setIsChangable ( false ) ; } else { getNumOfMonitors ( ) . setIsChangable ( true ) ; } }

Target:
private void updateNumOfMonitors ( ) { if ( ( getDisplayType ( ) . getSelectedItem ( ) ) == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) { getNumOfMonitors ( ) . setIsChangeable ( true ) ; } else { getNumOfMonitors ( ) . setSelectedItem ( 1 ) ; getNumOfMonitors ( ) . setIsChangeable ( false ) ; } }
Source:
public void calculateNetworkImplementationDetailsNetworkVmNetworkOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , iface.getMtu ( ) , iface.getVlanId ( ) , null ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkVmNetworkOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.getNetworkName ( ) , ( ! ( iface.isBridged ( ) ) ) , iface.getMtu ( ) , iface.getVlanId ( ) , createQos ( ) ) ; }
Source:
public void setupMocks ( ) { org.mockito.Mockito.when ( vdsGroupDao.get ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) . thenReturn ( getVdsGroup ( ) ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( cmd ) . getVdsGroupDAO ( ) ; org.mockito.Mockito.when ( cmd.getSyncJobInstance ( ) ) . thenReturn ( hookSyncJob ) ; }

Target:
public void setupMocks ( ) { org.mockito.Mockito.when ( vdsGroupDao.get ( org.ovirt.engine.core.bll.gluster.RefreshGlusterHooksCommandTest.CLUSTER_ID ) ) . thenReturn ( getVdsGroup ( ) ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( cmd ) . getVdsGroupDao ( ) ; org.mockito.Mockito.when ( cmd.getSyncJobInstance ( ) ) . thenReturn ( hookSyncJob ) ; }
Source:
public void diskImagesHasDerivedDisksNoStorageDomainSpecifiedFailure ( ) { disk1.setVmEntityType ( VmEntityType.TEMPLATE ) ; org.mockito.Mockito.when ( diskImageDao.getAllSnapshotsForParent ( disk1.getImageId ( ) ) ) . thenReturn ( java.util.Arrays.asList ( disk2 ) ) ; org.junit.Assert.assertThat ( validator.diskImagesHaveNoDerivedDisks ( null ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_DETECTED_DERIVED_DISKS ) ) ; }

Target:
public void diskImagesHasDerivedDisksNoStorageDomainSpecifiedFailure ( ) { disk1.setVmEntityType ( VmEntityType.TEMPLATE ) ; org.mockito.Mockito.when ( diskImageDao.getAllSnapshotsForParent ( disk1.getImageId ( ) ) ) . thenReturn ( java.util.Arrays.asList ( disk2 ) ) ; org.junit.Assert.assertThat ( validator.diskImagesHaveNoDerivedDisks ( null ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DETECTED_DERIVED_DISKS ) ) ; }
Source:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }
Source:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolumeEntity = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( getEntity ( ) ) ) ; setItems ( glusterVolumeEntity.getBricks ( ) ) ; } else { setItems ( null ) ; } updateRemoveBrickActionsAvailability ( ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( getEntity ( ) ) ) ) ; }

Target:
public void setVolumeEntity ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity ) { this . volumeEntity = volumeEntity ; updateRemoveBrickActionsAvailability ( volumeEntity ) ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getDbFacade ( ) . getVmDao ( ) . getAllVmsRelatedToQuotaId ( org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getParameters ( ) . getQuotaId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( vm ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.ImagesComparerByName ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.fillImagesBySnapshots ( vm ) ; } org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vms ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getDbFacade ( ) . getVmDao ( ) . getAllVmsRelatedToQuotaId ( org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getParameters ( ) . getQuotaId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( vm ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.ImagesComparerByName ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.fillImagesBySnapshots ( vm ) ; } org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vms ) ; }
Source:
private void handleFinalizingSuccess ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { log.info ( "Finalizing successful transfer for {}" , getTransferDescription ( ) ) ; if ( stopImageTransferSession ( context.entity ) ) { org.ovirt.engine.core.compat.Guid transferingVdsId = context.entity.getVdsId ( ) ; if ( verifyImage ( transferingVdsId ) ) { setVolumeLegalityInStorage ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.LEGAL_IMAGE ) ; org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.unLockImage ( ) ; updateEntityPhase ( ImageTransferPhase.FINISHED_SUCCESS ) ; } else { setImageStatus ( ImageStatus.ILLEGAL ) ; updateEntityPhase ( ImageTransferPhase.FINALIZING_FAILURE ) ; } tearDownImage ( context.entity.getVdsId ( ) ) ; } }

Target:
private void handleFinalizingSuccess ( final org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand < T > . StateContext context ) { log.info ( "Finalizing successful transfer for {}" , getTransferDescription ( ) ) ; if ( stopImageTransferSession ( context.entity ) ) { org.ovirt.engine.core.compat.Guid transferingVdsId = context.entity.getVdsId ( ) ; if ( verifyImage ( transferingVdsId ) ) { setVolumeLegalityInStorage ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.LEGAL_IMAGE ) ; updateQcowCompat ( ) ; org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.unLockImage ( ) ; updateEntityPhase ( ImageTransferPhase.FINISHED_SUCCESS ) ; } else { setImageStatus ( ImageStatus.ILLEGAL ) ; updateEntityPhase ( ImageTransferPhase.FINALIZING_FAILURE ) ; } tearDownImage ( context.entity.getVdsId ( ) ) ; } }
Source:
public int getInteger ( java.lang.String key ) { java.lang.String value = getProperty ( key ) ; try { return java.lang.Integer.parseInt ( value ) ; } catch ( java.lang.NumberFormatException exception ) { java.lang.String message = ( ( ( "The value \"" + value ) + "\" for property \"" ) + key ) + "\" is not a valid integer." ; org.ovirt.engine.core.utils.LocalConfig.log.error ( message , exception ) ; throw new java.lang.IllegalArgumentException ( message , exception ) ; } }

Target:
public boolean getBoolean ( java.lang.String key ) { return getBoolean ( key , null ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isOsSupportedForVirtIoScsi ( org.ovirt.engine.core.common.businessentities.VM vm ) { final java.util.List < java.lang.String > unsupportedOSs = org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > getValue ( ConfigValues.VirtIoScsiUnsupportedOsList ) ; java.lang.String vmOs = org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getUniqueOsNames ( ) . get ( vm.getVmOsId ( ) ) ; for ( java.lang.String os : unsupportedOSs ) { if ( os.equalsIgnoreCase ( vmOs ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isOsSupportedForVirtIoScsi ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isDiskInterfaceSupportedByOs ( vm.getOs ( ) , vm.getVdsGroupCompatibilityVersion ( ) , DiskInterface.VirtIO_SCSI ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void updateStatus ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster cluster ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , cluster.getcluster_id ( ) ) . addValue ( "network_id" , cluster.getnetwork_id ( ) ) . addValue ( "status" , cluster.getstatus ( ) ) ; getCallsHandler ( ) . executeModification ( "Updatenetwork_cluster_status" , parameterSource ) ; }

Target:
public void updateStatus ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster cluster ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , cluster.getClusterId ( ) ) . addValue ( "network_id" , cluster.getNetworkId ( ) ) . addValue ( "status" , cluster.getStatus ( ) ) ; getCallsHandler ( ) . executeModification ( "Updatenetwork_cluster_status" , parameterSource ) ; }
Source:
public void testUpdateClustersProps ( ) { org.junit.Assert.assertNotSame ( "pc-1.2.3" , existingCluster.getEmulatedMachine ( ) ) ; existingCluster.setEmulatedMachine ( "pc-1.2.3" ) ; dao.update ( existingCluster ) ; org.junit.Assert.assertEquals ( "pc-1.2.3" , existingCluster.getEmulatedMachine ( ) ) ; existingCluster.setDetectEmulatedMachine ( true ) ; dao.update ( existingCluster ) ; org.junit.Assert.assertTrue ( existingCluster.isDetectEmulatedMachine ( ) ) ; }

Target:
public void testUpdateClustersProps ( ) { org.junit.jupiter.api.Assertions.assertNotSame ( "pc-1.2.3" , existingCluster.getEmulatedMachine ( ) ) ; existingCluster.setEmulatedMachine ( "pc-1.2.3" ) ; dao.update ( existingCluster ) ; org.junit.jupiter.api.Assertions.assertEquals ( "pc-1.2.3" , existingCluster.getEmulatedMachine ( ) ) ; existingCluster.setDetectEmulatedMachine ( true ) ; dao.update ( existingCluster ) ; org.junit.jupiter.api.Assertions.assertTrue ( existingCluster.isDetectEmulatedMachine ( ) ) ; }
Source:
protected static org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain currDomain : domainsInPool ) { if ( ( ( currDomain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( ( currDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) && ( org.ovirt.engine.core.bll.VmHandler.doesStorageDomainHaveSpaceForRequest ( currDomain , disksList ) ) ) { return currDomain ; } } return null ; }

Target:
protected static org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain currDomain : domainsInPool ) { org.ovirt.engine.core.bll.VmHandler.updateDisksStorageType ( currDomain.getStorageType ( ) , disksList.get ( 0 ) ) ; if ( ( ( currDomain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( ( currDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) && ( org.ovirt.engine.core.bll.VmHandler.validateSpaceRequirements ( currDomain , disksList ) ) ) { return currDomain ; } } return null ; }
Source:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , boolean enableCallBack ) { persistCommand ( parentCommand , getContext ( ) , enableCallBack ) ; }

Target:
protected < P extends org.ovirt.engine.core.common.action.VdcActionParametersBase > P withRootCommandInfo ( P params , org.ovirt.engine.core.common.action.VdcActionType actionType ) { org.ovirt.engine.core.common.action.VdcActionType parentCommand = ( ( getParameters ( ) . getParentCommand ( ) ) != ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) ? getParameters ( ) . getParentCommand ( ) : actionType ; params.setParentParameters ( getParametersForTask ( parentCommand , getParameters ( ) ) ) ; params.setParentCommand ( parentCommand ) ; return params ; }
Source:
private boolean performStorageDomainsChecks ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters ) { org.ovirt.engine.core.common.businessentities.StorageDomain sourceDomain = getImageSourceDomain ( parameters.getImageId ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain destDomain = getStorageDomainById ( parameters.getTargetStorageDomainId ( ) , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePoolId ( ) ) ; return ( ( validateSourceStorageDomain ( sourceDomain ) ) && ( validateDestStorage ( destDomain ) ) ) && ( validateDestStorageAndSourceStorageOfSameTypes ( destDomain , sourceDomain ) ) ; }

Target:
private boolean performStorageDomainsChecks ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters ) { org.ovirt.engine.core.common.businessentities.StorageDomain sourceDomain = getImageSourceDomain ( parameters.getImageId ( ) ) ; org.ovirt.engine.core.common.businessentities.StorageDomain destDomain = getStorageDomainById ( parameters.getTargetStorageDomainId ( ) , org.ovirt.engine.core.bll.lsm.LiveMigrateVmDisksCommand.getStoragePoolId ( ) ) ; return ( ( validateSourceStorageDomain ( sourceDomain ) ) && ( validateDestStorage ( destDomain ) ) ) && ( ( liveStorageMigrationSupportedBetweenDifferentStorageTypes ( ) ) || ( validateDestStorageAndSourceStorageOfSameTypes ( destDomain , sourceDomain ) ) ) ; }
Source:
public void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc glusterVolumeSnapshotConfigGet ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterSnapshot.configList" ) . withOptionalParameter ( "volumeName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc ( clusterId , response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotConfigSet ( java.lang.String volumeName , java.lang.String configName , java.lang.String configValue ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.snapshotConfigSet" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "optionName" , configName ) . withParameter ( "optionValue" , configValue ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.VdsIdParametersBase parameters = new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
public javax.ws.rs.core.Response remove ( java.lang.String id , org.ovirt.engine.api.model.Host host ) { if ( host != null ) { this . host = host ; } return super . remove ( id ) ; }

Target:
public javax.ws.rs.core.Response remove ( java.lang.String id , org.ovirt.engine.api.model.Action action ) { getEntity ( id ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setid ( id ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( ( action != null ) && ( action.isSetHost ( ) ) ) { hostId = getHostId ( action.getHost ( ) ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }
Source:
private void add ( ) { if ( ( getWindow ( ) ) != null ) { return ; } setWindow ( new org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel ( this ) ) ; }

Target:
private void updateActionAvailability ( ) { java.util.List tempVar = getSelectedItems ( ) ; java.util.List selectedItems = ( tempVar != null ) ? tempVar : new java.util.ArrayList ( ) ; getEditCommand ( ) . setIsExecutionAllowed ( ( ( selectedItems.size ( ) ) == 1 ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( selectedItems.size ( ) ) > 0 ) ) ; }
Source:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getRoleList ( 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Tag tag ) { validateParameters ( tag , "name" ) ; if ( isSetParentName ( tag ) ) { tag.getParent ( ) . getTag ( ) . setId ( getParentId ( tag ) ) ; } return performCreation ( VdcActionType.AddTag , new org.ovirt.engine.core.common.action.TagsOperationParameters ( map ( tag ) ) , new org.ovirt.engine.api.restapi.resource.BackendTagsResource.TagNameResolver ( tag.getName ( ) ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Tag tag ) { validateParameters ( tag , "name" ) ; if ( isSetParentName ( tag ) ) { tag.getParent ( ) . getTag ( ) . setId ( getParentId ( tag ) ) ; } return performCreate ( VdcActionType.AddTag , new org.ovirt.engine.core.common.action.TagsOperationParameters ( map ( tag ) ) , new org.ovirt.engine.api.restapi.resource.BackendTagsResource.TagNameResolver ( tag.getName ( ) ) ) ; }
Source:
protected void initUser ( ) { if ( ( org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUser ( ) ) == null ) { setDbUser ( org.ovirt.engine.core.bll.UserCommandBase.initUser ( org.ovirt.engine.core.bll.VmPoolUserCommandBase.getParameters ( ) . getSessionId ( ) , org.ovirt.engine.core.bll.VmPoolUserCommandBase.getParameters ( ) . getUser ( ) . getDomain ( ) , org.ovirt.engine.core.bll.VmPoolUserCommandBase.getParameters ( ) . getUser ( ) . getId ( ) ) ) ; } }

Target:
protected void initUser ( ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUser ( ) ; if ( ( user != null ) && ( ( user.getId ( ) ) == null ) ) { user.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.VmPoolUserCommandBase.getDbUserDAO ( ) . save ( user ) ; } }
Source:
public void SetDefaultNames2 ( ) { org.ovirt.engine.core.common.businessentities.VDS host = context.host ; if ( ( host.getVdsGroupId ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetClusterById ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.hostCluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; SetDefaultNames3 ( ) ; } } , frontendHash ) , host.getVdsGroupId ( ) ) ; } else { SetDefaultNames3 ( ) ; } }

Target:
public void setDefaultNames2 ( ) { org.ovirt.engine.core.common.businessentities.VDS host = context.host ; if ( ( host.getVdsGroupId ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterById ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { context.hostCluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; setDefaultNames3 ( ) ; } } , frontendHash ) , host.getVdsGroupId ( ) ) ; } else { setDefaultNames3 ( ) ; } }
Source:
public void deleteCompletedJobs ( java.util.Date succeededJobs , java.util.Date failedJobs ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "succeeded_end_time" , succeededJobs ) . addValue ( "failed_end_time" , failedJobs ) ; getCallsHandler ( ) . executeModification ( "DeleteCompletedJobsOlderThanDate" , parameterSource ) ; }

Target:
public void deleteCompletedJobs ( final java.util.Date succeededJobs , final java.util.Date failedJobs ) { updateQuery ( entityManager.createNamedQuery ( "Job.deleteCompletedJobs" ) . setParameter ( "successEndTime" , succeededJobs ) . setParameter ( "failedEndTime" , failedJobs ) . setParameter ( "failStatus" , java.util.EnumSet.of ( JobExecutionStatus.FAILED , JobExecutionStatus.ABORTED , JobExecutionStatus.UNKNOWN ) ) . setParameter ( "successStatus" , JobExecutionStatus.FINISHED ) ) ; }
Source:
private void mockGetImageDomainsListVdsCommand ( ) { java.util.ArrayList < org.ovirt.engine.core.compat.Guid > guids = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( 1 ) ; guids.add ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; returnValue.setReturnValue ( guids ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetImageDomainsList ) , org.mockito.Matchers.< org.ovirt.engine.core.common.vdscommands.VDSParametersBase > any ( org.ovirt.engine.core.common.vdscommands.VDSParametersBase.class ) ) ) . thenReturn ( returnValue ) ; }

Target:
private void mockVdsGroupDAOReturnVdsGroup ( ) { org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.< org.ovirt.engine.core.compat.Guid > any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( createVdsGroup ( ) ) ; }
Source:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.StorageDomainDynamic mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic entity = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; entity.setAvailableDiskSize ( ( ( java.lang.Integer ) ( rs.getObject ( "available_disk_size" ) ) ) ) ; entity.setId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "id" ) ) ) ; entity.setUsedDiskSize ( ( ( java.lang.Integer ) ( rs.getObject ( "used_disk_size" ) ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.StorageDomainDynamic mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic entity = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; entity.setAvailableDiskSize ( ( ( java.lang.Integer ) ( rs.getObject ( "available_disk_size" ) ) ) ) ; entity.setId ( getGuidDefaultEmpty ( rs , "id" ) ) ; entity.setUsedDiskSize ( ( ( java.lang.Integer ) ( rs.getObject ( "used_disk_size" ) ) ) ) ; return entity ; }
Source:
protected void RemoveSnapshotFromDB ( org.ovirt.engine.core.common.businessentities.DiskImage snapshot ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesForDisk = getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }

Target:
protected void RemoveSnapshot ( org.ovirt.engine.core.common.businessentities.DiskImage snapshot ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . remove ( snapshot.getImageId ( ) ) ; getImageDao ( ) . remove ( snapshot.getImageId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesForDisk = getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( snapshot.getId ( ) ) ; if ( ( imagesForDisk == null ) || ( imagesForDisk.isEmpty ( ) ) ) { getBaseDiskDao ( ) . remove ( snapshot.getId ( ) ) ; } }
Source:
private void Alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String reason ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getTargetVdsID ( ) ) ; alert.AddCustomValue ( "Reason" , reason ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.Alert ( alert , logType ) ; }

Target:
private void Alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String reason ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getTargetVdsID ( ) ) ; alert.addCustomValue ( "Reason" , reason ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.Alert ( alert , logType ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlan ( java.lang.String baseIfaceName , int vlanId , java.lang.String networkName ) { return createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , ( ( baseIfaceName + "." ) + vlanId ) , false , null , baseIfaceName , vlanId , networkName , true , null , false , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createVlan ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseNic , int vlanId , java.lang.String networkName ) { java.lang.String baseIfaceName = baseNic.getName ( ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , ( ( baseIfaceName + "." ) + vlanId ) , false , null , baseIfaceName , vlanId , networkName , true , null , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; mockCalculateBaseNicWhenVlanNicIsPassed ( baseNic , nic ) ; return nic ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.VM > getAllUsingQuery ( java.lang.String query ) { return new org.springframework.jdbc.core.simple.SimpleJdbcTemplate ( jdbcTemplate ) . query ( query , org.ovirt.engine.core.dao.VmDAODbFacadeImpl.VMRowMapper.instance ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VM getByNameForDataCenter ( org.ovirt.engine.core.compat.Guid dataCenterId , java.lang.String name , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { return getCallsHandler ( ) . executeRead ( "GetVmByVmNameForDataCenter" , org.ovirt.engine.core.dao.VmDAODbFacadeImpl.VMRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "data_center_id" , dataCenterId ) . addValue ( "vm_name" , name ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ) ; }
Source:
public void testMemoryMapping ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( Guid.Empty ) ; vds.setPhysicalMemMb ( 4000 ) ; org.ovirt.engine.api.model.Host host = org.ovirt.engine.api.restapi.types.HostMapper.map ( vds , ( ( org.ovirt.engine.api.model.Host ) ( null ) ) ) ; org.junit.Assert.assertNotNull ( host.getMemory ( ) ) ; org.junit.Assert.assertEquals ( java.lang.Long.valueOf ( 4194304000L ) , host.getMemory ( ) ) ; }

Target:
public void testMemoryMapping ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( Guid.Empty ) ; vds.setPhysicalMemMb ( 4000 ) ; org.ovirt.engine.api.model.Host host = org.ovirt.engine.api.restapi.types.HostMapper.map ( vds , ( ( org.ovirt.engine.api.model.Host ) ( null ) ) ) ; org.junit.jupiter.api.Assertions.assertNotNull ( host.getMemory ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( java.lang.Long.valueOf ( 4194304000L ) , host.getMemory ( ) ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { if ( ( acceptEmptyInput ) && ( ( value == null ) || ( ( value instanceof java.lang.String ) && ( value.equals ( "" ) ) ) ) ) { return new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; } return super . validate ( ( value instanceof java.lang.String ? ( ( java.lang.String ) ( value ) ) . trim ( ) : value ) ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { if ( ( acceptEmptyInput ) && ( ( value == null ) || ( ( value instanceof java.lang.String ) && ( value.equals ( org.ovirt.engine.ui.uicommonweb.validation.EMPTY_STRING ) ) ) ) ) { return new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; } return super . validate ( ( value instanceof java.lang.String ? ( ( java.lang.String ) ( value ) ) . trim ( ) : value ) ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterVmListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getImportCommand ( ) ) ) { return registerEntityPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterTemplateListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getImportCommand ( ) ) ) { return registerEntityPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
private void doTestIpConfiguredForStaticBootProtocol ( java.lang.String address , java.lang.String netmask ) { org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_ADDR_MANDATORY_IN_STATIC_IP ) ; doTestIpConfiguredForStaticBootProtocol ( address , netmask , matcher ) ; }

Target:
public void testNetworkExistWhenBothNetworkNameAndNetworkIdAreSet ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkName ( "network" ) ; networkAttachment.setNetworkId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( networkAttachment ) . networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }