auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean validateAttachment ( ) { final org.ovirt.engine.core.bll.network.cluster.UpdateNetworkClusterValidator networkClusterValidator = createNetworkClusterValidator ( ) ; return ( ( validate ( networkClusterValidator.managementNetworkUnset ( ) ) ) && ( validate ( networkClusterValidator.glusterNetworkInUseAndUnset ( org.ovirt.engine.core.bll.network.cluster.UpdateNetworkOnClusterCommand.getVdsGroup ( ) ) ) ) ) && ( validateAttachment ( networkClusterValidator ) ) ; }

Target:
private boolean validateAttachment ( ) { final org.ovirt.engine.core.bll.network.cluster.UpdateNetworkClusterValidator networkClusterValidator = createNetworkClusterValidator ( ) ; return ( ( validate ( networkClusterValidator.managementNetworkUnset ( ) ) ) && ( validate ( networkClusterValidator.glusterNetworkInUseAndUnset ( org.ovirt.engine.core.bll.network.cluster.UpdateNetworkOnClusterCommand.getCluster ( ) ) ) ) ) && ( validateAttachment ( networkClusterValidator ) ) ; }
Source:
private void fillVolumeInformation ( org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.common.businessentities.DiskImage ancestor = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImageDao ( ) . getAncestor ( org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) . getImageId ( ) ) ; if ( ancestor == null ) { log.warnFormat ( "Can't find ancestor of Disk with ID {0}, using original disk for volume info." , org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) . getImageId ( ) ) ; ancestor = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) ; } disk.setvolumeFormat ( ancestor.getVolumeFormat ( ) ) ; disk.setVolumeType ( ancestor.getVolumeType ( ) ) ; }

Target:
private void fillVolumeInformation ( org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.common.businessentities.DiskImage ancestor = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImageDao ( ) . getAncestor ( org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) . getImageId ( ) ) ; if ( ancestor == null ) { log.warn ( "Can't find ancestor of Disk with ID '{}', using original disk for volume info." , org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) . getImageId ( ) ) ; ancestor = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) ; } disk.setvolumeFormat ( ancestor.getVolumeFormat ( ) ) ; disk.setVolumeType ( ancestor.getVolumeType ( ) ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun ) { return createIdParameterMapper ( lun.getId ( ) ) . addValue ( "physical_volume_id" , lun.getphysical_volume_id ( ) ) . addValue ( "volume_group_id" , lun.getvolume_group_id ( ) ) . addValue ( "serial" , lun.getSerial ( ) ) . addValue ( "lun_mapping" , lun.getLunMapping ( ) ) . addValue ( "vendor_id" , lun.getVendorId ( ) ) . addValue ( "product_id" , lun.getProductId ( ) ) . addValue ( "device_size" , lun.getDeviceSize ( ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun ) { return createIdParameterMapper ( lun.getId ( ) ) . addValue ( "physical_volume_id" , lun.getPhysicalVolumeId ( ) ) . addValue ( "volume_group_id" , lun.getVolumeGroupId ( ) ) . addValue ( "serial" , lun.getSerial ( ) ) . addValue ( "lun_mapping" , lun.getLunMapping ( ) ) . addValue ( "vendor_id" , lun.getVendorId ( ) ) . addValue ( "product_id" , lun.getProductId ( ) ) . addValue ( "device_size" , lun.getDeviceSize ( ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc list ( java.lang.String mode , java.lang.String [ ] vmIds ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.list ( mode , vmIds ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc remove_image_ticket ( java.lang.String ticketId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.remove_image_ticket ( ticketId ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( getStoragePool ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . remove ( getStoragePool ( ) . getId ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForDataCenter ( getStoragePoolId ( ) . getValue ( ) ) ; for ( final org.ovirt.engine.core.common.businessentities.Network net : networks ) { getCompensationContext ( ) . snapshotEntity ( net ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . remove ( net.getId ( ) ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
protected void updateQuota ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { if ( isDiskImage ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage oldDisk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getOldDisk ( ) ) ) ; if ( ! ( java.util.Objects.equals ( oldDisk.getQuotaId ( ) , diskImage.getQuotaId ( ) ) ) ) { org.ovirt.engine.core.bll.UpdateVmDiskCommand.getImageStorageDomainMapDao ( ) . updateQuotaForImageAndSnapshots ( diskImage.getId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getQuotaId ( ) ) ; } } }

Target:
protected void updateQuota ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { if ( isInternalManagedDisk ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage oldDisk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( getOldDisk ( ) ) ) ; if ( ! ( java.util.Objects.equals ( oldDisk.getQuotaId ( ) , diskImage.getQuotaId ( ) ) ) ) { org.ovirt.engine.core.bll.UpdateVmDiskCommand.getImageStorageDomainMapDao ( ) . updateQuotaForImageAndSnapshots ( diskImage.getId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getQuotaId ( ) ) ; } } }
Source:
public void getAuthzGroupsByUserId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAuthzGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void getIrsImageList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean forceRefresh , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageFileType ) { getIrsImageList ( aQuery , storagePoolId , forceRefresh , imageFileType , new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.RepoImageToImageFileNameAsyncConverter ( ) ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . canDoAction ( ) ) ) { return false ; } boolean isVolumeDistributed = glusterVolume.getVolumeType ( ) . isDistributedType ( ) ; if ( ! isVolumeDistributed ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NOT_DISTRIBUTED ) ; } else if ( ( glusterVolume.getBricks ( ) . size ( ) ) == 1 ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_DISTRIBUTED_AND_HAS_SINGLE_BRICK ) ; } org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator brickValidator = new org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator ( ) ; return validate ( brickValidator.canRebalance ( glusterVolume ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity glusterVolume = getGlusterVolume ( ) ; if ( ! ( super . validate ( ) ) ) { return false ; } boolean isVolumeDistributed = glusterVolume.getVolumeType ( ) . isDistributedType ( ) ; if ( ! isVolumeDistributed ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_NOT_DISTRIBUTED ) ; } else if ( ( glusterVolume.getBricks ( ) . size ( ) ) == 1 ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_DISTRIBUTED_AND_HAS_SINGLE_BRICK ) ; } org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator brickValidator = new org.ovirt.engine.core.bll.validator.gluster.GlusterBrickValidator ( ) ; return validate ( brickValidator.canRebalance ( glusterVolume ) ) ; }
Source:
private boolean CanFindAnyVds ( java.util.List < java.lang.String > messages , boolean isMigrate ) { return CanFindVdsToRun ( messages , isMigrate , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDAO ( ) . getAllOfTypes ( new org.ovirt.engine.core.common.businessentities.VDSType [ ] { org.ovirt.engine.core.common.businessentities.VDSType.VDS , org.ovirt.engine.core.common.businessentities.VDSType.oVirtNode } ) ) ; }

Target:
private boolean CanFindAnyVds ( java.util.List < java.lang.String > messages , boolean isMigrate ) { return CanFindVdsToRun ( messages , isMigrate , getVdsDAO ( ) . getVdsToRun ( new org.ovirt.engine.core.common.businessentities.VDSType [ ] { org.ovirt.engine.core.common.businessentities.VDSType.VDS , org.ovirt.engine.core.common.businessentities.VDSType.oVirtNode } , getVm ( ) . getvds_group_id ( ) , VDSStatus.Up , getVm ( ) . getnum_of_cpus ( ) ) ) ; }
Source:
private java.lang.String getSubResourceName ( java.lang.String collectionName , java.lang.String parent , java.lang.String [ ] periods , int i ) { java.lang.String resource = org.ovirt.engine.sdk.codegen.utils.StringUtils.toSingular ( collectionName ) ; java.lang.String resourceCandidate = getPublicEntity ( org.ovirt.engine.sdk.codegen.utils.StringUtils.toSingular ( collectionName.replace ( parent , "" ) . toLowerCase ( ) ) , periods , i , false ) ; if ( resourceCandidate != null ) { resource = parent + resourceCandidate ; } return resource ; }

Target:
private void addSubCollection ( org.ovirt.engine.sdk.codegen.utils.Tree < org.ovirt.engine.sdk.codegen.rsdl.Location > collectionTree ) { java.lang.String className = org.ovirt.engine.sdk.codegen.rsdl.BrokerRules.getBrokerType ( collectionTree ) ; java.lang.String classCode = new org.ovirt.engine.sdk.codegen.templates.SubCollectionTemplate ( ) . evaluate ( collectionTree ) ; code.put ( className , classCode ) ; }
Source:
protected void RemoveVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.tags_vm_map > all = getTagDAO ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.tags_vm_map tagVm : all ) { getTagDAO ( ) . detachVmFromTag ( tagVm.gettag_id ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }

Target:
protected void removeVmUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.tags_vm_map > all = getTagDAO ( ) . getTagVmMapByVmIdAndDefaultTag ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.tags_vm_map tagVm : all ) { getTagDAO ( ) . detachVmFromTag ( tagVm.gettag_id ( ) , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } }
Source:
private void addTypeColumn ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addColumn ( new org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn ( ) , constants.empty ( ) , "30px" ) ; }

Target:
private void addUserColumn ( ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Permission > userColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Permission > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Permission object ) { return object.getOwnerName ( ) ; } } ; userColumn.makeSortable ( ) ; org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addColumn ( userColumn , org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants.userPermission ( ) , "300px" ) ; }
Source:
private void reduceDomain ( ) { org.ovirt.engine.core.common.action.ReduceStorageDomainCommandParameters p = new org.ovirt.engine.core.common.action.ReduceStorageDomainCommandParameters ( org.ovirt.engine.core.bll.storage.domain.RemoveDeviceFromSANStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.domain.RemoveDeviceFromSANStorageDomainCommand.getParameters ( ) . getDeviceId ( ) ) ; p.setParentCommand ( org.ovirt.engine.core.bll.storage.domain.RemoveDeviceFromSANStorageDomainCommand.getActionType ( ) ) ; p.setParentParameters ( org.ovirt.engine.core.bll.storage.domain.RemoveDeviceFromSANStorageDomainCommand.getParameters ( ) ) ; p.setStoragePoolId ( org.ovirt.engine.core.bll.storage.domain.RemoveDeviceFromSANStorageDomainCommand.getStoragePoolId ( ) ) ; p.setVdsRunningOn ( org.ovirt.engine.core.bll.storage.domain.RemoveDeviceFromSANStorageDomainCommand.getParameters ( ) . getVdsId ( ) ) ; p.setEndProcedure ( EndProcedure.COMMAND_MANAGED ) ; runInternalAction ( VdcActionType.ReduceStorageDomain , p , null ) ; }

Target:
private void reduceDomain ( ) { org.ovirt.engine.core.common.action.ReduceStorageDomainCommandParameters p = new org.ovirt.engine.core.common.action.ReduceStorageDomainCommandParameters ( org.ovirt.engine.core.bll.storage.domain.RemoveDeviceFromSANStorageDomainCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.domain.RemoveDeviceFromSANStorageDomainCommand.getParameters ( ) . getDeviceId ( ) ) ; p.setParentCommand ( org.ovirt.engine.core.bll.storage.domain.RemoveDeviceFromSANStorageDomainCommand.getActionType ( ) ) ; p.setParentParameters ( org.ovirt.engine.core.bll.storage.domain.RemoveDeviceFromSANStorageDomainCommand.getParameters ( ) ) ; p.setStoragePoolId ( org.ovirt.engine.core.bll.storage.domain.RemoveDeviceFromSANStorageDomainCommand.getStoragePoolId ( ) ) ; p.setVdsRunningOn ( org.ovirt.engine.core.bll.storage.domain.RemoveDeviceFromSANStorageDomainCommand.getParameters ( ) . getVdsId ( ) ) ; p.setEndProcedure ( EndProcedure.COMMAND_MANAGED ) ; runInternalAction ( ActionType.ReduceStorageDomain , p , null ) ; }
Source:
public void testValidRemovedBonds_whenNotRemovingAnyBond ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Bond > emptyList ( ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , params , null , null , null ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testValidRemovedBondsWhenNotRemovingAnyBond ( ) throws java.lang.Exception { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.compat.Guid > emptySet ( ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( params , null ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.context.CommandContext createStepsContext ( org.ovirt.engine.core.common.job.StepEnum step ) { org.ovirt.engine.core.common.job.Step addedStep = org.ovirt.engine.core.bll.job.ExecutionHandler.addSubStep ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getExecutionContext ( ) . getJob ( ) . getStep ( StepEnum.EXECUTING ) , step , org.ovirt.engine.core.dal.job.ExecutionMessageDirector.resolveStepMessage ( step , java.util.Collections.emptyMap ( ) ) ) ; org.ovirt.engine.core.bll.job.ExecutionContext ctx = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; ctx.setStep ( addedStep ) ; ctx.setMonitored ( true ) ; org.ovirt.engine.core.bll.context.CommandContext commandCtx = org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getContext ( ) , null ) . withExecutionContext ( ctx ) ; return commandCtx ; }

Target:
private org.ovirt.engine.core.bll.context.CommandContext createStepsContext ( org.ovirt.engine.core.common.job.StepEnum step ) { org.ovirt.engine.core.common.job.Step addedStep = executionHandler.addSubStep ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getExecutionContext ( ) , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getExecutionContext ( ) . getJob ( ) . getStep ( StepEnum.EXECUTING ) , step , org.ovirt.engine.core.dal.job.ExecutionMessageDirector.resolveStepMessage ( step , java.util.Collections.emptyMap ( ) ) ) ; org.ovirt.engine.core.bll.job.ExecutionContext ctx = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; ctx.setStep ( addedStep ) ; ctx.setMonitored ( true ) ; org.ovirt.engine.core.bll.context.CommandContext commandCtx = org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.storage.lsm.LiveMigrateDiskCommand.getContext ( ) , null ) . withExecutionContext ( ctx ) ; return commandCtx ; }
Source:
public static void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }

Target:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListAsyncConverter ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
protected void initProviderList ( ) { startProgress ( null ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetAllProviders ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.filterNetworkProviders ( ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) ) ) ; providers.add ( 0 , null ) ; getProviders ( ) . setItems ( providers ) ; } } ) ) ; }

Target:
protected void initProviderList ( ) { startProgress ( null ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getAllNetworkProviders ( 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 ) { stopProgress ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) ; providers.add ( 0 , null ) ; getProviders ( ) . setItems ( providers ) ; } } ) ) ; }
Source:
public static void registerRollbackHandler ( final org.ovirt.engine.core.utils.transaction.RollbackHandler rollbackHandler ) { try { org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) . registerSynchronization ( new org.ovirt.engine.core.utils.transaction.Synchronization ( ) { @ java.lang.Override public void beforeCompletion ( ) { } @ java.lang.Override public void afterCompletion ( int status ) { if ( ! ( org.ovirt.engine.core.utils.transaction.TransactionSupport.needToRollback ( status ) ) ) return ; rollbackHandler.rollback ( ) ; } } ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( "Unable to register synchronization to current transaction" , e ) ; } }

Target:
public static void registerRollbackHandler ( final org.ovirt.engine.core.utils.transaction.RollbackHandler rollbackHandler ) { try { org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) . registerSynchronization ( new javax.transaction.Synchronization ( ) { @ java.lang.Override public void beforeCompletion ( ) { } @ java.lang.Override public void afterCompletion ( int status ) { if ( ! ( org.ovirt.engine.core.utils.transaction.TransactionSupport.needToRollback ( status ) ) ) return ; rollbackHandler.rollback ( ) ; } } ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( "Unable to register synchronization to current transaction" , e ) ; } }
Source:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }

Target:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
public static java.lang.String resource ( java.lang.String xmlEntity , java.lang.String [ ] subCollections , java.util.Map < java.lang.String , java.lang.String > knownWrapperTypes ) { java.lang.String actualXmlEntity = knownWrapperTypes.get ( xmlEntity.toLowerCase ( ) ) ; org.ovirt.engine.sdk.generator.rsdl.templates.ResourceTemplate template = new org.ovirt.engine.sdk.generator.rsdl.templates.ResourceTemplate ( ) ; template.set ( "sub_collections" , subCollections ) ; template.set ( "fixme" , org.ovirt.engine.sdk.generator.rsdl.Resource.SUB_COLLECTIONS_FIXME ) ; template.set ( "xml_entity" , ( actualXmlEntity != null ? actualXmlEntity : xmlEntity ) ) ; return template.evaluate ( ) ; }

Target:
public static java.lang.String resource ( org.ovirt.engine.sdk.generator.utils.Tree < org.ovirt.engine.sdk.generator.rsdl.Location > entityTree ) { java.lang.String entityType = org.ovirt.engine.sdk.generator.rsdl.SchemaRules.getSchemaType ( entityTree ) ; java.lang.String brokerType = org.ovirt.engine.sdk.generator.rsdl.BrokerRules.getBrokerType ( entityTree ) ; java.lang.String superClassParameterName = entityType.toLowerCase ( ) . replace ( "_" , "" ) ; org.ovirt.engine.sdk.generator.rsdl.templates.ResourceTemplate template = new org.ovirt.engine.sdk.generator.rsdl.templates.ResourceTemplate ( ) ; template.set ( "entity_type" , entityType ) ; template.set ( "broker_type" , brokerType ) ; template.set ( "superclass_parameter_name" , superClassParameterName ) ; return template.evaluate ( ) ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.MigrateModel object ) { org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.Driver.driver.edit ( object ) ; updateMessages ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { if ( args instanceof org.ovirt.engine.core.compat.PropertyChangedEventArgs ) { updateMessages ( object ) ; } } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.MigrateModel object ) { org.ovirt.engine.ui.webadmin.section.main.view.popup.vm.VmMigratePopupView.Driver.driver.edit ( object ) ; updateMessages ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( args instanceof org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) { updateMessages ( object ) ; } } } ) ; }
Source:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void validateSpaceNotEnough ( ) { 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 ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; mockGetAllSnapshots ( ) ; org.junit.Assert.assertFalse ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
public void validateSpaceNotEnough ( ) { 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 ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; mockGetAllSnapshots ( ) ; org.junit.jupiter.api.Assertions.assertFalse ( cmd.validateSpaceRequirements ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator ) . hasSpaceForClonedDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.verify ( storageDomainValidator , org.mockito.Mockito.never ( ) ) . hasSpaceForNewDisks ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
protected void endVmCommand ( ) { try { if ( org.ovirt.engine.core.bll.RemoveVmCommand.acquireLock ( ) ) { setVm ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ; if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) != null ) { processUnremovedDisks ( true ) ; removeVmFromDb ( ) ; } } org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( true ) ; } finally { org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; } }

