auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ! ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) { return failCanDoAction ( VdcBllMessages.VM_CANNOT_CANCEL_MIGRATION_WHEN_VM_IS_NOT_MIGRATING ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ! ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) { return failCanDoAction ( EngineMessage.VM_CANNOT_CANCEL_MIGRATION_WHEN_VM_IS_NOT_MIGRATING ) ; } return true ; }
Source:
public static void UnLockVm ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDAO ( ) . get ( vmId ) ; if ( ( vm.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.ImageLocked ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVmStatus , new org.ovirt.engine.core.common.vdscommands.SetVmStatusVDSCommandParameters ( vmId , org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ; } else { org.ovirt.engine.core.bll.VmHandler.log.errorFormat ( "Trying to unlock vm {0} in status {1} - not moving to down!" , vm.getvm_name ( ) , vm.getstatus ( ) ) ; } }

Target:
public java.lang.Void runInTransaction ( ) { compensationContext.snapshotEntityStatus ( vm , vm.getstatus ( ) ) ; org.ovirt.engine.core.bll.VmHandler.UnLockVm ( vm ) ; compensationContext.stateChanged ( ) ; return null ; }
Source:
public void testGetLocaleFromString ( ) { org.junit.Assert.assertNull ( "The locale should be null" , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( null ) ) ; org.junit.Assert.assertNull ( "The locale should be null" , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "notalocale" ) ) ; org.junit.Assert.assertNull ( "The locale should be null" , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "index.html" ) ) ; org.junit.Assert.assertEquals ( "The locale should be jp" , java.util.Locale.JAPANESE , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "ja" ) ) ; }

Target:
public void testGetLocaleFromString ( ) { org.junit.jupiter.api.Assertions.assertNull ( org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( null ) , "The locale should be null" ) ; org.junit.jupiter.api.Assertions.assertNull ( org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "notalocale" ) , "The locale should be null" ) ; org.junit.jupiter.api.Assertions.assertNull ( org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "index.html" ) , "The locale should be null" ) ; org.junit.jupiter.api.Assertions.assertEquals ( java.util.Locale.JAPANESE , org.ovirt.engine.core.utils.LocaleUtils.getLocaleFromString ( "ja" ) , "The locale should be jp" ) ; }
Source:
public void testPersistNetworkAttachmentsWhenIpConfigurationChanged ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachmentForClusterNetworkA = createNetworkAttachment ( clusterNetworkA ) ; networkAttachmentForClusterNetworkA.setNicId ( interfaceWithAttachedClusterNetworkA.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = org.ovirt.engine.core.utils.NetworkUtils.createIpConfigurationFromVdsNetworkInterface ( interfaceWithAttachedClusterNetworkA ) ; ipConfiguration.getIpv4PrimaryAddress ( ) . setAddress ( "192.168.1.11" ) ; networkAttachmentForClusterNetworkA.setIpConfiguration ( ipConfiguration ) ; networkAttachmentForClusterNetworkA.setProperties ( customPropertiesForNics.getCustomPropertiesFor ( interfaceWithAttachedClusterNetworkA ) ) ; callPersistNetworkAttachmentsAndVerifyThatNetworkAttachmentIsSynced ( networkAttachmentForClusterNetworkA , createLegacyPersister ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) ) ) ; }

Target:
private void assertIpConfigurationsEqual ( org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration1 , org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration2 ) { assertIpv4AddressesEqual ( ipConfiguration1.getIpv4PrimaryAddress ( ) , ipConfiguration2.getIpv4PrimaryAddress ( ) ) ; assertIpv6AddressesEqual ( ipConfiguration1.getIpv6PrimaryAddress ( ) , ipConfiguration2.getIpv6PrimaryAddress ( ) ) ; }
Source:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , true ) ; org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource resource = ( ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource ) ( this . resource ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , 0 , true ) ; org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource resource = ( ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource ) ( this . resource ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 0 ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void close ( ) throws java.io.IOException { org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "Entry" ) ; for ( org.ovirt.engineextensions.aaa.ldap.Framework.ConnectionPoolEntry entry : connectionPools.values ( ) ) { entry.close ( ) ; } connectionPools.clear ( ) ; if ( ( initglobals ) != null ) { globals.clear ( ) ; globals.putAll ( initglobals ) ; } org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "Return" ) ; }

Target:
public void close ( ) throws java.io.IOException { org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "close Entry" ) ; for ( org.ovirt.engineextensions.aaa.ldap.Framework.ConnectionPoolEntry entry : connectionPools.values ( ) ) { entry.close ( ) ; } connectionPools.clear ( ) ; if ( ( initglobals ) != null ) { globals.clear ( ) ; globals.putAll ( initglobals ) ; } org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "close Return" ) ; }
Source:
private boolean noChangesDetected ( ) { return ( ( ( getNetworks ( ) . isEmpty ( ) ) && ( getRemovedNetworks ( ) . isEmpty ( ) ) ) && ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getBonds ( ) . isEmpty ( ) ) ) && ( getRemovedBonds ( ) . isEmpty ( ) ) ; }

Target:
private boolean noChangesDetected ( ) { return ( ( ( getNetworksToConfigure ( ) . isEmpty ( ) ) && ( getRemovedNetworks ( ) . isEmpty ( ) ) ) && ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) . getBonds ( ) . isEmpty ( ) ) ) && ( getRemovedBondNames ( ) . isEmpty ( ) ) ; }
Source:
private java.lang.String getRootResourceName ( java.lang.String collectionName ) { java.lang.String resource = org.ovirt.engine.sdk.codegen.utils.StringUtils.toSingular ( collectionName ) ; java.lang.String resourceCandidate = getPublicEntity ( org.ovirt.engine.sdk.codegen.utils.StringUtils.toSingular ( collectionName ) , false ) ; if ( resourceCandidate != null ) { resource = resourceCandidate ; } return resource ; }

Target:
private java.lang.String getPublicEntity ( java.lang.String entityName , java.lang.String [ ] periods , int i , boolean throwError ) { try { return getPublicEntity ( entityName , periods , i ) ; } catch ( java.lang.RuntimeException rte ) { if ( ! throwError ) return null ; throw rte ; } }
Source:
public void getClusterUnsupportedVmsCpus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vdsGroupId , java.lang.String newCpuName ) { 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.HashMap ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClusterUnsupportedVmsCpus , new org.ovirt.engine.core.common.queries.GetClusterUnsupportedVmsCpusParameters ( vdsGroupId , newCpuName ) , aQuery ) ; }

Target:
public void getAllErrata ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Erratum > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetErrataForSystem , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void filterItems ( org.ovirt.engine.ui.uicommonweb.models.FilteredListModel.Filter < T > filter ) { if ( filter == null ) { if ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( this . allItems , org.ovirt.engine.ui.uicommonweb.models.FilteredListModel.getItems ( ) ) ) { return ; } setItemsSelectionAware ( this . allItems ) ; } final java.util.Collection < T > itemsToShow = new java.util.ArrayList < T > ( ) ; for ( T item : this . allItems ) { if ( filter.filter ( item ) ) { itemsToShow.add ( item ) ; } } setItemsSelectionAware ( itemsToShow ) ; }

Target:
public void filterItems ( org.ovirt.engine.ui.uicommonweb.models.FilteredListModel.Filter < T > filter ) { if ( filter == null ) { if ( java.util.Objects.equals ( this . allItems , org.ovirt.engine.ui.uicommonweb.models.FilteredListModel.getItems ( ) ) ) { return ; } setItemsSelectionAware ( this . allItems ) ; } final java.util.Collection < T > itemsToShow = new java.util.ArrayList < T > ( ) ; for ( T item : this . allItems ) { if ( filter.filter ( item ) ) { itemsToShow.add ( item ) ; } } setItemsSelectionAware ( itemsToShow ) ; }
Source:
public void testVmIllegal ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IMAGE_IS_ILLEGAL ) ) . when ( vmValidator ) . vmNotIlegal ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IMAGE_IS_ILLEGAL.name ( ) ) ) ; }

Target:
public void testImagesLocked ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getNonEmptyDiskList ( ) ) . when ( cmd ) . getDisksListForChecks ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED ) ) . when ( diskImagesValidator ) . diskImagesNotLocked ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED ) ; }
Source:
void updateMenuItem ( com.google.gwt.user.client.ui.MenuItem item , org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef , java.util.List selectedItems ) { item.setVisible ( ( ( buttonDef.isAccessible ( selectedItems ) ) && ( buttonDef.isVisible ( selectedItems ) ) ) ) ; item.setEnabled ( buttonDef.isEnabled ( selectedItems ) ) ; if ( ( buttonDef.getTooltip ( ) ) != null ) { org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipToElement ( buttonDef.getTooltip ( ) , item.getElement ( ) ) ; } }

Target:
void updateMenuItem ( com.google.gwt.user.client.ui.MenuItem item , org.ovirt.engine.ui.common.widget.action.ActionButtonDefinition < T > buttonDef , java.util.List selectedItems ) { item.setVisible ( ( ( buttonDef.isAccessible ( selectedItems ) ) && ( buttonDef.isVisible ( selectedItems ) ) ) ) ; item.setEnabled ( buttonDef.isEnabled ( selectedItems ) ) ; if ( ( buttonDef.getTooltip ( ) ) != null ) { org.ovirt.engine.ui.common.utils.ElementTooltipUtils.setTooltipOnElement ( item.getElement ( ) , buttonDef.getTooltip ( ) ) ; } }
Source:
private boolean refreshIsoDomainFileForStoragePool ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.ImageType imageType ) { boolean refreshSucceeded = false ; boolean updateFromVDSMSucceeded = true ; if ( imageType == ( org.ovirt.engine.core.common.businessentities.ImageType.ISO ) ) { updateFromVDSMSucceeded = updateIsoListFromVDSM ( storagePoolId , storageDomainId ) ; } else if ( imageType == ( org.ovirt.engine.core.common.businessentities.ImageType.Floppy ) ) { updateFromVDSMSucceeded = ( updateFloppyListFromVDSM ( storagePoolId , storageDomainId ) ) && updateFromVDSMSucceeded ; } if ( updateFromVDSMSucceeded ) { refreshSucceeded = true ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.debugFormat ( "Refresh succeeded for file type {0} at storage domain id {1} in storage pool id {2}." , imageType.name ( ) , storageDomainId , storagePoolId ) ; } return refreshSucceeded ; }

Target:
private boolean refreshIsoDomainFileForStoragePool ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.ImageFileType imageType ) { boolean refreshSucceeded = false ; boolean updateFromVDSMSucceeded = true ; if ( imageType == ( org.ovirt.engine.core.common.businessentities.ImageFileType.ISO ) ) { updateFromVDSMSucceeded = updateIsoListFromVDSM ( storagePoolId , storageDomainId ) ; } else if ( imageType == ( org.ovirt.engine.core.common.businessentities.ImageFileType.Floppy ) ) { updateFromVDSMSucceeded = ( updateFloppyListFromVDSM ( storagePoolId , storageDomainId ) ) && updateFromVDSMSucceeded ; } if ( updateFromVDSMSucceeded ) { refreshSucceeded = true ; org.ovirt.engine.core.bll.IsoDomainListSyncronizer.log.debugFormat ( "Refresh succeeded for file type {0} at storage domain id {1} in storage pool id {2}." , imageType.name ( ) , storageDomainId , storagePoolId ) ; } return refreshSucceeded ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( property1 ) == null ? 0 : property1.hashCode ( ) ) ; result = ( prime * result ) + ( ( property2 ) == null ? 0 : property2.hashCode ( ) ) ; return result ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.ui.uicommonweb.builders.TestingBackendModel ) ) { return false ; } org.ovirt.engine.ui.uicommonweb.builders.TestingBackendModel other = ( ( org.ovirt.engine.ui.uicommonweb.builders.TestingBackendModel ) ( obj ) ) ; return ( java.util.Objects.equals ( property1 , other.property1 ) ) && ( java.util.Objects.equals ( property2 , other.property2 ) ) ; }
Source:
public void testListCrash ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }

Target:
public void testListCrash ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpEntityQueryExpectations ( 1 , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }
Source:
protected void init ( ) { super . init ( ) ; setVmName ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getParameters ( ) . getExternalName ( ) ) ; setVdsId ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getParameters ( ) . getProxyHostId ( ) ) ; setStorageDomainId ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getParameters ( ) . getDestDomainId ( ) ) ; setStoragePoolId ( ( ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getVdsGroup ( ) ) != null ? org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getVdsGroup ( ) . getStoragePoolId ( ) : null ) ) ; }

Target:
protected void init ( ) { super . init ( ) ; setVmName ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getParameters ( ) . getExternalName ( ) ) ; setVdsId ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getParameters ( ) . getProxyHostId ( ) ) ; setStorageDomainId ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getParameters ( ) . getDestDomainId ( ) ) ; setStoragePoolId ( ( ( org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getCluster ( ) ) != null ? org.ovirt.engine.core.bll.ImportVmFromExternalProviderCommand.getCluster ( ) . getStoragePoolId ( ) : null ) ) ; }
Source:
public void init ( ) { mockCpuFlagsManagerHandler ( ) ; vmHandler.init ( ) ; mockVmPropertiesUtils ( ) ; org.mockito.Mockito.doNothing ( ) . when ( vmPropertiesUtils ) . separateCustomPropertiesToUserAndPredefined ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) ) ; }

Target:
public void init ( ) { mockCpuFlagsManagerHandler ( ) ; vmHandler.init ( ) ; mockVmPropertiesUtils ( ) ; org.mockito.Mockito.doNothing ( ) . when ( vmPropertiesUtils ) . separateCustomPropertiesToUserAndPredefined ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Version.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmStatic.class ) ) ; }
Source:
public void testGetAllForCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > result = dao.getAllForCluster ( cluster.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster thiscluster : result ) { org.junit.Assert.assertEquals ( cluster.getId ( ) , thiscluster.getcluster_id ( ) ) ; } }

Target:
public void testGetAllForCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkCluster > result = dao.getAllForCluster ( cluster.getId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster thiscluster : result ) { org.junit.Assert.assertEquals ( cluster.getId ( ) , thiscluster.getClusterId ( ) ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImagesForVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allDisks = new java.util.ArrayList ( getDiskImages ( disks ) ) ; allDisks.addAll ( org.ovirt.engine.core.bll.ImagesHandler.getCinderLeafImages ( disks , false ) ) ; return allDisks ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > getDiskImagesForVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > allDisks = new java.util.ArrayList ( getDiskImages ( disks ) ) ; allDisks.addAll ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getCinderLeafImages ( disks , false ) ) ; return allDisks ; }
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 ) ; } else { getHost ( ) . 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 ( ) . setIsChangable ( false ) ; getPort ( ) . setIsChangable ( false ) ; getFetchSshFingerprint ( ) . setIsChangable ( false ) ; } else { getHost ( ) . setIsChangable ( true ) ; getPort ( ) . setIsChangable ( true ) ; getFetchSshFingerprint ( ) . setIsChangable ( true ) ; } }
Source:
private static boolean canPlugInterfaceInDc ( java.lang.String macAddress , org.ovirt.engine.core.compat.Guid dataCenterId ) { if ( ( dataCenterId == null ) || ( macAddress == null ) ) { return false ; } org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolManagerStrategy pool = org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDcSingleton.getInstance ( ) . poolForDataCenter ( dataCenterId ) ; return ! ( pool.isMacInUse ( macAddress ) ) ; }

Target:
private static boolean canPlugInterface ( org.ovirt.engine.core.common.businessentities.network.VmNic iface ) { org.ovirt.engine.core.bll.network.VmInterfaceManager vmIfaceManager = new org.ovirt.engine.core.bll.network.VmInterfaceManager ( ) ; if ( vmIfaceManager.existsPluggedInterfaceWithSameMac ( iface ) ) { vmIfaceManager.auditLogMacInUseUnplug ( iface ) ; return false ; } else { return true ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; param.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; param.setApplyChangesLater ( applyCpuChangesLater ) ; setRngDeviceToParams ( model , param ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }

Target:
private org.ovirt.engine.core.common.action.VmManagementParametersBase getUpdateVmParameters ( boolean applyCpuChangesLater ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.core.common.action.VmManagementParametersBase params = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; params.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; params.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; setRngDeviceToParams ( model , params ) ; params.setApplyChangesLater ( applyCpuChangesLater ) ; setGraphicsDevicesToParams ( model , params ) ; return params ; }
Source:
public void testParseMultiple ( ) { java.util.List < org.ovirt.engine.api.model.PowerManagement > 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" ) ; assertNotNull ( ret ) ; 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" ) ; assertNotNull ( ret ) ; 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:
public void reportCompleted ( ) { final boolean isRunAndPaused = ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isRunAndPause ( ) ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; if ( isRunAndPaused ) { final org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.endJob ( executionContext , true ) ; } else { super . reportCompleted ( ) ; } }

Target:
private boolean isRunAndPaused ( ) { return ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isRunAndPause ( ) ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ; }
Source:
public void testList ( ) throws java.lang.Exception { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsHooksById2 , org.ovirt.engine.core.common.queries.GetVdsHooksByIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Hooks hooks = resource.list ( ) ; assertNotNull ( hooks.getHooks ( ) ) ; assertEquals ( hooks.getHooks ( ) . size ( ) , 4 ) ; }

Target:
public void testList ( ) throws java.lang.Exception { resource.setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetVdsHooksById , org.ovirt.engine.core.common.queries.GetVdsHooksByIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Hooks hooks = resource.list ( ) ; assertNotNull ( hooks.getHooks ( ) ) ; assertEquals ( hooks.getHooks ( ) . size ( ) , 4 ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.ListModel < java.util.Map.Entry < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > > list = ( ( org.ovirt.engine.ui.uicommonweb.models.ListModel < java.util.Map.Entry < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > > ) ( sender ) ) ; updateBondOptions ( list ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.hosts.SetupNetworksBondModel object ) { driver.edit ( object ) ; }
Source:
private boolean removeMemoryFromSnapshot ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot , boolean clearFromDB ) { final java.lang.String memoryVolume = snapshot.getMemoryVolume ( ) ; if ( memoryVolume.isEmpty ( ) ) { return true ; } if ( clearFromDB ) { getSnapshotDao ( ) . removeMemoryFromSnapshot ( snapshot.getId ( ) ) ; } return removeMemoryVolumes ( memoryVolume , getActionType ( ) , false ) ; }

Target:
private boolean removeMemoryVolumes ( java.lang.String memoryVolumes ) { org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters parameters = new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( memoryVolumes , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmId ( ) ) ; parameters.setParentCommand ( getActionType ( ) ) ; parameters.setEntityInfo ( getParameters ( ) . getEntityInfo ( ) ) ; parameters.setParentParameters ( getParameters ( ) ) ; return org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getBackend ( ) . runInternalAction ( VdcActionType.RemoveMemoryVolumes , parameters , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( getExecutionContext ( ) ) ) . getSucceeded ( ) ; }
Source:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void enableNewAddtionalFeatureWhenHostSupports ( ) { createCommandWithAddtionalFeature ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesForVms ( ) ; clusterHasVds ( ) ; org.mockito.Mockito.when ( hostFeatureDao.getSupportedHostFeaturesByHostId ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singleton ( "TEST_FEATURE" ) ) ; initAndAssertValidation ( true ) ; }

Target:
public void enableNewAddtionalFeatureWhenHostSupports ( ) { createCommandWithAddtionalFeature ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesForVms ( ) ; clusterHasVds ( ) ; org.mockito.Mockito.when ( hostFeatureDao.getSupportedHostFeaturesByHostId ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singleton ( "TEST_FEATURE" ) ) ; initAndAssertValidation ( true ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendDisksResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; }

Target:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Disk disk = resource.get ( ) ; assertTrue ( disk.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.verifyModelSpecific ( disk , 1 ) ; verifyLinks ( disk ) ; } finally { accepts.clear ( ) ; } }
Source:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name , org.ovirt.engine.core.compat.Guid datacenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( source != null ) && ( ! ( ( java.lang.Boolean ) ( source ) ) ) ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , params , aQuery ) ; }

Target:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void isSupportBridgesReportByVDSM ( 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.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
private void CacheFencingAgentsOptionTypes ( ) { java.lang.String localfencingOptionTypes = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.VdsFenceOptionTypes ) ; java.lang.String [ ] types = localfencingOptionTypes.split ( java.util.regex.Pattern.quote ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.COMMA ) , ( - 1 ) ) ; for ( java.lang.String entry : types ) { java.lang.String [ ] optionKeyVal = entry.split ( java.util.regex.Pattern.quote ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.EQUAL ) , ( - 1 ) ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionTypes.put ( optionKeyVal [ 0 ] , optionKeyVal [ 1 ] ) ; } }

Target:
private void cacheFenceAgentsOptionTypes ( ) { java.lang.String localfenceOptionTypes = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.VdsFenceOptionTypes ) ; java.lang.String [ ] types = localfenceOptionTypes.split ( java.util.regex.Pattern.quote ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.COMMA ) , ( - 1 ) ) ; for ( java.lang.String entry : types ) { java.lang.String [ ] optionKeyVal = entry.split ( java.util.regex.Pattern.quote ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.EQUAL ) , ( - 1 ) ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fenceOptionTypes.put ( optionKeyVal [ 0 ] , optionKeyVal [ 1 ] ) ; } }
Source:
public void testFetchSpecificAndGeneralQuotaForStorage ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorageList = dao.getQuotaStorageByStorageGuid ( null , FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) ; org.ovirt.engine.core.common.businessentities.QuotaStorage quotaStorage = quotaStorageList.get ( 0 ) ; org.junit.Assert.assertEquals ( true , ( ( quotaStorageList.size ( ) ) == 1 ) ) ; org.junit.Assert.assertNotNull ( quotaStorage ) ; org.junit.Assert.assertEquals ( true , ( ( quotaStorage.getStorageSizeGBUsage ( ) ) > 0 ) ) ; }

Target:
public void testFetchSpecificAndGeneralQuotaForStorage ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.QuotaStorage > quotaStorageList = dao.getQuotaStorageByStorageGuid ( null , FixturesTool.QUOTA_SPECIFIC_AND_GENERAL ) ; org.ovirt.engine.core.common.businessentities.QuotaStorage quotaStorage = quotaStorageList.get ( 0 ) ; org.junit.Assert.assertEquals ( 1 , quotaStorageList.size ( ) ) ; org.junit.Assert.assertNotNull ( quotaStorage ) ; org.junit.Assert.assertTrue ( ( ( quotaStorage.getStorageSizeGBUsage ( ) ) > 0 ) ) ; }
Source:
public void testSimpleParse ( ) { filter.clearFilterEntries ( ) ; filter.addFilterEntries ( org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.parse ( ( "include:VDC_STOP(snmp:) " + "exclude:*" ) ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "VDC_STOP" ) ) ; org.junit.Assert.assertTrue ( snmp.getEvents ( ) . contains ( "VDC_STOP-->" ) ) ; }

Target:
public void testSimpleParse ( ) { filter.clearFilterEntries ( ) ; filter.addFilterEntries ( org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilter.parse ( ( "include:VDC_STOP(snmp:) " + "exclude:*" ) ) ) ; filter.processEvent ( new org.ovirt.engine.core.notifier.filter.FirstMatchSimpleFilterTest.E ( "VDC_STOP" ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( snmp.getEvents ( ) . contains ( "VDC_STOP-->" ) ) ; }
Source:
public void addAllocateNewMacAddress ( ) { org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface = createNewInterface ( ) ; java.lang.String newMac = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( macPoolManager.allocateNewMac ( ) ) . thenReturn ( newMac ) ; vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , true ) ; org.junit.Assert.assertEquals ( newMac , iface.getMacAddress ( ) ) ; }

Target:
public void addAllocateNewMacAddress ( ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = createNewInterface ( ) ; java.lang.String newMac = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( macPoolManager.allocateNewMac ( ) ) . thenReturn ( newMac ) ; vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , true ) ; org.junit.Assert.assertEquals ( newMac , iface.getMacAddress ( ) ) ; }
Source:
public void massSaveNumaNode ( java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > numaNodes , org.ovirt.engine.core.compat.Guid vdsId , org.ovirt.engine.core.compat.Guid vmId ) { for ( org.ovirt.engine.core.common.businessentities.VdsNumaNode node : numaNodes ) { node.setVdsId ( vdsId ) ; node.setVmId ( vmId ) ; save ( node ) ; } }

Target:
public void massUpdateNumaNodeStatistics ( java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > numaNodes ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > executions = new java.util.ArrayList ( numaNodes.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNumaNode node : numaNodes ) { executions.add ( createNumaNodeStatisticsParametersMapper ( node ) ) ; } getCallsHandler ( ) . executeStoredProcAsBatch ( "UpdateNumaNodeStatistics" , executions ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase attemptRollback ( org.ovirt.engine.core.common.action.VdcActionType commandType , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.core.bll.context.CommandContext context ) { if ( canPerformRollbackUsingCommand ( commandType , params ) ) { params.setExecutionReason ( CommandExecutionReason.ROLLBACK_FLOW ) ; params.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; return getBackend ( ) . runInternalAction ( commandType , params , context ) ; } return new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase attemptRollback ( org.ovirt.engine.core.common.action.VdcActionType commandType , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.core.bll.context.CommandContext rollbackContext ) { if ( canPerformRollbackUsingCommand ( commandType , params ) ) { params.setExecutionReason ( CommandExecutionReason.ROLLBACK_FLOW ) ; params.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; return getBackend ( ) . runInternalAction ( commandType , params , rollbackContext ) ; } return new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; }
Source:
public void edit ( ) { T qos = ( ( T ) ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel.getSelectedItem ( ) ) ) ; if ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel.getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.EditQosModel < T , P > qosModel = getEditQosModel ( qos ) ; setWindow ( qosModel ) ; qosModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) , getEntity ( ) ) ; }

Target:
public void edit ( ) { T qos = ( ( T ) ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel.getSelectedItem ( ) ) ) ; if ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.DataCenterQosListModel.getWindow ( ) ) != null ) { return ; } final org.ovirt.engine.ui.uicommonweb.models.datacenters.qos.QosModel < T , P > qosModel = getEditQosModel ( qos ) ; setWindow ( qosModel ) ; qosModel.getDataCenters ( ) . setItems ( java.util.Arrays.asList ( getEntity ( ) ) , getEntity ( ) ) ; }
Source:
private static void GetVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParanet , new org.ovirt.engine.core.common.queries.GetAllChildVlanInterfacesQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public static void IsSupportBridgesReportByVDSM ( 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.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }
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.core.common.businessentities.Snapshot snapshot = ( ( org.ovirt.engine.core.common.businessentities.Snapshot ) ( getModel ( ) . getSelectedItem ( ) ) ) ; if ( ( snapshot != null ) && ( ! ( getTable ( ) . getSelectionModel ( ) . isSelected ( snapshot ) ) ) ) { getTable ( ) . getSelectionModel ( ) . setSelected ( snapshot , true ) ; } vmSnapshotInfoPanel.updatePanel ( snapshot ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateSnapshotInfo ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeStop ( java.lang.String volumeName , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.stop" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn glusterVolumeStop ( java.lang.String volumeName , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.stop" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }