auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.GetVmsRunningOnOrMigratingToVdsParameters ( id ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc delNetwork ( java.lang.String bridge , java.lang.String vlan , java.lang.String bond , java.lang.String [ ] nics ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.delNetwork" ) . withParameter ( "bridge" , bridge ) . withOptionalParameter ( "vlan" , vlan ) . withOptionalParameter ( "bond" , bond ) . withOptionalParameterAsList ( "nics" , new java.util.ArrayList < > ( java.util.Arrays.asList ( nics ) ) ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn delNetwork ( java.lang.String bridge , java.lang.String vlan , java.lang.String bond , java.lang.String [ ] nics ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.delNetwork" ) . withParameter ( "bridge" , bridge ) . withOptionalParameter ( "vlan" , vlan ) . withOptionalParameter ( "bond" , bond ) . withOptionalParameterAsList ( "nics" , new java.util.ArrayList < > ( java.util.Arrays.asList ( nics ) ) ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public void testParseStrayColons ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:::one=1,two=2,three=3" , "one=bool,two=int,three=bool" ) ; assertNotNull ( ret ) ; assertEquals ( 0 , ret.size ( ) ) ; }

Target:
public void testParseInvalidOption ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1,two=2,three" , "one=bool,two=int,three=bool" ) ; org.junit.Assert.assertNotNull ( ret ) ; org.junit.Assert.assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" ) ; }
Source:
public void testCheckIfRoleIsReadOnlyFalse ( ) { getRole ( ) . setis_readonly ( false ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < java.lang.String > ( ) ; org.junit.Assert.assertFalse ( "Role should be read only" , getCommand ( ) . checkIfRoleIsReadOnly ( messages ) ) ; org.junit.Assert.assertTrue ( "Shouldn't be any canDoAction messages" , messages.isEmpty ( ) ) ; }

Target:
public void testCheckIfRoleIsReadOnlyFalse ( ) { getRole ( ) . setReadonly ( false ) ; java.util.List < java.lang.String > messages = new java.util.ArrayList < java.lang.String > ( ) ; org.junit.Assert.assertFalse ( "Role should be read only" , getCommand ( ) . checkIfRoleIsReadOnly ( messages ) ) ; org.junit.Assert.assertTrue ( "Shouldn't be any canDoAction messages" , messages.isEmpty ( ) ) ; }
Source:
private void UpdateProperties ( ) { org.ovirt.engine.core.common.businessentities.Network network = ( ( org.ovirt.engine.core.common.businessentities.Network ) ( getEntity ( ) ) ) ; setName ( network.getName ( ) ) ; setDescription ( network.getdescription ( ) ) ; setVm ( network.isVmNetwork ( ) ) ; setVlan ( network.getvlan_id ( ) ) ; setMtu ( network.getMtu ( ) ) ; }

Target:
public void setId ( org.ovirt.engine.core.compat.Guid value ) { if ( ( ( ( privateId ) == null ) && ( value != null ) ) || ( ( ( privateId ) != null ) && ( ! ( privateId.equals ( value ) ) ) ) ) { privateId = value ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "Id" ) ) ; } }
Source:
public static void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { 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.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void onResize ( ) { super . onResize ( ) ; if ( ( uiHandlers ) != null ) { uiHandlers.setMainTabBarOffset ( getOffsetWidth ( ) ) ; } }

Target:
public void onResize ( ) { super . onResize ( ) ; java.lang.Double westStackWidth = horizontalSplitLayoutPanel.getWidgetSize ( westStackPanel ) ; if ( ( ( uiHandlers ) != null ) && ( westStackWidth != null ) ) { uiHandlers.setMainTabBarOffset ( westStackWidth.intValue ( ) ) ; } }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.DisplayType > getDisplayTypes ( int osId , org.ovirt.engine.core.compat.Version version ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.displayTypes.get ( osId ) . get ( version ) ; }

Target:
public boolean hasSpiceSupport ( int osId , org.ovirt.engine.core.compat.Version version ) { for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.DisplayType > graphicsDisplayPair : getGraphicsAndDisplays ( osId , version ) ) { if ( ( graphicsDisplayPair.getFirst ( ) ) == ( org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE ) ) { return true ; } } return false ; }
Source:
public void testVmFailNoDisks ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( vm , null , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , false , VdcBllMessages.VM_CANNOT_RUN_FROM_DISK_WITHOUT_DISK ) ; }

Target:
public void testNoDiskBootFromIsoDomain ( ) { org.ovirt.engine.core.bll.IsoDomainListSyncronizer mock = mockIsoDomainListSyncronizer ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.compat.Guid ( ) ) . when ( mock ) . findActiveISODomain ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.CD , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , true , null ) ; }
Source:
private boolean isPathEditable ( org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { return ( ( ( storage.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storage.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ) && ( ( storage.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Maintenance ) ) ; }

Target:
private boolean isPathEditable ( org.ovirt.engine.core.common.businessentities.StorageDomain storage ) { if ( ( storage.getStorageType ( ) . isFileDomain ( ) ) && ( ! ( storage.getStorageType ( ) . equals ( StorageType.GLUSTERFS ) ) ) ) { return ( ( ( storage.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Data ) ) || ( ( storage.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) ) && ( ( storage.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Maintenance ) ) ; } return false ; }
Source:
public void bondWithNetworkDidntChange ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( "net" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = createBondSlaves ( bond.getName ( ) ) ; mockExistingIfacesWithBond ( bond , ifaces ) ; org.ovirt.engine.core.common.action.SetupNetworksParameters parameters = new org.ovirt.engine.core.common.action.SetupNetworksParameters ( ) ; ifaces.add ( bond ) ; parameters.setInterfaces ( ifaces ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( parameters ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNoNetworksModified ( helper ) ; assertNoBondsRemoved ( helper ) ; assertNoNetworksRemoved ( helper ) ; }

Target:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; }
Source:
protected void ItemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . ItemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Storage ) ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storage = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.StoragePredicate ( storage.getId ( ) ) ) ) ; } }

Target:
protected void itemsCollectionChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.NotifyCollectionChangedEventArgs e ) { super . itemsCollectionChanged ( sender , e ) ; if ( ( ( getSystemTreeSelectedItem ( ) ) != null ) && ( ( getSystemTreeSelectedItem ( ) . getType ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.Storage ) ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storage = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getSystemTreeSelectedItem ( ) . getEntity ( ) ) ) ; setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.StorageDomain > Cast ( getItems ( ) ) , new org.ovirt.engine.ui.uicommonweb.Linq.StoragePredicate ( storage.getId ( ) ) ) ) ; } }
Source:
private org.ovirt.engine.core.bll.ValidationResult hostStatusLegalForSetupNetworks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSStatus > supportedStatuses = java.util.Arrays.asList ( VDSStatus.Maintenance , VDSStatus.Up , VDSStatus.NonOperational ) ; boolean hostStatusLegalForSetupNetworks = ( supportedStatuses.contains ( host.getStatus ( ) ) ) || ( ( ( host.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Installing ) ) && ( internalExecution ) ) ; if ( ! hostStatusLegalForSetupNetworks ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.bll.network.host.HostValidator.VAR_HOST_STATUS , supportedStatuses , "," , supportedStatuses.size ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult hostStatusLegalForSetupNetworks ( ) { org.ovirt.engine.core.common.businessentities.VDSStatus hostStatus = host.getStatus ( ) ; boolean hostStatusLegalForSetupNetworks = ( org.ovirt.engine.core.bll.network.host.HostValidator.LEGAL_STATUSES.contains ( hostStatus ) ) || ( ( hostStatus == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Installing ) ) && ( internalExecution ) ) ; if ( ! hostStatusLegalForSetupNetworks ) { org.ovirt.engine.core.bll.network.host.HostValidator.logger.error ( ( "Unable to setup network: operation can only be done when Host status is one of: {};" + " current status is {}" ) , org.ovirt.engine.core.bll.network.host.HostValidator.LEGAL_STATUSES_STR , hostStatus ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VDS_STATUS_ILLEGAL , org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.bll.network.host.HostValidator.VAR_HOST_STATUS , org.ovirt.engine.core.bll.network.host.HostValidator.LEGAL_STATUSES , "," , org.ovirt.engine.core.bll.network.host.HostValidator.LEGAL_STATUSES.size ( ) ) ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void clusterChanged ( ) { org.mockito.Mockito.when ( oldHost.getVdsGroupId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( host.getVdsGroupId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( validator.clusterNotChanged ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_CANNOT_UPDATE_CLUSTER ) ) ; }

Target:
public void clusterChanged ( ) { org.mockito.Mockito.when ( oldHost.getClusterId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( host.getClusterId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertThat ( validator.clusterNotChanged ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_CANNOT_UPDATE_CLUSTER ) ) ; }
Source:
private void handleVdsLiveSnapshotFailure ( org.ovirt.engine.core.common.errors.EngineException e ) { log.warn ( ( "Could not perform live snapshot due to error, VM will still be configured to the new created" + " snapshot: {}" ) , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; addCustomValue ( "SnapshotName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotName ( ) ) ; addCustomValue ( "VmName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ; updateCallStackFromThrowable ( e ) ; auditLogDirector.log ( this , AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE ) ; }

Target:
private void handleVmFailure ( org.ovirt.engine.core.common.errors.EngineException e , org.ovirt.engine.core.common.AuditLogType auditLogType , java.lang.String warnMessage ) { log.warn ( warnMessage , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; addCustomValue ( "SnapshotName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotName ( ) ) ; addCustomValue ( "VmName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ; updateCallStackFromThrowable ( e ) ; auditLogDirector.log ( this , auditLogType ) ; }
Source:
protected void setAllowChangeHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallFailed ) ) { getHost ( ) . setIsChangable ( false ) ; getPort ( ) . setIsChangable ( false ) ; } else { getHost ( ) . setIsChangable ( true ) ; getPort ( ) . setIsChangable ( true ) ; } }

Target:
protected void setAllowChangeHost ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.InstallFailed ) ) { getHost ( ) . setIsChangable ( false ) ; getAuthSshPort ( ) . setIsChangable ( false ) ; } else { getHost ( ) . setIsChangable ( true ) ; getAuthSshPort ( ) . setIsChangable ( true ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setVmTicket ( java.lang.String vmId , java.lang.String otp64 , java.lang.String sec , java.lang.String connectionAction , java.util.Map < java.lang.String , java.lang.String > params ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.setTicket" ) . withParameter ( "vmID" , vmId ) . withParameter ( "password" , otp64 ) . withParameter ( "ttl" , sec ) . withParameter ( "existingConnAction" , connectionAction ) . withParameter ( "params" , params ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc remove_image_ticket ( java.lang.String ticketId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.remove_image_ticket" ) . withParameter ( "uuid" , ticketId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
protected boolean checkCanBeMoveInVm ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsForDisk = getVmsForDiskId ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM currVm : vmsForDisk ) { if ( ( org.ovirt.engine.core.common.businessentities.VMStatus.Down ) != ( currVm.getStatus ( ) ) ) { org.ovirt.engine.core.common.businessentities.VmDevice vmDevice = getVmDeviceDAO ( ) . get ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getId ( ) , currVm.getId ( ) ) ) ; if ( vmDevice.getIsPlugged ( ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN ) ; return false ; } } } return true ; }

Target:
private java.util.List < org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VM , org.ovirt.engine.core.common.businessentities.VmDevice > > getVmsWithVmDeviceInfoForDiskId ( ) { if ( ( cachedVmsDeviceInfo ) == null ) { cachedVmsDeviceInfo = org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getVmDAO ( ) . getVmsWithPlugInfo ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . getId ( ) ) ; } return cachedVmsDeviceInfo ; }
Source:
protected org.ovirt.engine.api.model.DataCenter deprecatedPopulate ( org.ovirt.engine.api.model.DataCenter model , org.ovirt.engine.core.common.businessentities.StoragePool entity ) { org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) ; model.setSupportedVersions ( getMapper ( java.util.List.class , org.ovirt.engine.api.model.SupportedVersions.class ) . map ( getEntity ( java.util.List.class , VdcQueryType.GetAvailableStoragePoolVersions , parameters , model.getId ( ) ) , null ) ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.DataCenter deprecatedPopulate ( org.ovirt.engine.api.model.DataCenter model , org.ovirt.engine.core.common.businessentities.StoragePool entity ) { org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( asGuid ( model.getId ( ) ) ) ; model.setSupportedVersions ( getMapper ( java.util.List.class , org.ovirt.engine.api.model.SupportedVersions.class ) . map ( getEntity ( java.util.List.class , VdcQueryType.GetAvailableStoragePoolVersions , parameters , model.getId ( ) ) , null ) ) ; return model ; }
Source:
protected void updateCustomPropertySheet ( ) { if ( ( getModel ( ) . getCluster ( ) . getSelectedItem ( ) ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.VDSGroup cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( getModel ( ) . getCluster ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getCustomPropertySheet ( ) . setKeyValueString ( getModel ( ) . getCustomPropertiesKeysList ( ) . get ( cluster.getcompatibility_version ( ) ) ) ; }

Target:
public void postUpdateNumOfSockets2 ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; java.lang.String version = cluster.getcompatibility_version ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxNumOfCPUsPerSocket ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; behavior.maxCpusPerSocket = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.totalCpuCoresChanged ( ) ; } } , getModel ( ) . getHash ( ) ) , version ) ; }
Source:
private void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveGroup , org.ovirt.engine.core.common.action.AdElementParametersBase.class , new java.lang.String [ ] { "AdElementId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveGroup , org.ovirt.engine.core.common.action.IdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void rollback1 ( ) { org.ovirt.engine.ui.uicompat.Enlistment enlistment = context.enlistment ; org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext enlistmentContext = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext ) ( enlistment.getContext ( ) ) ) ; if ( ( enlistmentContext.getDataCenterId ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetDataCenterById ( 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 ) { context.dataCenterFoundById = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; rollback2 ( ) ; } } ) , enlistmentContext.getDataCenterId ( ) ) ; } else { rollback3 ( ) ; } }

Target:
public void rollback1 ( ) { org.ovirt.engine.ui.uicompat.Enlistment enlistment = context.enlistment ; org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext enlistmentContext = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext ) ( enlistment.getContext ( ) ) ) ; if ( ( enlistmentContext.getDataCenterId ( ) ) != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDataCenterById ( 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 ) { context.dataCenterFoundById = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( returnValue ) ) ; rollback2 ( ) ; } } ) , enlistmentContext.getDataCenterId ( ) ) ; } else { rollback3 ( ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( T value ) { setTitle ( value.getStopReason ( ) ) ; if ( ( ( value.getStopReason ( ) ) != null ) && ( ! ( value.getStopReason ( ) . trim ( ) . isEmpty ( ) ) ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.ReasonColumn.getApplicationResources ( ) . commentImage ( ) ; } 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.inlineImage ( 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 ( ) ) ) ; } return null ; }
Source:
public static void GetSANWipeAfterDelete ( 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SANWipeAfterDelete , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void GetGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
private boolean isMoveDiskInDbSucceded ( org.ovirt.engine.core.compat.Guid targetStorageDomainId ) { org.ovirt.engine.core.compat.Guid destinationImageId = getEnclosingCommand ( ) . getParameters ( ) . getDestinationImageId ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getDiskImageDao ( ) . get ( destinationImageId ) ; return ( diskImage != null ) && ( targetStorageDomainId.equals ( diskImage.getStorageIds ( ) . get ( 0 ) ) ) ; }

Target:
private boolean isMoveDiskInDbSucceded ( org.ovirt.engine.core.compat.Guid targetStorageDomainId ) { org.ovirt.engine.core.compat.Guid destinationImageId = getEnclosingCommand ( ) . getParameters ( ) . getDestinationImageId ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = org.ovirt.engine.core.bll.lsm.VmReplicateDiskFinishTaskHandler.getDiskImageDao ( ) . get ( destinationImageId ) ; return ( diskImage != null ) && ( targetStorageDomainId.equals ( diskImage.getStorageIds ( ) . get ( 0 ) ) ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterVolume model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( NAMES [ index ] , model.getName ( ) ) ; assertEquals ( org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTE , model.getVolumeType ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterVolume model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.model.GlusterVolumeType.DISTRIBUTE , model.getVolumeType ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterVolumesResourceTest.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; verifyLinks ( model ) ; }
Source:
public void invalidWhenConditionDoesntOccurWithMultipleReplacements ( ) { org.junit.Assert.assertThat ( org.ovirt.engine.core.bll.ValidationResult.failWith ( org.ovirt.engine.core.bll.ValidationResultTest.ERROR , org.ovirt.engine.core.bll.ValidationResultTest.REPLACEMENT , org.ovirt.engine.core.bll.ValidationResultTest.OTHER_REPLACEMENT ) . when ( true ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( org.ovirt.engine.core.bll.ValidationResultTest.ERROR ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.ValidationResultTest.REPLACEMENT ) ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.ValidationResultTest.OTHER_REPLACEMENT ) ) ) ) ; }

Target:
public void invalidWhenConditionDoesntOccurWithMultipleReplacements ( ) { org.hamcrest.MatcherAssert.assertThat ( org.ovirt.engine.core.bll.ValidationResult.failWith ( org.ovirt.engine.core.bll.ValidationResultTest.ERROR , org.ovirt.engine.core.bll.ValidationResultTest.REPLACEMENT , org.ovirt.engine.core.bll.ValidationResultTest.OTHER_REPLACEMENT ) . when ( true ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( org.ovirt.engine.core.bll.ValidationResultTest.ERROR ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.ValidationResultTest.REPLACEMENT ) ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.ValidationResultTest.OTHER_REPLACEMENT ) ) ) ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; vmStatics = dbFacade.getVmStaticDAO ( ) . getAllByName ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STATIC_VM_NAME ) ; vmStaticArrayInDescOrder = new org.ovirt.engine.core.common.businessentities.VmStatic [ org.ovirt.engine.core.dao.DbFacadeDAOTest.NUM_OF_VM_STATIC_IN_FIXTURES ] ; guidsArrayToBeChecked = new org.ovirt.engine.core.compat.Guid [ org.ovirt.engine.core.dao.DbFacadeDAOTest.NUM_OF_VM_STATIC_IN_FIXTURES ] ; vmStaticGuidsInDb = getListOfGuidFromListOfVmStatics ( vmStatics ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; vmStatics = dbFacade.getVmStaticDao ( ) . getAllByName ( org.ovirt.engine.core.dao.DbFacadeDAOTest.STATIC_VM_NAME ) ; vmStaticArrayInDescOrder = new org.ovirt.engine.core.common.businessentities.VmStatic [ org.ovirt.engine.core.dao.DbFacadeDAOTest.NUM_OF_VM_STATIC_IN_FIXTURES ] ; guidsArrayToBeChecked = new org.ovirt.engine.core.compat.Guid [ org.ovirt.engine.core.dao.DbFacadeDAOTest.NUM_OF_VM_STATIC_IN_FIXTURES ] ; vmStaticGuidsInDb = getListOfGuidFromListOfVmStatics ( vmStatics ) ; }
Source:
public void updateIdForNonExistingSnapshot ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid snapshotId = new org.ovirt.engine.core.compat.Guid ( ) ; org.ovirt.engine.core.compat.Guid newSnapshotId = new org.ovirt.engine.core.compat.Guid ( ) ; org.junit.Assert.assertNull ( dao.get ( snapshotId ) ) ; dao.updateId ( snapshotId , newSnapshotId ) ; org.junit.Assert.assertNull ( dao.get ( snapshotId ) ) ; org.junit.Assert.assertNull ( dao.get ( newSnapshotId ) ) ; }

Target:
public void updateIdForNonExistingSnapshot ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.Empty ; org.ovirt.engine.core.compat.Guid newSnapshotId = org.ovirt.engine.core.compat.Guid.Empty ; org.junit.Assert.assertNull ( dao.get ( snapshotId ) ) ; dao.updateId ( snapshotId , newSnapshotId ) ; org.junit.Assert.assertNull ( dao.get ( snapshotId ) ) ; org.junit.Assert.assertNull ( dao.get ( newSnapshotId ) ) ; }
Source:
public void getExternalProviderHostGroupList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalHostGroup > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostGroupsFromExternalProvider , params , aQuery ) ; }

Target:
public void getExternalProviderHostGroupList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalHostGroup > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostGroupsFromExternalProvider , params , aQuery ) ; }
Source:
private void setMtuSelectorsChangeability ( boolean isChangeable , java.lang.String prohibitionReason ) { if ( ! isChangeable ) { getMtuSelector ( ) . setChangeProhibitionReason ( prohibitionReason ) ; getMtu ( ) . setChangeProhibitionReason ( prohibitionReason ) ; } getMtuSelector ( ) . setIsChangable ( isChangeable ) ; getMtu ( ) . setIsChangable ( ( isChangeable && ( isCustomMtu ( ) ) ) ) ; }

Target:
private void setMtuSelectorsChangeability ( boolean isChangeable , java.lang.String prohibitionReason ) { if ( ! isChangeable ) { getMtuSelector ( ) . setChangeProhibitionReason ( prohibitionReason ) ; getMtu ( ) . setChangeProhibitionReason ( prohibitionReason ) ; } getMtuSelector ( ) . setIsChangeable ( isChangeable ) ; getMtu ( ) . setIsChangeable ( ( isChangeable && ( isCustomMtu ( ) ) ) ) ; }
Source:
private boolean canScheduleVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.compat.Guid > blacklist = new java.util.ArrayList < > ( ) ; if ( ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) != null ) { blacklist.add ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) ; } return org.ovirt.engine.core.bll.scheduling.SchedulingManager.getInstance ( ) . canSchedule ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsGroup ( ) , vm , blacklist , java.util.Collections.< org.ovirt.engine.core.compat.Guid > emptyList ( ) , vm.getDedicatedVmForVds ( ) , new java.util.ArrayList < java.lang.String > ( ) ) ; }

Target:
private boolean canScheduleVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.compat.Guid > blacklist = new java.util.ArrayList < > ( ) ; if ( ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) != null ) { blacklist.add ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) ; } return org.ovirt.engine.core.bll.scheduling.SchedulingManager.getInstance ( ) . canSchedule ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsGroup ( ) , vm , blacklist , java.util.Collections.< org.ovirt.engine.core.compat.Guid > emptyList ( ) , vm.getDedicatedVmForVdsList ( ) , new java.util.ArrayList < java.lang.String > ( ) ) ; }
Source:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommandTest.CLUSTER_ID , null ) ) ) ; setupMocks ( ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void canDoActionFailsOnNullHookId ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.EnableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( CLUSTER_ID , null ) ) ) ; setupMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_ID_IS_REQUIRED.toString ( ) ) ) ; }
Source:
public void getIpv4AddressOfNetworkReturnsNullWhenThereIsNoNetworkOfGivenName ( ) { java.lang.String networkName = "networkName" ; testResolveHostNetworkAddress ( ( e ) -> e.getIpv4AddressOfNetwork ( networkName ) , networkName ) ; }

Target:
public void setUp ( ) { injectorRule.bind ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil.class , managementNetworkUtil ) ; nic.setNetworkName ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.NETWORK_NAME1 ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.getInterfaces ( ) . add ( nic ) ; underTest = new org.ovirt.engine.core.bll.network.NetworkConfigurator ( vds , org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.COMMAND_CONTEXT ) ; }
Source:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void mapNoneSsoFromBackendToRest ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.SsoMethod backendSsoMethod = org.ovirt.engine.core.common.businessentities.SsoMethod.NONE ; org.ovirt.engine.api.model.Sso restSso = org.ovirt.engine.api.restapi.types.SsoMapper.map ( backendSsoMethod , null ) ; junit.framework.Assert.assertNotNull ( restSso ) ; junit.framework.Assert.assertNotNull ( restSso.getMethods ( ) ) ; junit.framework.Assert.assertNotNull ( restSso.getMethods ( ) . getMethods ( ) ) ; junit.framework.Assert.assertTrue ( restSso.getMethods ( ) . getMethods ( ) . isEmpty ( ) ) ; }

Target:
public void mapNoneSsoFromBackendToRest ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.SsoMethod backendSsoMethod = org.ovirt.engine.core.common.businessentities.SsoMethod.NONE ; org.ovirt.engine.api.model.Sso restSso = org.ovirt.engine.api.restapi.types.SsoMapper.map ( backendSsoMethod , null ) ; org.junit.Assert.assertNotNull ( restSso ) ; org.junit.Assert.assertNotNull ( restSso.getMethods ( ) ) ; org.junit.Assert.assertNotNull ( restSso.getMethods ( ) . getMethods ( ) ) ; org.junit.Assert.assertTrue ( restSso.getMethods ( ) . getMethods ( ) . isEmpty ( ) ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getResetCommand ( ) ) ) { Reset ( ) ; } else if ( command == ( getExpandAllCommand ( ) ) ) { ExpandAll ( ) ; } else if ( command == ( getCollapseAllCommand ( ) ) ) { CollapseAll ( ) ; } }

Target:
private void collapseAll ( ) { setIsExpandedRecursively ( false , getItems ( ) . get ( 0 ) ) ; }
Source:
public void testContainsBrick ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = new java.util.ArrayList < > ( ) ; bricks.add ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick1 ) ; bricks.add ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick2 ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.containsBrick ( bricks , org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick1 ) ) ; org.junit.Assert.assertTrue ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.containsBrick ( bricks , org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick2 ) ) ; org.junit.Assert.assertFalse ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.containsBrick ( bricks , org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick3 ) ) ; }

Target:
public void testContainsBrick ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks = new java.util.ArrayList < > ( ) ; bricks.add ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick1 ) ; bricks.add ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick2 ) ; org.junit.jupiter.api.Assertions.assertTrue ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.containsBrick ( bricks , org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick1 ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.containsBrick ( bricks , org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick2 ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtil.containsBrick ( bricks , org.ovirt.engine.core.common.utils.gluster.GlusterCoreUtilTest.brick3 ) ) ; }
Source:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }