auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void updateMigrationAvailability ( ) { java.lang.Boolean haHost = getModel ( ) . getIsHighlyAvailable ( ) . getEntity ( ) ; if ( haHost ) { getModel ( ) . getMigrationMode ( ) . setChangeProhibitionReason ( constants.hostIsHa ( ) ) ; getModel ( ) . getMigrationMode ( ) . setSelectedItem ( MigrationSupport.MIGRATABLE ) ; } getModel ( ) . getMigrationMode ( ) . setIsChangable ( ( ! haHost ) ) ; }

Target:
public void updateMigrationAvailability ( ) { java.lang.Boolean haHost = getModel ( ) . getIsHighlyAvailable ( ) . getEntity ( ) ; if ( haHost ) { getModel ( ) . getMigrationMode ( ) . setChangeProhibitionReason ( constants.hostIsHa ( ) ) ; getModel ( ) . getMigrationMode ( ) . setSelectedItem ( MigrationSupport.MIGRATABLE ) ; } getModel ( ) . getMigrationMode ( ) . setIsChangeable ( ( ! haHost ) ) ; }
Source:
public void testGetAllStoragePoolSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( "Datacenter:" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( storagePoolResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }

Target:
public void testGetAllMultiClusterSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Clusters" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertTrue ( ( ( vdsGroupResultList ) == ( searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ) ) ; }
Source:
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.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { return domain ; } } return null ; }

Target:
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.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : storageDomains ) { if ( ( domain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) { return domain ; } } return null ; }
Source:
private void onRemove ( ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = ( ( org.ovirt.engine.core.common.businessentities.Snapshot ) ( getSelectedItem ( ) ) ) ; if ( snapshot == null ) { cancel ( ) ; return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveSnapshot , new org.ovirt.engine.core.common.action.RemoveSnapshotParameters ( snapshot.getId ( ) , vm.getId ( ) ) , null , null ) ; } getCanSelectSnapshot ( ) . setEntity ( false ) ; cancel ( ) ; }

Target:
private void onRemove ( ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = ( ( org.ovirt.engine.core.common.businessentities.Snapshot ) ( getSelectedItem ( ) ) ) ; if ( snapshot == null ) { cancel ( ) ; return ; } org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveSnapshot , new org.ovirt.engine.core.common.action.RemoveSnapshotParameters ( snapshot.getId ( ) , vm.getId ( ) ) , null , null ) ; } getCanSelectSnapshot ( ) . setEntity ( false ) ; cancel ( ) ; }
Source:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }

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 ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
private java.lang.String getUrl ( ) { return org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel.getVmwareUrl ( getUsername ( ) . getEntity ( ) , getvCenter ( ) . getEntity ( ) , getVmwareDatacenter ( ) . getEntity ( ) , getEsx ( ) . getEntity ( ) , getVerify ( ) . getEntity ( ) ) ; }

