auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
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 > ( ) ; }

Target:
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 = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterByServiceList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) , supportsVirtService , supportsGlusterService ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
public static java.util.Set < org.ovirt.engine.core.compat.Guid > getAllStorageIdsForImageIds ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { java.util.Set < org.ovirt.engine.core.compat.Guid > domainsIds = new java.util.HashSet < org.ovirt.engine.core.compat.Guid > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { domainsIds.addAll ( image.getStorageIds ( ) ) ; } return domainsIds ; }

Target:
public static java.util.Set < org.ovirt.engine.core.compat.Guid > getAllStorageIdsForImageIds ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { java.util.Set < org.ovirt.engine.core.compat.Guid > domainsIds = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { domainsIds.addAll ( image.getStorageIds ( ) ) ; } return domainsIds ; }
Source:
private org.ovirt.engine.core.common.errors.VdcBllMessages getNetworkInUseValidationMessage ( int numberOfEntities ) { boolean singular = numberOfEntities == 1 ; if ( singular ) { return org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_IN_ONE_USE ; } else { return org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_IN_MANY_USES ; } }

Target:
private java.util.Collection < java.lang.String > getEntitiesNames ( java.util.List < ? extends org.ovirt.engine.core.common.businessentities.Nameable > entities ) { java.util.List < java.lang.String > result = new java.util.ArrayList < > ( entities.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Nameable itemName : entities ) { result.add ( itemName.getName ( ) ) ; } return result ; }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosCommitmentNicSetup ( int totalCommitment , java.lang.Integer nicSpeed ) { return qosCommitmentSetup ( false , totalCommitment , null , nicSpeed , null ) ; }

Target:
private void mockCalculateBaseNicWhenBaseNicIsPassed ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( org.mockito.Matchers.eq ( nic ) ) ) . thenReturn ( nic ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( org.mockito.Matchers.eq ( nic ) , org.mockito.Matchers.any ( java.util.Map.class ) ) ) . thenReturn ( nic ) ; }
Source:
public void testRemoveCommit ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.volumeId } , helper.getVolumeEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.CommitRemoveGlusterVolumeBricks , org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemoveCommit ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.volumeId } , helper.getVolumeEntity ( 1 ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.CommitRemoveGlusterVolumeBricks , org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; verifyRemove ( collection.remove ( getBrickModelsToRemove ( ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneMapReturn get_image_transfer_session_stats ( java.lang.String ticketId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.get_image_transfer_session_stats" ) . withParameter ( "ticketUUID" , ticketId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "statsMap" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneMapReturn ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.ImageTicketInformationReturn getImageTicket ( java.lang.String ticketId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.get_image_ticket" ) . withParameter ( "uuid" , ticketId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "result" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.ImageTicketInformationReturn ( response ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDao ( ) . getByName ( org.ovirt.engine.core.bll.AddTagCommand.getParameters ( ) . getTag ( ) . getTagName ( ) ) ; if ( tag != null ) { addCanDoActionMessage ( EngineMessage.TAGS_SPECIFY_TAG_IS_IN_USE ) ; return false ; } return true ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDao ( ) . getByName ( org.ovirt.engine.core.bll.AddTagCommand.getParameters ( ) . getTag ( ) . getTagName ( ) ) ; if ( tag != null ) { addValidationMessage ( EngineMessage.TAGS_SPECIFY_TAG_IS_IN_USE ) ; return false ; } return true ; }
Source:
private org.ovirt.engine.core.common.businessentities.Snapshot getActiveSnapshot ( ) { return getSnapshotDao ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , SnapshotType.ACTIVE ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmPayload getVmPayloadByDeviceType ( org.ovirt.engine.core.common.utils.VmDeviceType deviceType ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.bll.RunVmCommand.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getId ( ) , VmDeviceGeneralType.DISK , deviceType.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { if ( ( vmDevice.getIsManaged ( ) ) && ( org.ovirt.engine.core.common.businessentities.VmPayload.isPayload ( vmDevice.getSpecParams ( ) ) ) ) { return new org.ovirt.engine.core.common.businessentities.VmPayload ( vmDevice ) ; } } return null ; }
Source:
public org.ovirt.engine.api.model.Vms list ( ) { if ( isFiltered ( ) ) { return mapCollection ( getBackendCollection ( VdcQueryType.GetAllVms , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , SearchType.VM ) , true ) ; } else { return mapCollection ( getBackendCollection ( SearchType.VM ) , false ) ; } }

Target:
public org.ovirt.engine.api.model.Vms list ( ) { if ( isFiltered ( ) ) { return mapCollection ( getBackendCollection ( QueryType.GetAllVms , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , SearchType.VM ) , true ) ; } else { return mapCollection ( getBackendCollection ( SearchType.VM ) , false ) ; } }
Source:
protected org.ovirt.engine.core.dao.VdsDynamicDAO getVdsDynamicDao ( ) { return org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) ; }

Target:
private void decreasePendingVms ( ) { org.ovirt.engine.core.compat.Guid vdsId = getCurrentVdsId ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.RunVmCommandBase.getVm ( ) ; if ( ( vdsId == null ) || ( vdsId.equals ( lastDecreasedVds ) ) ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debugFormat ( "PendingVms for the guest {0} running on host {1} was already released, not releasing again" , vm.getName ( ) , vdsId ) ; return ; } lastDecreasedVds = vdsId ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVms ( vm , vdsId ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( hosts ) ; result = ( prime * result ) + ( ( vdsGroupId ) == null ? 0 : vdsGroupId.hashCode ( ) ) ; result = ( prime * result ) + ( vms ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( hosts , vdsGroupId , vms ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validateNotHostedEngineDisk ( ) { boolean isHostedEngineDisk = ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) && ( StorageConstants.HOSTED_ENGINE_LUN_DISK_ALIAS.equals ( disk.getDiskAlias ( ) ) ) ; return isHostedEngineDisk ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_HOSTED_ENGINE_DISK ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateNotHostedEngineDisk ( ) { boolean isHostedEngineDisk = ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) && ( StorageConstants.HOSTED_ENGINE_LUN_DISK_ALIAS.equals ( disk.getDiskAlias ( ) ) ) ; return isHostedEngineDisk ? new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_HOSTED_ENGINE_DISK ) : org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > createStorageDomains ( org.ovirt.engine.core.compat.Guid sdIdToBeSelected ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd1 = org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.createStorageDomain ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , StorageType.NFS , org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.LOW_SPACE_IN_GB ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sd2 = org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.createStorageDomain ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , StorageType.NFS , org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.LOW_SPACE_IN_GB ) ; org.ovirt.engine.core.common.businessentities.StorageDomain sd3 = org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.createStorageDomain ( sdIdToBeSelected , StorageType.NFS , org.ovirt.engine.core.bll.memory.MemoryStorageHandlerTest.ENOUGH_SPACE_IN_GB ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = java.util.Arrays.asList ( sd1 , sd2 , sd3 ) ; return storageDomains ; }

Target:
private void verifyDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = memoryStorageHandler.findStorageDomainForMemory ( storageDomains , disksList ) ; org.junit.Assert.assertEquals ( storageDomain , validStorageDomain ) ; }
Source:
public void testContainsKeyReturnsFalseForNotExistingName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > testItems = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( null , "name" ) ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( testItems ) ; org.junit.Assert.assertThat ( map.containsKey ( "different name" ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testContainsKeyReturnsFalseForNotExistingName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > testItems = java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( null , "name" ) ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem > map = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( testItems ) ; org.hamcrest.MatcherAssert.assertThat ( map.containsKey ( "different name" ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AbstractGraphicsDeviceCommand.getParameters ( ) . getDev ( ) . getVmId ( ) , ( org.ovirt.engine.core.bll.AbstractGraphicsDeviceCommand.getParameters ( ) . isVm ( ) ? org.ovirt.engine.core.common.VdcObjectType.VM : org.ovirt.engine.core.common.VdcObjectType.VmTemplate ) , org.ovirt.engine.core.bll.AbstractGraphicsDeviceCommand.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( getVmBaseId ( ) , ( org.ovirt.engine.core.bll.AbstractGraphicsDeviceCommand.getParameters ( ) . isVm ( ) ? org.ovirt.engine.core.common.VdcObjectType.VM : org.ovirt.engine.core.common.VdcObjectType.VmTemplate ) , org.ovirt.engine.core.bll.AbstractGraphicsDeviceCommand.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isDomainWithinThresholds ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic dynamic = storageDomain.getStorageDynamicData ( ) ; if ( ( dynamic != null ) && ( ( dynamic.getfreeDiskInGB ( ) ) < ( org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator.getLowDiskSpaceThreshold ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN , storageName ( ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isDomainWithinThresholds ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic dynamic = storageDomain.getStorageDynamicData ( ) ; if ( ( ( dynamic != null ) && ( ( dynamic.getAvailableDiskSize ( ) ) != null ) ) && ( ( dynamic.getAvailableDiskSize ( ) ) < ( org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator.getLowDiskSpaceThreshold ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN , storageName ( ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static void GetDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static boolean IsLinuxOsType ( org.ovirt.engine.core.common.businessentities.VmOsType osType ) { if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetLinuxOsTypes ( ) . contains ( osType ) ) { return true ; } return false ; }
Source:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateNumOfSockets ( ) ; updateQuotaByCluster ( vm.getQuotaId ( ) , vm.getQuotaName ( ) ) ; updateCpuPinningVisibility ( ) ; updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; updateNetworkInterfaces ( networkBehavior , networkInerfaces ) ; updateVirtioScsiAvailability ( ) ; }

Target:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateNumOfSockets ( ) ; updateQuotaByCluster ( vm.getQuotaId ( ) , vm.getQuotaName ( ) ) ; updateCpuPinningVisibility ( ) ; updateMemoryBalloon ( ) ; updateCpuSharesAvailability ( ) ; updateNetworkInterfaces ( networkBehavior , networkInerfaces ) ; updateVirtioScsiAvailability ( ) ; updateOSValues ( ) ; }
Source:
public static void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { 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.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
Source:
private static void copyProperties ( org.ovirt.engine.core.common.businessentities.storage.DiskVmElement source , org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dest ) { dest.setBoot ( source.isBoot ( ) ) ; dest.setPassDiscard ( source.isPassDiscard ( ) ) ; dest.setDiskInterface ( source.getDiskInterface ( ) ) ; }

Target:
private static void copyProperties ( org.ovirt.engine.core.common.businessentities.storage.DiskVmElement source , org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dest ) { dest.setBoot ( source.isBoot ( ) ) ; dest.setPassDiscard ( source.isPassDiscard ( ) ) ; dest.setDiskInterface ( source.getDiskInterface ( ) ) ; dest.setUsingScsiReservation ( source.isUsingScsiReservation ( ) ) ; dest.setPlugged ( source.isPlugged ( ) ) ; dest.setLogicalName ( source.getLogicalName ( ) ) ; dest.setReadOnly ( source.isReadOnly ( ) ) ; }
Source:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
protected void EntityPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . EntityPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "IsSelectedNullable" ) ) { org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel selectionTreeNodeModel = ( ( org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel ) ( sender ) ) ; org.ovirt.engine.ui.uicommonweb.models.tags.TagModel tagModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagModel ) ( selectionTreeNodeModel.getEntity ( ) ) ) ; tagModel.setSelection ( selectionTreeNodeModel.getIsSelectedNullable ( ) ) ; OnTagSelectionChanged ( tagModel , e ) ; } }

Target:
protected void entityPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . entityPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "IsSelectedNullable" ) ) { org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel selectionTreeNodeModel = ( ( org.ovirt.engine.ui.uicommonweb.models.common.SelectionTreeNodeModel ) ( sender ) ) ; org.ovirt.engine.ui.uicommonweb.models.tags.TagModel tagModel = ( ( org.ovirt.engine.ui.uicommonweb.models.tags.TagModel ) ( selectionTreeNodeModel.getEntity ( ) ) ) ; tagModel.setSelection ( selectionTreeNodeModel.getIsSelectedNullable ( ) ) ; onTagSelectionChanged ( tagModel , e ) ; } }
Source:
public void canDoActionVmRunningStateless ( ) { createParameters ( ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , diskImageId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS ) ) . when ( vmValidator ) . vmNotRunningStateless ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS.name ( ) ) ) ; }

Target:
public void canDoActionVmRunningStateless ( ) { createParameters ( ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS ) ) . when ( vmValidator ) . vmNotRunningStateless ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS.name ( ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.VDSParametersBase getVDSParameters ( ) { return org.ovirt.engine.core.bll.storage.PostZeroHandler.fixParametersWithPostZero ( new org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters ( getEnclosingCommand ( ) . getParameters ( ) . getStoragePoolId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getSourceStorageDomainId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . get ( getEnclosingCommand ( ) . getParameters ( ) . getDestinationImageId ( ) ) . isWipeAfterDelete ( ) , getEnclosingCommand ( ) . getParameters ( ) . getForceDelete ( ) ) ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSParametersBase getVDSParameters ( ) { return org.ovirt.engine.core.bll.storage.domain.PostZeroHandler.fixParametersWithPostZero ( new org.ovirt.engine.core.common.vdscommands.DeleteImageGroupVDSCommandParameters ( getEnclosingCommand ( ) . getParameters ( ) . getStoragePoolId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getSourceStorageDomainId ( ) , getEnclosingCommand ( ) . getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskImageDao ( ) . get ( getEnclosingCommand ( ) . getParameters ( ) . getDestinationImageId ( ) ) . isWipeAfterDelete ( ) , getEnclosingCommand ( ) . getParameters ( ) . getForceDelete ( ) ) ) ; }
Source:
protected void SelectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . SelectedItemPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "status" ) ) { UpdateActionAvailability ( ) ; } else if ( e.PropertyName.equals ( "display_type" ) ) { UpdateConsoleModels ( ) ; } }

Target:
protected void SelectedItemPropertyChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs e ) { super . SelectedItemPropertyChanged ( sender , e ) ; if ( e.PropertyName.equals ( "status" ) ) { UpdateActionAvailability ( ) ; } else if ( e.PropertyName.equals ( "display_type" ) ) { updateConsoleModels ( ) ; } }
Source:
public static 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.RunQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getSession ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession session = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession ( ) ; session.setMasterVolumeName ( "VOL1" ) ; session.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; session.setSessionKey ( ( ( session.getId ( ) ) + ( session.getMasterVolumeName ( ) ) ) ) ; session.setStatus ( GeoRepSessionStatus.ACTIVE ) ; session.setSessionDetails ( getSessionDetailsList ( ) ) ; return session ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getSession ( boolean populateVoId ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession session = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession ( ) ; session.setMasterVolumeName ( "VOL1" ) ; if ( populateVoId ) { session.setMasterVolumeId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } session.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; session.setSessionKey ( ( ( session.getId ( ) ) + ( session.getMasterVolumeName ( ) ) ) ) ; session.setStatus ( GeoRepSessionStatus.ACTIVE ) ; session.setSessionDetails ( getSessionDetailsList ( ) ) ; return session ; }
Source:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , boolean enableCallBack ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity.buildCommandEntity ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus , enableCallBack , getReturnValue ( ) ) ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }

Target:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.bll.context.CommandContext cmdContext , boolean enableCallback ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.common.businessentities.CommandEntity commandEntity = buildCommandEntity ( getParentParameters ( parentCommand ) . getCommandId ( ) , enableCallback ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.persistCommand ( commandEntity , cmdContext ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } }
Source:
protected void afterUpdate ( ) { boolean newSizeUnderCurrentConsumption = org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . isStorageQuotaExceeded ( getQuota ( ) . getId ( ) ) ; if ( newSizeUnderCurrentConsumption ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "QuotaName" , getQuotaName ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.QUOTA_STORAGE_RESIZE_LOWER_THEN_CONSUMPTION ) ; } }

Target:
protected void afterUpdate ( ) { boolean newSizeUnderCurrentConsumption = org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . isStorageQuotaExceeded ( getQuota ( ) . getId ( ) ) ; if ( newSizeUnderCurrentConsumption ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.addCustomValue ( "QuotaName" , getQuotaName ( ) ) ; new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( logable , AuditLogType.QUOTA_STORAGE_RESIZE_LOWER_THEN_CONSUMPTION ) ; } }
Source:
public void testGetPeersWithWrongPassword ( ) throws java.io.IOException , javax.naming.AuthenticationException { org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.mockito.Mockito.doReturn ( client ) . when ( glusterUtil ) . getSSHClient ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP ) . when ( glusterUtil ) . getFingerprints ( org.mockito.Matchers.any ( java.util.Set.class ) ) ; glusterUtil.getPeers ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.USER , org.ovirt.engine.core.bll.utils.GlusterUtilTest.WRONG_PASSWORD ) ; }

Target:
public void testGetPeersWithWrongPassword ( ) throws java.io.IOException , javax.naming.AuthenticationException { org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP.put ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.FINGER_PRINT1 ) ; org.mockito.Mockito.doReturn ( client ) . when ( glusterUtil ) . getSSHClient ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.EXPECTED_MAP ) . when ( glusterUtil ) . getFingerprints ( org.mockito.Matchers.anySetOf ( java.lang.String.class ) ) ; glusterUtil.getPeers ( org.ovirt.engine.core.bll.utils.GlusterUtilTest.SERVER_NAME1 , org.ovirt.engine.core.bll.utils.GlusterUtilTest.USER , org.ovirt.engine.core.bll.utils.GlusterUtilTest.WRONG_PASSWORD ) ; }
Source:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; control.replay ( ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertTrue ( model.isSparse ( ) ) ; assertTrue ( ( ! ( model.isBootable ( ) ) ) ) ; assertTrue ( model.isPropagateErrors ( ) ) ; }
Source:
protected org.ovirt.engine.ui.webadmin.section.main.view.popup.host.NicLabelEditor createWidget ( org.ovirt.engine.ui.uicommonweb.models.ListModel < java.lang.String > value ) { org.ovirt.engine.ui.webadmin.section.main.view.popup.host.NicLabelEditor editor = super . createWidget ( value ) ; editor.suggestBoxEditor.addContentWidgetStyleName ( this . style.labelEditorContent ( ) ) ; editor.suggestBoxEditor.addWrapperStyleName ( this . style.labelEditorWrapper ( ) ) ; return editor ; }

