auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean addMac ( java.lang.String mac ) { lockObj.writeLock ( ) . lock ( ) ; try { checkIfInitialized ( ) ; boolean added = macsStorage.useMac ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( mac ) ) ; logWhenMacPoolIsEmpty ( ) ; return added ; } finally { lockObj.writeLock ( ) . unlock ( ) ; } }

Target:
public void forceAddMac ( java.lang.String mac ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock l = new org.ovirt.engine.core.utils.lock.AutoCloseableLock ( lockObj.writeLock ( ) ) ) { checkIfInitialized ( ) ; forceAddMacWithoutLocking ( mac ) ; } }
Source:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "ValidationResult [message=" ) . append ( getMessage ( ) ) . append ( "]" ) ; return builder.toString ( ) ; }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( ) ; builder.append ( "ValidationResult [message=" ) . append ( getMessage ( ) ) . append ( ", variableReplacements=" ) . append ( getVariableReplacements ( ) ) . append ( "]" ) ; return builder.toString ( ) ; }
Source:
public void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password , org.ovirt.engine.core.common.businessentities.OriginType originType ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , originType , vdsId , dataCenterId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VolumeType getVolumeTypeForDomain ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic destDomain = org.ovirt.engine.core.bll.CopyImageGroupCommand.getStorageDomainStaticDAO ( ) . get ( storageDomainId ) ; org.ovirt.engine.core.common.businessentities.VolumeType volumeType = ( destDomain.getStorageType ( ) . isBlockDomain ( ) ) ? org.ovirt.engine.core.common.businessentities.VolumeType.Preallocated : org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getVolumeType ( ) ; return volumeType ; }

Target:
private org.ovirt.engine.core.common.businessentities.VolumeFormat getVolumeFormatForDomain ( ) { if ( ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getVolumeFormat ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ) ) { return org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ; } org.ovirt.engine.core.common.businessentities.StorageDomainStatic destDomain = org.ovirt.engine.core.bll.CopyImageGroupCommand.getStorageDomainStaticDAO ( ) . get ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ; if ( ( destDomain.getStorageType ( ) . isBlockDomain ( ) ) && ( ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getVolumeType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VolumeType.Sparse ) ) ) { return org.ovirt.engine.core.common.businessentities.VolumeFormat.COW ; } else { return org.ovirt.engine.core.common.businessentities.VolumeFormat.RAW ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getOvaInfo ( java.lang.String ovaPath ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getOvaInfo ( ovaPath ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( xmlRpcReturnValue ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc convertVmFromOva ( java.lang.String ovaPath , java.util.Map < java.lang.String , java.lang.Object > vm , java.lang.String jobUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.convertExternalVmFromOva ( ovaPath , vm , jobUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void snapshotExistsByGuidReturnsValidResultWhenSnapshotExists ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.mockito.Mockito.when ( snapshotDao.exists ( vmId , snapshotId ) ) . thenReturn ( true ) ; validateValidResult ( validator.snapshotExists ( vmId , snapshotId ) ) ; }

Target:
public void snapshotExistsByGuidReturnsValidResultWhenSnapshotExists ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid vmId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.mockito.Mockito.when ( snapshotDao.exists ( vmId , snapshotId ) ) . thenReturn ( true ) ; org.ovirt.engine.core.bll.snapshots.SnapshotsValidatorTest.validateValidResult ( validator.snapshotExists ( vmId , snapshotId ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getDataCenter ( ) ) ) ) { DataCenter_SelectedItemChanged ( ) ; } else if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getCluster ( ) ) ) ) { Cluster_SelectedItemChanged ( ) ; } else if ( sender == ( getConsoleAddressEnabled ( ) ) ) { consoleAddressChanged ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getDataCenter ( ) ) ) ) { dataCenter_SelectedItemChanged ( ) ; } else if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getCluster ( ) ) ) ) { cluster_SelectedItemChanged ( ) ; } else if ( sender == ( getConsoleAddressEnabled ( ) ) ) { consoleAddressChanged ( ) ; } }
Source:
public void setParser ( org.ovirt.engine.core.config.EngineConfigCLIParser parser ) { this . parser = parser ; }

