auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void validateFailsWhenCreateAllSnapshotFromVmValidationFails ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . validateCreateAllSnapshotsFromVmCommand ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }

Target:
public void validateFailsWhenCreateAllSnapshotFromVmValidationFails ( ) { initStorageDomain ( srcStorageId ) ; initStorageDomain ( dstStorageId ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . validateCreateAllSnapshotsFromVmCommand ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }
Source:
private org.ovirt.engine.core.common.action.CloneCinderDisksParameters buildCinderChildCommandParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks , org.ovirt.engine.core.compat.Guid newSnapshotId ) { org.ovirt.engine.core.common.action.CloneCinderDisksParameters createParams = new org.ovirt.engine.core.common.action.CloneCinderDisksParameters ( ) ; createParams.setCinderDisks ( cinderDisks ) ; createParams.setVmSnapshotId ( newSnapshotId ) ; createParams.setParentHasTasks ( ( ! ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . isEmpty ( ) ) ) ) ; return withRootCommandInfo ( createParams , org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getActionType ( ) ) ; }

Target:
private org.ovirt.engine.core.common.action.CloneCinderDisksParameters buildCinderChildCommandParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks , org.ovirt.engine.core.compat.Guid newSnapshotId ) { org.ovirt.engine.core.common.action.CloneCinderDisksParameters createParams = new org.ovirt.engine.core.common.action.CloneCinderDisksParameters ( ) ; createParams.setCinderDisks ( cinderDisks ) ; createParams.setVmSnapshotId ( newSnapshotId ) ; createParams.setParentHasTasks ( ( ! ( org.ovirt.engine.core.bll.TryBackToAllSnapshotsOfVmCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . isEmpty ( ) ) ) ) ; return withRootCommandInfo ( createParams ) ; }
Source:
public void testGetSuffixedProperty ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( org.ovirt.engine.core.uutils.config.ShellLikeConfdTest.config.getProperty ( "key00" , "non_existent" , false ) , "value0" ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.uutils.config.ShellLikeConfdTest.config.getProperty ( "key01" , "suffixed" , false ) , "suffixed val" ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.uutils.config.ShellLikeConfdTest.config.getProperty ( "non_existent" , "non_existent" , false ) , "throws exception" ) ; }

Target:
public void testGetSuffixedProperty ( ) throws java.lang.Exception { org.junit.Assert.assertEquals ( "value0" , org.ovirt.engine.core.uutils.config.ShellLikeConfdTest.config.getProperty ( "key00" , "non_existent" , false ) ) ; org.junit.Assert.assertEquals ( "suffixed val" , org.ovirt.engine.core.uutils.config.ShellLikeConfdTest.config.getProperty ( "key01" , "suffixed" , false ) ) ; org.junit.Assert.assertEquals ( "throws exception" , org.ovirt.engine.core.uutils.config.ShellLikeConfdTest.config.getProperty ( "non_existent" , "non_existent" , false ) ) ; }
Source:
private void listenOnDiskModelChangeEvent ( final org.ovirt.engine.ui.userportal.uicommon.model.basic.UserPortalBasicListProvider modelProvider ) { modelProvider.getModel ( ) . getvmBasicDiskListModel ( ) . getItemsChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } setupDisks ( modelProvider ) ; } } ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( modelProvider.getModel ( ) . getSelectedItem ( ) ) == null ) { return ; } setupDisks ( modelProvider ) ; }
Source:
private void queryQoss ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.AsyncQuery qossQuery = new org.ovirt.engine.ui.uicommonweb.models.hosts.AsyncQuery ( ) ; qossQuery.asyncCallback = new org.ovirt.engine.ui.frontend.AsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object returnValue ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.network.HostNetworkQos > qoss = ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.HostNetworkQos > ) ( returnValue ) ) ; qosById = org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( qoss ) ; queryInterfaces ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllHostNetworkQos ( getEntity ( ) . getStoragePoolId ( ) , qossQuery ) ; }

