auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void runSingleQuery ( ) { org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters parameters = new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue value = backend.runInternalQuery ( VdcQueryType.GetAllRoles , parameters ) ; org.junit.Assert.assertTrue ( value.getSucceeded ( ) ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.roles > roles = ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.roles > ) ( value.getReturnValue ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.roles role : roles ) { java.lang.System.out.println ( role.getname ( ) ) ; } }

Target:
public void runSingleQuery ( ) { org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters parameters = new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue value = backend.runInternalQuery ( VdcQueryType.GetAllRoles , parameters ) ; org.junit.Assert.assertTrue ( value.getSucceeded ( ) ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.Role > roles = ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Role > ) ( value.getReturnValue ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Role role : roles ) { java.lang.System.out.println ( role.getname ( ) ) ; } }
Source:
protected void lockVmWithCompensationIfNeeded ( ) { log.info ( "Locking VM(id = '{}') compensation." , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) , ( org.ovirt.engine.core.bll.VmCommand.isInternalExecution ( ) ? "without" : "with" ) ) ; if ( org.ovirt.engine.core.bll.VmCommand.isInternalExecution ( ) ) { org.ovirt.engine.core.bll.VmHandler.checkStatusAndLockVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } else { org.ovirt.engine.core.bll.VmHandler.checkStatusAndLockVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) , org.ovirt.engine.core.bll.VmCommand.getCompensationContext ( ) ) ; } }

Target:
protected void lockVmWithCompensationIfNeeded ( ) { log.info ( "Locking VM(id = '{}') compensation." , org.ovirt.engine.core.bll.VmCommand.getVmId ( ) , ( org.ovirt.engine.core.bll.VmCommand.isInternalExecution ( ) ? "without" : "with" ) ) ; if ( org.ovirt.engine.core.bll.VmCommand.isInternalExecution ( ) ) { vmHandler.checkStatusAndLockVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) ) ; } else { vmHandler.checkStatusAndLockVm ( org.ovirt.engine.core.bll.VmCommand.getVmId ( ) , org.ovirt.engine.core.bll.VmCommand.getCompensationContext ( ) ) ; } }
Source:
public void update ( org.ovirt.engine.core.common.businessentities.Tags tag ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "description" , tag.getdescription ( ) ) . addValue ( "tag_id" , tag.gettag_id ( ) ) . addValue ( "tag_name" , tag.gettag_name ( ) ) . addValue ( "parent_id" , tag.getparent_id ( ) ) . addValue ( "readonly" , tag.getIsReadonly ( ) ) . addValue ( "type" , tag.gettype ( ) ) ; getCallsHandler ( ) . executeModification ( "Updatetags" , parameterSource ) ; }

Target:
public void update ( org.ovirt.engine.core.common.businessentities.Tags tag ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "description" , tag.getDescription ( ) ) . addValue ( "tag_id" , tag.getTagId ( ) ) . addValue ( "tag_name" , tag.getTagName ( ) ) . addValue ( "parent_id" , tag.getParentId ( ) ) . addValue ( "readonly" , tag.getIsReadonly ( ) ) . addValue ( "type" , tag.getType ( ) ) ; getCallsHandler ( ) . executeModification ( "Updatetags" , parameterSource ) ; }
Source:
private org.ovirt.engine.core.compat.Guid getHostId ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return storageDomain.getHost ( ) . isSetId ( ) ? new org.ovirt.engine.core.compat.Guid ( storageDomain.getHost ( ) . getId ( ) ) : storageDomain.getHost ( ) . isSetName ( ) ? getEntity ( org.ovirt.engine.core.common.businessentities.VdsStatic.class , VdcQueryType.GetVdsStaticByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomain.getHost ( ) . getName ( ) ) , ( "Hosts: name=" + ( storageDomain.getHost ( ) . getName ( ) ) ) ) . getId ( ) : null ; }

Target:
private org.ovirt.engine.core.compat.Guid getHostId ( org.ovirt.engine.api.model.StorageDomain storageDomain ) { return storageDomain.getHost ( ) . isSetId ( ) ? new org.ovirt.engine.core.compat.Guid ( storageDomain.getHost ( ) . getId ( ) ) : storageDomain.getHost ( ) . isSetName ( ) ? getEntity ( org.ovirt.engine.core.common.businessentities.VdsStatic.class , QueryType.GetVdsStaticByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomain.getHost ( ) . getName ( ) ) , ( "Hosts: name=" + ( storageDomain.getHost ( ) . getName ( ) ) ) ) . getId ( ) : null ; }
Source:
protected void executeCommand ( ) { try { addVmToDb ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; if ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.hasSnappableDisks ( vm ) ) ) { endVmRelatedOps ( ) ; } else { processImages ( ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { try { addVmToDb ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; if ( vm.getImages ( ) . isEmpty ( ) ) { endVmRelatedOps ( ) ; } else { processImages ( ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } setSucceeded ( true ) ; }
Source:
public int compare ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > o1 , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > o2 ) { return o1.getFirst ( ) . compareTo ( o2.getFirst ( ) ) ; }

Target:
public void updateAllDiskImageDynamicWithDiskIdByVmId ( java.util.Collection < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > > diskImageDynamicForVm ) { java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > > sortedDisks = new java.util.ArrayList < > ( ) ; sortedDisks.addAll ( diskImageDynamicForVm ) ; java.util.Collections.sort ( sortedDisks , new org.ovirt.engine.core.common.utils.PairFirstComparator ( new org.ovirt.engine.core.common.utils.NaturalOrderComparator ( ) ) ) ; getCallsHandler ( ) . executeStoredProcAsBatch ( "Updatedisk_image_dynamic_by_disk_id_and_vm_id" , sortedDisks , getBatchImageGroupMapper ( ) ) ; }
Source:
protected void selectDataCenterWithCluster ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.compat.Guid selectedCluster , java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster > dataCentersWithClusters ) { if ( selectedCluster == null ) { getDataCenterWithClustersList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCentersWithClusters ) ) ; } else { model.getDataCenterWithClustersList ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCentersWithClusters , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterWithClusterAccordingClusterPredicate ( selectedCluster ) ) ) ; } }

Target:
protected void selectDataCenterWithCluster ( org.ovirt.engine.core.compat.Guid selectedCluster , java.util.List < org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster > dataCentersWithClusters ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster selectedDataCenterWithCluster = ( selectedCluster == null ) ? org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCentersWithClusters ) : org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCentersWithClusters , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterWithClusterAccordingClusterPredicate ( selectedCluster ) ) ; getDataCenterWithClustersList ( ) . setItems ( dataCentersWithClusters , selectedDataCenterWithCluster ) ; }
Source:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } if ( ( ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVdsGroup ( ) ) == null ) && ( ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) . getTemplateType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY ) ; return false ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } if ( ( ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getCluster ( ) ) == null ) && ( ( org.ovirt.engine.core.bll.network.template.VmTemplateInterfaceCommandBase.getVmTemplate ( ) . getTemplateType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_CLUSTER_CAN_NOT_BE_EMPTY ) ; return false ; } return true ; }
Source:
public static void GetVmById ( 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.RunQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.GetVmByVmIdParameters ( vmId ) , aQuery ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > GetWindowsOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008R2x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows7 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows7x64 , org.ovirt.engine.core.common.businessentities.VmOsType.WindowsXP } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.windowsOsTypes ; }
Source:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getBroker ( ) . disconnectStoragePool ( org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getParameters ( ) . getvds_spm_id ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.ProceedProxyReturnValue ( ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getBroker ( ) . disconnectStoragePool ( org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getParameters ( ) . getvds_spm_id ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DisconnectStoragePoolVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
public void testGet ( ) { for ( org.ovirt.engine.core.common.businessentities.ActionGroup action : org.ovirt.engine.core.common.businessentities.ActionGroup.values ( ) ) { org.ovirt.engine.api.restapi.resource.BackendPermitResource resource = new org.ovirt.engine.api.restapi.resource.BackendPermitResource ( java.lang.Integer.toString ( action.getId ( ) ) , new org.ovirt.engine.api.restapi.resource.BackendPermitsResource ( org.ovirt.engine.api.restapi.resource.BackendPermitResourceTest.ROLE_ID ) ) ; resource.setMappingLocator ( mapperLocator ) ; resource.getParent ( ) . setMappingLocator ( mapperLocator ) ; verifyPermit ( resource.get ( ) , action ) ; } }

Target:
public void testGet ( ) { for ( org.ovirt.engine.core.common.businessentities.ActionGroup action : org.ovirt.engine.core.common.businessentities.ActionGroup.values ( ) ) { org.ovirt.engine.api.restapi.resource.BackendPermitResource resource = new org.ovirt.engine.api.restapi.resource.BackendPermitResource ( java.lang.Integer.toString ( action.getId ( ) ) , new org.ovirt.engine.api.restapi.resource.BackendPermitsResource ( org.ovirt.engine.api.restapi.resource.BackendPermitResourceTest.ROLE_ID ) ) ; resource.setMappingLocator ( mapperLocator ) ; resource.getParent ( ) . setMappingLocator ( mapperLocator ) ; resource.setValidatorLocator ( validatorLocator ) ; resource.getParent ( ) . setValidatorLocator ( validatorLocator ) ; verifyPermit ( resource.get ( ) , action ) ; } }
Source:
public void testGetPermittedStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getPermittedStorageDomainsByStoragePool ( org.ovirt.engine.core.dao.StorageDomainDaoTest.EXISTING_USER_ID , ActionGroup.CONFIGURE_VM_STORAGE , new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( result.get ( 0 ) . getId ( ) , existingDomain.getId ( ) ) ; }

Target:
public void testGetAllWithPermissionsDisabledUnprivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getAll ( org.ovirt.engine.core.dao.UNPRIVILEGED_USER_ID , false ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }
Source:
public void testGetStorageDomainWithNoStatus ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain result = dao.getStorageDomain ( FixturesTool.STORAGE_POOL_NFS_INACTIVE_ISO , StorageDomainType.ISO , null ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOMAIN_NFS_INACTIVE_ISO , result.getId ( ) ) ; }

Target:
public void testGetStorageDomainWithNoStatus ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain result = dao.getStorageDomain ( FixturesTool.STORAGE_POOL_NFS_INACTIVE_ISO , StorageDomainType.ISO , null ) ; org.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOMAIN_NFS_INACTIVE_ISO , result.getId ( ) ) ; org.junit.Assert.assertEquals ( "Wrong committed disk size" , 0 , result.getCommittedDiskSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong actual disk size" , 0 , result.getActualImagesSize ( ) ) ; }
Source:
void setColumnWidth ( com.google.gwt.user.cellview.client.Column < T , ? > column , java.lang.String width ) { table.setColumnWidth ( column , width ) ; tableHeader.setColumnWidth ( column , width ) ; int columnIndex = table.getColumnIndex ( column ) ; for ( com.google.gwt.dom.client.TableCellElement cell : getTableBodyCells ( columnIndex ) ) { cell.getStyle ( ) . setProperty ( "width" , width ) ; } for ( com.google.gwt.dom.client.TableCellElement cell : getTableHeaderCells ( columnIndex ) ) { cell.getStyle ( ) . setProperty ( "width" , width ) ; } }

Target:
public void addColumnWithHtmlHeader ( com.google.gwt.user.cellview.client.Column < T , ? > column , java.lang.String headerHtml ) { table.addColumnWithHtmlHeader ( column , headerHtml ) ; tableHeader.addColumnWithHtmlHeader ( column , headerHtml ) ; }
Source:
public void canDoActionFailsOnNullDiskInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.COW ) ; image.setVolumeType ( VolumeType.Preallocated ) ; org.ovirt.engine.core.common.action.AddDiskParameters params = new org.ovirt.engine.core.common.action.AddDiskParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , image ) ; initializeCommand ( storageId , params ) ; org.junit.Assert.assertFalse ( command.validateInputs ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( "VALIDATION_DISK_INTERFACE_NOT_NULL" ) ) ; }

Target:
public void validateFailsOnNullDiskInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.COW ) ; image.setVolumeType ( VolumeType.Preallocated ) ; org.ovirt.engine.core.common.action.AddDiskParameters params = new org.ovirt.engine.core.common.action.AddDiskParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , image ) ; initializeCommand ( storageId , params ) ; org.junit.Assert.assertFalse ( command.validateInputs ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( "VALIDATION_DISK_INTERFACE_NOT_NULL" ) ) ; }
Source:
public static void GetHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.GetAllVdsByStoragePoolParameters ( spId ) , aQuery ) ; }

Target:
public static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.GetAllVdsByStoragePoolParameters ( spId ) , aQuery ) ; }
Source:
public void updateOvfGenerations ( java.util.List < org.ovirt.engine.core.compat.Guid > ids , java.util.List < java.lang.Long > values ) { getCallsHandler ( ) . executeModification ( "UpdateOvfGenerations" , getCustomMapSqlParameterSource ( ) . addValue ( "vms_ids" , org.apache.commons.lang.StringUtils.join ( ids , ',' ) ) . addValue ( "vms_db_generations" , org.apache.commons.lang.StringUtils.join ( values , ',' ) ) ) ; }

Target:
public void updateOvfGenerations ( java.util.List < org.ovirt.engine.core.compat.Guid > ids , java.util.List < java.lang.Long > values , java.util.List < java.lang.String > ovfData ) { getCallsHandler ( ) . executeModification ( "UpdateOvfGenerations" , getCustomMapSqlParameterSource ( ) . addValue ( "vms_ids" , org.apache.commons.lang.StringUtils.join ( ids , ',' ) ) . addValue ( "vms_db_generations" , org.apache.commons.lang.StringUtils.join ( values , ',' ) ) . addValue ( "ovf_data" , org.apache.commons.lang.StringUtils.join ( ovfData , org.ovirt.engine.core.dao.VmAndTemplatesGenerationsDbFacadeImpl.ovfSeparator ) ) . addValue ( "ovf_data_seperator" , org.ovirt.engine.core.dao.VmAndTemplatesGenerationsDbFacadeImpl.ovfSeparator ) ) ; }
Source:
public void testListFailure ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) ; collection.setParent ( parentMock ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; assertEquals ( mockl10n ( org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) , ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) . getDetail ( ) ) ; } }

Target:
public void testListFailure ( ) throws java.lang.Exception { collection.setUriInfo ( setUpUriExpectations ( null ) ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.defaultQuery , org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) ; collection.setParent ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.parentMock ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertTrue ( ( ( wae.getResponse ( ) . getEntity ( ) ) instanceof org.ovirt.engine.api.model.Fault ) ) ; assertEquals ( mockl10n ( org.ovirt.engine.api.restapi.resource.gluster.FAILURE ) , ( ( org.ovirt.engine.api.model.Fault ) ( wae.getResponse ( ) . getEntity ( ) ) ) . getDetail ( ) ) ; } }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVmTemplateDao ( ) ; existingTemplate = dao.get ( new org.ovirt.engine.core.compat.Guid ( "1b85420c-b84c-4f29-997e-0eb674b40b79" ) ) ; newVmTemplate = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; newVmTemplate.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newVmTemplate.setName ( "NewVmTemplate" ) ; newVmTemplate.setVdsGroupId ( org.ovirt.engine.core.dao.VmTemplateDAOTest.VDS_GROUP_ID ) ; newVmTemplate.setClusterArch ( ArchitectureType.x86_64 ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getVmTemplateDao ( ) ; existingTemplate = dao.get ( new org.ovirt.engine.core.compat.Guid ( "1b85420c-b84c-4f29-997e-0eb674b40b79" ) ) ; existingInstanceType = dao.get ( new org.ovirt.engine.core.compat.Guid ( "99408929-82cf-4dc7-a532-9d998063fa95" ) ) ; newVmTemplate = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; newVmTemplate.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newVmTemplate.setName ( "NewVmTemplate" ) ; newVmTemplate.setVdsGroupId ( org.ovirt.engine.core.dao.VmTemplateDAOTest.VDS_GROUP_ID ) ; newVmTemplate.setClusterArch ( ArchitectureType.x86_64 ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel object ) { super . edit ( object ) ; initTabAvailabilityListeners ( object ) ; if ( object.isVmAttachedToPool ( ) ) { specificHost.setEnabled ( false ) ; specificHostLabel.setStyleName ( style.labelDisabled ( ) , true ) ; customPropertiesSheetEditor.setEnabled ( false ) ; } }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel unitVmModel ) { super . edit ( unitVmModel ) ; initTabAvailabilityListeners ( ) ; if ( unitVmModel.isVmAttachedToPool ( ) ) { specificHost.setEnabled ( false ) ; specificHostLabel.setStyleName ( style.labelDisabled ( ) , true ) ; customPropertiesSheetEditor.setEnabled ( false ) ; } }
Source:
protected void performLogin ( T loginModel ) { org.ovirt.engine.core.common.businessentities.DbUser loggedUser = loginModel.getLoggedUser ( ) ; java.lang.String loginPassword = ( ( java.lang.String ) ( loginModel.getPassword ( ) . getEntity ( ) ) ) ; frontend.initLoggedInUser ( loggedUser , loginPassword ) ; beforeUiCommonInitEvent ( loginModel ) ; org.ovirt.engine.ui.common.uicommon.model.UiCommonInitEvent.fire ( eventBus ) ; user.onUserLogin ( loggedUser ) ; loginModel.getPassword ( ) . setEntity ( null ) ; }

Target:
protected void performBootstrap ( ) { user.setLogoutHandler ( this ) ; initUiCommon ( ) ; initFrontend ( ) ; initLoginModel ( ) ; org.ovirt.engine.ui.common.auth.AutoLoginData autoLoginData = org.ovirt.engine.ui.common.auth.AutoLoginData.instance ( ) ; if ( autoLoginData != null ) { handleAutoLogin ( autoLoginData ) ; } org.ovirt.engine.ui.common.restapi.EngineSessionTimeoutData engineSessionTimeoutData = org.ovirt.engine.ui.common.restapi.EngineSessionTimeoutData.instance ( ) ; if ( engineSessionTimeoutData != null ) { restApiSessionManager.setSessionTimeout ( engineSessionTimeoutData.getSessionTimeout ( ) ) ; restApiSessionManager.setHardLimit ( engineSessionTimeoutData.getSessionHardLimit ( ) ) ; } }
Source:
private static void addFloppyDetails ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct struct ) { struct.add ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.add ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; struct.add ( VdsProperties.Index , "0" ) ; struct.add ( VdsProperties.NETWORK_INTERFACE , VdsProperties.Fdc ) ; struct.add ( VdsProperties.ReadOnly , java.lang.String.valueOf ( vmDevice.getIsReadOnly ( ) ) ) ; struct.add ( VdsProperties.Shareable , java.lang.Boolean.FALSE.toString ( ) ) ; }

Target:
private static void addFloppyDetails ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice , java.util.Map < java.lang.String , java.lang.Object > struct ) { struct.put ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.put ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; struct.put ( VdsProperties.Index , "0" ) ; struct.put ( VdsProperties.INTERFACE , VdsProperties.Fdc ) ; struct.put ( VdsProperties.ReadOnly , java.lang.String.valueOf ( vmDevice.getIsReadOnly ( ) ) ) ; struct.put ( VdsProperties.Shareable , java.lang.Boolean.FALSE.toString ( ) ) ; }
Source:
public void hostNInUse ( ) { org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VDS_WITH_SAME_HOST_EXIST ) ) ; }

Target:
public void hostNInUse ( ) { org.mockito.Mockito.when ( oldHost.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( host.getHostName ( ) ) . thenReturn ( generateRandomName ( ) ) ; org.mockito.Mockito.when ( hostDao.getAllForHostname ( org.mockito.ArgumentMatchers.any ( java.lang.String.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ) ; org.junit.Assert.assertThat ( validator.hostNameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VDS_WITH_SAME_HOST_EXIST ) ) ; }
Source:
public void validateInvalidSourceDomain ( ) { createParameters ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = initStorageDomain ( srcStorageId ) ; storageDomain.setStatus ( StorageDomainStatus.Locked ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2.toString ( ) ) ) ; }

Target:
public void validateFailsWhenCreateAllSnapshotFromVmValidationFails ( ) { createParameters ( srcStorageId , dstStorageId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . validateCreateAllSnapshotsFromVmCommand ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }
Source:
public void testGetAllNetworkSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( "Network:" , org.ovirt.engine.core.common.interfaces.SearchType.Network ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( networkResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }

Target:
public void testGetAllNetworkSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Network" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.Network ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( networkResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.UpdateVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "DiskInfo.WipeAfterDelete" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.FALSE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmDisk , org.ovirt.engine.core.common.action.VmDiskOperationParameterBase.class , new java.lang.String [ ] { "VmId" , "DiskInfo.WipeAfterDelete" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.VM_ID , java.lang.Boolean.FALSE } , true , true ) ) ; org.ovirt.engine.api.model.Disk disk = resource.update ( getUpdate ( ) ) ; assertNotNull ( disk ) ; }
Source:
public static void GetClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void GetClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase ( dataCenterId ) , aQuery ) ; }
Source:
private java.util.List < java.lang.String > readPubKey ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue readPubKeyReturnvalue = runInternalQuery ( VdcQueryType.GetGlusterHostPublicKeys , new org.ovirt.engine.core.common.queries.IdQueryParameters ( upServer.getId ( ) ) ) ; if ( readPubKeyReturnvalue.getSucceeded ( ) ) { return ( ( java.util.List < java.lang.String > ) ( readPubKeyReturnvalue.getReturnValue ( ) ) ) ; } else { handleVdsError ( AuditLogType.GLUSTER_GEO_REP_PUB_KEY_FETCH_FAILED , readPubKeyReturnvalue.getExceptionString ( ) ) ; return null ; } }

Target:
private java.util.List < java.lang.String > readPubKey ( org.ovirt.engine.core.compat.Guid upServerId ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue readPubKeyReturnvalue = runInternalQuery ( VdcQueryType.GetGlusterHostPublicKeys , new org.ovirt.engine.core.common.queries.IdQueryParameters ( upServerId ) ) ; if ( readPubKeyReturnvalue.getSucceeded ( ) ) { return ( ( java.util.List < java.lang.String > ) ( readPubKeyReturnvalue.getReturnValue ( ) ) ) ; } else { handleVdsError ( AuditLogType.GLUSTER_GEO_REP_PUB_KEY_FETCH_FAILED , readPubKeyReturnvalue.getExceptionString ( ) ) ; return null ; } }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > GetDiskInterfaceList ( ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.DiskInterface [ ] { org.ovirt.engine.core.common.businessentities.DiskInterface.IDE , org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO } ) ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > getDiskInterfaceList ( org.ovirt.engine.core.compat.Version clusterVersion ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > diskInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskInterface > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.DiskInterface [ ] { org.ovirt.engine.core.common.businessentities.DiskInterface.IDE , org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO } ) ) ; boolean isVirtIOScsiEnabled = ( clusterVersion != null ) ? ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.VirtIoScsiEnabled , clusterVersion.getValue ( ) ) ) ) : true ; if ( isVirtIOScsiEnabled ) { diskInterfaces.add ( DiskInterface.VirtIO_SCSI ) ; } return diskInterfaces ; }
Source:
private boolean removeHibernationDisks ( ) { java.lang.String hiberVol = org.ovirt.engine.core.bll.StopVmCommandBase.getActiveSnapshot ( ) . getMemoryVolume ( ) ; if ( org.apache.commons.lang.StringUtils.isEmpty ( hiberVol ) ) { return false ; } return removeHibernationDisks ( hiberVol ) ; }

Target:
protected void executeVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.getParameters ( ) . setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.VM , org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getId ( ) ) ) ; java.lang.String hiberVol = org.ovirt.engine.core.bll.StopVmCommandBase.getActiveSnapshot ( ) . getMemoryVolume ( ) ; suspendedVm = ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ; if ( suspendedVm ) { endVmCommand ( ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setCommandShouldBeLogged ( true ) ; } else { super . executeVmCommand ( ) ; } removeMemoryDisksIfNeeded ( hiberVol ) ; }
Source:
protected void updateDiskProfile ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { if ( isDiskImage ( ) ) { org.ovirt.engine.core.common.businessentities.DiskImage oldDisk = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( getOldDisk ( ) ) ) ; if ( ! ( java.util.Objects.equals ( oldDisk.getDiskProfileId ( ) , diskImage.getDiskProfileId ( ) ) ) ) { org.ovirt.engine.core.bll.UpdateVmDiskCommand.getImageStorageDomainMapDao ( ) . updateDiskProfileForImageAndSnapshots ( diskImage.getId ( ) , diskImage.getStorageIds ( ) . get ( 0 ) , diskImage.getDiskProfileIds ( ) . get ( 0 ) ) ; } } }

Target:
protected org.ovirt.engine.core.common.action.LockProperties applyLockProperties ( org.ovirt.engine.core.common.action.LockProperties lockProperties ) { return lockProperties.withScope ( Scope.Command ) ; }
Source:
public static void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public static void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
private static java.lang.Double AssignDoubleValue ( java.util.Map < java.lang.String , java.lang.Object > input , java.lang.String name ) { java.lang.Double returnValue = null ; if ( input.containsKey ( name ) ) { java.lang.String stringValue = ( ( java.lang.String ) ( ( ( input.get ( name ) ) instanceof java.lang.String ) ? input.get ( name ) : null ) ) ; returnValue = ( stringValue == null ) ? null : java.lang.Double.parseDouble ( stringValue ) ; } return returnValue ; }

Target:
private static java.lang.Double truncatePercentage ( java.lang.Double value ) { return value == null ? null : java.lang.Math.min ( 100 , value ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmTemplate , org.ovirt.engine.core.common.queries.GetVmTemplateParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; } }
Source:
public java.util.concurrent.Future < java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse > > batchCall ( java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest > requests ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.internal.BatchCall call = new org.ovirt.vdsm.jsonrpc.client.internal.BatchCall ( requests ) ; for ( final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request : requests ) { if ( ( this . runningCalls.putIfAbsent ( request.getId ( ) , call ) ) != null ) { throw new org.ovirt.vdsm.jsonrpc.client.RequestAlreadySentException ( ) ; } } this . getClient ( ) . sendMessage ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.jsonToByteArray ( requests , objectMapper ) ) ; retryBatchCall ( requests , call ) ; return call ; }

Target:
public void processResponse ( org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse response ) { org.ovirt.vdsm.jsonrpc.client.internal.JsonRpcCall call = this . tracker.removeCall ( response.getId ( ) ) ; if ( call == null ) { return ; } call.addResponse ( response ) ; }
Source:
public void getGlusterSwiftServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByServerId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( serverId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
private org.ovirt.engine.core.compat.Guid pickProxyHostFromDataCenter ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdss = org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getVdsDao ( ) . getAllForStoragePoolAndStatus ( org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getDataCenterId ( ) , VDSStatus.Up ) ; if ( vdss.isEmpty ( ) ) { logNoProxyAvailable ( org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getDataCenterId ( ) ) ; throw new java.lang.IllegalArgumentException ( ) ; } return vdss.get ( 0 ) . getId ( ) ; }

Target:
private org.ovirt.engine.core.compat.Guid pickProxyHostFromDataCenter ( ) { org.ovirt.engine.core.compat.Guid dataCenterId = ( ( org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getDataCenterId ( ) ) == null ) ? getRandomDataCenter ( ) : org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getDataCenterId ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdss = org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getVdsDao ( ) . getAllForStoragePoolAndStatus ( dataCenterId , VDSStatus.Up ) ; if ( vdss.isEmpty ( ) ) { logNoProxyAvailable ( org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getParameters ( ) . getDataCenterId ( ) ) ; throw new java.lang.IllegalArgumentException ( ) ; } return vdss.get ( 0 ) . getId ( ) ; }