auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public final boolean addMac ( java.lang.String mac ) { boolean added = super . addMac ( mac ) ; if ( added ) { getStrategyForMacAllocation ( ) . forEach ( ( e ) -> e.releaseMacsInCaseOfRollback ( java.util.Collections.singletonList ( mac ) ) ) ; } return added ; }

Target:
public final void forceAddMac ( java.lang.String mac ) { super . forceAddMac ( mac ) ; getStrategyForMacAllocation ( ) . forEach ( ( e ) -> e.releaseMacsInCaseOfRollback ( java.util.Collections.singletonList ( mac ) ) ) ; }
Source:
public int setTabIndexes ( int nextTabIndex ) { nameEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; descriptionEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; clusterEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; quotaEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; nextTabIndex = disksAllocationView.setTabIndexes ( nextTabIndex ) ; isTemplatePublicEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; copyVmPermissions.setTabIndex ( ( nextTabIndex ++ ) ) ; return nextTabIndex ; }

Target:
public int setTabIndexes ( int nextTabIndex ) { nameEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; descriptionEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; commentEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; clusterEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; quotaEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; nextTabIndex = disksAllocationView.setTabIndexes ( nextTabIndex ) ; isTemplatePublicEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; copyVmPermissions.setTabIndex ( ( nextTabIndex ++ ) ) ; return nextTabIndex ; }
Source:
public void getRpmVersion ( 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.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( getDefaultConfigurationVersion ( ) ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getGlusterSnapshotConfig ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.setHandleFailure ( true ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotConfig , new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeQueriesParameters ( clusterId , volumeId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepConfigListXmlRpc glusterVolumeGeoRepConfigList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { try { return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepConfigListXmlRpc ( vdsServer.glusterVolumeGeoRepConfigList ( volumeName , slaveHost , slaveVolumeName ) ) ; } 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 glusterVolumeGeoRepConfigReset ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String configKey , java.lang.String userName ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepConfigReset ( volumeName , slaveHost , slaveVolumeName , configKey , userName ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void init ( ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initializing Scheduling manager" ) ; loadPolicyUnits ( ) ; loadClusterPolicies ( ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread discoveryThread = new org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread ( ) ; if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.ExternalSchedulerEnabled ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Starting external scheduler dicovery thread" ) ; discoveryThread.start ( ) ; } else { discoveryThread.markAllExternalPoliciesAsDisabled ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "External scheduler disabled, discovery skipped" ) ; } org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initialized Scheduling manager" ) ; }

Target:
protected void loadExternalScheduler ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.ExternalSchedulerEnabled ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Starting external scheduler discovery thread" ) ; org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { if ( exSchedulerDiscovery.discover ( ) ) { reloadPolicyUnits ( ) ; } } } ) ; } else { exSchedulerDiscovery.markAllExternalPoliciesAsDisabled ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "External scheduler disabled, discovery skipped" ) ; } }
Source:
public void testExecuteQueryCommnad ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getServer ( ) ) . thenReturn ( serverName ) ; getQuery ( ) . executeQueryCommand ( ) ; java.lang.String serverFingerprint = ( ( java.lang.String ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertNotNull ( serverFingerprint ) ; org.junit.Assert.assertEquals ( fingerPrint , serverFingerprint ) ; }

Target:
public void testExecuteQueryCommnad ( ) throws java.io.IOException { org.mockito.Mockito.when ( getQueryParameters ( ) . getServer ( ) ) . thenReturn ( serverName ) ; org.mockito.Mockito.doReturn ( fingerPrint ) . when ( mockEngineSSHDialog ) . getHostFingerprint ( ) ; getQuery ( ) . executeQueryCommand ( ) ; java.lang.String serverFingerprint = ( ( java.lang.String ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) ; org.junit.Assert.assertNotNull ( serverFingerprint ) ; org.junit.Assert.assertEquals ( fingerPrint , serverFingerprint ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData object ) { ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( object.getClusterNames ( ) ) ; return ( object.getCluster ( ) . getSelectedItem ( ) ) != null ? object.getCluster ( ) . getSelectedItem ( ) . getName ( ) : constants.empty ( ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportEntityData < E > object ) { ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( object.getClusterNames ( ) ) ; return ( object.getCluster ( ) . getSelectedItem ( ) ) != null ? object.getCluster ( ) . getSelectedItem ( ) . getName ( ) : constants.empty ( ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; if ( ( ( result != null ) && ( ( result.getReturnValue ( ) ) != null ) ) && ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { cancel ( ) ; } }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList ) { java.util.List < org.ovirt.engine.core.compat.Guid > vmIds = getAffinityGroup ( ) . getVmIds ( ) ; getVmsSelectionModel ( ) . init ( vmList , ( vmIds != null ? vmIds : new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ) ; stopProgress ( ) ; }
Source:
protected void updateSingleNic ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { super . updateSingleNic ( node , iface ) ; iface.setMacAddress ( ( ( node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) ) != null ? node.SelectSingleNode ( "rasd:MACAddress" , _xmlNS ) . innerText : "" ) ) ; }

Target:
protected void updateSingleNic ( org.ovirt.engine.core.utils.ovf.xml.XmlNode node , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { super . updateSingleNic ( node , iface ) ; iface.setMacAddress ( ( ( selectSingleNode ( node , "rasd:MACAddress" , _xmlNS ) ) != null ? selectSingleNode ( node , "rasd:MACAddress" , _xmlNS ) . innerText : "" ) ) ; }
Source:
private void AttachIso_EntityChanged ( ) { getIsoImage ( ) . setIsChangable ( ( ( java.lang.Boolean ) ( getAttachIso ( ) . getEntity ( ) ) ) ) ; getBootSequence ( ) . getCdromOption ( ) . setIsChangable ( ( ( java.lang.Boolean ) ( getAttachIso ( ) . getEntity ( ) ) ) ) ; }

Target:
private void attachIso_EntityChanged ( ) { getIsoImage ( ) . setIsChangable ( ( ( java.lang.Boolean ) ( getAttachIso ( ) . getEntity ( ) ) ) ) ; getBootSequence ( ) . getCdromOption ( ) . setIsChangable ( ( ( java.lang.Boolean ) ( getAttachIso ( ) . getEntity ( ) ) ) ) ; }
Source:
protected void sendWarningForNonExportableDisks ( org.ovirt.engine.core.common.businessentities.VM entity ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetVmDiskList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getWindow ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( target ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > vmDisks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( model , vmDisks , VmModelHelper.WarningType.VM_EXPORT ) ; } } ) , entity.getId ( ) ) ; }

Target:
protected void sendWarningForNonExportableDisks ( org.ovirt.engine.core.common.businessentities.VM entity ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getVmDiskList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getWindow ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { final org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ExportVmModel ) ( target ) ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > vmDisks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.VmModelHelper.sendWarningForNonExportableDisks ( model , vmDisks , VmModelHelper.WarningType.VM_EXPORT ) ; } } ) , entity.getId ( ) ) ; }
Source:
public void validateFailsIfHostDoesNotExists ( ) { org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters param = org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommandTest.createParameters ( ) ; org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > command = createCommand ( param ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; }

Target:
public void validateFailsIsoVersionNotCompatible ( ) { mockVdsWithOsVersion ( org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommandTest.INVALID_OVIRT_VERSION ) ; command.getParameters ( ) . setoVirtIsoFile ( org.ovirt.engine.core.bll.hostdeploy.UpgradeOvirtNodeInternalCommandTest.VALID_VERSION_OVIRT_ISO_FILENAME ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.VDS_CANNOT_UPGRADE_BETWEEN_MAJOR_VERSION ) ; }
Source:
public void validateFailedGuestOsIsNotSupported ( ) { mockInterfaceList ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( 15 ) ; createVirtIODisk ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getOsName ( 15 ) ) . thenReturn ( "RHEL3x64" ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getDiskHotpluggableInterfaces ( org.mockito.ArgumentMatchers.any ( java.lang.Integer.class ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.emptySet ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; }

Target:
public void validateFailedGuestOsIsNotSupported ( ) { mockInterfaceList ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = mockVmStatusUp ( ) ; vm.setVmOs ( 15 ) ; createVirtIODisk ( ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getOsName ( 15 ) ) . thenReturn ( "RHEL3x64" ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.storage.disk.HotPlugDiskToVmCommandTest.osRepository.getDiskHotpluggableInterfaces ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.emptySet ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_GUEST_OS_VERSION_IS_NOT_SUPPORTED ) ; }
Source:
public void waitBeforeNextPoll ( long timeBeforePoll ) { if ( ( ( java.lang.System.currentTimeMillis ( ) ) - timeBeforePoll ) < ( org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller.POLLING_BREAK ) ) { try { java.lang.Thread.sleep ( org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller.POLLING_BREAK ) ; } catch ( java.lang.InterruptedException e ) { } } }

Target:
private boolean getValue ( org.ovirt.engine.core.common.interfaces.FutureVDSCall < org.ovirt.engine.core.common.vdscommands.VDSReturnValue > task ) { try { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue = task.get ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.SetupNetworksPollingTimeout ) , java.util.concurrent.TimeUnit.SECONDS ) ; return vdsReturnValue.getSucceeded ( ) ; } catch ( java.util.concurrent.TimeoutException e ) { return false ; } }
Source:
public boolean brickExists ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newBrick ) { for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick : getGlusterBrickDao ( ) . getGlusterVolumeBricksByServerId ( newBrick.getServerId ( ) ) ) { if ( ( ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.objectsEqual ( newBrick.getVolumeId ( ) , brick.getVolumeId ( ) ) ) && ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.objectsEqual ( newBrick.getServerId ( ) , brick.getServerId ( ) ) ) ) && ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.objectsEqual ( newBrick.getBrickDirectory ( ) , brick.getBrickDirectory ( ) ) ) ) { return true ; } } return false ; }