Target:
private java.lang.String getUrl ( ) { return org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmsModel.getVmwareUrl ( getUsername ( ) . getEntity ( ) , getvCenter ( ) . getEntity ( ) , getVmwareDatacenter ( ) . getEntity ( ) , getVmwareCluster ( ) . getEntity ( ) , getEsx ( ) . getEntity ( ) , getVerify ( ) . getEntity ( ) ) ; }
Source:
public void testUpdateOriginalTemplateName ( ) { dao.updateOriginalTemplateName ( FixturesTool.VM_TEMPLATE_RHEL6_2 , "renamed" ) ; java.util.List < java.lang.String > renamedTemplates = java.util.Arrays.asList ( "77296e00-0cad-4e5a-9299-008a7b6f4354" , "77296e00-0cad-4e5a-9299-008a7b6f4355" , "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ; java.util.List < java.lang.String > notRenamedTemplate = java.util.Arrays.asList ( "77296e00-0cad-4e5a-9299-008a7b6f4359" ) ; assertOriginalTemplateNameIs ( renamedTemplates , "renamed" ) ; assertOriginalTemplateNameIs ( notRenamedTemplate , "otherTemplateName" ) ; }

Target:
public void testUpdateOriginalTemplateName ( ) { dao.updateOriginalTemplateName ( FixturesTool.VM_TEMPLATE_RHEL6_2 , "renamed" ) ; java.util.List < java.lang.String > renamedTemplates = java.util.Arrays.asList ( "77296e00-0cad-4e5a-9299-008a7b6f4354" , "77296e00-0cad-4e5a-9299-008a7b6f4355" , "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ; java.util.List < java.lang.String > notRenamedTemplate = java.util.Collections.singletonList ( "77296e00-0cad-4e5a-9299-008a7b6f4359" ) ; assertOriginalTemplateNameIs ( renamedTemplates , "renamed" ) ; assertOriginalTemplateNameIs ( notRenamedTemplate , "otherTemplateName" ) ; }
Source:
public static void GetNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) , aQuery ) ; }

Target:
public static void GetDocumentationBaseURL ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void executeCommand ( ) { try { addVmToDb ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = getVm ( ) ; if ( vm.getImages ( ) . isEmpty ( ) ) { endVmRelatedOps ( ) ; } else { processImages ( ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { try { addVmToDb ( ) ; processImages ( ) ; if ( getReturnValue ( ) . getVdsmTaskIdList ( ) . isEmpty ( ) ) { endVmRelatedOps ( ) ; } } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } setSucceeded ( true ) ; }
Source:
public org.ovirt.engine.core.common.locks.LockInfo getLockInfo ( java.lang.String key ) { org.ovirt.engine.core.bll.lock.InMemoryLockManager.InternalLockView internalLockView = locks.get ( key ) ; if ( internalLockView == null ) { return null ; } java.util.Set < java.lang.String > messages = internalLockView.getMessages ( ) ; messages.remove ( VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED.name ( ) ) ; if ( messages.isEmpty ( ) ) { return null ; } return new org.ovirt.engine.core.common.locks.LockInfo ( internalLockView.getExclusive ( ) , messages ) ; }

Target:
public org.ovirt.engine.core.common.locks.LockInfo getLockInfo ( java.lang.String key ) { org.ovirt.engine.core.bll.lock.InMemoryLockManager.InternalLockView internalLockView = locks.get ( key ) ; if ( internalLockView == null ) { return null ; } java.util.Set < java.lang.String > messages = internalLockView.getMessages ( ) ; messages.remove ( EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED.name ( ) ) ; if ( messages.isEmpty ( ) ) { return null ; } return new org.ovirt.engine.core.common.locks.LockInfo ( internalLockView.getExclusive ( ) , messages ) ; }
Source:
protected com.google.gwt.user.cellview.client.CellTree createDataDisplayWidget ( org.ovirt.engine.ui.webadmin.uicommon.model.SystemTreeModelProvider modelProvider ) { org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.SystemTreeResources res = com.google.gwt.core.client.GWT.create ( org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.SystemTreeResources.class ) ; display = new com.google.gwt.user.cellview.client.CellTree ( modelProvider , null , res ) ; display.setAnimationEnabled ( true ) ; display.setKeyboardSelectionPolicy ( KeyboardSelectionPolicy.BOUND_TO_SELECTION ) ; return display ; }

Target:
protected com.google.gwt.user.cellview.client.CellTree createDataDisplayWidget ( org.ovirt.engine.ui.webadmin.uicommon.model.SystemTreeModelProvider modelProvider ) { org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.SystemTreeResources res = com.google.gwt.core.client.GWT.create ( org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.SystemTreeResources.class ) ; display = new com.google.gwt.user.cellview.client.CellTree ( modelProvider , null , res ) { @ java.lang.Override protected void onLoad ( ) { expandTree ( display.getRootTreeNode ( ) , org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.ITEM_LEVEL ) ; } } ; display.setAnimationEnabled ( true ) ; display.setKeyboardSelectionPolicy ( KeyboardSelectionPolicy.BOUND_TO_SELECTION ) ; return display ; }
Source:
public void getAAANamespaces ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.List < ? > ) ( source ) ) ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
private boolean containsNetwork ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments , final org.ovirt.engine.core.common.businessentities.network.Network network ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachmentRelatedToNetwork = org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( networkAttachments , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { return network.getId ( ) . equals ( networkAttachment.getNetworkId ( ) ) ; } } ) ; return networkAttachmentRelatedToNetwork != null ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment getNetworkAttachmentRelatedToNetwork ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments , final org.ovirt.engine.core.common.businessentities.network.Network network ) { return org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( networkAttachments , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment ) { return network.getId ( ) . equals ( networkAttachment.getNetworkId ( ) ) ; } } ) ; }
Source:
public void processOnVmStop ( final java.util.Collection < org.ovirt.engine.core.compat.Guid > vmIds ) { if ( vmIds.isEmpty ( ) ) { return ; } org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmIds ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.IdParameters ( vmId ) ) ; } } } ) ; }

Target:
public void processOnVmStop ( final java.util.Collection < org.ovirt.engine.core.compat.Guid > vmIds , final org.ovirt.engine.core.compat.Guid hostId , boolean useSeparateThread ) { if ( vmIds.isEmpty ( ) ) { return ; } if ( useSeparateThread ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { processOnVmStopInternal ( vmIds , hostId ) ; } } ) ; } else { processOnVmStopInternal ( vmIds , hostId ) ; } }
Source:
public void networkNotInVfsConfigNotValid ( ) { networkInVfsConfigCommonTest ( true ) ; org.junit.Assert.assertThat ( validator.networkNotInVfsConfig ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_ALREADY_IN_VFS_CONFIG , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) ) ; }

Target:
public void networkNotInVfsConfigNotValid ( ) { networkInVfsConfigCommonTest ( true ) ; org.junit.Assert.assertThat ( validator.networkNotInVfsConfig ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_ALREADY_IN_VFS_CONFIG , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) ) ; }
Source:
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 ) ; }

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.debug ( "PendingVms for the guest '{}' running on host '{}' 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:
static java.util.List < org.ovirt.engine.core.common.scheduling.AffinityGroup > setsToAffinityGroups ( java.util.Set < java.util.Set < org.ovirt.engine.core.compat.Guid > > uag ) { java.util.List < org.ovirt.engine.core.common.scheduling.AffinityGroup > output = new java.util.ArrayList < > ( ) ; for ( java.util.Set < org.ovirt.engine.core.compat.Guid > s : uag ) { org.ovirt.engine.core.common.scheduling.AffinityGroup temp = new org.ovirt.engine.core.common.scheduling.AffinityGroup ( ) ; temp.setPositive ( true ) ; java.util.List < org.ovirt.engine.core.compat.Guid > entities = new java.util.ArrayList < > ( ) ; entities.addAll ( s ) ; temp.setEntityIds ( entities ) ; output.add ( temp ) ; } return output ; }

Target:
static java.util.List < org.ovirt.engine.core.common.scheduling.AffinityGroup > setsToAffinityGroups ( java.util.Set < java.util.Set < org.ovirt.engine.core.compat.Guid > > uag ) { java.util.List < org.ovirt.engine.core.common.scheduling.AffinityGroup > output = new java.util.ArrayList < > ( ) ; for ( java.util.Set < org.ovirt.engine.core.compat.Guid > s : uag ) { org.ovirt.engine.core.common.scheduling.AffinityGroup temp = new org.ovirt.engine.core.common.scheduling.AffinityGroup ( ) ; temp.setVmAffinityRule ( EntityAffinityRule.POSITIVE ) ; java.util.List < org.ovirt.engine.core.compat.Guid > entities = new java.util.ArrayList < > ( ) ; entities.addAll ( s ) ; temp.setVmIds ( entities ) ; output.add ( temp ) ; } return output ; }
Source:
private boolean useMac ( long mac , boolean allowDuplicates ) { org.ovirt.engine.core.bll.network.macpoolmanager.Range range = findIncludingRange ( mac ) ; if ( range == null ) { return customMacs.increase ( mac , allowDuplicates ) ; } else { return range.use ( mac , allowDuplicates ) ; } }

Target:
private boolean useMac ( long mac , boolean allowDuplicates ) { org.ovirt.engine.core.bll.network.macpool.Range range = findIncludingRange ( mac ) ; if ( range == null ) { return customMacs.increase ( mac , allowDuplicates ) ; } else { return range.use ( mac , allowDuplicates ) ; } }
Source:
private void addImportedDevices ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = vm.getStaticData ( ) ; vmStatic.setImages ( new java.util.ArrayList < > ( ) ) ; vmStatic.setInterfaces ( new java.util.ArrayList < > ( ) ) ; org.ovirt.engine.core.bll.ImportUtils.updateGraphicsDevices ( vmStatic , org.ovirt.engine.core.bll.ConvertVmCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( vmStatic , false ) ; }

Target:
private void addImportedDevices ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = vm.getStaticData ( ) ; vmStatic.setImages ( new java.util.ArrayList < > ( ) ) ; vmStatic.setInterfaces ( new java.util.ArrayList < > ( ) ) ; org.ovirt.engine.core.bll.ImportUtils.updateGraphicsDevices ( vmStatic , org.ovirt.engine.core.bll.ConvertVmCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addImportedDevices ( vmStatic , false ) ; org.ovirt.engine.core.bll.ConvertVmCommand.getVmDeviceDao ( ) . updateBootOrderInBatch ( new java.util.ArrayList ( vm.getManagedVmDeviceMap ( ) . values ( ) ) ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImage ( ) ; if ( diskImage == null ) { return null ; } return java.util.Collections.singletonMap ( diskImage.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.DISK , getDiskIsBeingExportedMessage ( ) ) ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImage ( ) ; if ( diskImage == null ) { return null ; } return java.util.Collections.singletonMap ( diskImage.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.DISK , new org.ovirt.engine.core.bll.LockMessage ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_IS_BEING_EXPORTED ) . withOptional ( "DiskAlias" , ( ( getDiskImage ( ) ) != null ? getDiskImage ( ) . getDiskAlias ( ) : null ) ) ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > getVdsNumaNodes ( ) { if ( ! ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) . getDedicatedVmForVdsList ( ) . isEmpty ( ) ) ) { org.ovirt.engine.core.compat.Guid vdsId = org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) . getDedicatedVmForVdsList ( ) . get ( 0 ) ; if ( vdsId != null ) { return getVdsNumaNodeDao ( ) . getAllVdsNumaNodeByVdsId ( vdsId ) ; } } return java.util.Arrays.asList ( ) ; }

Target:
protected org.ovirt.engine.core.bll.numa.vm.NumaValidator getNumaValidator ( ) { return numaValidator ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "IsAvailable" . equals ( args.propertyName ) ) { toggleVisibility ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "IsAvailable" . equals ( args.propertyName ) ) { toggleVisibility ( ) ; } else if ( "IsChangable" . equals ( args.propertyName ) ) { updateChangeability ( model.getIsChangable ( ) ) ; } }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase createDefaultConcreteException ( java.lang.String errorMessage ) { org.ovirt.engine.core.common.businessentities.StorageDomain domainFromDb = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . get ( org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( domainFromDb == null ) || ( ( domainFromDb.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return new org.ovirt.engine.core.vdsbroker.irsbroker.IrsOperationFailedNoFailoverException ( errorMessage ) ; } return super . createDefaultConcreteException ( errorMessage ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase createDefaultConcreteException ( java.lang.String errorMessage ) { org.ovirt.engine.core.common.businessentities.StorageDomain domainFromDb = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . get ( org.ovirt.engine.core.vdsbroker.irsbroker.AttachStorageDomainVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( domainFromDb == null ) || ( ( domainFromDb.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) { return new org.ovirt.engine.core.vdsbroker.irsbroker.IrsOperationFailedNoFailoverException ( errorMessage ) ; } return super . createDefaultConcreteException ( errorMessage ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.DbGroup getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DbGroup entity = new org.ovirt.engine.core.common.businessentities.DbGroup ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.GROUP_NAMES [ index ] ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.DbGroup getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DbGroup entity = new org.ovirt.engine.core.common.businessentities.DbGroup ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setName ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.GROUP_NAMES [ index ] ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; entity.setNamespace ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.NAMESPACE ) ; return entity ; }
Source:
protected void setAllowChangeHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallFailed ) ) { getHost ( ) . setIsChangable ( false ) ; getAuthSshPort ( ) . setIsChangable ( false ) ; } else { getHost ( ) . setIsChangable ( true ) ; getAuthSshPort ( ) . setIsChangable ( true ) ; } }

Target:
protected void setAllowChangeHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallFailed ) ) { getHost ( ) . setIsChangeable ( false ) ; getAuthSshPort ( ) . setIsChangeable ( false ) ; } else { getHost ( ) . setIsChangeable ( true ) ; getAuthSshPort ( ) . setIsChangeable ( true ) ; } }
Source:
private static void assertContainsBlankTemplate ( org.ovirt.engine.api.model.SpecialObjects objs ) { for ( org.ovirt.engine.api.model.Link link : objs.getLinks ( ) ) { if ( ( link.getHref ( ) . equals ( org.ovirt.engine.api.restapi.resource.BackendApiResourceTest.BLANK_TEMPLATE_HREF ) ) && ( link.getRel ( ) . equals ( org.ovirt.engine.api.restapi.resource.BackendApiResourceTest.BLANK_TEMPLATE_REL ) ) ) { return ; } } fail ( ) ; }

Target:
private static void assertContainsBlankTemplate ( org.ovirt.engine.api.model.SpecialObjects objs ) { for ( org.ovirt.engine.api.model.Link link : objs.getLinks ( ) ) { if ( ( link.getHref ( ) . equals ( org.ovirt.engine.api.restapi.resource.BackendApiResourceTest.BLANK_TEMPLATE_HREF ) ) && ( link.getRel ( ) . equals ( org.ovirt.engine.api.restapi.resource.BackendApiResourceTest.BLANK_TEMPLATE_REL ) ) ) { return ; } } org.junit.Assert.fail ( ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > getAll ( ) { try { org.openstack.quantum.model.Networks networks = getQuantumClient ( ) . execute ( new org.openstack.quantum.api.networks.ListNetworks ( ) ) ; return map ( networks.getList ( ) ) ; } catch ( java.lang.RuntimeException e ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.ENGINE , new java.lang.RuntimeException ( e ) ) ; } }

Target:
private com.woorea.openstack.quantum.Quantum getClient ( ) { if ( ( client ) == null ) { client = new com.woorea.openstack.quantum.Quantum ( ( ( provider.getUrl ( ) ) + ( org.ovirt.engine.core.bll.provider.network.openstack.OpenstackNetworkProviderProxy.API_VERSION ) ) ) ; } return client ; }
Source:
public void perform ( ) { if ( manager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = ( getRefreshStatistics ( ) ) ? new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( manager ) : new org.ovirt.engine.core.vdsbroker.VmsListFetcher ( manager ) ; long fetchTime = java.lang.System.nanoTime ( ) ; fetcher.fetch ( ) ; new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( manager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , auditLogDirector , fetchTime ) . perform ( ) ; } }

Target:
public void perform ( ) { if ( manager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = ( getRefreshStatistics ( ) ) ? new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( manager ) : new org.ovirt.engine.core.vdsbroker.VmsListFetcher ( manager ) ; long fetchTime = java.lang.System.nanoTime ( ) ; if ( fetcher.fetch ( ) ) { getVmsMonitoring ( fetcher , fetchTime ) . perform ( ) ; } else { org.ovirt.engine.core.vdsbroker.PollVMStatsRefresher.log.info ( "Failed to fetch vms info for host '{}' - skipping VMs monitoring." , manager.getVdsName ( ) ) ; } } updateIteration ( ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( masterDomain.getStorageStaticData ( ) ) ; masterDomain.setStorageDomainType ( StorageDomainType.Data ) ; getDbFacade ( ) . getStorageDomainStaticDao ( ) . update ( masterDomain.getStorageStaticData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { detachStorageDomainWithEntities ( masterDomain ) ; getCompensationContext ( ) . snapshotEntity ( masterDomain.getStorageStaticData ( ) ) ; masterDomain.setStorageDomainType ( StorageDomainType.Data ) ; getDbFacade ( ) . getStorageDomainStaticDao ( ) . update ( masterDomain.getStorageStaticData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
protected void setUpGetGraphicsExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetGraphicsDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } }

Target:
protected void setUpGetGraphicsExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetGraphicsDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.GraphicsDevice ( org.ovirt.engine.core.common.utils.VmDeviceType.SPICE ) ) ) ; } }
Source:
protected boolean setAndValidateDiskProfiles ( ) { java.util.Map < org.ovirt.engine.core.common.businessentities.storage.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImageByImageId ( parameters.getImageId ( ) ) ; map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCurrentUser ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { java.util.Map < org.ovirt.engine.core.common.businessentities.storage.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getDiskImageByImageId ( parameters.getImageId ( ) ) ; map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( diskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.storage.lsm.LiveMigrateVmDisksCommand.getCurrentUser ( ) ) ) ; }
Source:
public boolean isValid ( ) throws org.ovirt.engine.core.sso.utils.AuthenticationException { if ( org.apache.commons.lang.StringUtils.isEmpty ( username ) ) { throw new org.ovirt.engine.core.sso.utils.AuthenticationException ( java.lang.String.format ( "No user name found in credentials" ) ) ; } if ( ! ( profileValid ) ) { throw new org.ovirt.engine.core.sso.utils.AuthenticationException ( java.lang.String.format ( "No valid profile found in credentials" ) ) ; } if ( org.apache.commons.lang.StringUtils.isEmpty ( profile ) ) { throw new org.ovirt.engine.core.sso.utils.AuthenticationException ( java.lang.String.format ( "No profile found in credentials" ) ) ; } return true ; }

Target:
public boolean isProfileValid ( ) { return profileValid ; }
Source:
protected boolean isDiskPassPCIAndIDELimit ( org.ovirt.engine.core.common.businessentities.Disk diskInfo ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > vmInterfaces = org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmNetworkInterfaceDAO ( ) . getAllForVm ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Disk > allVmDisks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) ; allVmDisks.add ( diskInfo ) ; return CheckPCIAndIDELimit ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getnum_of_monitors ( ) , vmInterfaces , allVmDisks , org.ovirt.engine.core.bll.AbstractDiskVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean isDiskPassPciAndIdeLimit ( org.ovirt.engine.core.common.businessentities.Disk diskInfo ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > vmInterfaces = org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmNetworkInterfaceDAO ( ) . getAllForVm ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Disk > allVmDisks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) ; allVmDisks.add ( diskInfo ) ; return checkPciAndIdeLimit ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getnum_of_monitors ( ) , vmInterfaces , allVmDisks , org.ovirt.engine.core.bll.AbstractDiskVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
public void testAddStoragePoolIsoMap ( ) { dao.save ( newStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( newStoragePoolIsoMap.getstorage_id ( ) , new org.ovirt.engine.core.compat.Guid ( newStoragePoolIsoMap.getstorage_pool_id ( ) . toString ( ) ) ) ) ; assertNotNull ( result ) ; assertEquals ( newStoragePoolIsoMap , result ) ; }

Target:
public void testAddStoragePoolIsoMap ( ) { dao.save ( newStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( newStoragePoolIsoMap.getstorage_id ( ) , new org.ovirt.engine.core.compat.Guid ( newStoragePoolIsoMap.getstorage_pool_id ( ) . toString ( ) ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( newStoragePoolIsoMap , result ) ; }
Source:
public java.lang.String scheduleAFixedDelayJob ( java.lang.Object instance , java.lang.String methodName , java.lang.Class < ? > [ ] inputTypes , java.lang.Object [ ] inputParams , long initialDelay , long taskDelay , java.util.concurrent.TimeUnit timeUnit ) { org.quartz.JobDetail job = createJobForDelayJob ( instance , methodName , inputTypes , inputParams , taskDelay , timeUnit ) ; scheduleJobWithTrigger ( initialDelay , timeUnit , instance , job ) ; return job.getKey ( ) . getName ( ) ; }

Target:
private void setBasicMapValues ( org.quartz.JobDataMap data , java.lang.Object instance , java.lang.String methodName , java.lang.Class < ? > [ ] inputTypes , java.lang.Object [ ] inputParams ) { data.put ( org.ovirt.engine.core.utils.timer.RUNNABLE_INSTANCE , instance ) ; data.put ( org.ovirt.engine.core.utils.timer.RUN_METHOD_NAME , methodName ) ; data.put ( org.ovirt.engine.core.utils.timer.RUN_METHOD_PARAM , inputParams ) ; data.put ( org.ovirt.engine.core.utils.timer.RUN_METHOD_PARAM_TYPE , inputTypes ) ; }
Source:
public void networkExists ( ) { simulateVdsGroupExists ( ) ; org.mockito.Mockito.when ( networkDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getNetwork ( ) ) ; assertCanDoActionSucceeds ( ) ; }

Target:
public void networkExists ( ) { simulateVdsGroupExists ( ) ; org.mockito.Mockito.when ( networkDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getNetwork ( ) ) ; org.mockito.Mockito.when ( networkClusterDAO.get ( param.getNetworkCluster ( ) . getId ( ) ) ) . thenReturn ( param.getNetworkCluster ( ) ) ; assertCanDoActionFailure ( VdcBllMessages.NETWORK_ALREADY_ATTACHED_TO_CLUSTER.toString ( ) ) ; }
Source:
private void testBusyDomainInList ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus status ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase param = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ) ; org.ovirt.engine.core.bll.storage.pool.RemoveStoragePoolCommand < org.ovirt.engine.core.common.action.StoragePoolParametersBase > cmd = org.ovirt.engine.core.bll.storage.pool.RemoveStoragePoolCommandTest.createCommand ( param ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain tempStorageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; tempStorageDomains.setStatus ( status ) ; domainsList.add ( tempStorageDomains ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > listReturned = cmd.getActiveOrLockedDomainList ( domainsList ) ; org.junit.Assert.assertTrue ( ( ! ( listReturned.isEmpty ( ) ) ) ) ; }

Target:
public void testActiveDomainInList ( ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase param = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ) ; org.ovirt.engine.core.bll.storage.pool.RemoveStoragePoolCommand < org.ovirt.engine.core.common.action.StoragePoolParametersBase > cmd = org.ovirt.engine.core.bll.storage.pool.RemoveStoragePoolCommandTest.createCommand ( param ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsList = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain tempStorageDomains = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; tempStorageDomains.setStatus ( StorageDomainStatus.Active ) ; domainsList.add ( tempStorageDomains ) ; org.junit.Assert.assertFalse ( cmd.validateDomainsInMaintenance ( domainsList ) ) ; }
Source:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static void IsHotPlugAvailable ( 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.HotPlugEnabled ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void GetVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }
Source:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( QueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( QueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateVMVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case Done : return ; default : org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase outEx = createDefaultConcreteException ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateVMVDSCommand.getReturnStatus ( ) . mMessage ) ; InitializeVdsError ( returnStatus ) ; outEx.setVdsError ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateVMVDSCommand.getVDSReturnValue ( ) . getVdsError ( ) ) ; throw outEx ; } }

Target:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateVMVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case Done : return ; default : org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase outEx = createDefaultConcreteException ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateVMVDSCommand.getReturnStatus ( ) . mMessage ) ; initializeVdsError ( returnStatus ) ; outEx.setVdsError ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateVMVDSCommand.getVDSReturnValue ( ) . getVdsError ( ) ) ; throw outEx ; } }
Source:
private void doProviderSearch ( ) { org.ovirt.engine.ui.frontend.AsyncQuery providersQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; providersQuery.setModel ( this ) ; providersQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setProviders ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( returnValue ) ) ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllProviders ( providersQuery , false ) ; }

Target:
private void doProviderSearch ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllProviders ( new org.ovirt.engine.ui.uicommonweb.models.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > > ( ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider < ? > > returnValue ) { setProviders ( ( ( java.util.List ) ( returnValue ) ) ) ; } } ) , false ) ; }