Target:
public void setUpAndExecute ( org.ovirt.engine.core.config.EngineConfigCLIParser parser ) throws java.lang.Exception { org.ovirt.engine.core.config.EngineConfig.log.debug ( ( "Arguments have been parsed: " + ( parser.engineConfigMapToString ( ) ) ) ) ; org.ovirt.engine.core.config.validation.ConfigActionType actionType = parser.getConfigAction ( ) ; actionType.validate ( parser.getEngineConfigMap ( ) ) ; setEngineConfigLogic ( new org.ovirt.engine.core.config.EngineConfigLogic ( parser ) ) ; engineConfigLogic.execute ( ) ; }
Source:
private static void logNullParameters ( org.ovirt.engine.core.common.businessentities.async_tasks task ) { if ( ( task.getaction_parameters ( ) ) == null ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( "Null action_parameters:\n" ) ; java.lang.StackTraceElement [ ] st = java.lang.Thread.currentThread ( ) . getStackTrace ( ) ; for ( java.lang.StackTraceElement element : st ) { sb.append ( java.lang.String.format ( "\tMethod: %1$s\n" , element.getMethodName ( ) ) ) ; } org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.log.error ( sb.toString ( ) ) ; } }

Target:
private static void logNullParameters ( org.ovirt.engine.core.common.businessentities.AsyncTasks task ) { if ( ( task.getaction_parameters ( ) ) == null ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( "Null action_parameters:\n" ) ; java.lang.StackTraceElement [ ] st = java.lang.Thread.currentThread ( ) . getStackTrace ( ) ; for ( java.lang.StackTraceElement element : st ) { sb.append ( java.lang.String.format ( "\tMethod: %1$s\n" , element.getMethodName ( ) ) ) ; } org.ovirt.engine.core.dao.AsyncTaskDAODbFacadeImpl.log.error ( sb.toString ( ) ) ; } }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ! ( isRngSupportedByCluster ( ) ) ) && ( ( getTemplateType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL ) ; } if ( getRngDevices ( ) . isEmpty ( ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_RNG_NOT_FOUND ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( getTemplateType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { if ( ! ( validate ( getVirtioRngValidator ( ) . canAddRngDevice ( getVdsGroup ( ) , getParameters ( ) . getRngDevice ( ) ) ) ) ) { return false ; } } if ( getRngDevices ( ) . isEmpty ( ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_RNG_NOT_FOUND ) ; } return true ; }
Source:
protected void onInitDisks ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > disks = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getDiskImages ( ) ) { disks.add ( org.ovirt.engine.ui.uicommonweb.Linq.diskToModel ( disk ) ) ; } setDisks ( disks ) ; initStorageDomains ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { for ( int i = 0 ; i < ( result.getReturnValues ( ) . size ( ) ) ; i ++ ) { java.util.Map < java.lang.Boolean , java.util.List < org.ovirt.engine.core.common.businessentities.VM > > resultValue = result.getReturnValues ( ) . get ( i ) . getReturnValue ( ) ; disks.get ( i ) . setPluggedToRunningVm ( ( ! ( isAllVmsDown ( resultValue ) ) ) ) ; } setDisks ( disks ) ; initStorageDomains ( ) ; }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId , boolean filterOutExistingHosts , java.lang.String searchFilter ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId , filterOutExistingHosts , searchFilter ) , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand uiCommand ) { if ( ! ( labelPopup.validate ( ) ) ) { return ; } sourceListModel.setConfirmWindow ( null ) ; java.lang.String label = labelPopup.getLabel ( ) . getEntity ( ) ; dcLabels.add ( label ) ; NetworkOperation.LABEL.getCommand ( new org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkLabelModel ( label , this ) , networkCommand.getOp2 ( ) , hostSetupNetworksParametersData ) . execute ( ) ; redraw ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { dcLabels = ( ( java.util.SortedSet < java.lang.String > ) ( returnValue ) ) ; initLabelModels ( ) ; queryNetworks ( ) ; }
Source:
public void testSimpleUpdate ( ) { org.ovirt.engine.core.common.scheduling.AffinityGroup existing = dao.get ( FixturesTool.EXISTING_AFFINITY_GROUP_ID ) ; existing.setName ( "my_new_name" ) ; existing.setVmAffinityRule ( EntityAffinityRule.NEGATIVE ) ; existing.setVmEnforcing ( true ) ; dao.update ( existing ) ; org.ovirt.engine.core.common.scheduling.AffinityGroup fetched = dao.get ( existing.getId ( ) ) ; org.junit.Assert.assertTrue ( equals ( existing , fetched ) ) ; }

Target:
public void testSimpleUpdate ( ) { org.ovirt.engine.core.common.scheduling.AffinityGroup existing = dao.get ( FixturesTool.EXISTING_AFFINITY_GROUP_ID ) ; existing.setName ( "my_new_name" ) ; existing.setVmAffinityRule ( EntityAffinityRule.NEGATIVE ) ; existing.setVmEnforcing ( true ) ; dao.update ( existing ) ; org.ovirt.engine.core.common.scheduling.AffinityGroup fetched = dao.get ( existing.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( equals ( existing , fetched ) ) ; }
Source:
public void testClassOnlyOutput ( ) { java.lang.String expected = ( ( ( getClass ( ) . getSimpleName ( ) ) + ( ToStringBuilder.CLASS_NAME_SUFFIX ) ) + ( ToStringBuilder.ATTRIBUTES_LIST_PREFIX ) ) + ( ToStringBuilder.ATTRIBUTES_LIST_SUFFIX ) ; org.junit.Assert.assertEquals ( expected , org.ovirt.engine.core.common.utils.ToStringBuilder.forClass ( org.ovirt.engine.core.common.utils.ToStringBuilderTest.class ) . build ( ) ) ; }

Target:
public void testClassOnlyOutput ( ) { java.lang.String expected = ( ( ( getClass ( ) . getSimpleName ( ) ) + ( ToStringBuilder.CLASS_NAME_SUFFIX ) ) + ( ToStringBuilder.ATTRIBUTES_LIST_PREFIX ) ) + ( ToStringBuilder.ATTRIBUTES_LIST_SUFFIX ) ; org.junit.jupiter.api.Assertions.assertEquals ( expected , org.ovirt.engine.core.common.utils.ToStringBuilder.forClass ( org.ovirt.engine.core.common.utils.ToStringBuilderTest.class ) . build ( ) ) ; }
Source:
public java.lang.Object runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.storage_pool_iso_map domainPoolMap = new org.ovirt.engine.core.common.businessentities.storage_pool_iso_map ( getRecoveryStoragePoolParametersData ( ) . getNewMasterDomainId ( ) , getRecoveryStoragePoolParametersData ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDAO ( ) . save ( domainPoolMap ) ; getCompensationContext ( ) . snapshotNewEntity ( domainPoolMap ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.storage_pool_iso_map domainPoolMap = new org.ovirt.engine.core.common.businessentities.storage_pool_iso_map ( getRecoveryStoragePoolParametersData ( ) . getNewMasterDomainId ( ) , getRecoveryStoragePoolParametersData ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . save ( domainPoolMap ) ; getCompensationContext ( ) . snapshotNewEntity ( domainPoolMap ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
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 getIsPasswordDelegationPossible ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { final org.ovirt.engine.ui.frontend.INewAsyncCallback chainedCallback = asyncQuery.asyncCallback ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { chainedCallback.onSuccess ( model , ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsPasswordDelegationPossible , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , asyncQuery ) ; }
Source:
private < T > void validateMessageItems ( java.lang.String [ ] messageItems , java.util.List < T > items ) { validateMessageContainsProperties ( messageItems ) ; org.junit.Assert.assertTrue ( messageItems [ 0 ] . contains ( org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_VALUE ) ) ; org.junit.Assert.assertTrue ( messageItems [ 1 ] . contains ( java.lang.String.valueOf ( items.size ( ) ) ) ) ; }

Target:
private < T > void validateReplacements ( java.util.Collection < java.lang.String > replacements , java.util.List < T > items ) { validateReplacementsContainsExpectedProperties ( replacements , items ) ; org.junit.Assert.assertTrue ( validateReplacementContains ( replacements , org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_VALUE ) ) ; }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getImageId ( ) ; if ( ! ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( imageId ) ) ) { return validateImageTransfer ( imageId ) ; } else { if ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Download ) ) { return validateCreateImage ( ) ; } else { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_IMAGE_NOT_SPECIFIED_FOR_DOWNLOAD ) ; } } }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getImageId ( ) ; if ( isImageProvided ( ) ) { return validateImageTransfer ( imageId ) ; } else if ( ( org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.getParameters ( ) . getTransferType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.TransferType.Download ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_IMAGE_NOT_SPECIFIED_FOR_DOWNLOAD ) ; } return validateCreateImage ( ) ; }
Source:
public javax.ws.rs.core.Response get ( ) { java.net.URI uri = java.net.URI.create ( org.ovirt.engine.api.common.util.LinkHelper.addLinks ( getUriInfo ( ) , newModel ( id ) ) . getHref ( ) ) ; javax.ws.rs.core.Response.Status status = Response.Status.MOVED_PERMANENTLY ; return javax.ws.rs.core.Response.status ( status ) . location ( uri ) . build ( ) ; }

Target:
public javax.ws.rs.core.Response get ( ) { java.net.URI uri = java.net.URI.create ( org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , newModel ( id ) ) . getHref ( ) ) ; javax.ws.rs.core.Response.Status status = Response.Status.MOVED_PERMANENTLY ; return javax.ws.rs.core.Response.status ( status ) . location ( uri ) . build ( ) ; }
Source:
public static void GetVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void canDoActionVmDuringSnapshot ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , null , diskImageId ) ; org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( Snapshot.SnapshotStatus.LOCKED ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT ) ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT ) ; }

Target:
public void canDoActionVmDuringSnapshot ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , null , diskImageId ) ; org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( Snapshot.SnapshotStatus.LOCKED ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT ) ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT ) ; }
Source:
public void testValidRemovedBondsWhenBondIsNotRequired ( ) throws java.lang.Exception { java.lang.String nicName = "nicName" ; bond.setName ( nicName ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedBonds ( bond.getId ( ) ) ) . addExistingInterfaces ( java.util.Collections.singletonList ( bond ) ) . build ( ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidRemovedBondsWhenBondIsNotRequired ( ) { java.lang.String nicName = "nicName" ; bond.setName ( nicName ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedBonds ( bond.getId ( ) ) ) . addExistingInterfaces ( java.util.Collections.singletonList ( bond ) ) . build ( ) ; org.hamcrest.MatcherAssert.assertThat ( validator.validRemovedBonds ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ) ) { return false ; } org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap other = ( ( org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ) ( obj ) ) ; return ( ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( id , other.id ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( quotaId , other.quotaId ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( diskProfileId , other.diskProfileId ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ) ) { return false ; } org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap other = ( ( org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ) ( obj ) ) ; return ( ( java.util.Objects.equals ( id , other.id ) ) && ( java.util.Objects.equals ( quotaId , other.quotaId ) ) ) && ( java.util.Objects.equals ( diskProfileId , other.diskProfileId ) ) ; }
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 ) { updateFencingPolicyContent ( ( ( getVersion ( ) ) == null ? null : getVersion ( ) . getSelectedItem ( ) ) ) ; }

Target:
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 ) { if ( ( ( getEnableTrustedService ( ) . getEntity ( ) ) != null ) && ( getEnableTrustedService ( ) . getEntity ( ) ) ) { getEnableGlusterService ( ) . setEntity ( false ) ; getEnableGlusterService ( ) . setIsChangeable ( false ) ; } else { getEnableGlusterService ( ) . setIsChangeable ( true ) ; } }
Source:
public static org.ovirt.engine.api.restapi.types.WatchdogAction map ( org.ovirt.engine.core.common.businessentities.VmWatchdogAction action , org.ovirt.engine.api.restapi.types.WatchdogAction incoming ) { switch ( action ) { case DUMP : return WatchdogAction.DUMP ; case NONE : return WatchdogAction.NONE ; case PAUSE : return WatchdogAction.PAUSE ; case POWEROFF : return WatchdogAction.POWEROFF ; case RESET : return WatchdogAction.RESET ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.WatchdogAction map ( org.ovirt.engine.core.common.businessentities.VmWatchdogAction action , org.ovirt.engine.api.model.WatchdogAction incoming ) { switch ( action ) { case DUMP : return org.ovirt.engine.api.model.WatchdogAction.DUMP ; case NONE : return org.ovirt.engine.api.model.WatchdogAction.NONE ; case PAUSE : return org.ovirt.engine.api.model.WatchdogAction.PAUSE ; case POWEROFF : return org.ovirt.engine.api.model.WatchdogAction.POWEROFF ; case RESET : return org.ovirt.engine.api.model.WatchdogAction.RESET ; default : return null ; } }
Source:
private void mockOsRepository ( ) { org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.mockito.Mockito.when ( osRepository.get64bitOss ( ) ) . thenReturn ( new java.util.ArrayList < java.lang.Integer > ( ) { { add ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest._64_BIT_OS ) ; } } ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }

Target:
private void mockOsRepository ( ) { org.ovirt.engine.core.common.osinfo.OsRepository osRepository = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.mockito.Mockito.when ( osRepository.get64bitOss ( ) ) . thenReturn ( java.util.Collections.singletonList ( org.ovirt.engine.core.bll.validator.RunVmValidatorTest._64_BIT_OS ) ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; storageListModel.removeConnection = true ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setstorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; storageListModel.connection.setid ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetNetworkLabelsByNetworkId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.NETWORK_ID } , getEntityList ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.jupiter.api.Assertions.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetNetworkLabelsByNetworkId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.NETWORK_ID } , getEntityList ( ) , failure ) ; }
Source:
public void render ( com.google.gwt.cell.client.Cell.Context context , T object , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( showMask.showMask ( object ) ) { sb.appendHtmlConstant ( "<div style=\"position: absolute; left: 19px\" >" ) ; sb.append ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( mask ) . getHTML ( ) ) ) ; sb.appendHtmlConstant ( "</div>" ) ; } super . render ( context , object , sb ) ; }

Target:
public void render ( com.google.gwt.cell.client.Cell.Context context , T object , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( showMask.showMask ( object ) ) { org.ovirt.engine.ui.userportal.widget.table.column.AbstractMaskedVmImageColumn.renderMask ( mask , sb ) ; } super . render ( context , object , sb ) ; }
Source:
private void addMemBalloonDevice ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct struct = new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct ( ) ; struct.add ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.add ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; addDevice ( struct , vmDevice , null ) ; }

Target:
private void addMemBalloonDevice ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct struct = new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct ( ) ; struct.add ( VdsProperties.Type , vmDevice.getType ( ) ) ; struct.add ( VdsProperties.Device , vmDevice.getDevice ( ) ) ; java.util.Map < java.lang.String , java.lang.Object > specParams = vmDevice.getSpecParams ( ) ; if ( specParams == null ) { vmDevice.setSpecParams ( new java.util.HashMap < java.lang.String , java.lang.Object > ( ) ) ; } specParams.put ( VdsProperties.Model , VdsProperties.Virtio ) ; addDevice ( struct , vmDevice , null ) ; }
Source:
private void setUpGetBallooningExpectations ( int times , int index ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , true ) ; } }

Target:
private void setUpGetBallooningExpectations ( int times , int index ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , true ) ; } }
Source:
private void assertCorrectSlaveCountInValidBonds ( int numberOfSlaves , java.lang.String reason , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { java.lang.String bondName = "bondName" ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( bondName , true ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = createGivenCountOfSlavesForBond ( bondName , numberOfSlaves ) ; org.junit.Assert.assertThat ( reason , new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . validBond ( slaves ) , matcher ) ; }

Target:
private void assertCorrectSlaveCountInValidBondsWhenInsufficientBonds ( int numberOfSlaves ) { java.lang.String bondName = "bondName" ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_BONDS_INVALID_SLAVE_COUNT_LIST , bondName ) ) ; assertCorrectSlaveCountInValidBonds ( numberOfSlaves , java.lang.String.format ( "bonded interface with only %1$d slaves is not valid bond" , numberOfSlaves ) , matcher , bondName ) ; }
Source:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { 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.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
public void isClusterEmpty ( 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.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
private < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > org.ovirt.engine.core.bll.ValidationResult validateCoherentIdentification ( org.ovirt.engine.core.compat.Guid violatingEntityId , org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName , org.ovirt.engine.core.common.errors.VdcBllMessages message , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { boolean bothIdentificationSet = ( nicId != null ) && ( nicName != null ) ; java.lang.String [ ] replacements = createIncoherentIdentificationErrorReplacements ( violatingEntityId , nicId , nicName ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( message , replacements ) . when ( ( bothIdentificationSet && ( nameAndIdIsIncoherent ( nicId , nicName , map ) ) ) ) ; }

Target:
private < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > boolean isNameAndIdIncoherent ( org.ovirt.engine.core.compat.Guid id , java.lang.String name , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { T entityById = map.get ( id ) ; T entityByName = map.get ( name ) ; return ! ( java.util.Objects.equals ( entityById , entityByName ) ) ; }
Source:
private void UpdateVmData ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamicData ) { if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getrun_on_vds ( ) ) != null ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getrun_on_vds ( ) . getValue ( ) , vmDynamicData ) ) ; } else { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . update ( vmDynamicData ) ; } }

Target:
private void updateVmData ( org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamicData ) { if ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getrun_on_vds ( ) ) != null ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVmDynamicData , new org.ovirt.engine.core.common.vdscommands.UpdateVmDynamicDataVDSCommandParameters ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getrun_on_vds ( ) . getValue ( ) , vmDynamicData ) ) ; } else { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDao ( ) . update ( vmDynamicData ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.network.ExternalSubnet getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.network.ExternalSubnet subnet = control.createMock ( org.ovirt.engine.core.common.businessentities.network.ExternalSubnet.class ) ; org.easymock.EasyMock.expect ( subnet.getId ( ) ) . andReturn ( org.ovirt.engine.api.restapi.utils.HexUtils.string2hex ( NAMES [ index ] ) ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( subnet.getName ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; return subnet ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.ExternalSubnet getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.network.ExternalSubnet subnet = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.network.ExternalSubnet.class ) ; org.mockito.Mockito.when ( subnet.getId ( ) ) . thenReturn ( org.ovirt.engine.api.restapi.utils.HexUtils.string2hex ( NAMES [ index ] ) ) ; org.mockito.Mockito.when ( subnet.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; return subnet ; }
Source:
public void reload ( ) { onImportSourceChanged ( ) ; }

Target:
private void updateVms ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms ) { clearVms ( ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > externalVms = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { externalVms.add ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > ( vm ) ) ; } externalVmModels.setItems ( externalVms ) ; stopProgress ( ) ; }
Source:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }