auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel model ) { super . init ( model ) ; model.getErrors ( ) . getItemsChangedEvent ( ) . 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 ) { getView ( ) . validateImportedNetworks ( ( ( java.util.List < java.lang.String > ) ( model.getErrors ( ) . getItems ( ) ) ) ) ; } } ) ; }

Target:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.networks.BaseImportNetworksModel model ) { super . init ( model ) ; model.getErrors ( ) . getItemsChangedEvent ( ) . 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 ) { getView ( ) . validateImportedNetworks ( ( ( java.util.List < java.lang.String > ) ( model.getErrors ( ) . getItems ( ) ) ) ) ; } } ) ; }
Source:
public org.ovirt.engine.core.common.utils.Pair < java.util.List < org.ovirt.engine.core.compat.Guid > , org.ovirt.engine.core.compat.Guid > balance ( @ javax.validation.constraints.NotNull org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , java.util.Map < java.lang.String , java.lang.String > parameters , java.util.ArrayList < java.lang.String > messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( "Policy unit '{}' balance is not implemented" , getPolicyUnit ( ) . getName ( ) ) ; return null ; }

Target:
public java.util.Optional < org.ovirt.engine.core.bll.scheduling.external.BalanceResult > balance ( @ javax.validation.constraints.NotNull org.ovirt.engine.core.common.businessentities.Cluster cluster , java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts , java.util.Map < java.lang.String , java.lang.String > parameters , java.util.ArrayList < java.lang.String > messages ) { org.ovirt.engine.core.bll.scheduling.PolicyUnitImpl.log.error ( "Policy unit '{}' balance is not implemented" , getPolicyUnit ( ) . getName ( ) ) ; return java.util.Optional.empty ( ) ; }
Source:
private void assertValidateMessage ( org.ovirt.engine.core.common.errors.EngineMessage msg ) { org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "validate failed for the wrong reason" , command , msg ) ; }

Target:
public void testBlockUseHostCpuWithPPCArch ( ) { prepareVmToPassValidate ( ) ; command.initEffectiveCompatibilityVersion ( ) ; vm.setClusterArch ( ArchitectureType.ppc64le ) ; group.setArchitecture ( ArchitectureType.ppc ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.UpdateVmCommandTest.osRepository.getArchitectureFromOS ( OsType.Windows.ordinal ( ) ) ) . thenReturn ( ArchitectureType.ppc ) ; vmStatic.setUseHostCpuFlags ( true ) ; vmStatic.setMigrationSupport ( MigrationSupport.PINNED_TO_HOST ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.USE_HOST_CPU_REQUESTED_ON_UNSUPPORTED_ARCH ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc glusterVolumeSnapshotConfigGet ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue ; if ( volumeName == null ) { xmlRpcReturnValue = vdsServer.glusterSnapshotConfigGet ( "" ) ; } else { xmlRpcReturnValue = vdsServer.glusterSnapshotConfigGet ( volumeName ) ; } org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotConfigReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionCreate ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String remoteUserName , java.lang.Boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeGeoRepSessionCreate ( volumeName , remoteHost , remoteVolumeName , remoteUserName , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void mockStoragePoolDao ( ) { org.mockito.Mockito.doReturn ( storagePoolDao ) . when ( command ) . getStoragePoolDao ( ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePoolId ) ) . thenReturn ( storagePool ) ; }

Target:
public void validateSufficientSpaceOnDestinationDomains ( ) { setupForStorageTests ( ) ; command.ensureDestinationImageMap ( ) ; org.junit.Assert.assertTrue ( command.checkDestDomains ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }
Source:
private void mockDiskImageDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > diskImageList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setstorage_ids ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ) ) ; diskImageList.add ( diskImage ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( spyCommand ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.getAllForVm ( vmId ) ) . thenReturn ( diskImageList ) ; }

Target:
private void mockDiskImageDao ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > diskImageList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ) ) ; diskImageList.add ( diskImage ) ; org.mockito.Mockito.doReturn ( diskDao ) . when ( spyCommand ) . getDiskDao ( ) ; org.mockito.Mockito.when ( diskDao.getAllForVm ( vmId ) ) . thenReturn ( diskImageList ) ; }
Source:
protected void setCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { org.ovirt.engine.ui.uicommonweb.UICommand newCommand = ( command != null ) ? command : org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.EMPTY_COMMAND ; if ( ( this . command ) != newCommand ) { this . command = newCommand ; com.google.gwt.event.logical.shared.InitializeEvent.fire ( this ) ; if ( newCommand != ( org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.EMPTY_COMMAND ) ) { newCommand.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { com.google.gwt.event.logical.shared.InitializeEvent.fire ( org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.this ) ; } } ) ; } } }

Target:
protected void setCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { org.ovirt.engine.ui.uicommonweb.UICommand newCommand = ( command != null ) ? command : org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.EMPTY_COMMAND ; if ( ( this . command ) != newCommand ) { removePropertyChangeEventHandler ( ) ; this . command = newCommand ; com.google.gwt.event.logical.shared.InitializeEvent.fire ( this ) ; if ( newCommand != ( org.ovirt.engine.ui.common.widget.action.UiCommandButtonDefinition.EMPTY_COMMAND ) ) { addPropertyChangeEventHandler ( ) ; } } }
Source:
public void testVmPools ( ) { org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( 100 ) ; org.ovirt.engine.core.searchbackend.ISyntaxChecker curSyntaxChecker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createBackendSyntaxChecker ( "foo" ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = curSyntaxChecker.analyzeSyntaxState ( "Pools: " , true ) ; java.lang.String query = chkr.generateQueryFromSyntaxContainer ( res , true ) ; junit.framework.Assert.assertEquals ( "SELECT * FROM ((SELECT * FROM vm_pools_full_view ) ORDER BY vm_pool_name ASC ) as T1 OFFSET (1 -1) LIMIT 0" , query ) ; }

Target:
public void testVmPools ( ) { org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( 100 ) ; org.ovirt.engine.core.searchbackend.ISyntaxChecker curSyntaxChecker = org.ovirt.engine.core.searchbackend.SyntaxCheckerFactory.createBackendSyntaxChecker ( "foo" ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = curSyntaxChecker.analyzeSyntaxState ( "Pools: " , true ) ; java.lang.String query = chkr.generateQueryFromSyntaxContainer ( res , true ) ; org.junit.Assert.assertEquals ( "SELECT * FROM ((SELECT * FROM vm_pools_full_view ) ORDER BY vm_pool_name ASC ) as T1 OFFSET (1 -1) LIMIT 0" , query ) ; }
Source:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( getReturnStatus ( ) ) ; switch ( returnStatus ) { case StorageServerConnectionRefIdAlreadyInUse : case StorageServerConnectionRefIdDoesNotExist : org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase outEx = new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSErrorException ( java.lang.String.format ( "Failed in vdscommand %1$s, error = %2$s" , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getCommandName ( ) , getReturnStatus ( ) . mMessage ) ) ; initializeVdsError ( returnStatus ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; throw outEx ; default : super . ProceedProxyReturnValue ( ) ; break ; } }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( getReturnStatus ( ) ) ; switch ( returnStatus ) { case StorageServerConnectionRefIdAlreadyInUse : case StorageServerConnectionRefIdDoesNotExist : org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase outEx = new org.ovirt.engine.core.vdsbroker.vdsbroker.VDSErrorException ( java.lang.String.format ( "Failed in vdscommand %1$s, error = %2$s" , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getCommandName ( ) , getReturnStatus ( ) . mMessage ) ) ; initializeVdsError ( returnStatus ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; throw outEx ; default : super . proceedProxyReturnValue ( ) ; break ; } }
Source:
protected org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel createNetworkClusterModel ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { if ( cluster.getId ( ) . equals ( this . cluster.getId ( ) ) ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel networkClusterModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel ( cluster ) ; networkClusterModel.setAttached ( true ) ; networkClusterModel.setRequired ( ( ! ( ( java.lang.Boolean ) ( getExport ( ) . getEntity ( ) ) ) ) ) ; networkClusterModel.setIsChangable ( false ) ; return networkClusterModel ; } else { return super . createNetworkClusterModel ( cluster ) ; } }

Target:
protected org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel createNetworkClusterModel ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { if ( cluster.getId ( ) . equals ( this . cluster.getId ( ) ) ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel networkClusterModel = new org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel ( cluster ) ; networkClusterModel.setAttached ( true ) ; networkClusterModel.setRequired ( ( ! ( ( java.lang.Boolean ) ( getExport ( ) . getEntity ( ) ) ) ) ) ; networkClusterModel.setIsChangeable ( false ) ; return networkClusterModel ; } else { return super . createNetworkClusterModel ( cluster ) ; } }
Source:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }

Target:
private void setUpGetBallooningExpectations ( int times ) throws java.lang.Exception { for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , true ) ; } }
Source:
void enforceScrollPosition ( ) { tableContainer.getElement ( ) . setScrollLeft ( tableContainerHorizontalScrollPosition ) ; updateTableHeaderPosition ( ) ; }

Target:
void enforceScrollPosition ( ) { tableContainer.getElement ( ) . setScrollLeft ( tableContainerHorizontalScrollPosition ) ; updateTableHeaderPosition ( ) ; if ( ( ( table.getParent ( ) ) != null ) && ( ( table.getParent ( ) . getElement ( ) ) != null ) ) { table.getParent ( ) . getElement ( ) . setScrollTop ( scrollOffset ) ; } }
Source:
public org.ovirt.engine.core.bll.adbroker.LdapReturnValueBase Execute ( ) { try { ExecuteQuery ( ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.adbroker.InternalBrokerCommandBase.log.errorFormat ( "Error in executing Internal broker command. Exception is {0} " , e.getMessage ( ) ) ; _ldapReturnValue.setSucceeded ( false ) ; _ldapReturnValue.setReturnValue ( null ) ; } return _ldapReturnValue ; }

Target:
public org.ovirt.engine.core.bll.adbroker.LdapReturnValueBase execute ( ) { try { ExecuteQuery ( ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.adbroker.InternalBrokerCommandBase.log.errorFormat ( "Error in executing Internal broker command. Exception is {0} " , e.getMessage ( ) ) ; _ldapReturnValue.setSucceeded ( false ) ; _ldapReturnValue.setReturnValue ( null ) ; } return _ldapReturnValue ; }
Source:
public void canDoActionDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( ) ; initVmForFail ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; 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_DISKS_LOCKED.toString ( ) ) ) ; }

Target:
public void canDoActionVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; 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:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel1.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel1.Cancel ( ) ; } }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel1 = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel1.getWindow ( ) . StopProgress ( ) ; vmListModel1.Cancel ( ) ; }
Source:
public void untarEmptyTarArchiveReturnsEntries ( ) throws java.io.IOException { byte [ ] emptyFile = load ( "tar-with-empty-file.tar" ) ; try ( org.ovirt.engine.core.utils.archivers.tar.TarInMemoryExport tar = new org.ovirt.engine.core.utils.archivers.tar.TarInMemoryExport ( new java.io.ByteArrayInputStream ( emptyFile ) ) ) { java.util.Map < java.lang.String , java.nio.ByteBuffer > entries = tar.unTar ( ) ; org.junit.Assert.assertThat ( entries.size ( ) , org.hamcrest.Matchers.is ( 1 ) ) ; org.junit.Assert.assertThat ( entries , org.hamcrest.Matchers.hasKey ( "empty.file" ) ) ; } }

Target:
public void untarEmptyTarArchiveReturnsEntries ( ) throws java.io.IOException { byte [ ] emptyFile = load ( "tar-with-empty-file.tar" ) ; try ( org.ovirt.engine.core.utils.archivers.tar.TarInMemoryExport tar = new org.ovirt.engine.core.utils.archivers.tar.TarInMemoryExport ( new java.io.ByteArrayInputStream ( emptyFile ) ) ) { java.util.Map < java.lang.String , java.nio.ByteBuffer > entries = tar.unTar ( ) ; org.hamcrest.MatcherAssert.assertThat ( entries.size ( ) , org.hamcrest.Matchers.is ( 1 ) ) ; org.hamcrest.MatcherAssert.assertThat ( entries , org.hamcrest.Matchers.hasKey ( "empty.file" ) ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < java.lang.String > pmTypes = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; updatePmTypeList ( pmTypes , getPmType ( ) ) ; updatePmTypeList ( pmTypes , getPmSecondaryType ( ) ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { updateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.storage.image_storage_domain_map ) ) { return false ; } org.ovirt.engine.core.common.businessentities.storage.image_storage_domain_map other = ( ( org.ovirt.engine.core.common.businessentities.storage.image_storage_domain_map ) ( obj ) ) ; return ( ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( id , other.id ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( quotaId , other.quotaId ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( diskProfileId , other.diskProfileId ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( obj == null ) { return false ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ) ) { return false ; } org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap other = ( ( org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ) ( obj ) ) ; return ( ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( id , other.id ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( quotaId , other.quotaId ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( diskProfileId , other.diskProfileId ) ) ; }
Source:
public void getRoleList ( 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.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }

Target:
public void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.Role > > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public void finishSshSoftFencingExecution ( org.ovirt.engine.core.common.businessentities.VDS vds ) { mUnrespondedAttempts.set ( 0 ) ; setStatus ( VDSStatus.Connecting , vds ) ; updateDynamicData ( vds.getDynamicData ( ) ) ; }

Target:
public boolean isHostInGracePeriod ( boolean sshSoftFencingExecuted ) { long timeoutToFence = calcTimeoutToFence ( cachedVds.getVmCount ( ) , cachedVds.getSpmStatus ( ) ) ; int unrespondedAttemptsBarrier = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.VDSAttemptsToResetCount ) ; if ( sshSoftFencingExecuted ) { timeoutToFence = timeoutToFence * 2 ; unrespondedAttemptsBarrier = unrespondedAttemptsBarrier * 2 ; } return ( ( mUnrespondedAttempts.get ( ) ) < unrespondedAttemptsBarrier ) || ( ( ( lastUpdate ) + timeoutToFence ) > ( java.lang.System.currentTimeMillis ( ) ) ) ; }
Source:
public void flushToPrivateModel ( ) { if ( spiceRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.SPICE ) ; setSelectedSpiceImpl ( ) ; } else if ( remoteDesktopRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.RDP ) ; setSelectedRdpImpl ( ) ; } else if ( vncRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.VNC ) ; setSelectedVncImpl ( ) ; } flushCheckBoxes ( remapCtrlAltDeleteSpice , remapCtrlAltDeleteVnc , enableUsbAutoshare , openInFullScreen , enableSpiceProxy , useLocalDrives , wanEnabled , disableSmartcard ) ; }

Target:
public void flushToPrivateModel ( ) { if ( spiceRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.SPICE ) ; initSelectedSpiceImpl ( ) ; } else if ( remoteDesktopRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.RDP ) ; setSelectedRdpImpl ( ) ; } else if ( vncRadioButton.asRadioButton ( ) . getValue ( ) ) { setSelectedProtocol ( ConsoleProtocol.VNC ) ; setSelectedVncImpl ( ) ; } flushCheckBoxes ( remapCtrlAltDeleteSpice , remapCtrlAltDeleteVnc , enableUsbAutoshare , openInFullScreen , enableSpiceProxy , useLocalDrives , wanEnabled , disableSmartcard ) ; }
Source:
public void externalNetworkVmNetworkChanged ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network externalNetwork = mockExternalNetwork ( ) ; boolean vmNetwork = true ; org.mockito.Mockito.when ( externalNetwork.isVmNetwork ( ) ) . thenReturn ( vmNetwork ) ; org.mockito.Mockito.when ( network.isVmNetwork ( ) ) . thenReturn ( ( ! vmNetwork ) ) ; assertThatExternalNetworkDetailsUnchangedFails ( externalNetwork ) ; }

Target:
public void externalNetworkVmNetworkChanged ( ) { org.ovirt.engine.core.common.businessentities.network.Network externalNetwork = createExternalNetwork ( ) ; externalNetwork.setVmNetwork ( true ) ; network.setVmNetwork ( false ) ; assertThatExternalNetworkDetailsUnchangedFails ( externalNetwork ) ; }
Source:
private void fetchScema ( org.ovirt.engine.sdk.web.HttpProxyBroker httpProxy ) throws java.io.IOException , javax.xml.bind.JAXBException , org.ovirt.engine.sdk.exceptions.ServerException { java.io.PrintWriter out = null ; java.lang.String schema = httpProxy.get ( org.ovirt.engine.sdk.codegen.xsd.XsdCodegen.SCHEMA_URL ) ; if ( ( schema != null ) && ( ! ( schema.equals ( "" ) ) ) ) { try { out = new java.io.PrintWriter ( org.ovirt.engine.sdk.codegen.xsd.XsdCodegen.SCHEMA_FILE_NAME ) ; out.println ( schema ) ; } finally { if ( out != null ) { out.close ( ) ; } } } else { throw new java.lang.RuntimeException ( "xsd schema download failed." ) ; } }

Target:
public static void main ( java.lang.String [ ] args ) throws java.io.IOException , javax.xml.bind.JAXBException { org.ovirt.engine.sdk.codegen.xsd.XsdCodegen generator = new org.ovirt.engine.sdk.codegen.xsd.XsdCodegen ( args [ 0 ] ) ; generator.generate ( ) ; }
Source:
public void validateVmMemoryCantStartOnVdsHostTooSmall ( ) { vds.setMemFree ( 8835L ) ; boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertEquals ( vmPassedMemoryRequirement , false ) ; }

Target:
public void validateVmMemoryCanStartOnVdsHostTooSmallButLowOverhead ( ) { vds.setMemFree ( 8835L ) ; org.mockito.Mockito.doReturn ( 0 ) . when ( vmOverheadCalculator ) . getStaticOverheadInMb ( org.mockito.Matchers.any ( ) ) ; boolean vmPassedMemoryRequirement = slaValidator.hasPhysMemoryToRunVM ( vds , vm , 0 ) ; org.junit.Assert.assertTrue ( vmPassedMemoryRequirement ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.storage_domains setupForSpaceTest ( final org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings settings ) { org.ovirt.engine.core.common.businessentities.storage_domain_dynamic dynamic = new org.ovirt.engine.core.common.businessentities.storage_domain_dynamic ( ) ; dynamic.setavailable_disk_size ( settings.diskSpaceFree ) ; dynamic.setused_disk_size ( settings.diskSpaceUsed ) ; org.ovirt.engine.core.common.businessentities.storage_domains domain = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; domain.setStorageDynamicData ( dynamic ) ; org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.mockConfig ( settings.spaceThresholdGB , settings.spaceThresholdPct ) ; return domain ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage_domains setupForSpaceTest ( final org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.SpaceTestSettings settings ) { org.ovirt.engine.core.common.businessentities.StorageDomainDynamic dynamic = new org.ovirt.engine.core.common.businessentities.StorageDomainDynamic ( ) ; dynamic.setavailable_disk_size ( settings.diskSpaceFree ) ; dynamic.setused_disk_size ( settings.diskSpaceUsed ) ; org.ovirt.engine.core.common.businessentities.storage_domains domain = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; domain.setStorageDynamicData ( dynamic ) ; org.ovirt.engine.core.bll.command.utils.StorageDomainSpaceCheckerTest.mockConfig ( settings.spaceThresholdGB , settings.spaceThresholdPct ) ; return domain ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > getLUNs ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; luns.add ( lun ) ; return luns ; }

Target:
private static java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > getLUNs ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; return java.util.Collections.singletonList ( lun ) ; }
Source:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void getGlusterRemoveBricksStatus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId , java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks ) { aQuery.setHandleFailure ( true ) ; org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters parameters = new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksQueriesParameters ( clusterId , volumeId , bricks ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeRemoveBricksStatus , parameters , aQuery ) ; }
Source:
private java.util.List < java.lang.String > findViolatedNics ( java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypesMap ) { java.util.List < java.lang.String > violatedNics = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypes : nicNameToNetworkTypesMap.entrySet ( ) ) { java.lang.String nicName = nicNameToNetworkTypes.getKey ( ) ; java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > networkTypes = nicNameToNetworkTypes.getValue ( ) ; if ( ! ( validateNetworkTypesOnNic ( networkTypes ) ) ) { violatedNics.add ( nicName ) ; } } return violatedNics ; }

Target:
private java.util.List < java.lang.String > findViolatedNics ( java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.network.NetworkType > > nicNameToNetworkTypesMap ) { java.util.List < java.lang.String > violatedNics = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.network.NetworkType > > nicNameToNetworkTypes : nicNameToNetworkTypesMap.entrySet ( ) ) { java.lang.String nicName = nicNameToNetworkTypes.getKey ( ) ; java.util.List < org.ovirt.engine.core.bll.validator.network.NetworkType > networkTypes = nicNameToNetworkTypes.getValue ( ) ; if ( ! ( networkExclusivenessValidator.isNetworkExclusive ( networkTypes ) ) ) { violatedNics.add ( nicName ) ; } } return violatedNics ; }
Source:
public void testGetPermittedStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getPermittedStorageDomainsByStoragePool ( org.ovirt.engine.core.dao.StorageDomainDaoTest.EXISTING_USER_ID , ActionGroup.CONFIGURE_VM_STORAGE , new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( result.get ( 0 ) . getId ( ) , existingDomain.getId ( ) ) ; }

Target:
public void testGetPermittedStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getPermittedStorageDomainsByStoragePool ( FixturesTool.USER_EXISTING_ID , ActionGroup.CONFIGURE_VM_STORAGE , FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( result.get ( 0 ) . getId ( ) , existingDomain.getId ( ) ) ; }
Source:
public java.lang.String createSnapshot ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk ) { return execute ( new java.util.concurrent.Callable < java.lang.String > ( ) { @ java.lang.Override public java.lang.String call ( ) { com.woorea.openstack.cinder.model.SnapshotForCreate snapshotForCreate = new com.woorea.openstack.cinder.model.SnapshotForCreate ( ) ; snapshotForCreate.setVolumeId ( cinderDisk.getImageId ( ) . toString ( ) ) ; return proxy.createSnapshot ( snapshotForCreate ) ; } } ) ; }

Target:
public java.lang.String createSnapshot ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk , final java.lang.String snapshotDescription ) { return execute ( new java.util.concurrent.Callable < java.lang.String > ( ) { @ java.lang.Override public java.lang.String call ( ) { com.woorea.openstack.cinder.model.SnapshotForCreate snapshotForCreate = new com.woorea.openstack.cinder.model.SnapshotForCreate ( ) ; snapshotForCreate.setVolumeId ( cinderDisk.getImageId ( ) . toString ( ) ) ; snapshotForCreate.setDescription ( snapshotDescription ) ; return proxy.createSnapshot ( snapshotForCreate ) ; } } ) ; }
Source:
public void canDoActionFailsOnNullHook ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookStatusChangeParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd , false ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_HOOK_DOES_NOT_EXIST.toString ( ) ) ) ; }

Target:
public void executeCommand ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , true ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE ) ; }
Source:
private void copyFromCommandEntity ( org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask , org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { if ( cmdEntity != null ) { asyncTask.setActionParameters ( cmdEntity.getActionParameters ( ) ) ; asyncTask.setRootCommandId ( cmdEntity.getRootCommandId ( ) ) ; asyncTask.setCommandStatus ( cmdEntity.getCommandStatus ( ) ) ; asyncTask.setCommandType ( cmdEntity.getCommandType ( ) ) ; asyncTask.setCreatedAt ( cmdEntity.getCreatedAt ( ) ) ; } }

Target:
public void persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ) { commandsCache.put ( cmdEntity ) ; if ( cmdEntity.isCallBackEnabled ( ) ) { buildCmdHierarchy ( cmdEntity ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepKeysUpdate ( java.util.List < java.lang.String > geoRepPubKeys , java.lang.String remoteUserName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterGeoRepKeysUpdate ( remoteUserName , geoRepPubKeys ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.BooleanReturnForXmlRpc glusterVolumeEmptyCheck ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeEmptyCheck ( volumeName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.BooleanReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.BooleanReturnForXmlRpc ( xmlRpcReturnValue , "volumeEmptyCheck" ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private static void initDisksUsage ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct vmStruct , org.ovirt.engine.core.common.businessentities.VmStatistics vm ) { java.lang.Object [ ] vmDisksUsage = ( ( java.lang.Object [ ] ) ( vmStruct.getItem ( VdsProperties.VM_DISKS_USAGE ) ) ) ; if ( vmDisksUsage != null ) { java.util.ArrayList < java.lang.Object > disksUsageList = new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( vmDisksUsage ) ) ; vm.setDisksUsage ( new org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer ( ) . serializeUnformattedJson ( disksUsageList ) ) ; } }

Target:
private static void initDisksUsage ( org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcStruct vmStruct , org.ovirt.engine.core.common.businessentities.VmStatistics vm ) { java.lang.Object [ ] vmDisksUsage = ( ( java.lang.Object [ ] ) ( vmStruct.getItem ( VdsProperties.VM_DISKS_USAGE ) ) ) ; if ( vmDisksUsage != null ) { java.util.ArrayList < java.lang.Object > disksUsageList = new java.util.ArrayList < java.lang.Object > ( java.util.Arrays.asList ( vmDisksUsage ) ) ; vm.setDisksUsage ( org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) . serializeUnformattedJson ( disksUsageList ) ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypesCollection = new java.util.HashSet < org.ovirt.engine.core.common.businessentities.GraphicsType > ( ) ; for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice graphicsDevice : graphicsDevices ) { graphicsTypesCollection.add ( graphicsDevice.getGraphicsType ( ) ) ; } org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes graphicsTypes = UnitVmModel.GraphicsTypes.fromGraphicsTypes ( graphicsTypesCollection ) ; org.ovirt.engine.ui.uicompat.Translator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) ; setGraphicsType ( translator.translate ( graphicsTypes ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsDevice > graphicsDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.GraphicsType > graphicsTypesCollection = new java.util.HashSet < org.ovirt.engine.core.common.businessentities.GraphicsType > ( ) ; for ( org.ovirt.engine.core.common.businessentities.GraphicsDevice graphicsDevice : graphicsDevices ) { graphicsTypesCollection.add ( graphicsDevice.getGraphicsType ( ) ) ; } org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel.GraphicsTypes graphicsTypes = UnitVmModel.GraphicsTypes.fromGraphicsTypes ( graphicsTypesCollection ) ; org.ovirt.engine.ui.uicompat.Translator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) ; setGraphicsType ( translator.translate ( graphicsTypes ) ) ; }
Source:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > > aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
public static java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > queryGroupRecords ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { org.ovirt.engine.api.extensions.ExtMap inputMap = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.GROUP ) . mput ( Authz.InvokeKeys.QUERY_FLAGS , org.ovirt.engine.core.aaa.AuthzUtils.queryFlagValue ( groupsResolving , groupsResolvingRecursive ) ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) . mput ( Authz.InvokeKeys.NAMESPACE , namespace ) ; return org.ovirt.engine.core.aaa.AuthzUtils.populateGroups ( extension , namespace , inputMap ) ; }

Target:
public static java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > queryGroupRecords ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final org.ovirt.engine.api.extensions.ExtMap filter , boolean groupsResolving , boolean groupsResolvingRecursive ) { org.ovirt.engine.api.extensions.ExtMap inputMap = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.InvokeKeys.QUERY_ENTITY , Authz.QueryEntity.GROUP ) . mput ( Authz.InvokeKeys.QUERY_FLAGS , org.ovirt.engine.core.aaa.AuthzUtils.queryFlagValue ( groupsResolving , groupsResolvingRecursive ) ) . mput ( Authz.InvokeKeys.QUERY_FILTER , filter ) . mput ( Authz.InvokeKeys.NAMESPACE , namespace ) ; return org.ovirt.engine.core.aaa.AuthzUtils.populateRecords ( extension , namespace , inputMap ) ; }
Source:
public void validateFailsOnNull ( ) { cmd.getParameters ( ) . setServiceType ( ServiceType.NFS ) ; cmd.getParameters ( ) . setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_START ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
private void setUpMockUpForStart ( ) { prepareMocks ( ) ; org.mockito.Mockito.when ( serviceDao.getByServiceType ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.ServiceType.class ) ) ) . thenReturn ( getGlusterServiceListByServiceType ( ServiceType.GLUSTER_SWIFT , GlusterServiceStatus.STOPPED ) ) ; org.mockito.Mockito.doReturn ( getGlusterServerServicesByServerIdAndServiceType ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , ServiceType.GLUSTER_SWIFT , GlusterServiceStatus.STOPPED ) ) . when ( serverServiceDao ) . getByServerIdAndServiceType ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.ServiceType.class ) ) ; }
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.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig config = org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig.from ( vm.getVmType ( ) , vm.isStateless ( ) , vm.isNextRunConfigurationExists ( ) ) ; java.lang.String tooltipContent = config.getTooltip ( ) ; return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( tooltipContent ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String tooltipContent ; if ( ( vm.getVmPoolId ( ) ) == null ) { org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig config = org.ovirt.engine.ui.webadmin.widget.table.column.VmTypeConfig.from ( vm.getVmType ( ) , vm.isStateless ( ) , vm.isNextRunConfigurationExists ( ) ) ; tooltipContent = config.getTooltip ( ) ; } else { tooltipContent = getPoolVmTooltip ( vm.getVmType ( ) ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromString ( tooltipContent ) ; }