Target:
protected void endVmCommand ( ) { org.ovirt.engine.core.bll.RemoveVmCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( true ) ; }
Source:
protected static org.ovirt.engine.core.compat.Guid getPrestartedVmToAttach ( org.ovirt.engine.core.compat.NGuid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.vm_pool_map > vmPoolMaps = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDAO ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Up ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.vm_pool_map map : vmPoolMaps ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.CanAttachPrestartedVmToUser ( map.getvm_guid ( ) ) ) { return map.getvm_guid ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
protected static org.ovirt.engine.core.compat.Guid getPrestartedVmToAttach ( org.ovirt.engine.core.compat.NGuid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.vm_pool_map > vmPoolMaps = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDAO ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Up ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.vm_pool_map map : vmPoolMaps ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachPrestartedVmToUser ( map.getvm_guid ( ) ) ) { return map.getvm_guid ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }
Source:
protected void verify ( org.ovirt.engine.api.model.Job model , org.ovirt.engine.api.model.Job transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.Assert.assertEquals ( model.getDescription ( ) , transform.getDescription ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.Job model , org.ovirt.engine.api.model.Job transform ) { org.junit.jupiter.api.Assertions.assertNotNull ( transform ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getDescription ( ) , transform.getDescription ( ) ) ; }
Source:
public void updateClusterEnabled ( ) { boolean importAsTemplate = getImportAsTemplate ( ) . getEntity ( ) ; getCluster ( ) . setIsAvailable ( importAsTemplate ) ; getCluster ( ) . setIsChangeable ( ( ! ( getCluster ( ) . getIsEmpty ( ) ) ) ) ; }

Target:
public void updateClusterEnabled ( ) { boolean importAsTemplate = getImportAsTemplate ( ) . getEntity ( ) ; getCluster ( ) . setIsAvailable ( importAsTemplate ) ; getCluster ( ) . setIsChangeable ( ( ! ( getCluster ( ) . getIsEmpty ( ) ) ) ) ; getTemplateName ( ) . setIsAvailable ( importAsTemplate ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; }

Target:
public static void getMaxNumOfCPUsPerSocket ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
private java.util.Map < java.lang.String , java.lang.Object > generateNetworks ( ) { java.util.Map < java.lang.String , java.lang.Object > networks = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.vdscommands.HostNetwork hostNetwork : org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.getParameters ( ) . getNetworks ( ) ) { networks.put ( hostNetwork.getNetworkName ( ) , createNetworkAttributes ( hostNetwork ) ) ; } for ( java.lang.String net : org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.getParameters ( ) . getRemovedNetworks ( ) ) { networks.put ( net , org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.REMOVE_OBJ ) ; } return networks ; }

Target:
private java.util.Map < java.lang.String , java.lang.Object > generateNetworks ( ) { java.util.Map < java.lang.String , java.lang.Object > networks = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.vdscommands.HostNetwork hostNetwork : org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.getParameters ( ) . getNetworks ( ) ) { networks.put ( hostNetwork.getVdsmName ( ) , createNetworkAttributes ( hostNetwork ) ) ; } for ( java.lang.String net : org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.getParameters ( ) . getRemovedNetworks ( ) ) { networks.put ( net , org.ovirt.engine.core.vdsbroker.vdsbroker.HostSetupNetworksVDSCommand.REMOVE_OBJ ) ; } return networks ; }
Source:
public void testGetClustersByServiceAndCompatibilityVersion ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = dao.getClustersByServiceAndCompatibilityVersion ( true , false , "2.3" ) ; org.junit.Assert.assertNotNull ( clusters ) ; org.junit.Assert.assertEquals ( 1 , clusters.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.GLUSTER_CLUSTER_ID , clusters.get ( 0 ) . getId ( ) ) ; }

Target:
public void testGetClustersByServiceAndCompatibilityVersion ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters = dao.getClustersByServiceAndCompatibilityVersion ( true , false , "2.3" ) ; org.junit.jupiter.api.Assertions.assertNotNull ( clusters ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , clusters.size ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.GLUSTER_CLUSTER_ID , clusters.get ( 0 ) . getId ( ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getParameters ( ) . getVdsId ( ) ) ; params.getNetworkAttachments ( ) . add ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.HostSetupNetworks , params ) ; org.ovirt.engine.core.compat.Guid createdAttachmentId = resolveCreatedAttachmentId ( ) ; org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getReturnValue ( ) . setActionReturnValue ( createdAttachmentId ) ; propagateFailure ( returnValue ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleter completer = new org.ovirt.engine.core.bll.network.host.NicNameNicIdCompleter ( getHostInterfaces ( ) ) ; completer.completeNetworkAttachment ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ) ; this . networkIdNameCompleter.completeNetworkAttachment ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ; if ( networkAttachment == null ) { return failCanDoAction ( EngineMessage.NETWORK_ATTACHMENT_NOT_SPECIFIED ) ; } if ( ( networkAttachment.getId ( ) ) != null ) { return failCanDoAction ( EngineMessage.NETWORK_ATTACHMENT_CANNOT_BE_CREATED_WITH_SPECIFIC_ID ) ; } return true ; }
Source:
public void testRemoveForced ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendTemplateDiskResource.FORCE , java.lang.Boolean.TRUE.toString ( ) ) ; setUriInfo ( uriInfo ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemoveForced ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( ActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendTemplateDiskResource.FORCE , java.lang.Boolean.TRUE.toString ( ) ) ; setUriInfo ( uriInfo ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void checkClear ( ) { org.junit.Assert.assertTrue ( org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLock ( lockLock1 ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLock ( lockLock2 ) ) ; org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . clear ( ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLock ( lockLock1 ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLock ( lockLock2 ) ) ; org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . clear ( ) ; }

Target:
public void checkShowLocks ( ) { org.junit.Assert.assertTrue ( org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLock ( lockLock1 ) . getFirst ( ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLock ( lockLock2 ) . getFirst ( ) ) ; org.junit.Assert.assertTrue ( ( ( lockMager.showAllLocks ( ) . size ( ) ) == 2 ) ) ; org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . clear ( ) ; org.junit.Assert.assertTrue ( lockMager.showAllLocks ( ) . isEmpty ( ) ) ; }
Source:
public void testGetAllUsersWithPermissionsOnEntity ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > result = dao.getAllForEntity ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 2 , result.size ( ) ) ; org.ovirt.engine.core.dao.PermissionDAOTest.assertGetAllForEntityResult ( result ) ; }

Target:
public void testGetAllUsersWithPermissionsOnEntity ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > result = dao.getAllForEntity ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , org.ovirt.engine.core.dao.PRIVILEGED_USER_SESSION_ID , true , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( 2 , result.size ( ) ) ; org.ovirt.engine.core.dao.PermissionDAOTest.assertGetAllForEntityResult ( result ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult changeProtocolAllowed ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.VDS_STATUS_NOT_VALID_FOR_UPDATE ) . when ( ( ( ( ( getHost ( ) . getProtocol ( ) ) != ( oldHost.getProtocol ( ) ) ) && ( ( oldHost.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) ) && ( ( oldHost.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallingOS ) ) ) ) ; }

Target:
protected boolean isUpdateValid ( ) { return vdsHandler.isUpdateValid ( getHost ( ) . getStaticData ( ) , oldHost.getStaticData ( ) , oldHost.getStatus ( ) ) ; }
Source:
private void InitVdsBroker ( ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.infoFormat ( "vdsBroker({0},{1})" , _vds.gethost_name ( ) , _vds.getport ( ) ) ; int clientTimeOut = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.vdsTimeout ) ) * 1000 ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerConnector , org.apache.commons.httpclient.HttpClient > returnValue = org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcUtils.getConnection ( _vds.gethost_name ( ) , _vds.getport ( ) , clientTimeOut , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerConnector.class , org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.UseSecureConnectionWithServers ) ) ; _vdsProxy = new org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerWrapper ( returnValue.getFirst ( ) , returnValue.getSecond ( ) ) ; }

Target:
private void InitVdsBroker ( ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.infoFormat ( "Initialize vdsBroker ({0},{1})" , _vds.gethost_name ( ) , _vds.getport ( ) ) ; int clientTimeOut = ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.vdsTimeout ) ) * 1000 ; org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerConnector , org.apache.commons.httpclient.HttpClient > returnValue = org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcUtils.getConnection ( _vds.gethost_name ( ) , _vds.getport ( ) , clientTimeOut , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerConnector.class , org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.UseSecureConnectionWithServers ) ) ; _vdsProxy = new org.ovirt.engine.core.vdsbroker.vdsbroker.VdsServerWrapper ( returnValue.getFirst ( ) , returnValue.getSecond ( ) ) ; }
Source:
public boolean validateBrickCount ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType selectedVolumeType ) { int brickCount = 0 ; if ( ( bricks.getItems ( ) ) != null ) { brickCount = ( ( java.util.List < ? > ) ( getBricks ( ) . getItems ( ) ) ) . size ( ) ; } int replicaCount = getReplicaCountValue ( ) ; int stripeCount = getStripeCountValue ( ) ; return org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeBrickModel.validateBrickCount ( selectedVolumeType , brickCount , replicaCount , stripeCount ) ; }

Target:
public boolean validateBrickCount ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType selectedVolumeType , boolean isCreateVolume ) { int brickCount = 0 ; if ( ( bricks.getItems ( ) ) != null ) { brickCount = ( ( java.util.List < ? > ) ( getBricks ( ) . getItems ( ) ) ) . size ( ) ; } int replicaCount = getReplicaCountValue ( ) ; int stripeCount = getStripeCountValue ( ) ; return org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeBrickModel.validateBrickCount ( selectedVolumeType , brickCount , replicaCount , stripeCount , isCreateVolume ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validate ( java.util.concurrent.Callable < org.ovirt.engine.core.bll.ValidationResult > callable ) { try { return callable.call ( ) ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException e ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_CINDER , java.lang.String.format ( "$cinderException %1$s" , e.getMessage ( ) ) ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
private org.ovirt.engine.core.bll.ValidationResult validate ( java.util.concurrent.Callable < org.ovirt.engine.core.bll.ValidationResult > callable ) { try { return callable.call ( ) ; } catch ( com.woorea.openstack.base.client.OpenStackResponseException e ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_CINDER , java.lang.String.format ( "$cinderException %1$s" , e.getMessage ( ) ) ) ; } catch ( java.lang.Exception e ) { throw new java.lang.RuntimeException ( e ) ; } }
Source:
public org.ovirt.engine.ui.uicommonweb.models.userportal.ConsoleProtocol resolveSelectedProtocol ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { org.ovirt.engine.core.compat.Guid vmId = ( ( item.getEntity ( ) ) instanceof org.ovirt.engine.core.common.businessentities.VM ) ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item.getEntity ( ) ) ) . getId ( ) : null ; if ( vmId == null ) { return null ; } org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel selectedConsoleModel = resolveSelectedConsoleModel ( vmId ) ; return selectedConsoleModel == null ? null : org.ovirt.engine.ui.uicommonweb.models.userportal.ConsoleProtocol.getProtocolByModel ( selectedConsoleModel.getClass ( ) ) ; }

Target:
public org.ovirt.engine.ui.uicommonweb.models.ConsoleProtocol resolveSelectedProtocol ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel item ) { return consoleModelsCache.resolveSelectedProtocol ( item ) ; }