Target:
public boolean brickExists ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newBrick ) { for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick : getGlusterBrickDao ( ) . getGlusterVolumeBricksByServerId ( newBrick.getServerId ( ) ) ) { if ( ( ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( newBrick.getVolumeId ( ) , brick.getVolumeId ( ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( newBrick.getServerId ( ) , brick.getServerId ( ) ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( newBrick.getBrickDirectory ( ) , brick.getBrickDirectory ( ) ) ) ) { return true ; } } return false ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue runVdsCommand ( org.ovirt.engine.core.common.vdscommands.VDSCommandType commandType , org.ovirt.engine.core.common.vdscommands.VDSParametersBase parameters ) { return super . runVdsCommand ( commandType , parameters ) ; }

Target:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = heStorageDomain.getStorageStaticData ( ) . getConnection ( ) ; connection.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; storageServerConnectionDao.save ( connection ) ; heStorageDomain.setStorage ( connection.getId ( ) ) ; setSucceeded ( true ) ; getCompensationContext ( ) . snapshotEntity ( connection ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ev.equals ( ConsoleModel.ErrorEventDefinition ) ) && ( ( sender instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) || ( sender instanceof org.ovirt.engine.ui.uicommonweb.models.vms.RdpConsoleModel ) ) ) { consoleModelError ( sender , getConsoleModelErrorMessage ( sender , ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs ) ( args ) ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ev.matchesDefinition ( ConsoleModel.ErrorEventDefinition ) ) && ( ( sender instanceof org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel ) || ( sender instanceof org.ovirt.engine.ui.uicommonweb.models.vms.RdpConsoleModel ) ) ) { consoleModelError ( sender , getConsoleModelErrorMessage ( sender , ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ErrorCodeEventArgs ) ( args ) ) ) ) ; } }
Source:
private void updateDisplayAndGraphics ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.DisplayType > > graphicsAndDisplays = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGraphicsAndDisplays ( osType , cluster.getcompatibility_version ( ) ) ; initDisplayModels ( graphicsAndDisplays ) ; }

Target:
private void updateDisplayAndGraphics ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getSelectedCluster ( ) ; java.lang.Integer osType = getOSType ( ) . getSelectedItem ( ) ; if ( ( cluster == null ) || ( osType == null ) ) { return ; } java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.DisplayType > > graphicsAndDisplays = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGraphicsAndDisplays ( osType , cluster.getCompatibilityVersion ( ) ) ; initDisplayModels ( graphicsAndDisplays ) ; }
Source:
private boolean checkLunsInStorageDomain ( java.util.List < java.lang.String > lunIds ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromDb = org.ovirt.engine.core.bll.storage.domain.RefreshLunsSizeCommand.getLunDao ( ) . getAllForVolumeGroup ( org.ovirt.engine.core.bll.storage.domain.RefreshLunsSizeCommand.getStorageDomain ( ) . getStorage ( ) ) ; java.util.Set < java.lang.String > lunsSet = new java.util.HashSet < > ( lunIds ) ; for ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun : lunsFromDb ) { if ( lunsSet.contains ( lun.getLUN_id ( ) ) ) { lunsSet.remove ( lun.getLUN_id ( ) ) ; } } return lunsSet.isEmpty ( ) ; }

Target:
private boolean checkLunsInStorageDomain ( java.util.List < java.lang.String > lunIds ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsFromDb = org.ovirt.engine.core.bll.storage.domain.RefreshLunsSizeCommand.getLunDao ( ) . getAllForVolumeGroup ( org.ovirt.engine.core.bll.storage.domain.RefreshLunsSizeCommand.getStorageDomain ( ) . getStorage ( ) ) ; java.util.Set < java.lang.String > lunsSet = new java.util.HashSet < > ( lunIds ) ; for ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun : lunsFromDb ) { if ( lunsSet.contains ( lun.getLUNId ( ) ) ) { lunsSet.remove ( lun.getLUNId ( ) ) ; } } return lunsSet.isEmpty ( ) ; }
Source:
public void update ( org.ovirt.engine.core.common.businessentities.Cluster group ) { getCallsHandler ( ) . executeModification ( "UpdateCluster" , getClusterParamSource ( group ) ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.Cluster cluster ) { org.ovirt.engine.core.compat.Guid id = cluster.getId ( ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( id ) ) { id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; cluster.setId ( id ) ; } getCallsHandler ( ) . executeModification ( "InsertCluster" , getClusterParamSource ( cluster ) ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid vdsgroupid = org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getDbFacade ( ) . getNetworkDao ( ) . getAllForCluster ( vdsgroupid , org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid clusterId = org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getParameters ( ) . getId ( ) ; org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getDbFacade ( ) . getNetworkDao ( ) . getAllForCluster ( clusterId , org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getUserID ( ) , org.ovirt.engine.core.bll.network.cluster.GetAllNetworksByClusterIdQuery.getParameters ( ) . isFiltered ( ) ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel eval ( java.lang.String labelId ) { return new org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel ( labelId ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel > getHostNicLabels ( org.ovirt.engine.core.compat.Guid hostNicId ) { final org.ovirt.engine.api.restapi.resource.BackendHostNicsResource hostNicsResource = inject ( new org.ovirt.engine.api.restapi.resource.BackendHostNicsResource ( hostId ) ) ; final org.ovirt.engine.core.common.businessentities.network.HostNicVfsConfig vfsConfig = hostNicsResource.findVfsConfig ( hostNicId ) ; if ( vfsConfig == null ) { return java.util.Collections.emptyList ( ) ; } final java.util.Set < java.lang.String > networkLabelIds = vfsConfig.getNetworkLabels ( ) ; return networkLabelIds.stream ( ) . map ( NetworkLabel :: new ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public org.ovirt.engine.api.model.GlusterHook get ( ) { org.ovirt.engine.api.model.GlusterHook hook = performGet ( QueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( guid , true ) ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( QueryType.GetGlusterHookContent , new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( guid ) ) ; if ( ( ( result != null ) && ( result.getSucceeded ( ) ) ) && ( ( result.getReturnValue ( ) ) != null ) ) { hook.setContent ( result.getReturnValue ( ) ) ; } return hook ; }

Target:
public org.ovirt.engine.api.model.GlusterHook get ( ) { org.ovirt.engine.api.model.GlusterHook hook = performGet ( QueryType.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( guid , true ) ) ; org.ovirt.engine.core.common.queries.QueryReturnValue result = runQuery ( QueryType.GetGlusterHookContent , new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( guid ) ) ; if ( ( ( result != null ) && ( result.getSucceeded ( ) ) ) && ( ( result.getReturnValue ( ) ) != null ) ) { hook.setContent ( result.getReturnValue ( ) ) ; } return hook ; }
Source:
protected void ExecuteIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.ResetIrs , new org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getParameters ( ) . getPreferredSPMId ( ) ) ) ; }

Target:
protected void executeIrsBrokerCommand ( ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . runVdsCommand ( VDSCommandType.ResetIrs , new org.ovirt.engine.core.common.vdscommands.ResetIrsVDSCommandParameters ( org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getCurrentIrsProxyData ( ) . getCurrentVdsId ( ) , org.ovirt.engine.core.vdsbroker.irsbroker.SpmStopOnIrsVDSCommand.getParameters ( ) . getPreferredSPMId ( ) ) ) ; }
Source:
public java.lang.Void runInTransaction ( ) { _vdsManager.setStatus ( parameters.getStatus ( ) , vds ) ; _vdsManager.updateDynamicData ( vds.getDynamicData ( ) ) ; _vdsManager.updateStatisticsData ( vds.getStatisticsData ( ) ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { _vdsManager.setStatus ( parameters.getStatus ( ) , vds ) ; _vdsManager.updatePartialDynamicData ( parameters.getNonOperationalReason ( ) , parameters.getMaintenanceReason ( ) ) ; _vdsManager.updateStatisticsData ( vds.getStatisticsData ( ) ) ; return null ; }
Source:
protected void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetAdGroupById , org.ovirt.engine.core.common.queries.GetAdGroupByIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; }

Target:
protected void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetAdGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; }
Source:
public org.ovirt.engine.api.v3.types.V3Host get ( @ javax.ws.rs.core.Context javax.ws.rs.core.UriInfo ui ) { boolean force = org.ovirt.engine.api.common.util.QueryHelper.getBooleanMatrixParameter ( ui , "force" , true , false ) ; if ( force ) { try { getDelegate ( ) . refresh ( new org.ovirt.engine.api.model.Action ( ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } } return adaptGet ( getDelegate ( ) :: get ) ; }

Target:
public org.ovirt.engine.api.v3.types.V3Host get ( @ javax.ws.rs.core.Context javax.ws.rs.core.HttpHeaders headers , @ javax.ws.rs.core.Context javax.ws.rs.core.UriInfo ui ) { boolean force = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( headers , ui , "force" , true , false ) ; if ( force ) { try { getDelegate ( ) . refresh ( new org.ovirt.engine.api.model.Action ( ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } } return adaptGet ( getDelegate ( ) :: get ) ; }
Source:
protected org.ovirt.engine.core.bll.SPMAsyncTask ConcreteCreateTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , new org.ovirt.engine.core.common.businessentities.async_tasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getTaskID ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getCommandId ( ) ) ) ; p.setEntityId ( org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getParameters ( ) . getEntityId ( ) ) ; return org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CreateTask ( AsyncTaskType.mergeSnapshots , p ) ; }

Target:
protected org.ovirt.engine.core.common.asynctasks.AsyncTaskType getTaskType ( ) { return org.ovirt.engine.core.common.asynctasks.AsyncTaskType.mergeSnapshots ; }
Source:
public void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { 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.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public void getDbGroupsByUserId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.aaa.DbGroup > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.aaa.DbGroup > Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.DbGroup > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDbGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
private java.lang.String getConstraint ( ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; buffer.append ( "Providers: type=" ) ; buffer.append ( ProviderType.FOREMAN.name ( ) ) ; java.lang.String query = org.ovirt.engine.api.restapi.util.QueryHelper.getConstraint ( httpHeaders , uriInfo , null , modelType , false ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( query ) ) { buffer.append ( " AND (" ) ; buffer.append ( query ) ; buffer.append ( ")" ) ; } return buffer.toString ( ) ; }

Target:
private java.lang.String getConstraint ( ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; buffer.append ( "Providers: type=" ) ; buffer.append ( ProviderType.FOREMAN.name ( ) ) ; java.lang.String query = org.ovirt.engine.api.restapi.util.QueryHelper.getConstraint ( httpHeaders , uriInfo , null , modelType , false ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( query ) ) { buffer.append ( java.lang.String.format ( " AND %1$s" , query ) ) ; } return buffer.toString ( ) ; }
Source:
protected void verifyModel ( R model , int index ) { assertEquals ( org.ovirt.engine.api.restapi.resource.AbstractBackendResourceTest.GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.AbstractBackendResourceTest.NAMES [ index ] , model.getName ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.AbstractBackendResourceTest.DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( R model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendResourceTest.verifyLinks ( model ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VM loadEntity ( ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( getGuid ( ) ) , getGuid ( ) . toString ( ) , true ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.GraphicsConsole console ) { org.ovirt.engine.core.common.businessentities.GraphicsDevice device = getMapper ( org.ovirt.engine.api.model.GraphicsConsole.class , org.ovirt.engine.core.common.businessentities.GraphicsDevice.class ) . map ( console , null ) ; device.setVmId ( guid ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase res = doCreateEntity ( VdcActionType.AddGraphicsDevice , createAddGraphicsDeviceParams ( device ) ) ; if ( ( res != null ) && ( res.getSucceeded ( ) ) ) { return org.ovirt.engine.api.restapi.resource.BackendGraphicsConsoleHelper.find ( console , this :: list ) ; } throw new javax.ws.rs.WebApplicationException ( javax.ws.rs.core.Response.status ( Response.Status.NOT_FOUND ) . build ( ) ) ; }
Source:
public void rollback ( ) { super . rollback ( ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDcSingleton.getInstance ( ) . removePool ( getMacPoolId ( ) ) ; }

Target:
protected void executeCommand ( ) { registerRollbackHandler ( new org.ovirt.engine.core.bll.AddMacPoolCommand.CustomTransactionCompletionListener ( ) ) ; getMacPoolEntity ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; getMacPoolDao ( ) . save ( getMacPoolEntity ( ) ) ; addPermission ( getCurrentUser ( ) . getId ( ) , getMacPoolEntity ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDcSingleton.getInstance ( ) . createPool ( getMacPoolEntity ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }
Source:
private void validateEnumParameters ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateEnum ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.class , volume.getVolumeType ( ) ) ; if ( volume.isSetTransportTypes ( ) ) { validateEnums ( org.ovirt.engine.core.common.businessentities.gluster.TransportType.class , volume.getTransportTypes ( ) . getTransportTypes ( ) ) ; } if ( volume.isSetAccessProtocols ( ) ) { validateEnums ( org.ovirt.engine.core.common.businessentities.gluster.AccessProtocol.class , volume.getAccessProtocols ( ) . getAccessProtocols ( ) ) ; } }

Target:
private void validateEnumParameters ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateEnum ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeType.class , volume.getVolumeType ( ) . toUpperCase ( ) ) ; if ( volume.isSetTransportTypes ( ) ) { validateEnumValues ( org.ovirt.engine.core.common.businessentities.gluster.TransportType.class , org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResource.convertToUppercase ( volume.getTransportTypes ( ) . getTransportTypes ( ) ) ) ; } if ( volume.isSetAccessProtocols ( ) ) { validateEnumValues ( org.ovirt.engine.core.common.businessentities.gluster.AccessProtocol.class , org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResource.convertToUppercase ( volume.getAccessProtocols ( ) . getAccessProtocols ( ) ) ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.QuotaStorage getSpecificQuotaStorage ( org.ovirt.engine.core.compat.Guid quotaId ) { org.ovirt.engine.core.common.businessentities.QuotaStorage quotaStorage = new org.ovirt.engine.core.common.businessentities.QuotaStorage ( ) ; quotaStorage.setQuotaId ( quotaId ) ; quotaStorage.setQuotaStorageId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; quotaStorage.setStorageId ( FixturesTool.STORAGE_DOAMIN_NFS_MASTER ) ; quotaStorage.setStorageSizeGB ( 10000L ) ; quotaStorage.setStorageSizeGBUsage ( 0.0 ) ; return quotaStorage ; }

Target:
private static org.ovirt.engine.core.common.businessentities.QuotaStorage getSpecificQuotaStorage ( org.ovirt.engine.core.compat.Guid quotaId ) { org.ovirt.engine.core.common.businessentities.QuotaStorage quotaStorage = new org.ovirt.engine.core.common.businessentities.QuotaStorage ( ) ; quotaStorage.setQuotaId ( quotaId ) ; quotaStorage.setQuotaStorageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; quotaStorage.setStorageId ( FixturesTool.STORAGE_DOAMIN_NFS_MASTER ) ; quotaStorage.setStorageSizeGB ( 10000L ) ; quotaStorage.setStorageSizeGBUsage ( 0.0 ) ; return quotaStorage ; }
Source:
public void testGetAllForUsersAndGroupsInvalidUserAndGroups ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > result = dao.getAllForUserAndGroups ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) , ApplicationMode.AllModes.getValue ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.isEmpty ( ) ) ; }

Target:
public void testGetAllForUsersAndGroupsInvalidUserAndGroups ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > result = dao.getAnyAdminRoleForUserAndGroups ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) , ApplicationMode.AllModes.getValue ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.isEmpty ( ) ) ; }
Source:
private < T > T readJsonString ( java.lang.Object source , java.lang.Class < T > type , org.codehaus.jackson.map.ObjectMapper mapper ) { try { return mapper.readValue ( source.toString ( ) , type ) ; } catch ( java.io.IOException e ) { throw new org.apache.commons.lang.SerializationException ( e ) ; } }

Target:
private < T > T readJsonString ( java.lang.Object source , java.lang.Class < T > type , org.codehaus.jackson.map.ObjectMapper mapper ) { try { return mapper.readValue ( source.toString ( ) , type ) ; } catch ( java.io.IOException e ) { throw new org.ovirt.engine.core.utils.SerializationException ( e ) ; } }
Source:
protected org.ovirt.engine.api.model.Storage lookupStorage ( java.lang.String id ) { for ( org.ovirt.engine.core.common.businessentities.LUNs lun : getLogicalUnits ( ) ) { if ( lun.getLUN_id ( ) . equals ( id ) ) { return addLinks ( map ( lun ) ) ; } } for ( org.ovirt.engine.api.restapi.resource.StorageDomain vg : getVolumeGroups ( ) ) { if ( vg.getstorage ( ) . equals ( id ) ) { return addLinks ( map ( vg ) ) ; } } return notFound ( ) ; }

Target:
protected org.ovirt.engine.api.model.Storage lookupStorage ( java.lang.String id ) { for ( org.ovirt.engine.core.common.businessentities.LUNs lun : getLogicalUnits ( ) ) { if ( lun.getLUN_id ( ) . equals ( id ) ) { return addLinks ( map ( lun ) ) ; } } for ( org.ovirt.engine.api.restapi.resource.StorageDomain vg : getVolumeGroups ( ) ) { if ( vg.getStorage ( ) . equals ( id ) ) { return addLinks ( map ( vg ) ) ; } } return notFound ( ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getValue ( T value ) { if ( ( ( getReason ( value ) ) != null ) && ( ! ( getReason ( value ) . trim ( ) . isEmpty ( ) ) ) ) { return templates.inlineImageWithTitle ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( resources.commentImage ( ) ) . getHTML ( ) ) , getReason ( value ) ) ; } return null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getValue ( T value ) { if ( ( ( getReason ( value ) ) != null ) && ( ! ( getReason ( value ) . trim ( ) . isEmpty ( ) ) ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.ReasonColumn.templates.inlineImageWithTitle ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( org.ovirt.engine.ui.webadmin.widget.table.column.ReasonColumn.resources.commentImage ( ) ) . getHTML ( ) ) , getReason ( value ) ) ; } return null ; }
Source:
private java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > createActionResultList ( final org.ovirt.engine.core.common.action.VdcReturnValueBase resultValue , final int count ) { java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > result = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { result.add ( resultValue ) ; } return result ; }

Target:
private java.util.List < org.ovirt.engine.core.common.action.ActionReturnValue > createActionResultList ( final org.ovirt.engine.core.common.action.ActionReturnValue resultValue , final int count ) { java.util.List < org.ovirt.engine.core.common.action.ActionReturnValue > result = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { result.add ( resultValue ) ; } return result ; }
Source:
public void provisioningValidated ( ) throws java.lang.Exception { setupVirtMock ( ) ; org.junit.Assert.assertTrue ( commandMock.canDoAction ( ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningComputeResourceValid ( org.mockito.Matchers.any ( java.lang.Boolean.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ExternalComputeResource.class ) ) ; org.mockito.Mockito.verify ( validator , org.mockito.Mockito.times ( 1 ) ) . provisioningHostGroupValid ( org.mockito.Matchers.any ( java.lang.Boolean.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ExternalHostGroup.class ) ) ; }

Target:
public void validateFailsForGlusterServerWhenNoUpServer ( ) throws java.lang.Exception { setupGlusterMock ( true , null , false ) ; org.junit.Assert.assertFalse ( commandMock.validate ( ) ) ; org.junit.Assert.assertTrue ( commandMock.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_NO_GLUSTER_HOST_TO_PEER_PROBE.toString ( ) ) ) ; }
Source:
public void testAttachFailDomainAlreadyInPool ( ) { org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( storageDomain.getId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ) ) ; org.ovirt.engine.core.bll.ValidationResult attachedDomainInsertionResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertThat ( attachedDomainInsertionResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ) ; }

Target:
public void testAttachFailDomainAlreadyInPool ( ) { org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( storageDomain.getId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ) ) ; org.ovirt.engine.core.bll.ValidationResult attachedDomainInsertionResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.hamcrest.MatcherAssert.assertThat ( attachedDomainInsertionResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ) ; }
Source:
public void canDoActionInvalidVmStatus ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Unknown , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageId ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP.toString ( ) ) ) ; }

Target:
public void moveDisk ( ) { command.getParameters ( ) . setParametersList ( createMoveDisksParameters ( ) ) ; initDiskImage ( diskImageId ) ; initVm ( VMStatus.Down , null , diskImageId ) ; command.updateParameters ( ) ; org.junit.Assert.assertTrue ( ( ( command.getMoveDiskParametersList ( ) . size ( ) ) == 1 ) ) ; }
Source:
public void OnSuccess ( org.ovirt.engine.ui.uicompat.FrontendQueryAsyncResult result ) { if ( ( ( result != null ) && ( ( result.getReturnValue ( ) ) != null ) ) && ( ( result.getReturnValue ( ) . getReturnValue ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue fenceStatusReturnValue = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( result.getReturnValue ( ) . getReturnValue ( ) ) ) ; java.lang.String message = fenceStatusReturnValue.toString ( ) ; setMessage ( message ) ; getTestCommand ( ) . setIsExecutionAllowed ( true ) ; } }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.maxSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; InitSpmPriorities1 ( ) ; }
Source:
public void testAddGroup ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ( ( "ADGROUP@" + ( DOMAIN ) ) + ": name=*" ) , SearchType.AdGroup , getAdGroup ( 0 ) ) ; setUpCreationExpectations ( VdcActionType.AddUser , org.ovirt.engine.core.common.action.AddUserParameters.class , new java.lang.String [ ] { "AdGroup.id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true , null , VdcQueryType.GetAdGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getEntity ( 0 ) ) ; org.ovirt.engine.api.model.Group model = new org.ovirt.engine.api.model.Group ( ) ; model.setName ( NAMES [ 0 ] ) ; javax.ws.rs.core.Response response = collection.add ( model ) ; assertEquals ( 201 , response.getStatus ( ) ) ; assertTrue ( ( ( response.getEntity ( ) ) instanceof org.ovirt.engine.api.model.Group ) ) ; verifyModel ( ( ( org.ovirt.engine.api.model.Group ) ( response.getEntity ( ) ) ) , 0 ) ; }

Target:
public void testListCrashClientLocale ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }
Source:
public org.ovirt.engine.core.bll.ValidationResult isStorageDomainLocalityFitsDC ( ) { if ( ( ! ( isStorageDomainOfTypeIsoOrExport ( ) ) ) && ( ( storageDomainStatic.getStorageType ( ) . isLocal ( ) ) != ( storagePool.isLocal ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ERROR_CANNOT_ATTACH_STORAGE_DOMAIN_STORAGE_TYPE_NOT_MATCH ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isStorageDomainLocalityFitsDC ( ) { if ( ( ! ( isStorageDomainOfTypeIsoOrExport ( ) ) ) && ( ( storageDomainStatic.getStorageType ( ) . isLocal ( ) ) != ( storagePool.isLocal ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ERROR_CANNOT_ATTACH_STORAGE_DOMAIN_STORAGE_TYPE_NOT_MATCH ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }