auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getDocumentationBaseURL ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.LunDisk > filterDiskBasedOnLuns ( java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > listOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.LunDisk > lunDisks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LunDisk > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk disk : listOfDisks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ) { lunDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.LunDisk ) ( disk ) ) ) ; } } return lunDisks ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.storage.LunDisk > filterDiskBasedOnLuns ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.Disk > listOfDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LunDisk > lunDisks = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : listOfDisks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ) { lunDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.LunDisk ) ( disk ) ) ) ; } } return lunDisks ; }
Source:
public java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > executeAsyncCommand ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , final org.ovirt.engine.core.bll.context.CommandContext cmdContext ) { final org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters , cmdContext ) ; return org.ovirt.engine.core.bll.tasks.CommandExecutor.executor.submit ( new java.util.concurrent.Callable < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.action.VdcReturnValueBase call ( ) throws java.lang.Exception { return executeCommand ( command ) ; } } ) ; }

Target:
public java.util.concurrent.Future < org.ovirt.engine.core.common.action.VdcReturnValueBase > executeAsyncCommand ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , final org.ovirt.engine.core.bll.context.CommandContext cmdContext ) { final org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters , cmdContext ) ; coco.saveCommandContext ( command.getCommandId ( ) , cmdContext ) ; return org.ovirt.engine.core.bll.tasks.CommandExecutor.executor.submit ( new java.util.concurrent.Callable < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.action.VdcReturnValueBase call ( ) throws java.lang.Exception { return executeCommand ( command , cmdContext ) ; } } ) ; }
Source:
private void validateVMPluggedDisksWithReservationStatus ( boolean vmHasDisksPluggedWithReservation ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( null , vm.getId ( ) ) ; dve.setUsingScsiReservation ( vmHasDisksPluggedWithReservation ) ; org.mockito.Mockito.when ( diskVmElementDao.getAllPluggedToVm ( vm.getId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( dve ) ) ; if ( vmHasDisksPluggedWithReservation ) { org.junit.Assert.assertThat ( validator.isVmPluggedDiskNotUsingScsiReservation ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION ) ) ; } else { org.junit.Assert.assertThat ( validator.isVmPluggedDiskNotUsingScsiReservation ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; } }

Target:
private void validateVMPluggedDisksWithReservationStatus ( boolean vmHasDisksPluggedWithReservation ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( null , vm.getId ( ) ) ; dve.setUsingScsiReservation ( vmHasDisksPluggedWithReservation ) ; org.mockito.Mockito.when ( diskVmElementDao.getAllPluggedToVm ( vm.getId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( dve ) ) ; if ( vmHasDisksPluggedWithReservation ) { org.hamcrest.MatcherAssert.assertThat ( validator.isVmPluggedDiskNotUsingScsiReservation ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_VM_USES_SCSI_RESERVATION ) ) ; } else { org.hamcrest.MatcherAssert.assertThat ( validator.isVmPluggedDiskNotUsingScsiReservation ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; } }
Source:
private java.lang.Void executeAddQutoa ( ) { getQuotaDAO ( ) . save ( getQuota ( ) ) ; if ( getParameters ( ) . isCopyPermissions ( ) ) { copyQuotaPermissions ( ) ; } getReturnValue ( ) . setSucceeded ( true ) ; setActionReturnValue ( getQuota ( ) . getId ( ) ) ; return null ; }

Target:
private java.lang.Void executeAddQutoa ( ) { getQuotaDao ( ) . save ( getQuota ( ) ) ; if ( getParameters ( ) . isCopyPermissions ( ) ) { copyQuotaPermissions ( ) ; } getReturnValue ( ) . setSucceeded ( true ) ; setActionReturnValue ( getQuota ( ) . getId ( ) ) ; return null ; }
Source:
protected void executeCommand ( ) { if ( removeImages ( ) ) { if ( ( org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.getParameters ( ) . getSnapshot ( ) . getType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR ) ) { org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.getImage ( ) . setActive ( true ) ; imageDao.update ( org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.getImage ( ) . getImage ( ) ) ; } org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.setSucceeded ( true ) ; } }

Target:
protected void executeCommand ( ) { if ( removeImages ( ) ) { if ( ( org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.getParameters ( ) . getSnapshot ( ) . getType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR ) ) { org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.getImage ( ) . setActive ( true ) ; imageDao.update ( org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.getImage ( ) . getImage ( ) ) ; } discardHelper.logIfDisksWithIllegalPassDiscardExist ( org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.snapshots.RestoreFromSnapshotCommand.setSucceeded ( true ) ; } }
Source:
protected boolean canDoAction ( ) { return ( ( ( ( validate ( networkExists ( getRemovedNetwork ( ) ) ) ) && ( validate ( notManagementNetwork ( ) ) ) ) && ( validate ( networkNotUsedByVms ( getRemovedNetwork ( ) ) ) ) ) && ( validate ( networkNotUsedByTemplates ( getRemovedNetwork ( ) ) ) ) ) && ( validate ( networkNotUsedByHosts ( getRemovedNetwork ( ) ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetworkDAO ( ) . get ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetwork ( ) . getId ( ) ) ) ; return ( ( ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notManagementNetwork ( ) ) ) ) && ( validate ( validator.networkNotUsedByVms ( ) ) ) ) && ( validate ( validator.networkNotUsedByTemplates ( ) ) ) ; }
Source:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) , org.hamcrest.CoreMatchers.hasItem ( UPGRADE_ERROR.VM_NUMA_PINNED ) ) ; }

Target:
public void shouldDetectNumaPinning ( ) { invalidVM.setvNumaNodeList ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVmNumaNode ( 1 , java.util.Arrays.asList ( org.ovirt.engine.core.bll.utils.NumaTestUtils.createVdsNumaNode ( 1 ) ) ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.checkVmReadyForUpgrade ( invalidVM ) , org.hamcrest.CoreMatchers.hasItem ( EngineMessage.CLUSTER_UPGRADE_DETAIL_VM_NUMA_PINNED.name ( ) ) ) ; }
Source:
public static void getHostById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void testManagementNetworkChange ( boolean managementAfter , boolean emptyCluster , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expectedResult ) { networkCluster.setManagement ( managementAfter ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.ovirt.engine.core.bll.network.cluster.TEST_CLUSTER_ID ) ) . thenReturn ( ( emptyCluster ? java.util.Collections.emptyList ( ) : java.util.Collections.singletonList ( null ) ) ) ; org.junit.Assert.assertThat ( validator.managementNetworkChange ( ) , expectedResult ) ; }

Target:
private void testManagementNetworkChange ( boolean managementAfter , boolean emptyCluster , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expectedResult ) { networkCluster.setManagement ( managementAfter ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.ovirt.engine.core.bll.network.cluster.TEST_CLUSTER_ID ) ) . thenReturn ( ( emptyCluster ? java.util.Collections.emptyList ( ) : java.util.Collections.singletonList ( null ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.managementNetworkChange ( ) , expectedResult ) ; }
Source:
public java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > runMultipleActions ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , boolean isRunOnlyIfAllValidationPass , boolean waitForResult ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = notAllowToRunAction ( actionType ) ; if ( returnValue != null ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcReturnValueBase > list = new java.util.ArrayList < > ( ) ; list.add ( returnValue ) ; return list ; } else { return runMultipleActionsImpl ( actionType , parameters , false , isRunOnlyIfAllValidationPass , waitForResult , null ) ; } }

Target:
public java.util.List < org.ovirt.engine.core.common.action.ActionReturnValue > runMultipleActions ( org.ovirt.engine.core.common.action.ActionType actionType , java.util.List < org.ovirt.engine.core.common.action.ActionParametersBase > parameters , boolean isRunOnlyIfAllValidationPass , boolean waitForResult ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = notAllowToRunAction ( actionType ) ; if ( returnValue != null ) { java.util.List < org.ovirt.engine.core.common.action.ActionReturnValue > list = new java.util.ArrayList < > ( ) ; list.add ( returnValue ) ; return list ; } else { return runMultipleActionsImpl ( actionType , parameters , false , isRunOnlyIfAllValidationPass , waitForResult , null ) ; } }
Source:
public void validateSufficientSpaceOnDestinationDomains ( ) { setupForStorageTests ( ) ; command.ensureDestinationImageMap ( ) ; org.junit.Assert.assertTrue ( command.checkDestDomains ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }

Target:
public void validateSufficientSpaceOnDestinationDomains ( ) { setupForStorageTests ( ) ; command.ensureDestinationImageMap ( ) ; org.junit.Assert.assertTrue ( command.checkDestDomains ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.ArgumentMatchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }
Source:
public static void GetClusterById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.GetVdsGroupByIdParameters ( id ) , aQuery ) ; }

Target:
public static void GetClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { return ( ( validateParameters ( ) ) && ( validateNameNotExistInDC ( ) ) ) && ( validateValues ( ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkQosValidator validator = new org.ovirt.engine.core.bll.validator.NetworkQosValidator ( getNetworkQoS ( ) ) ; return ( ( ( validateParameters ( ) ) && ( validate ( validator.nameNotTakenInDc ( ) ) ) ) && ( validate ( validator.allValuesPresent ( ) ) ) ) && ( validate ( validator.peakConsistentWithAverage ( ) ) ) ; }
Source:
private void setupMock ( ) throws java.lang.Exception { commandMock = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.EndExternalJobCommand ( parameters , null ) ) ; org.mockito.Mockito.when ( commandMock.getParameters ( ) ) . thenReturn ( parameters ) ; org.mockito.Mockito.doReturn ( jobDaoMock ) . when ( commandMock ) . getJobDao ( ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.jobId ) ) . thenReturn ( makeExternalTestJob ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.jobId ) ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.nonExternalJobId ) ) . thenReturn ( makeNonExternalTestJob ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.nonExternalJobId ) ) ; }

Target:
public void validateNonExistingJobFails ( ) throws java.lang.Exception { setupMock ( ) ; org.mockito.Mockito.when ( jobDaoMock.get ( org.ovirt.engine.core.bll.EndExternalJobCommandTest.jobId ) ) . thenReturn ( null ) ; org.junit.Assert.assertTrue ( ( ! ( commandMock.validate ( ) ) ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.AsyncTasks getByVdsmTaskId ( org.ovirt.engine.core.compat.Guid vdsmTaskId ) { org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . getByVdsmTaskId ( vdsmTaskId ) ; if ( asyncTask != null ) { copyFromCommandEntity ( asyncTask , commandsCache.get ( asyncTask.getCommandId ( ) ) ) ; } return asyncTask ; }

Target:
public void revertTasks ( org.ovirt.engine.core.bll.CommandBase command ) { coCoAsyncTaskHelper.revertTasks ( command ) ; }
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 ) { updatePmModels ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String fingerprint = ( ( java.lang.String ) ( result ) ) ; if ( ( fingerprint != null ) && ( ( fingerprint.length ( ) ) > 0 ) ) { getFetchSshFingerprint ( ) . setEntity ( fingerprint ) ; getFetchResult ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . successLoadingFingerprint ( ) ) ; } else { getFetchResult ( ) . setEntity ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . errorLoadingFingerprint ( ) ) ; } }
Source:
public void testUpdateWithExistingNetwork ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setGetVmQueryExpectations ( 2 ) ; setGetNetworksQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getUpdate ( true ) ) ; assertNotNull ( nic ) ; }

Target:
public void testUpdateWithNonExistingNetwork ( ) throws java.lang.Exception { control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getNic ( true ) ) ; nic.getNetwork ( ) . setId ( GUIDS [ 2 ] . toString ( ) ) ; assertNotNull ( nic ) ; }
Source:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public static void getNumberOfVmsInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNumberOfVmsInVdsGroupByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public boolean checkIfCpusSameManufacture ( java.lang.String cpuName1 , java.lang.String cpuName2 , org.ovirt.engine.core.compat.Version ver ) { final org.ovirt.engine.core.bll.CpuFlagsManagerHandler.CpuFlagsManager cpuFlagsManager = org.ovirt.engine.core.bll.CpuFlagsManagerHandler._managersDictionary.get ( ver ) ; if ( cpuFlagsManager != null ) { return cpuFlagsManager.checkIfCpusSameManufacture ( cpuName1 , cpuName2 ) ; } return false ; }

Target:
public boolean checkIfCpusSameManufacture ( java.lang.String cpuName1 , java.lang.String cpuName2 ) { if ( ( cpuName1 == null ) || ( cpuName2 == null ) ) { return false ; } if ( intelCpuByNameDictionary.containsKey ( cpuName1 ) ) { return intelCpuByNameDictionary.containsKey ( cpuName2 ) ; } if ( amdCpuByNameDictionary.containsKey ( cpuName1 ) ) { return amdCpuByNameDictionary.containsKey ( cpuName2 ) ; } if ( ibmCpuByNameDictionary.containsKey ( cpuName1 ) ) { return ibmCpuByNameDictionary.containsKey ( cpuName2 ) ; } return false ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc setVolumeLegality ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID , java.lang.String legality ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.setLegality" ) . withParameter ( "storagepoolID" , spID ) . withParameter ( "storagedomainID" , sdID ) . withParameter ( "imageID" , imageID ) . withParameter ( "volumeID" , volumeID ) . withParameter ( "legality" , legality ) . 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.irsbroker.StatusReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc verifyUntrustedVolume ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Volume.verify_untrusted" ) . withParameter ( "storagepoolID" , spID ) . withParameter ( "storagedomainID" , sdID ) . withParameter ( "imageID" , imageID ) . withParameter ( "volumeID" , volumeID ) . 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.irsbroker.StatusReturnForXmlRpc ( response ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } oldMacPool = getMacPoolDao ( ) . get ( getParameters ( ) . getMacPoolId ( ) ) ; final org.ovirt.engine.core.bll.MacPoolValidator validator = new org.ovirt.engine.core.bll.MacPoolValidator ( oldMacPool ) ; return ( ( validate ( validator.macPoolExists ( ) ) ) && ( validate ( validator.notRemovingUsedPool ( ) ) ) ) && ( validate ( validator.notRemovingDefaultPool ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.MacPool getOldMacPool ( ) { if ( ( oldMacPool ) == null ) { oldMacPool = getMacPoolDao ( ) . get ( getMacPoolId ( ) ) ; } return oldMacPool ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { org.ovirt.engine.core.common.businessentities.VM vm = item.getVM ( ) ; if ( vm != null ) { java.lang.String tooltip = getTooltipText ( vm.getStatus ( ) ) ; if ( tooltip != null ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( tooltip ) ; } } return null ; }

Target:
public java.lang.String getTooltip ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { org.ovirt.engine.core.common.businessentities.VM vm = item.getVM ( ) ; if ( vm != null ) { java.lang.String tooltip = getTooltipText ( vm.getStatus ( ) ) ; if ( tooltip != null ) { return tooltip ; } } return "" ; }
Source:
public int hashCode ( ) { return words.hashCode ( ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.api.metamodel.concepts.Name ) ) { return false ; } org.ovirt.api.metamodel.concepts.Name other = ( ( org.ovirt.api.metamodel.concepts.Name ) ( obj ) ) ; return java.util.Objects.equals ( words , other.words ) ; }
Source:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; 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 validCpuMessage ( ) { org.ovirt.engine.core.common.businessentities.qos.CpuQos qos = new org.ovirt.engine.core.common.businessentities.qos.CpuQos ( ) ; qos.setCpuLimit ( org.ovirt.engine.core.bll.scheduling.QosRangeValidatorTest.OUT_OF_RANGE ) ; java.util.List < java.lang.String > canDoMsgs = org.ovirt.engine.core.common.utils.ValidationUtils.validateInputs ( java.util.Arrays.asList ( new java.lang.Class < ? > [ ] { javax.validation.groups.Default.class } ) , qos ) ; assertCanDoMsgCount ( canDoMsgs , "$range 1-100" , 1 ) ; assertCanDoMsgCount ( canDoMsgs , EngineMessage.ACTION_TYPE_FAILED_QOS_OUT_OF_RANGE_VALUES.name ( ) , 1 ) ; }

Target:
public void validCpuMessage ( ) { org.ovirt.engine.core.common.businessentities.qos.CpuQos qos = new org.ovirt.engine.core.common.businessentities.qos.CpuQos ( ) ; qos.setCpuLimit ( org.ovirt.engine.core.bll.scheduling.QosRangeValidatorTest.OUT_OF_RANGE ) ; java.util.List < java.lang.String > validationMessages = org.ovirt.engine.core.common.utils.ValidationUtils.validateInputs ( java.util.Arrays.asList ( new java.lang.Class < ? > [ ] { javax.validation.groups.Default.class } ) , qos ) ; assertValidateMsgCount ( validationMessages , "$range 1-100" , 1 ) ; assertValidateMsgCount ( validationMessages , EngineMessage.ACTION_TYPE_FAILED_QOS_OUT_OF_RANGE_VALUES.name ( ) , 1 ) ; }
Source:
private void addHostNICStates ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.NicStatus [ ] values ) { version.setHostNicStates ( new org.ovirt.engine.api.model.HostNICStates ( ) ) ; for ( org.ovirt.engine.api.model.NicStatus status : values ) { version.getHostNicStates ( ) . getHostNICStates ( ) . add ( status.value ( ) ) ; } }

Target:
private void addHostNICStates ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.NicStatus [ ] values ) { version.setHostNicStates ( new org.ovirt.engine.api.model.HostNicStates ( ) ) ; for ( org.ovirt.engine.api.model.NicStatus status : values ) { version.getHostNicStates ( ) . getHostNicStates ( ) . add ( status.value ( ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionResume ( java.lang.String volumeName , java.lang.String slaveHostName , java.lang.String slaveVolumeName , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionResume" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHostName ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . 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.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionResume ( java.lang.String volumeName , java.lang.String slaveHostName , java.lang.String slaveVolumeName , java.lang.String userName , boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionResume" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHostName ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . withOptionalParameter ( "remoteUserName" , userName ) . 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 ) ; }
Source:
private void initImportSources ( ) { importSources.setItems ( java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.values ( ) ) ) ; importSources.setSelectedItem ( ImportSource.EXPORT_DOMAIN ) ; importSources.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override 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 ) { clearVms ( ) ; clearValidations ( ) ; } } ) ; }

Target:
private void initImportSources ( ) { importSources.setItems ( java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.values ( ) ) ) ; importSources.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override 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 ) { clearVms ( ) ; clearValidations ( ) ; loadProviders ( ) ; } } ) ; importSources.setSelectedItem ( ImportSource.EXPORT_DOMAIN ) ; }
Source:
private void createSnapshotsForDisks ( org.ovirt.engine.core.compat.Guid vmSnapshotId ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getDisksList ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.CreateSnapshot , buildCreateSnapshotParameters ( image , vmSnapshotId ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getExecutionContext ( ) ) ) ; if ( vdcReturnValue.getSucceeded ( ) ) { org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getTaskIdList ( ) . addAll ( vdcReturnValue.getInternalTaskIdList ( ) ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcReturnValue.getFault ( ) . getError ( ) , "CreateAllSnapshotsFromVmCommand::executeVmCommand: Failed to create snapshot!" ) ; } } }

Target:
private void createSnapshotsForDisks ( org.ovirt.engine.core.compat.Guid vmSnapshotId ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getDisksList ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.CreateSnapshot , buildCreateSnapshotParameters ( image , vmSnapshotId ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( getExecutionContext ( ) ) ) ; if ( vdcReturnValue.getSucceeded ( ) ) { getTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcReturnValue.getFault ( ) . getError ( ) , "Failed to create snapshot!" ) ; } } }
Source:
public void run ( ) { org.ovirt.engine.core.bll.VdsEventListener.log.info ( "ResourceManager::vdsNotResponding entered for Host '{}', '{}'" , vds.getId ( ) , vds.getHostName ( ) ) ; org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.VdsNotRespondingTreatment , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; moveBricksToUnknown ( vds ) ; }

Target:
public void vdsNonOperational ( org.ovirt.engine.core.compat.Guid vdsId , org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , boolean logCommand , org.ovirt.engine.core.compat.Guid domainId , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.bll.job.ExecutionHandler.updateSpecificActionJobCompleted ( vdsId , VdcActionType.MaintenanceVds , false ) ; org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( vdsId , reason , customLogValues ) ; tempVar.setStorageDomainId ( domainId ) ; tempVar.setShouldBeLogged ( logCommand ) ; backend.runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
private void sortVms ( java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > vms ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > vm : vms ) { vmsList.add ( vm.getEntity ( ) ) ; } java.util.Collections.sort ( vmsList , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator ( ) ) ; vms.clear ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsList ) { vms.add ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( vm ) ) ; } }

Target:
public void onSuccess ( java.lang.Object nothing , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > allClusters = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; clusterArchitecturesInDataCenters = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster cluster : allClusters ) { if ( ( cluster.supportsVirtService ( ) ) && ( ( cluster.getArchitecture ( ) ) != null ) ) { addArchitecture ( cluster.getStoragePoolId ( ) , cluster.getArchitecture ( ) ) ; } } }
Source:
public void getEngineSshPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetEngineSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getEngineSshPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.String > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.StringConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetEngineSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private static int getNextImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( images.get ( i ) . getParentId ( ) . equals ( curr.getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionType getActionType ( ) { return super . getActionType ( ) ; }
Source:
public final boolean connect ( java.lang.String server , java.lang.String rootPassword , long timeout ) { return _doConnect ( server , "root" , rootPassword , null , null , timeout ) ; }

Target:
public java.lang.String getServerKeyFingerprint ( java.lang.String server , long timeout ) throws java.lang.Exception { java.lang.String fingerprint = null ; _openSession ( server , timeout , timeout ) ; java.security.PublicKey serverKey = this . client.getServerKey ( ) ; if ( serverKey != null ) { fingerprint = org.ovirt.engine.core.engineencryptutils.OpenSSHUtils.getKeyFingerprintString ( serverKey ) ; } return fingerprint ; }
Source:
public static void GetDocumentationBaseURL ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DocsURL , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void IsHotPlugAvailable ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.HotPlugEnabled ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }
Source:
public static boolean isGraphicsAndDisplaySupported ( int osId , java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > graphics , org.ovirt.engine.core.common.businessentities.DisplayType displayType , java.util.List < java.lang.String > reasons , org.ovirt.engine.core.compat.Version clusterVersion ) { boolean result = org.ovirt.engine.core.bll.validator.VmValidationUtils.isGraphicsAndDisplaySupported ( osId , clusterVersion , graphics , displayType ) ; if ( ! result ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_VM_DISPLAY_TYPE_IS_NOT_SUPPORTED_BY_OS.name ( ) ) ; } return result ; }

Target:
public static boolean isOsTypeSupportedForVirtioScsi ( int osId , org.ovirt.engine.core.compat.Version clusterVersion , java.util.List < java.lang.String > reasons ) { boolean result = org.ovirt.engine.core.bll.validator.VmValidationUtils.isDiskInterfaceSupportedByOs ( osId , clusterVersion , DiskInterface.VirtIO_SCSI ) ; if ( ! result ) { reasons.add ( EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI.name ( ) ) ; } return result ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult a ) { stopProgress ( a.getState ( ) ) ; cancel ( ) ; }

Target:
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 ( ( ( java.lang.Boolean ) ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ) ) ; param.setConsoleEnabled ( ( ( java.lang.Boolean ) ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallbacks.NetworkUpdateFrontendAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }
Source:
public static org.ovirt.engine.api.model.StorageDomainStatus map ( org.ovirt.engine.api.model.StorageDomainStatus status , org.ovirt.engine.api.model.StorageDomainStatus template ) { switch ( status ) { case Unattached : return org.ovirt.engine.api.model.StorageDomainStatus.UNATTACHED ; case Activating : return org.ovirt.engine.api.model.StorageDomainStatus.ACTIVATING ; case Active : return org.ovirt.engine.api.model.StorageDomainStatus.ACTIVE ; case Inactive : return org.ovirt.engine.api.model.StorageDomainStatus.INACTIVE ; case Locked : return org.ovirt.engine.api.model.StorageDomainStatus.LOCKED ; case PreparingForMaintenance : return org.ovirt.engine.api.model.StorageDomainStatus.PREPARING_FOR_MAINTENANCE ; case Detaching : return org.ovirt.engine.api.model.StorageDomainStatus.DETACHING ; case Maintenance : return org.ovirt.engine.api.model.StorageDomainStatus.MAINTENANCE ; case Unknown : return org.ovirt.engine.api.model.StorageDomainStatus.UNKNOWN ; case Uninitialized : return null ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.StorageDomainStatus mapStorageDomainStatus ( org.ovirt.engine.api.model.StorageDomainStatus status ) { switch ( status ) { case Unattached : return org.ovirt.engine.api.model.StorageDomainStatus.UNATTACHED ; case Activating : return org.ovirt.engine.api.model.StorageDomainStatus.ACTIVATING ; case Active : return org.ovirt.engine.api.model.StorageDomainStatus.ACTIVE ; case Inactive : return org.ovirt.engine.api.model.StorageDomainStatus.INACTIVE ; case Locked : return org.ovirt.engine.api.model.StorageDomainStatus.LOCKED ; case PreparingForMaintenance : return org.ovirt.engine.api.model.StorageDomainStatus.PREPARING_FOR_MAINTENANCE ; case Detaching : return org.ovirt.engine.api.model.StorageDomainStatus.DETACHING ; case Maintenance : return org.ovirt.engine.api.model.StorageDomainStatus.MAINTENANCE ; case Unknown : return org.ovirt.engine.api.model.StorageDomainStatus.UNKNOWN ; case Uninitialized : return null ; default : return null ; } }
Source:
private void addAddtionalParams ( org.ovirt.engine.core.common.action.VmNumaNodeOperationParameters params ) { params.setDedicatedHost ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVds ( ) ) ; params.setNumaTuneMode ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumaTuneMode ( ) ) ; params.setMigrationSupport ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) . getMigrationSupport ( ) ) ; }

Target:
private void addAddtionalParams ( org.ovirt.engine.core.common.action.VmNumaNodeOperationParameters params ) { params.setDedicatedHostList ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) . getDedicatedVmForVdsList ( ) ) ; params.setNumaTuneMode ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumaTuneMode ( ) ) ; params.setMigrationSupport ( org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) . getMigrationSupport ( ) ) ; }
Source:
public static void IsCustomPropertiesAvailable ( 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.SupportCustomProperties ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void GetAllowClusterWithVirtGlusterEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : java.lang.Boolean.TRUE ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.AllowClusterWithVirtGlusterEnabled , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VmTemplate createLatestTemplate ( org.ovirt.engine.core.common.businessentities.VmTemplate template ) { org.ovirt.engine.core.common.businessentities.VmTemplate latestTemplate = new org.ovirt.engine.core.common.businessentities.VmTemplate ( template ) ; latestTemplate.setTemplateVersionName ( constants.latestTemplateVersionName ( ) ) ; latestTemplate.setDescription ( constants.latestTemplateVersionDescription ( ) ) ; return latestTemplate ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; if ( useLatest ) { template = new org.ovirt.engine.ui.uicommonweb.models.templates.LatestVmTemplate ( template ) ; } setupBaseTemplate ( template.getBaseTemplateId ( ) ) ; model.getTemplate ( ) . setItems ( java.util.Collections.singletonList ( template ) ) ; model.getTemplate ( ) . setSelectedItem ( template ) ; model.getTemplate ( ) . setIsChangable ( false ) ; }