Target:
private boolean canEditAssign ( org.ovirt.engine.ui.uicommonweb.models.hosts.VfsConfigNetwork vfsConfigNetwork ) { return ! ( vfsConfigNetwork.isAttachedViaLabel ( ) ) ; }
Source:
public static org.ovirt.engine.api.model.StorageType map ( org.ovirt.engine.api.model.StorageType storageType , org.ovirt.engine.api.model.StorageType template ) { switch ( storageType ) { case ISCSI : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case FCP : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case NFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case LOCALFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case POSIXFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.StorageType map ( org.ovirt.engine.api.model.StorageType storageType , org.ovirt.engine.api.model.StorageType template ) { switch ( storageType ) { case ISCSI : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case FCP : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case NFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case LOCALFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case POSIXFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; case GLUSTERFS : return org.ovirt.engine.api.model.org.ovirt.engine.core.common.businessentities.StorageType ; default : return null ; } }
Source:
private void addAuthzColumn ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Permission > authzColumn = 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.getAuthz ( ) ; } } ; authzColumn.makeSortable ( ) ; org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addColumn ( authzColumn , constants.authz ( ) , "150px" ) ; }

Target:
private void addAuthzColumn ( ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.Permission > authzColumn = 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.getAuthz ( ) ; } } ; authzColumn.makeSortable ( ) ; org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.getTable ( ) . addColumn ( authzColumn , org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionListModelTable.constants.authz ( ) , "150px" ) ; }
Source:
private void remove ( ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveProvider , new org.ovirt.engine.core.common.action.ProviderParameters ( ( ( org.ovirt.engine.core.common.businessentities.Provider ) ( getSelectedItem ( ) ) ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { getSearchCommand ( ) . Execute ( ) ; } } ) ; }

Target:
private void remove ( ) { if ( ( getConfirmWindow ( ) ) != null ) { return ; } setConfirmWindow ( new org.ovirt.engine.ui.uicommonweb.models.providers.RemoveProvidersModel ( this ) ) ; }
Source:
protected void updateNumOfSockets ( ) { org.ovirt.engine.core.compat.Version version = getCompatibilityVersion ( ) ; if ( version == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfVmSockets ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.this ; behavior.maxNumOfSockets = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.updataMaxVmsInPool ( ) ; } } ) , version.toString ( ) ) ; }

Target:
protected < T > org.ovirt.engine.ui.frontend.AsyncQuery < T > asyncQuery ( org.ovirt.engine.ui.frontend.AsyncCallback < T > callback ) { return getModel ( ) . asyncQuery ( callback ) ; }
Source:
protected void expectGetLunsForVg ( java.lang.String vgId ) { org.ovirt.engine.core.dao.LunDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.LunDAO.class ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getLunDao ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.getAllForVolumeGroup ( vgId ) ) . thenReturn ( setUpLuns ( ) ) ; }

Target:
protected void expectGetLunsForVg ( java.lang.String vgId , boolean withDummyLun ) { org.ovirt.engine.core.dao.LunDAO dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.LunDAO.class ) ; org.mockito.Mockito.when ( getDbFacadeMockInstance ( ) . getLunDao ( ) ) . thenReturn ( dao ) ; org.mockito.Mockito.when ( dao.getAllForVolumeGroup ( vgId ) ) . thenReturn ( setUpLuns ( withDummyLun ) ) ; }
Source:
public void testDisable ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.DisableGlusterHook , org.ovirt.engine.core.common.action.gluster.GlusterHookParameters.class , new java.lang.String [ ] { "HookId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.hookId } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; verifyActionResponse ( resource.disable ( action ) ) ; }

Target:
public void testDisable ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.DisableGlusterHook , org.ovirt.engine.core.common.action.gluster.GlusterHookParameters.class , new java.lang.String [ ] { "HookId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.hookId } ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; verifyActionResponse ( resource.disable ( action ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc migrateStatus ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.migrateStatus ( vmId ) ; 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 ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusReturnForXmlRpc migrateStatus ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.migrateStatus ( vmId ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.MigrateStatusReturnForXmlRpc ( xmlRpcReturnValue ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void onSave ( ) { if ( validate ( ) ) { flush ( ) ; getDiskModel ( ) . setEntity ( this ) ; this . setChanged ( true ) ; fillData ( ) ; parentModel.getParentListModel ( ) . setWindow ( null ) ; parentModel.getParentListModel ( ) . setWindow ( parentModel.getUnitVmModel ( ) ) ; } }

Target:
public void onSave ( ) { if ( validate ( ) ) { flush ( ) ; getDiskModel ( ) . setEntity ( this ) ; this . setChanged ( true ) ; fillData ( ) ; setDiskModel ( null ) ; } }
Source:
public void testSubResourceLocatorBadGuid ( ) { try { collection.getDiskResource ( "foo" ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testAddIncompleteParameters2 ( ) { org.ovirt.engine.api.model.Disk model = org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.getModel ( ) ; model.setProvisionedSize ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; verifyIncompleteException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( model ) ) , "Disk" , "lambda$testAddIncompleteParameters2$2" , "provisionedSize|size" ) ; }
Source:
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 ( ) ) ) ; if ( ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( org.apache.commons.lang.StringUtils.isNotEmpty ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getHibernationVolHandle ( ) ) ) ) { setSuspendedVm ( true ) ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( stopSuspendedVm ( ) ) ; } else { super . executeVmCommand ( ) ; } }

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 ( ) ) ) ; if ( ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( org.apache.commons.lang.StringUtils.isNotEmpty ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getHibernationVolHandle ( ) ) ) ) { suspendedVm = true ; org.ovirt.engine.core.bll.StopVmCommandBase.setSucceeded ( stopSuspendedVm ( ) ) ; } else { super . executeVmCommand ( ) ; } }
Source:
private void setUpEntityQueryExpectations ( int index , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDirectoryUserById , org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters.class , new java.lang.String [ ] { "Domain" , "Id" } , new java.lang.Object [ ] { DOMAIN , org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( EXTERNAL_IDS [ index ] ) } , ( notFound ? null : getEntity ( index ) ) ) ; }

Target:
private void setUpEntityQueryExpectations ( int index , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( QueryType.GetDirectoryUserById , org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters.class , new java.lang.String [ ] { "Domain" , "Id" } , new java.lang.Object [ ] { DOMAIN , org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( EXTERNAL_IDS [ index ] ) } , ( notFound ? null : getEntity ( index ) ) ) ; }