Target:
private void queryQoss ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllHostNetworkQos ( getEntity ( ) . getStoragePoolId ( ) , new org.ovirt.engine.ui.uicommonweb.models.hosts.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNetworkQos > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.network.HostNetworkQos > qoss ) { qosById = org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( qoss ) ; queryInterfaces ( ) ; } } ) ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getBroker ( ) . discoverSendTargets ( org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelper.getInstance ( ) . createStructFromConnection ( org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getConnection ( ) , null , org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getVdsId ( ) ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( ( _result.isFullTargets ( ) ? parseFullTargets ( _result.getIqnList ( ) ) : parseTargets ( _result.getIqnList ( ) ) ) ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getBroker ( ) . discoverSendTargets ( org.ovirt.engine.core.vdsbroker.storage.StorageConnectionHelper.getInstance ( ) . createStructFromConnection ( org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getConnection ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getVdsId ( ) ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.proceedProxyReturnValue ( ) ; setReturnValue ( ( _result.isFullTargets ( ) ? parseFullTargets ( _result.getIqnList ( ) ) : parseTargets ( _result.getIqnList ( ) ) ) ) ; }
Source:
private void updateSuggestedDiskAlias ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNextAvailableDiskAliasNameByVMId ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String suggestedDiskAlias = ( ( java.lang.String ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( model ) ) ; diskModel.getAlias ( ) . setEntity ( suggestedDiskAlias ) ; } } , getHash ( ) ) , getVm ( ) . getId ( ) ) ; }

Target:
private void updateSuggestedDiskAlias ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNextAvailableDiskAliasNameByVMId ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.String suggestedDiskAlias = ( ( java.lang.String ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( model ) ) ; diskModel.getAlias ( ) . setEntity ( suggestedDiskAlias ) ; } } ) , getVm ( ) . getId ( ) ) ; }
Source:
public static void updateDisksFromDb ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > imageList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( vm.getId ( ) ) ; vm.getDiskList ( ) . clear ( ) ; vm.getDiskMap ( ) . clear ( ) ; org.ovirt.engine.core.bll.VmHandler.updateDisksForVm ( vm , imageList ) ; }

Target:
public static void updateDisksFromDb ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > imageList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( vm.getId ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateDisksForVm ( vm , imageList ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > devs = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsRngEnabled ( ) . setEntity ( ( ! ( devs.isEmpty ( ) ) ) ) ; getModel ( ) . setRngDevice ( ( devs.isEmpty ( ) ? org.ovirt.engine.core.common.businessentities.VmRngDevice.getInitVmDevice ( ) : devs.get ( 0 ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > devs = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsRngEnabled ( ) . setEntity ( ( ! ( devs.isEmpty ( ) ) ) ) ; getModel ( ) . setRngDevice ( ( devs.isEmpty ( ) ? new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) : devs.get ( 0 ) ) ) ; }
Source:
public javax.ws.rs.core.Response remove ( org.ovirt.engine.api.model.Action action ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( id ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( ( action != null ) && ( action.isSetHost ( ) ) ) { hostId = getHostId ( action.getHost ( ) ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }

Target:
public javax.ws.rs.core.Response remove ( org.ovirt.engine.api.model.Action action ) { get ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( id ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.Empty ; if ( ( action != null ) && ( action.isSetHost ( ) ) ) { hostId = getHostId ( action.getHost ( ) ) ; } org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( connection , hostId , false ) ; return performAction ( VdcActionType.RemoveStorageServerConnection , parameters ) ; }
Source:
public void canDoActionVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( ) ; initVm ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; initVmDevice ( ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }

Target:
public void canDoActionVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( ) ; initVm ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAffinityGroupsByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpAffinityGroups ( ) , failure ) ; control.replay ( ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAffinityGroupsByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpAffinityGroups ( ) , failure ) ; control.replay ( ) ; }
Source:
public static java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network > networksByName ( java.util.List < org.ovirt.engine.core.common.businessentities.network > networks ) { if ( ! ( networks.isEmpty ( ) ) ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network > byName = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.businessentities.network > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network net : networks ) { byName.put ( net.getname ( ) , net ) ; } return byName ; } else { return java.util.Collections.emptyMap ( ) ; } }

Target:
public static java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > networksByName ( java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks ) { if ( ! ( networks.isEmpty ( ) ) ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > byName = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.businessentities.Network > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : networks ) { byName.put ( net.getname ( ) , net ) ; } return byName ; } else { return java.util.Collections.emptyMap ( ) ; } }
Source:
protected boolean matchesSafely ( org.ovirt.engine.core.bll.ValidationResult item ) { java.util.List < java.lang.String > replacements = item.getVariableReplacements ( ) ; final java.util.List < java.lang.String > vr = ( replacements == null ) ? java.util.Collections.< java.lang.String > emptyList ( ) : replacements ; return ( ( variableReplacements.length ) == ( vr.size ( ) ) ) && ( vr.containsAll ( java.util.Arrays.asList ( variableReplacements ) ) ) ; }

Target:
protected boolean matchesSafely ( org.ovirt.engine.core.bll.ValidationResult item ) { final java.util.List < java.lang.String > vr = item.getVariableReplacements ( ) ; return ( ( variableReplacements.length ) == ( vr.size ( ) ) ) && ( vr.containsAll ( java.util.Arrays.asList ( variableReplacements ) ) ) ; }
Source:
private static java.lang.String mockConfig ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.queries.ConfigurationValues configurationValues ) { java.lang.String returnValue = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 , true ) ; org.ovirt.engine.core.common.config.ConfigValues configValues = org.ovirt.engine.core.common.config.ConfigValues.valueOf ( configurationValues.name ( ) ) ; mcr.mockConfigValue ( configValues , version , returnValue ) ; return returnValue ; }

Target:
private static java.lang.String mockConfig ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.config.ConfigValues configValues ) { java.lang.String returnValue = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 , true ) ; mcr.mockConfigValue ( configValues , version , returnValue ) ; return returnValue ; }
Source:
public org.ovirt.engine.api.model.GraphicsConsole get ( ) { java.util.List < java.lang.String > supportedIds = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.api.model.GraphicsConsole graphicsConsole : parent.list ( ) . getGraphicsConsoles ( ) ) { if ( consoleId.equals ( graphicsConsole.getId ( ) ) ) { return graphicsConsole ; } supportedIds.add ( graphicsConsole.getId ( ) ) ; } throw new javax.ws.rs.WebApplicationException ( javax.ws.rs.core.Response.status ( Response.Status.NOT_FOUND ) . build ( ) ) ; }

Target:
public org.ovirt.engine.api.model.GraphicsConsole get ( ) { for ( org.ovirt.engine.api.model.GraphicsConsole graphicsConsole : parent.list ( ) . getGraphicsConsoles ( ) ) { if ( consoleId.equals ( graphicsConsole.getId ( ) ) ) { return graphicsConsole ; } } throw new javax.ws.rs.WebApplicationException ( javax.ws.rs.core.Response.status ( Response.Status.NOT_FOUND ) . build ( ) ) ; }
Source:
public void shouldNotCreateCpuPinningForVirtualNumaNodes ( ) { for ( org.ovirt.engine.core.common.businessentities.VmNumaNode numaNode : org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vmNumaNodes ) { numaNode.getVdsNumaNodeList ( ) . clear ( ) ; } java.util.Map < java.lang.String , java.lang.Object > cpuPinning = org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactory.buildCpuPinningWithNumaSetting ( org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vmNumaNodes , org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vdsNumaNodes ) ; org.assertj.core.api.Assertions.assertThat ( cpuPinning ) . isEmpty ( ) ; java.util.Map < java.lang.String , java.lang.Object > mapping = org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactory.buildVmNumatuneSetting ( NumaTuneMode.INTERLEAVE , org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vmNumaNodes ) ; org.assertj.core.api.Assertions.assertThat ( mapping ) . doesNotContainKeys ( VdsProperties.NUMA_TUNE_MODE , VdsProperties.NUMA_TUNE_NODESET ) ; }

Target:
public void shouldNotCreateCpuPinningForVirtualNumaNodes ( ) { for ( org.ovirt.engine.core.common.businessentities.VmNumaNode numaNode : org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vmNumaNodes ) { numaNode.getVdsNumaNodeList ( ) . clear ( ) ; } java.util.Map < java.lang.String , java.lang.Object > cpuPinning = org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactory.buildCpuPinningWithNumaSetting ( org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vmNumaNodes , org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vdsNumaNodes ) ; org.assertj.core.api.Assertions.assertThat ( cpuPinning ) . isEmpty ( ) ; java.util.Map < java.lang.String , java.lang.Object > mapping = org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactory.buildVmNumatuneSetting ( NumaTuneMode.INTERLEAVE , org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vmNumaNodes , org.ovirt.engine.core.vdsbroker.vdsbroker.NumaSettingFactoryTest.vdsNumaNodes ) ; org.assertj.core.api.Assertions.assertThat ( mapping ) . doesNotContainKeys ( VdsProperties.NUMA_TUNE_MODE , VdsProperties.NUMA_TUNE_NODESET ) ; }
Source:
public static java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getIsoStorageModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel localIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ( ) ; models.add ( localIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel posixIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; models.add ( posixIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel nfsIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ( ) ; models.add ( nfsIsoModel ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : models ) { model.setRole ( StorageDomainType.ISO ) ; } return models ; }

Target:
public static java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getIsoStorageModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel nfsIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ( ) ; models.add ( nfsIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel posixIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; models.add ( posixIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel localIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ( ) ; models.add ( localIsoModel ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel model : models ) { model.setRole ( StorageDomainType.ISO ) ; } return models ; }
Source:
public void setMessage ( java.lang.String message ) { if ( ( ( getHashName ( ) ) != null ) && ( getHashName ( ) . startsWith ( "remove_" ) ) ) { super . setMessage ( constants.removeConfirmationPopupMessage ( ) ) ; } else { super . setMessage ( message ) ; } }

Target:
public void setMessage ( java.lang.String message ) { super . setMessage ( ( message == null ? constants.removeConfirmationPopupMessage ( ) : message ) ) ; }
Source:
private boolean allowedNetworkLabelManipulation ( ) { boolean labelNotChanged = ! ( new SyncNetworkParametersBuilder ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getContext ( ) ) . labelChanged ( ) ) ; boolean newLabelAssigned = ! ( new SyncNetworkParametersBuilder ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getContext ( ) ) . labelAdded ( ) ) ; return ( ! ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) . isExternal ( ) ) ) && ( labelNotChanged || newLabelAssigned ) ; }

Target:
private boolean allowedNetworkLabelManipulation ( ) { boolean labelNotChanged = ! ( labelChanged ( ) ) ; boolean newLabelAssigned = ! ( labelAdded ( ) ) ; return ( ! ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) . isExternal ( ) ) ) && ( labelNotChanged || newLabelAssigned ) ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel object ) { updateKeyTitle ( object ) ; object.getKeys ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( org.ovirt.engine.ui.common.widget.form.key_value.KeyValueLineWidget.this , object ) ; updateKeyTitle ( object ) ; } } ) ; driver.edit ( object ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.key_value.KeyValueLineModel object ) { updateKeyTitle ( object ) ; object.getKeys ( ) . 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 ) { com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( org.ovirt.engine.ui.common.widget.form.key_value.KeyValueLineWidget.this , object ) ; updateKeyTitle ( object ) ; } } ) ; driver.edit ( object ) ; }
Source:
public void commandFailsSlaveVolumeNotMonitoredByOvirt ( ) { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeGeoRepSessionCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters ( masterVolumeId , slaveVolumeName , org.ovirt.engine.core.compat.Guid.newGuid ( ) , null , null , false ) , null ) ) ; prepareMocks ( ) ; org.mockito.Mockito.doReturn ( null ) . when ( command ) . getSlaveVolume ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeGeoRepSessionCommandTest.SUPPORTED_VERSION ) . when ( cluster ) . getCompatibilityVersion ( ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getSlaveHost ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }

Target:
public void commandFailsSlaveVolumeNotMonitoredByOvirt ( ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeGeoRepSessionCommandTest.SUPPORTED_VERSION ) . when ( cluster ) . getCompatibilityVersion ( ) ; org.mockito.Mockito.doReturn ( vds ) . when ( command ) . getSlaveHost ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; }
Source:
private void waitForConnect ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { if ( ! ( this . connected.await ( policy.getRetryTimeOut ( ) , policy.getTimeUnit ( ) ) ) ) { closeChannel ( ) ; throw new org.ovirt.vdsm.jsonrpc.client.ClientConnectionException ( "Connection timeout" ) ; } } catch ( java.lang.InterruptedException e ) { disconnect ( "Waiting for connect interrupted" ) ; throw new java.lang.IllegalStateException ( "Communication interrupted" ) ; } }

Target:
private void waitForConnect ( ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { try { this . connected.await ( policy.getRetryTimeOut ( ) , policy.getTimeUnit ( ) ) ; } catch ( java.lang.InterruptedException e ) { disconnect ( "Waiting for connect interrupted" ) ; throw new java.lang.IllegalStateException ( "Communication interrupted" ) ; } }
Source:
org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > build ( ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > pair = pairOf ( createDbVm ( ) , createVmInternalData ( ) ) ; pair.getSecond ( ) . getVmDynamic ( ) . setStatus ( VMStatus.MigratingTo ) ; pair.getSecond ( ) . getVmDynamic ( ) . setRunOnVds ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs.DST_HOST_ID ) ; return pair ; }

Target:
org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > build ( ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.vdsbroker.monitoring.VdsmVm > pair = pairOf ( createDbVm ( ) , createVmInternalData ( null ) ) ; pair.getSecond ( ) . getVmDynamic ( ) . setStatus ( VMStatus.MigratingTo ) ; pair.getSecond ( ) . getVmDynamic ( ) . setRunOnVds ( org.ovirt.engine.core.vdsbroker.monitoring.VmTestPairs.DST_HOST_ID ) ; return pair ; }
Source:
public void updateAll ( java.util.Collection < T > entities ) { for ( T entity : entities ) { org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getCallsHandler ( ) . executeModification ( org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) , org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.createFullParametersMapper ( entity ) ) ; } }

Target:
public void updateAll ( java.util.Collection < T > entities ) { updateAll ( org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) , entities ) ; for ( T entity : entities ) { org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getCallsHandler ( ) . executeModification ( org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) , org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.createFullParametersMapper ( entity ) ) ; } }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 , true ) ; control.replay ( ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 , true ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private java.util.Map < java.lang.String , java.lang.String > getAvailableValues ( java.lang.String message , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ) { java.util.Map < java.lang.String , java.lang.String > returnValue = new java.util.HashMap < java.lang.String , java.lang.String > ( logable.getCustomValues ( ) ) ; java.util.Set < java.lang.String > attributes = resolvePlaceHolders ( message ) ; if ( ( attributes != null ) && ( ( attributes.size ( ) ) > 0 ) ) { org.ovirt.engine.core.compat.backendcompat.TypeCompat.getPropertyValues ( logable , attributes , returnValue ) ; } return returnValue ; }

Target:
private java.util.Map < java.lang.String , java.lang.String > getAvailableValues ( java.lang.String message , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ) { java.util.Map < java.lang.String , java.lang.String > returnValue = new java.util.HashMap ( logable.getCustomValues ( ) ) ; java.util.Set < java.lang.String > attributes = resolvePlaceHolders ( message ) ; if ( ( attributes != null ) && ( ( attributes.size ( ) ) > 0 ) ) { org.ovirt.engine.core.compat.backendcompat.TypeCompat.getPropertyValues ( logable , attributes , returnValue ) ; } return returnValue ; }
Source:
public static org.ovirt.engine.api.model.Permit map ( org.ovirt.engine.api.model.PermitType entity , org.ovirt.engine.api.model.Permit template ) { org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup = org.ovirt.engine.api.restapi.types.PermitMapper.map ( entity , ( ( org.ovirt.engine.core.common.businessentities.ActionGroup ) ( null ) ) ) ; return org.ovirt.engine.api.restapi.types.PermitMapper.map ( actionGroup , ( ( org.ovirt.engine.api.model.Permit ) ( null ) ) ) ; }

Target:
public static org.ovirt.engine.api.model.Permit map ( org.ovirt.engine.api.model.PermitType entity , org.ovirt.engine.api.model.Permit template ) { org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup = org.ovirt.engine.api.restapi.types.PermitMapper.map ( entity , ( ( org.ovirt.engine.core.common.businessentities.ActionGroup ) ( null ) ) ) ; if ( actionGroup == null ) { return null ; } return org.ovirt.engine.api.restapi.types.PermitMapper.map ( actionGroup , ( ( org.ovirt.engine.api.model.Permit ) ( null ) ) ) ; }
Source:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }

Target:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
private void addPmProxyTypes ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.PmProxyType [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_2 ) ) { version.setPmProxyTypes ( new org.ovirt.engine.api.model.PmProxyTypes ( ) ) ; for ( org.ovirt.engine.api.model.PmProxyType pmProxyType : values ) { version.getPmProxyTypes ( ) . getPmProxyTypes ( ) . add ( pmProxyType.value ( ) ) ; } } }

Target:
private void addPmProxyTypes ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.PmProxyType [ ] values ) { version.setPmProxyTypes ( new org.ovirt.engine.api.model.PmProxyTypes ( ) ) ; for ( org.ovirt.engine.api.model.PmProxyType pmProxyType : values ) { version.getPmProxyTypes ( ) . getPmProxyTypes ( ) . add ( pmProxyType.value ( ) ) ; } }
Source:
public void testAllDomainsHaveSpaceForAllDisksSuccess ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getDisksList ( ) ; cmd.getParameters ( ) . setSaveMemory ( true ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStorageDomainIdForVmMemory ( org.mockito.ArgumentMatchers.eq ( java.util.Collections.emptyList ( ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForAllDisks ( org.mockito.ArgumentMatchers.eq ( java.util.Collections.emptyList ( ) ) , org.mockito.ArgumentMatchers.anyList ( ) ) ; }

Target:
public void testAllDomainsHaveSpaceForAllDisksSuccess ( ) { org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getDisksList ( ) ; cmd.getParameters ( ) . setSaveMemory ( true ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStorageDomainIdForVmMemory ( org.mockito.ArgumentMatchers.eq ( java.util.Collections.emptyList ( ) ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForAllDisks ( org.mockito.ArgumentMatchers.eq ( java.util.Collections.emptyList ( ) ) , org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private void checkConnection ( ) throws java.sql.SQLException { java.sql.Statement statement = null ; java.sql.ResultSet rs = null ; try { statement = connection.createStatement ( ) ; rs = statement.executeQuery ( "select null" ) ; rs.next ( ) ; } finally { if ( statement != null ) { statement.close ( ) ; } if ( rs != null ) { rs.close ( ) ; } } }

Target:
private void checkConnection ( ) throws java.sql.SQLException { try ( java.sql.Statement statement = connection.createStatement ( ) ; java.sql.ResultSet rs = statement.executeQuery ( "select null" ) ) { rs.next ( ) ; } }
Source:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }

Target:
public void testConflictedUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 1 ) ; model.setId ( GUIDS [ 1 ] . toString ( ) ) ; try { resource.update ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyImmutabilityConstraint ( wae ) ; } }
Source:
private boolean diskShouldBeUnPlugged ( ) { return java.lang.Boolean.TRUE.equals ( ( ( ( org.ovirt.engine.core.bll.DetachDiskFromVmCommand.getParameters ( ) . isPlugUnPlug ( ) ) && ( vmDevice.getIsPlugged ( ) ) ) && ( ( org.ovirt.engine.core.bll.DetachDiskFromVmCommand.getVm ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) ) ; }

Target:
private boolean diskShouldBeUnPlugged ( ) { return java.lang.Boolean.TRUE.equals ( ( ( ( org.ovirt.engine.core.bll.DetachDiskFromVmCommand.getParameters ( ) . isPlugUnPlug ( ) ) && ( vmDevice.getIsPlugged ( ) ) ) && ( ( org.ovirt.engine.core.bll.DetachDiskFromVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) ) ) ) ; }
Source:
private boolean isNewerVersion ( org.ovirt.engine.core.compat.Version isoClusterVersion ) { org.ovirt.engine.core.common.businessentities.VDS vds = getVdsByVdsId ( org.ovirt.engine.core.bll.hostdeploy.GetoVirtISOsQuery.getParameters ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.compat.Version vdsClusterVersion = vds.getVdsGroupCompatibilityVersion ( ) ; log.debug ( "vdsClusterVersion '{}' isoClusterVersion '{}'" , vdsClusterVersion , isoClusterVersion ) ; return ( ( vdsClusterVersion.getMajor ( ) ) == ( isoClusterVersion.getMajor ( ) ) ) && ( ( vdsClusterVersion.getMinor ( ) ) <= ( isoClusterVersion.getMinor ( ) ) ) ; }

Target:
private boolean isNewerVersion ( org.ovirt.engine.core.compat.Version isoClusterVersion ) { org.ovirt.engine.core.common.businessentities.VDS vds = getVdsByVdsId ( org.ovirt.engine.core.bll.hostdeploy.GetoVirtISOsQuery.getParameters ( ) . getId ( ) ) ; org.ovirt.engine.core.compat.Version vdsClusterVersion = vds.getVdsGroupCompatibilityVersion ( ) ; log.debug ( "vdsClusterVersion '{}' isoClusterVersion '{}'" , vdsClusterVersion , isoClusterVersion ) ; return ( ( vdsClusterVersion.getMajor ( ) ) == ( isoClusterVersion.getMajor ( ) ) ) && ( ( vdsClusterVersion.getMinor ( ) ) <= ( isoClusterVersion.getMinor ( ) ) ) ; }
Source:
private boolean consumeForStorageQuota ( org.ovirt.engine.core.compat.Guid quotaId ) { org.ovirt.engine.core.bll.quota.QuotaConsumptionParametersWrapper parameters = null ; try { parameters = parametersWrapper.clone ( ) ; parameters.getParameters ( ) . add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( quotaId , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID , 1.0 ) ) ; } catch ( java.lang.CloneNotSupportedException e ) { } return quotaManager.consume ( parameters ) ; }

Target:
private boolean consumeForStorageQuota ( org.ovirt.engine.core.compat.Guid quotaId ) throws java.lang.CloneNotSupportedException { org.ovirt.engine.core.bll.quota.QuotaConsumptionParametersWrapper parameters = parametersWrapper.clone ( ) ; parameters.getParameters ( ) . add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( quotaId , null , QuotaConsumptionParameter.QuotaAction.CONSUME , org.ovirt.engine.core.bll.quota.QuotaManagerTest.DESTINATION_GUID , 1.0 ) ) ; return quotaManager.consume ( parameters ) ; }
Source:
private void moveVDSToMaintenanceIfNeeded ( ) { if ( ( ( _vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) && ( monitoringStrategy.canMoveToMaintenance ( _vds ) ) ) { _vdsManager.setStatus ( VDSStatus.Maintenance , _vds ) ; _saveVdsDynamic = true ; _saveVdsStatistics = true ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "Updated vds status from 'Preparing for Maintenance' to 'Maintenance' in database, vds = {0} : {1}" , _vds.getId ( ) , _vds.getVdsName ( ) ) ; } }

Target:
private void moveVDSToMaintenanceIfNeeded ( ) { if ( ( ( _vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) && ( monitoringStrategy.canMoveToMaintenance ( _vds ) ) ) { _vdsManager.setStatus ( VDSStatus.Maintenance , _vds ) ; _saveVdsDynamic = true ; _saveVdsStatistics = true ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "Updated vds status from 'Preparing for Maintenance' to 'Maintenance' in database, vds = {0} : {1}" , _vds.getId ( ) , _vds.getName ( ) ) ; } }
Source:
public void validateImageNotFound ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void validateImageNotFound ( ) throws java.lang.Exception { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST.toString ( ) ) ) ; }
Source:
public boolean supportedForUnitVmModel ( org.ovirt.engine.core.common.queries.ConfigurationValues feature , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { if ( ( ( model.getSelectedCluster ( ) ) == null ) || ( ( model.getSelectedCluster ( ) . getCompatibilityVersion ( ) ) == null ) ) { return false ; } java.lang.String version = model.getSelectedCluster ( ) . getCompatibilityVersion ( ) . getValue ( ) ; return ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( feature , version ) ) ) ; }

Target:
public boolean supportedForUnitVmModel ( org.ovirt.engine.core.common.queries.ConfigurationValues feature , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.core.compat.Version version = model.getCompatibilityVersion ( ) ; if ( version == null ) { return false ; } else { return ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( feature , version.getValue ( ) ) ) ) ; } }
Source:
public void testCreateTasksStartedFromCLIWithErrors ( ) { org.mockito.Mockito.doReturn ( getTasks ( JobExecutionStatus.STARTED ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 0 ) ) . endStepJob ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.job.Step.class ) ) ; }

Target:
public void testCreateTasksStartedFromCLIWithErrors ( ) { org.mockito.Mockito.doReturn ( getTasks ( JobExecutionStatus.STARTED ) ) . when ( provider ) . getTaskListForCluster ( org.ovirt.engine.core.bll.gluster.GlusterTasksSyncJobTest.CLUSTER_GUIDS [ 1 ] ) ; tasksSyncJob.updateGlusterAsyncTasks ( ) ; org.mockito.Mockito.verify ( taskUtils , org.mockito.Mockito.times ( 0 ) ) . endStepJob ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
private void testUpdateManagementNetworkChange ( boolean emptyCluster , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expectedResult ) { org.mockito.Mockito.when ( networkCluster.getClusterId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.network.cluster.TEST_CLUSTER_ID ) ; 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 testUpdateManagementNetworkChange ( boolean emptyCluster , org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > expectedResult ) { 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 ) ; }
Source:
public java.util.List < java.net.InetAddress > resolveAll ( java.lang.String name ) throws java.net.UnknownHostException { org.ovirt.engineextensions.aaa.ldap.Resolver.log.debug ( "Entry: name='{}'" , name ) ; java.util.List < java.net.InetAddress > addresses = _resolveAll ( name ) ; java.util.List < java.net.InetAddress > ret ; if ( ( addresses.size ( ) ) == 1 ) { ret = addresses ; } else { ret = new java.util.ArrayList < java.net.InetAddress > ( addresses ) ; java.util.Collections.shuffle ( ret , random ) ; } org.ovirt.engineextensions.aaa.ldap.Resolver.log.debug ( "Return: {}" , ret ) ; return ret ; }

Target:
public java.util.List < java.net.InetAddress > resolveAll ( java.lang.String name ) throws java.net.UnknownHostException { org.ovirt.engineextensions.aaa.ldap.Resolver.log.debug ( "Entry: name='{}'" , name ) ; java.util.List < java.net.InetAddress > addresses = _resolveAll ( name ) ; java.util.List < java.net.InetAddress > ret ; if ( ( addresses.size ( ) ) == 1 ) { ret = addresses ; } else { ret = new java.util.ArrayList < > ( addresses ) ; java.util.Collections.shuffle ( ret , random ) ; } org.ovirt.engineextensions.aaa.ldap.Resolver.log.debug ( "Return: {}" , ret ) ; return ret ; }