auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue getVdsReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vdsmVm ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setSucceeded ( true ) ; if ( vdsmVm != null ) { value.setReturnValue ( java.util.Collections.singletonMap ( vdsmVm.getVmDynamic ( ) . getId ( ) , vdsmVm ) ) ; } else { value.setReturnValue ( java.util.Collections.emptyMap ( ) ) ; } return value ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue getVdsReturnValue ( org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VdsmVm vdsmVm ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue value = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; value.setSucceeded ( true ) ; if ( vdsmVm != null ) { value.setReturnValue ( java.util.Collections.singletonMap ( vdsmVm.getVmDynamic ( ) . getId ( ) , vdsmVm ) ) ; } else { value.setReturnValue ( java.util.Collections.emptyMap ( ) ) ; } return value ; }
Source:
private boolean isEditConsoleEnabled ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { if ( ( ( ! ( item.getIsPool ( ) ) ) && ( ( consoleUtils.determineConnectionProtocol ( item ) ) != null ) ) && ( item.getStatus ( ) . equals ( VMStatus.Up ) ) ) { return true ; } return false ; }

Target:
private boolean isEditConsoleEnabled ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { if ( ( ( ! ( item.isPool ( ) ) ) && ( ( consoleUtils.determineConnectionProtocol ( item ) ) != null ) ) && ( item.getStatus ( ) . equals ( VMStatus.Up ) ) ) { return true ; } return false ; }
Source:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public void getDefaultSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
protected boolean validateSoundDevice ( ) { if ( ! ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isSoundDeviceExists ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getManagedVmDeviceMap ( ) . values ( ) ) ) ) { return true ; } if ( ! ( osRepository.isSoundDeviceEnabled ( org.ovirt.engine.core.bll.ImportVmCommandBase.getVm ( ) . getStaticData ( ) . getOsId ( ) , getEffectiveCompatibilityVersion ( ) ) ) ) { addValidationMessageVariable ( "clusterArch" , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getArchitecture ( ) ) ; return failValidation ( EngineMessage.SOUND_DEVICE_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; } return true ; }

Target:
protected boolean validateBallonDevice ( ) { if ( ! ( org.ovirt.engine.core.common.utils.VmDeviceCommonUtils.isBalloonDeviceExists ( getVm ( ) . getManagedVmDeviceMap ( ) . values ( ) ) ) ) { return true ; } if ( ! ( osRepository.isBalloonEnabled ( getVm ( ) . getStaticData ( ) . getOsId ( ) , getEffectiveCompatibilityVersion ( ) ) ) ) { addValidationMessageVariable ( "clusterArch" , org.ovirt.engine.core.bll.ImportVmCommandBase.getVdsGroup ( ) . getArchitecture ( ) ) ; return failValidation ( EngineMessage.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; } return true ; }
Source:
public void getMaxNumOfVmSockets ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
private java.util.List < java.lang.Object > createItems ( ) { java.util.List < java.lang.Object > items = new java.util.ArrayList < java.lang.Object > ( ( ( ReplacementUtils.MAX_NUMBER_OF_PRINTED_ITEMS ) * 2 ) ) ; for ( int i = 0 ; i < ( ( ReplacementUtils.MAX_NUMBER_OF_PRINTED_ITEMS ) * 2 ) ; i ++ ) { items.add ( buildPropertyValue ( i ) ) ; } return items ; }

Target:
private java.util.List < java.lang.Object > createItems ( ) { java.util.List < java.lang.Object > items = new java.util.ArrayList < java.lang.Object > ( ( ( ReplacementUtils.DEFAULT_MAX_NUMBER_OF_PRINTED_ITEMS ) * 2 ) ) ; for ( int i = 0 ; i < ( ( ReplacementUtils.DEFAULT_MAX_NUMBER_OF_PRINTED_ITEMS ) * 2 ) ; i ++ ) { items.add ( buildPropertyValue ( i ) ) ; } return items ; }
Source:
protected boolean validateNoDuplicateDiskImages ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { if ( ! ( getParameters ( ) . isImportAsNewEntity ( ) ) ) { org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( images ) ; return validate ( diskImagesValidator.diskImagesAlreadyExist ( ) ) ; } return true ; }

Target:
protected boolean validateNoDuplicateDiskImages ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { if ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.getParameters ( ) . isImportAsNewEntity ( ) ) ) { org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( images ) ; return validate ( diskImagesValidator.diskImagesAlreadyExist ( ) ) ; } return true ; }
Source:
public void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setTitle ( ( object.getReadOnly ( ) ? getDefaultTitle ( ) : null ) ) ; return object.getReadOnly ( ) ? getDefaultImage ( ) : null ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { if ( ( object.getLastAlignmentScan ( ) ) != null ) { java.lang.String lastScanDate = com.google.gwt.i18n.client.DateTimeFormat.getFormat ( "yyyy-MM-dd, HH:mm" ) . format ( object.getLastAlignmentScan ( ) ) ; setTitle ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.messages.lastDiskAlignment ( lastScanDate ) ) ; } else { setTitle ( null ) ; } return object.getAlignment ( ) . toString ( ) ; }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetVdsInterfacesByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) ) ; try { resource.get ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testParseMultiple ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1,two=2,three=3;bar:ninetynine=99" , "one=bool,two=int,three=bool,ninetynine=int" ) ; org.junit.Assert.assertNotNull ( ret ) ; org.junit.Assert.assertEquals ( 2 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" , "three" , "bool" , "3" ) ; verifyResult ( ret.get ( 1 ) , "bar" , "ninetynine" , "int" , "99" ) ; }

Target:
public void testParseMultiple ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1,two=2,three=3;bar:ninetynine=99" , "one=bool,two=int,three=bool,ninetynine=int" ) ; org.junit.jupiter.api.Assertions.assertNotNull ( ret ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" , "three" , "bool" , "3" ) ; verifyResult ( ret.get ( 1 ) , "bar" , "ninetynine" , "int" , "99" ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = runInternalQuery ( VdcQueryType.GetWatchdog , new org.ovirt.engine.core.common.queries.IdQueryParameters ( getParameters ( ) . getId ( ) ) ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.VmWatchdog > watchdogs = returnValue.getReturnValue ( ) ; if ( ! ( watchdogs.isEmpty ( ) ) ) { return failCanDoAction ( EngineMessage.WATCHDOG_ALREADY_EXISTS ) ; } if ( ! ( validate ( validateWatchdog ( ) ) ) ) { return false ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = runInternalQuery ( VdcQueryType.GetWatchdog , new org.ovirt.engine.core.common.queries.IdQueryParameters ( getParameters ( ) . getId ( ) ) ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.VmWatchdog > watchdogs = returnValue.getReturnValue ( ) ; if ( ! ( watchdogs.isEmpty ( ) ) ) { return failValidation ( EngineMessage.WATCHDOG_ALREADY_EXISTS ) ; } if ( ! ( validate ( validateWatchdog ( ) ) ) ) { return false ; } return true ; }
Source:
public void testGuestFQDN ( ) { org.ovirt.engine.api.restapi.types.VM vm = new org.ovirt.engine.api.restapi.types.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vmDynamic.setFqdn ( "localhost.localdomain" ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.Vm map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; assertNotNull ( map.getFqdn ( ) ) ; assertEquals ( "localhost.localdomain" , map.getFqdn ( ) ) ; }

Target:
public void testGuestFQDN ( ) { org.ovirt.engine.api.restapi.types.VM vm = new org.ovirt.engine.api.restapi.types.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; vmDynamic.setStatus ( VMStatus.Up ) ; vmDynamic.setFqdn ( "localhost.localdomain" ) ; vm.setDynamicData ( vmDynamic ) ; org.ovirt.engine.api.model.Vm map = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.model.Vm ) ( null ) ) ) ; org.junit.Assert.assertNotNull ( map.getFqdn ( ) ) ; org.junit.Assert.assertEquals ( "localhost.localdomain" , map.getFqdn ( ) ) ; }
Source:
public void lowerVersionMgmtNetworkNonSupportedFeatures ( ) { storagePoolWithLowerVersion ( ) ; addNonDefaultClusterToPool ( ) ; final org.ovirt.engine.core.compat.Guid anotherManagementNetworkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; addManagementNetworksToPool ( anotherManagementNetworkId , org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.TEST_MANAGEMENT_NETWORK_ID ) ; setupNetworkValidator ( false ) ; canDoActionFailed ( VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION ) ; }

Target:
private void addManagementNetworksToPool ( int numberOfNetworks ) { for ( int i = 0 ; i < numberOfNetworks ; i ++ ) { final org.ovirt.engine.core.compat.Guid managementNetworkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; allDcNetworks.add ( createNetwork ( managementNetworkId ) ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( managementNetworkId ) ) . thenReturn ( true ) ; } org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( allDcNetworks ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.CommandEntity getChildCommandEntity ( org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = coco.getCommandEntity ( command.getCommandId ( ) ) ; if ( cmdEntity == null ) { command.persistCommand ( parentCommand , ( ( command.getCallBack ( ) ) != null ) ) ; } return coco.getCommandEntity ( command.getCommandId ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.CommandEntity getChildCommandEntity ( org.ovirt.engine.core.bll.CommandBase < ? > command , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = coco.getCommandEntity ( command.getCommandId ( ) ) ; if ( cmdEntity == null ) { command.persistCommand ( parentCommand , ( ( command.getCallback ( ) ) != null ) ) ; } return coco.getCommandEntity ( command.getCommandId ( ) ) ; }
Source:
private void runOnce ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.RunOnceModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.WebadminRunOnceModel ( vm , getCustomPropertiesKeysList ( ) . get ( vm.getVdsGroupCompatibilityVersion ( ) ) , this ) ; setWindow ( model ) ; model.init ( ) ; }

Target:
private void shutdown ( ) { org.ovirt.engine.ui.uicompat.UIConstants constants = org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) ; powerAction ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.SHUTDOWN , constants.shutdownVirtualMachinesTitle ( ) , constants.areYouSureYouWantToShutDownTheFollowingVirtualMachinesMsg ( ) ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.TagsVmMap tagsVmMap ; tagsVmMap = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDao ( ) . getTagVmByTagIdAndByVmId ( org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . gettag_id ( ) , org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getvm_id ( ) ) ; if ( tagsVmMap == null ) { addCanDoActionMessage ( VdcBllMessages.TAGS_SPECIFY_TAG_IS_NOT_EXISTS ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.TagsVmMap tagsVmMap ; tagsVmMap = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getTagDao ( ) . getTagVmByTagIdAndByVmId ( org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . gettag_id ( ) , org.ovirt.engine.core.bll.UpdateTagsVmMapDefaultDisplayTypeCommand.getParameters ( ) . getTagsVmMap ( ) . getvm_id ( ) ) ; if ( tagsVmMap == null ) { addCanDoActionMessage ( EngineMessage.TAGS_SPECIFY_TAG_IS_NOT_EXISTS ) ; return false ; } return true ; }
Source:
public void testRemove ( ) { int before = dao.getAll ( ) . size ( ) ; dao.remove ( existingNetworkCluster.getcluster_id ( ) , existingNetworkCluster.getnetwork_id ( ) ) ; int after = dao.getAll ( ) . size ( ) ; org.junit.Assert.assertEquals ( ( before - 1 ) , after ) ; }

Target:
public void testRemove ( ) { int before = dao.getAll ( ) . size ( ) ; dao.remove ( existingNetworkCluster.getClusterId ( ) , existingNetworkCluster.getNetworkId ( ) ) ; int after = dao.getAll ( ) . size ( ) ; org.junit.Assert.assertEquals ( ( before - 1 ) , after ) ; }
Source:
public void removeAllRemovesFromMacPoolAlso ( ) { runRemoveAllAndVerify ( true , org.mockito.Mockito.times ( 1 ) ) ; }

Target:
protected void verifyRemoveAllDelegatedCorrectly ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface ) { org.mockito.Mockito.verify ( macPoolManager , org.mockito.Mockito.times ( 1 ) ) . freeMac ( iface.getMacAddress ( ) ) ; org.mockito.Mockito.verify ( vmNetworkInterfaceDAO ) . remove ( iface.getId ( ) ) ; org.mockito.Mockito.verify ( vmNetworkStatisticsDAO ) . remove ( iface.getId ( ) ) ; }
Source:
public static org.ovirt.engine.core.bll.provider.storage.OpenStackImageProviderProxy getFromStorageDomainId ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomainStatic = getDbFacade ( ) . getStorageDomainStaticDao ( ) . get ( storageDomainId ) ; if ( storageDomainStatic != null ) { org.ovirt.engine.core.common.businessentities.Provider < ? > provider = getDbFacade ( ) . getProviderDao ( ) . get ( new org.ovirt.engine.core.compat.Guid ( storageDomainStatic.getStorage ( ) ) ) ; return org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( provider ) ; } return null ; }

Target:
public static org.ovirt.engine.core.bll.provider.storage.OpenStackImageProviderProxy getFromStorageDomainId ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.bll.provider.ProviderProxyFactory providerProxyFactory ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomainStatic = getDbFacade ( ) . getStorageDomainStaticDao ( ) . get ( storageDomainId ) ; if ( storageDomainStatic != null ) { org.ovirt.engine.core.common.businessentities.Provider < ? > provider = getDbFacade ( ) . getProviderDao ( ) . get ( new org.ovirt.engine.core.compat.Guid ( storageDomainStatic.getStorage ( ) ) ) ; return providerProxyFactory.create ( provider ) ; } return null ; }
Source:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getDbFacade ( ) . getVmDao ( ) . getAllVmsRelatedToQuotaId ( org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getParameters ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( vm.getStaticData ( ) , true ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.fillImagesBySnapshots ( vm ) ; } org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vms ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = vmDao.getAllVmsRelatedToQuotaId ( org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getParameters ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmInitFromDB ( vm.getStaticData ( ) , true ) ; java.util.Collections.sort ( vm.getDiskList ( ) , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.fillImagesBySnapshots ( vm ) ; } org.ovirt.engine.core.bll.GetVmsRelatedToQuotaIdQuery.getQueryReturnValue ( ) . setReturnValue ( vms ) ; }
Source:
protected org.ovirt.engine.api.model.VmPool deprecatedPopulate ( org.ovirt.engine.api.model.VmPool model , org.ovirt.engine.api.model.VmPool entity ) { if ( ( model.isSetSize ( ) ) && ( ( model.getSize ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , SearchType.VM , ( "Vms: pool=" + ( model.getName ( ) ) ) ) ; model.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; model.getTemplate ( ) . setId ( vm.getVmtGuid ( ) . toString ( ) ) ; } return model ; }

Target:
protected org.ovirt.engine.api.model.VmPool deprecatedPopulate ( org.ovirt.engine.api.model.VmPool model , org.ovirt.engine.api.model.VmPool entity ) { if ( ( model.isSetSize ( ) ) && ( ( model.getSize ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.VM vm = getVM ( model ) ; model.setTemplate ( new org.ovirt.engine.api.model.Template ( ) ) ; model.getTemplate ( ) . setId ( vm.getVmtGuid ( ) . toString ( ) ) ; } return model ; }
Source:
private void updateActionAvailability ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( ) ; getSyncStorageDevicesCommand ( ) . setIsExecutionAllowed ( ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) ; }

Target:
private void updateActionAvailability ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( ) ; if ( vds != null ) { getSyncStorageDevicesCommand ( ) . setIsExecutionAllowed ( ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) ; getCreateBrickCommand ( ) . setIsExecutionAllowed ( ( ( vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { if ( removeVmTemplateImages ( ) ) { org.ovirt.engine.core.bll.VmHandler.removeVmInitFromDB ( getVmTemplate ( ) ) ; setSucceeded ( true ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { if ( ( ! ( imageTemplates.isEmpty ( ) ) ) && ( removeVmTemplateImages ( ) ) ) { org.ovirt.engine.core.bll.VmHandler.removeVmInitFromDB ( getVmTemplate ( ) ) ; setSucceeded ( true ) ; } if ( ! ( cinderDisks.isEmpty ( ) ) ) { removeCinderDisks ( cinderDisks ) ; setSucceeded ( true ) ; } return null ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( ( ( getModel ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.events.EventListModel ) && ( "LastEvent" . equals ( pcArgs.PropertyName ) ) ) { org.ovirt.engine.ui.uicommonweb.models.events.EventListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.events.EventListModel ) ( getModel ( ) ) ) ; if ( ( ( model.getLastEvent ( ) ) == null ) && ( model.isRequestingData ( ) ) ) { clearData ( ) ; } else { updateData ( ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( ( ( getModel ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.events.EventListModel ) && ( "LastEvent" . equals ( pcArgs.propertyName ) ) ) { org.ovirt.engine.ui.uicommonweb.models.events.EventListModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.events.EventListModel ) ( getModel ( ) ) ) ; if ( ( ( model.getLastEvent ( ) ) == null ) && ( model.isRequestingData ( ) ) ) { clearData ( ) ; } else { updateData ( ) ; } } }
Source:
protected void setImageStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus imageStatus , org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { if ( ( diskImage != null ) && ( ( diskImage.getImageStatus ( ) ) != imageStatus ) ) { diskImage.setImageStatus ( imageStatus ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( diskImage.getImage ( ) . getId ( ) , imageStatus ) ; } }

Target:
protected void setImageStatus ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus imageStatus , org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { if ( ( diskImage != null ) && ( ( diskImage.getImageStatus ( ) ) != imageStatus ) ) { diskImage.setImageStatus ( imageStatus ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( diskImage.getImage ( ) . getId ( ) , imageStatus ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.DiscoverSendTargetsQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DiscoverSendTargets , new org.ovirt.engine.core.common.vdscommands.DiscoverSendTargetsVDSCommandParameters ( org.ovirt.engine.core.bll.storage.DiscoverSendTargetsQuery.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.DiscoverSendTargetsQuery.getParameters ( ) . getConnection ( ) ) ) . getReturnValue ( ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.DiscoverSendTargetsQuery.getQueryReturnValue ( ) . setReturnValue ( runVdsCommand ( VDSCommandType.DiscoverSendTargets , new org.ovirt.engine.core.common.vdscommands.DiscoverSendTargetsVDSCommandParameters ( org.ovirt.engine.core.bll.storage.DiscoverSendTargetsQuery.getParameters ( ) . getVdsId ( ) , org.ovirt.engine.core.bll.storage.DiscoverSendTargetsQuery.getParameters ( ) . getConnection ( ) ) ) . getReturnValue ( ) ) ; }
Source:
public void testAddVMToAffinityGroup ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.EditAffinityGroup , org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setId ( GUIDS [ 0 ] . toString ( ) ) ; javax.ws.rs.core.Response response = collection.add ( vm ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }

Target:
public void testAddVMToAffinityGroup ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( false ) ; setUriInfo ( setUpActionExpectations ( ActionType.EditAffinityGroup , org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setId ( GUIDS [ 0 ] . toString ( ) ) ; javax.ws.rs.core.Response response = collection.add ( vm ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }
Source:
public void canDoActionFailsWhenGlusterServerHasPeers ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.junit.Assert.assertFalse ( commandMock.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( commandMock.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.SERVER_ALREADY_PART_OF_ANOTHER_CLUSTER.toString ( ) ) ) ; }

Target:
public void canDoActionFailsWhenGlusterServerHasPeers ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterDBUtils.serverExists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( org.ovirt.engine.core.bll.AddVdsCommandTest.PEER_1 ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( commandMock.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( commandMock.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.SERVER_ALREADY_PART_OF_ANOTHER_CLUSTER.toString ( ) ) ) ; }
Source:
protected void failedToMigrate ( ) { try { determineMigrationFailureForAuditLog ( ) ; org.ovirt.engine.core.bll.MigrateVmCommand.runningFailed ( ) ; } finally { org.ovirt.engine.core.bll.MigrateVmCommand.freeLock ( ) ; } }

Target:
public void rerun ( ) { org.ovirt.engine.core.bll.MigrateVmCommand.setVm ( null ) ; determineMigrationFailureForAuditLog ( ) ; if ( ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.MigrateVmCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ) { setVdsDestinationId ( null ) ; super . rerun ( ) ; } else { org.ovirt.engine.core.bll.MigrateVmCommand.runningFailed ( ) ; _isRerun = true ; } }
Source:
private void activeDetailModelChanging ( org.ovirt.engine.ui.uicommonweb.models.EntityModel newValue , org.ovirt.engine.ui.uicommonweb.models.EntityModel oldValue ) { if ( oldValue != null ) { oldValue.setEntity ( null ) ; if ( oldValue instanceof org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) { ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( oldValue ) ) . stopRefresh ( ) ; } } if ( newValue != null ) { newValue.setEntity ( provideDetailModelEntity ( getSelectedItem ( ) ) ) ; } }

Target:
private void activeDetailModelChanging ( org.ovirt.engine.ui.uicommonweb.models.HasEntity < D > newValue , org.ovirt.engine.ui.uicommonweb.models.HasEntity < D > oldValue ) { if ( oldValue != null ) { oldValue.setEntity ( null ) ; if ( oldValue instanceof org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) { ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( oldValue ) ) . stopRefresh ( ) ; } } if ( newValue != null ) { newValue.setEntity ( provideDetailModelEntity ( org.ovirt.engine.ui.uicommonweb.models.ListWithDetailsModel.getSelectedItem ( ) ) ) ; } }
Source:
protected boolean updateReadOnlyRequested ( ) { java.lang.Boolean readOnlyNewValue = getNewDisk ( ) . getReadOnly ( ) ; return ( readOnlyNewValue != null ) && ( ! ( getVmDeviceForVm ( ) . getIsReadOnly ( ) . equals ( readOnlyNewValue ) ) ) ; }

Target:
private boolean resizeDiskImageRequested ( ) { boolean sizeChanged = ( getNewDisk ( ) . getSize ( ) ) != ( getOldDisk ( ) . getSize ( ) ) ; switch ( getNewDisk ( ) . getDiskStorageType ( ) ) { case IMAGE : return sizeChanged && ( ( vmDeviceForVm.getSnapshotId ( ) ) == null ) ; case CINDER : return sizeChanged ; } return false ; }
Source:
public void getUpHostListByCluster ( 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 ) { 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 > ( ) ; } } ; getUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DataCenter dataCenter ) { validateParameters ( dataCenter , "name" , "storageType" ) ; validateEnums ( org.ovirt.engine.api.model.DataCenter.class , dataCenter ) ; validateEnum ( org.ovirt.engine.api.model.StorageType.class , dataCenter.getStorageType ( ) . toUpperCase ( ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool entity = map ( dataCenter ) ; return performCreation ( VdcActionType.AddEmptyStoragePool , new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DataCenter dataCenter ) { validateParameters ( dataCenter , "name" , "storageType" ) ; validateEnums ( org.ovirt.engine.api.model.DataCenter.class , dataCenter ) ; validateEnum ( org.ovirt.engine.api.model.StorageType.class , dataCenter.getStorageType ( ) . toUpperCase ( ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool entity = map ( dataCenter ) ; return performCreate ( VdcActionType.AddEmptyStoragePool , new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase.class ) ) ; }
Source:
private void addInterfaceDeviceToDb ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addNetworkInterfaceDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . isPlugged ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDevice ) ; }

Target:
private void addInterfaceDeviceToDb ( ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addNetworkInterfaceDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getParameters ( ) . getVmId ( ) ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . isPlugged ( ) , org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getInterface ( ) . getCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVmInterfaceCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDevice ) ; }
Source:
public void canDoActionFailsOnCompatVersion ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CommitRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTask , getBricks ( volumeWithRemoveBricksTask ) ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.UNSUPPORTED_VERSION ) . when ( vdsGroup ) . getCompatibilityVersion ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.GLUSTER_TASKS_NOT_SUPPORTED_FOR_CLUSTER_LEVEL.toString ( ) ) ) ; }

Target:
public void canDoActionFailsOnCompatVersion ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CommitRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTask , getBricks ( volumeWithRemoveBricksTask ) ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.UNSUPPORTED_VERSION ) . when ( vdsGroup ) . getCompatibilityVersion ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.GLUSTER_TASKS_NOT_SUPPORTED_FOR_CLUSTER_LEVEL.toString ( ) ) ) ; }
Source:
public void canDoActionEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ) . when ( command ) . getAllImageSnapshots ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void canDoActionEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public void onDoubleClick ( com.google.gwt.event.dom.client.DoubleClickEvent event ) { org.ovirt.engine.ui.uicommonweb.models.Model model = dataProvider.getModel ( ) ; org.ovirt.engine.ui.uicommonweb.UICommand defaultCommand = model.getDefaultCommand ( ) ; if ( ( defaultCommand != null ) && ( defaultCommand.getIsExecutionAllowed ( ) ) ) { org.ovirt.engine.ui.common.uicommon.model.DeferredModelCommandInvoker invoker = new org.ovirt.engine.ui.common.uicommon.model.DeferredModelCommandInvoker ( model ) ; invoker.invokeDefaultCommand ( ) ; } }

Target:
public void onDoubleClick ( com.google.gwt.event.dom.client.DoubleClickEvent event ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel model = dataProvider.getModel ( ) ; org.ovirt.engine.ui.uicommonweb.UICommand command = model.getDoubleClickCommand ( ) ; if ( ( command != null ) && ( command.getIsExecutionAllowed ( ) ) ) { org.ovirt.engine.ui.common.uicommon.model.DeferredModelCommandInvoker invoker = new org.ovirt.engine.ui.common.uicommon.model.DeferredModelCommandInvoker ( model ) ; invoker.invokeCommand ( command ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createConnection ( org.ovirt.engine.core.compat.Guid id , java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type , org.ovirt.engine.core.common.businessentities.NfsVersion version , int timeout , int retrans ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connectionDetails.setid ( id.toString ( ) ) ; connectionDetails.setconnection ( connection ) ; connectionDetails.setNfsVersion ( version ) ; connectionDetails.setNfsTimeo ( ( ( short ) ( timeout ) ) ) ; connectionDetails.setstorage_type ( type ) ; connectionDetails.setNfsRetrans ( ( ( short ) ( retrans ) ) ) ; return connectionDetails ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createNFSConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type , org.ovirt.engine.core.common.businessentities.NfsVersion version , int timeout , int retrans ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( id , connection , type ) ; connectionDetails.setNfsVersion ( version ) ; connectionDetails.setNfsTimeo ( ( ( short ) ( timeout ) ) ) ; connectionDetails.setNfsRetrans ( ( ( short ) ( retrans ) ) ) ; return connectionDetails ; }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addBonds ( org.ovirt.engine.core.common.businessentities.network.Bond ... bonds ) { if ( emptyParameters ( bonds ) ) { return this ; } if ( ( parameters.getBonds ( ) ) == null ) { parameters.setBonds ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Bond > ( ) ) ; } parameters.getBonds ( ) . addAll ( java.util.Arrays.asList ( bonds ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedNetworkAttachments ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ... networkAttachments ) { if ( nullParameters ( networkAttachments ) ) { return this ; } if ( ( parameters.getRemovedNetworkAttachments ( ) ) == null ) { parameters.setRemovedNetworkAttachments ( new java.util.HashSet < > ( ) ) ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment : networkAttachments ) { parameters.getRemovedNetworkAttachments ( ) . add ( networkAttachment.getId ( ) ) ; } return this ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { java.lang.Object returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) . getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > allHostVfs = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig > ) ( returnValue ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig : allHostVfs ) { originalVfsConfigs.add ( vfsConfig ) ; nicToVfsConfig.put ( vfsConfig.getNicId ( ) , new org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig ( vfsConfig ) ) ; } queryFreeBonds ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { allNetworks = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > ) ( returnValue ) ) ; initNetworkModels ( ) ; initDcNetworkParams ( ) ; queryInterfaces ( ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createBond ( java.lang.String name , java.lang.String networkName ) { return createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , name , true , null , null , null , networkName , true , null , false , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface createNic ( java.lang.String nicName , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createVdsInterface ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , nicName , false , null , null , null , networkName , true , null , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED ) ; mockCalculateBaseNicWhenBaseNicIsPassed ( nic ) ; return nic ; }
Source:
public void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public void getGlusterVolumeGeoRepRecommendationViolations ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId , org.ovirt.engine.core.compat.Guid slaveVolumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return returnValue == null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ( ) : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ) ( returnValue ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNonEligibilityReasonsOfVolumeForGeoRepSession , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeGeoRepEligibilityParameters ( masterVolumeId , slaveVolumeId ) , aQuery ) ; }
Source:
private static boolean IsLegalStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { boolean result ; switch ( status ) { case Down : case InstallFailed : case Maintenance : case NonOperational : case NonResponsive : case Reboot : case Installing : result = true ; break ; default : result = false ; break ; } return result ; }

Target:
private static boolean IsLegalStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { boolean result ; switch ( status ) { case Down : case InstallFailed : case Maintenance : case NonOperational : case NonResponsive : case Reboot : case Installing : case Connecting : result = true ; break ; default : result = false ; break ; } return result ; }