auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStorageDomain ( boolean removeStorageDomainFromList ) { filter = new org.ovirt.engine.core.bll.memory.sdfilters.StorageDomainFilter ( ) { @ java.lang.Override protected org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.StorageDomain > getPredicate ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { return predicate ; } } ; org.mockito.Mockito.when ( predicate.eval ( storageDomain ) ) . thenReturn ( ( ! removeStorageDomainFromList ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = java.util.Arrays.asList ( storageDomain ) ; return filter.filterStorageDomains ( storageDomains , disksList ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStorageDomain ( boolean removeStorageDomainFromList ) { filter = new org.ovirt.engine.core.bll.memory.sdfilters.StorageDomainFilter ( ) { @ java.lang.Override protected org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.StorageDomain > getPredicate ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisks ) { return predicate ; } } ; org.mockito.Mockito.when ( predicate.eval ( storageDomain ) ) . thenReturn ( ( ! removeStorageDomainFromList ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = java.util.Arrays.asList ( storageDomain ) ; return filter.filterStorageDomains ( storageDomains , memoryDisks ) ; }
Source:
private boolean unsetAddress ( org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration ) { return ( ( ! ( ipConfiguration.hasPrimaryAddressSet ( ) ) ) || ( org.apache.commons.lang.StringUtils.isEmpty ( ipConfiguration.getPrimaryAddress ( ) . getAddress ( ) ) ) ) || ( org.apache.commons.lang.StringUtils.isEmpty ( ipConfiguration.getPrimaryAddress ( ) . getNetmask ( ) ) ) ; }

Target:
protected boolean isRoleNetwork ( ) { return ( ( getNetworkCluster ( ) . isDisplay ( ) ) || ( getNetworkCluster ( ) . isMigration ( ) ) ) || ( getNetworkCluster ( ) . isGluster ( ) ) ; }
Source:
private void handleNonResponsiveHosts ( java.util.List < java.lang.String > hostNotRespondingList ) { if ( ! ( hostNotRespondingList.isEmpty ( ) ) ) { addCanDoActionMessage ( EngineMessage.VDS_CANNOT_MAINTENANCE_VDS_IS_NOT_RESPONDING_WITH_VMS ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getCanDoActionMessages ( ) . add ( java.lang.String.format ( "$HostNotResponding %1$s" , org.apache.commons.lang.StringUtils.join ( hostNotRespondingList , "," ) ) ) ; } }

Target:
private void handleNonResponsiveHosts ( java.util.List < java.lang.String > hostNotRespondingList ) { if ( ! ( hostNotRespondingList.isEmpty ( ) ) ) { addValidationMessage ( EngineMessage.VDS_CANNOT_MAINTENANCE_VDS_IS_NOT_RESPONDING_WITH_VMS ) ; org.ovirt.engine.core.bll.MaintenanceNumberOfVdssCommand.getReturnValue ( ) . getValidationMessages ( ) . add ( java.lang.String.format ( "$HostNotResponding %1$s" , org.apache.commons.lang.StringUtils.join ( hostNotRespondingList , "," ) ) ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc desktopLock ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.desktopLock ( vmId ) ; 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.StatusOnlyReturnForXmlRpc glusterHookDisable ( java.lang.String glusterCommand , java.lang.String stage , java.lang.String hookName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHookDisable ( glusterCommand , stage , hookName ) ; 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:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Integer > aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.DefaultValueConverter < > ( 0 ) ; aQuery.getAsyncCallback ( ) . onSuccess ( 10 ) ; }
Source:
public void testValidateQosNotPartiallyConfiguredWhenNotUpdatingAttachments ( ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setHost ( host ) . setParams ( new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ) . build ( ) ; java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = java.util.Collections.emptyList ( ) ; org.junit.Assert.assertThat ( validator.validateQosNotPartiallyConfigured ( networkAttachments ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
private org.ovirt.engine.core.common.action.HostSetupNetworksParameters build ( ) { parameters.setVdsId ( host.getId ( ) ) ; return parameters ; }
Source:
public void testRemoveNotFound ( ) { setUpEntityQueryExpectations ( QueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testRemoveNotFound ( ) { setUpEntityQueryExpectations ( QueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
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 ) ; }

Target:
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 < org.ovirt.engine.core.compat.RpmVersion > ( ( ( 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.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc validateStorageDomain ( java.lang.String sdUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.validateStorageDomain ( sdUUID ) ; 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.StatusOnlyReturnForXmlRpc hotplugDisk ( java.util.Map info ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.hotplugDisk ( info ) ; 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:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , null , true ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , boolean canDo , boolean success ) { return setUpActionExpectations ( task , clz , names , values , canDo , success , null , true , org.ovirt.engine.api.restapi.resource.AbstractBackendBaseTest.CANT_DO ) ; }
Source:
public void testGetAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsSpmIdMap > result = dao.getAll ( FixturesTool.DATA_CENTER ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsSpmIdMap mapping : result ) { org.junit.Assert.assertEquals ( FixturesTool.DATA_CENTER , mapping.getStoragePoolId ( ) ) ; } }

Target:
public void testGetAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsSpmIdMap > result = dao.getAll ( FixturesTool.DATA_CENTER ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VdsSpmIdMap mapping : result ) { org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.DATA_CENTER , mapping.getStoragePoolId ( ) ) ; } }
Source:
protected boolean wasSkippedDueToPolicy ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { if ( ( result.getActionReturnValue ( ) ) instanceof org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) { return ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( result.getActionReturnValue ( ) ) ) . getIsSkipped ( ) ; } else { return false ; } }

Target:
protected boolean wasSkippedDueToPolicy ( org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { boolean skipped = false ; if ( ( result.getActionReturnValue ( ) ) instanceof org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue fenceReturnValue = result.getActionReturnValue ( ) ; if ( ( fenceReturnValue.getReturnValue ( ) ) instanceof org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) { skipped = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( fenceReturnValue.getReturnValue ( ) ) ) . getIsSkipped ( ) ; } } return skipped ; }
Source:
public void validateVmMemoryCanRunOnVdsHighMem ( ) { vm.setMinAllocatedMem ( 10000 ) ; vm.setVmMemSizeMb ( 10000 ) ; vds.setPhysicalMemMb ( 15000 ) ; boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasOvercommitMemoryToRunVM ( vds , vm ) ; org.junit.Assert.assertEquals ( vmPassedMemoryRequirement , true ) ; }

Target:
public void validateVmMemoryCanRunOnVdsHighMem ( ) { vm.setMinAllocatedMem ( 10000 ) ; vm.setVmMemSizeMb ( 10000 ) ; vds.setPhysicalMemMb ( 15000 ) ; boolean vmPassedMemoryRequirement = org.ovirt.engine.core.bll.scheduling.SlaValidator.getInstance ( ) . hasOvercommitMemoryToRunVM ( vds , vm ) ; org.junit.Assert.assertTrue ( vmPassedMemoryRequirement ) ; }
Source:
public static void getTemplateListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
protected void verify ( org.ovirt.engine.api.model.ExternalHost model , org.ovirt.engine.api.model.ExternalHost transform ) { assertNotNull ( transform ) ; assertEquals ( model.getId ( ) , transform.getId ( ) ) ; assertEquals ( model.getName ( ) , transform.getName ( ) ) ; assertEquals ( model.getAddress ( ) , transform.getAddress ( ) ) ; }

Target:
protected void verify ( org.ovirt.engine.api.model.ExternalHost model , org.ovirt.engine.api.model.ExternalHost transform ) { org.junit.Assert.assertNotNull ( transform ) ; org.junit.Assert.assertEquals ( model.getId ( ) , transform.getId ( ) ) ; org.junit.Assert.assertEquals ( model.getName ( ) , transform.getName ( ) ) ; org.junit.Assert.assertEquals ( model.getAddress ( ) , transform.getAddress ( ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.FenceAgent getSecondaryAgent ( java.util.List < org.ovirt.engine.core.common.businessentities.FenceAgent > fenceAgents ) { assert ! ( fenceAgents.isEmpty ( ) ) ; if ( ( fenceAgents.size ( ) ) == 1 ) { fenceAgents.add ( new org.ovirt.engine.core.common.businessentities.FenceAgent ( ) ) ; } return fenceAgents.get ( 1 ) ; }

Target:
private static org.ovirt.engine.core.common.businessentities.pm.FenceAgent getSecondaryAgent ( java.util.List < org.ovirt.engine.core.common.businessentities.pm.FenceAgent > fenceAgents ) { assert ! ( fenceAgents.isEmpty ( ) ) ; if ( ( fenceAgents.size ( ) ) == 1 ) { fenceAgents.add ( new org.ovirt.engine.core.common.businessentities.pm.FenceAgent ( ) ) ; } return fenceAgents.get ( 1 ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel createUnmanagedNetworkModel ( java.lang.String networkName , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.Network unmanagedNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unmanagedNetwork.setname ( networkName ) ; unmanagedNetwork.setvlan_id ( nic.getVlanId ( ) ) ; unmanagedNetwork.setMtu ( nic.getMtu ( ) ) ; unmanagedNetwork.setVmNetwork ( nic.isBridged ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel = new org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ( unmanagedNetwork , this ) ; networkMap.put ( networkName , networkModel ) ; return networkModel ; }

Target:
private org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel createUnmanagedNetworkModel ( java.lang.String networkName , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { org.ovirt.engine.core.common.businessentities.network.Network unmanagedNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unmanagedNetwork.setName ( networkName ) ; unmanagedNetwork.setVlanId ( nic.getVlanId ( ) ) ; unmanagedNetwork.setMtu ( nic.getMtu ( ) ) ; unmanagedNetwork.setVmNetwork ( nic.isBridged ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkModel = new org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ( unmanagedNetwork , this ) ; networkMap.put ( networkName , networkModel ) ; return networkModel ; }
Source:
public static void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { 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.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public void getVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private static int getFirstImage ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images , org.ovirt.engine.core.common.businessentities.DiskImage curr ) { for ( int i = 0 ; i < ( images.size ( ) ) ; i ++ ) { if ( curr.getParentId ( ) . equals ( images.get ( i ) . getImageId ( ) ) ) { return i ; } } return - 1 ; }

Target:
public org.ovirt.engine.core.common.action.ImportVmParameters getParameters ( ) { return super . getParameters ( ) ; }
Source:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public int compare ( org.ovirt.engine.core.common.migration.MigrationPolicy m1 , org.ovirt.engine.core.common.migration.MigrationPolicy m2 ) { if ( NoMigrationPolicy.ID.equals ( m1.getId ( ) ) ) { return - 1 ; } return m1.getName ( ) . compareTo ( m2.getName ( ) ) ; }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void validatePatternBasedPoolName ( ) { java.lang.String patternBaseName = "aa-??bb" ; command.getParameters ( ) . getVmStaticData ( ) . setName ( patternBaseName ) ; command.getParameters ( ) . getVmPool ( ) . setName ( patternBaseName ) ; org.junit.Assert.assertTrue ( command.validateInputs ( ) ) ; }

Target:
public void validateBeanValidations ( ) { org.junit.jupiter.api.Assertions.assertTrue ( command.validateInputs ( ) ) ; }
Source:
public void autoLogin ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { loggingInAutomatically = true ; getUserName ( ) . setEntity ( user.getLoginName ( ) ) ; getDomain ( ) . setSelectedItem ( user.getDomain ( ) ) ; disableLoginScreen ( ) ; setLoggedUser ( user ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . setLoggedInUser ( user ) ; raiseLoggedInEvent ( ) ; }

Target:
public void autoLogin ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { loggingInAutomatically = true ; getUserName ( ) . setEntity ( user.getLoginName ( ) ) ; getProfile ( ) . setSelectedItem ( user.getDomain ( ) ) ; disableLoginScreen ( ) ; setLoggedUser ( user ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . setLoggedInUser ( user ) ; raiseLoggedInEvent ( ) ; }
Source:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN ) ; }

Target:
public void canDoActionNotEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmForSpace ( ) ; initVmDiskImage ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithoutSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ; }
Source:
public void testUpdateFieldsQuotaEnforcementType ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.DISABLED ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.HARD_ENFORCEMENT ) ; org.junit.Assert.assertTrue ( "Update should be valid for different quota enforcement types" , VmTemplateHandler.mUpdateVmTemplate.IsUpdateValid ( src , dest ) ) ; }

Target:
public void testUpdateFieldsQuotaEnforcementType ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.DISABLED ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setQuotaEnforcementType ( QuotaEnforcementTypeEnum.HARD_ENFORCEMENT ) ; org.junit.Assert.assertTrue ( "Update should be valid for different quota enforcement types" , org.ovirt.engine.core.bll.VmTemplateHandler.isUpdateValid ( src , dest ) ) ; }
Source:
public void setItems ( java.lang.Iterable value ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( value != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Disk > cast ( value ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; org.ovirt.engine.ui.uicommonweb.Linq.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; super . setItems ( disks ) ; updateActionAvailability ( ) ; }

Target:
public void setItems ( java.lang.Iterable value ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( value != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.Disk > cast ( value ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; super . setItems ( disks ) ; updateActionAvailability ( ) ; }
Source:
protected boolean buildAndCheckDestStorageDomains ( ) { boolean retValue = true ; if ( diskInfoDestinationMap.isEmpty ( ) ) { retValue = fillDestMap ( ) ; } else { retValue = validateProvidedDestinations ( ) ; } if ( retValue && ( ( getImagesToCheckDestinationStorageDomains ( ) . size ( ) ) != ( diskInfoDestinationMap.size ( ) ) ) ) { log.errorFormat ( "Can not found any default active domain for one of the disks of template with id : {0}" , org.ovirt.engine.core.bll.AddVmCommand.getVmTemplate ( ) . getId ( ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_MISSED_STORAGES_FOR_SOME_DISKS ) ; retValue = false ; } return retValue && ( validateIsImagesOnDomains ( ) ) ; }

Target:
protected boolean buildAndCheckDestStorageDomains ( ) { boolean retValue = true ; if ( diskInfoDestinationMap.isEmpty ( ) ) { retValue = fillDestMap ( ) ; } else { retValue = validateProvidedDestinations ( ) ; } if ( retValue && ( ( getImagesToCheckDestinationStorageDomains ( ) . size ( ) ) != ( diskInfoDestinationMap.size ( ) ) ) ) { log.errorFormat ( "Can not find any default active domain for one of the disks of template with id : {0}" , vmDisksSource.getId ( ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_MISSED_STORAGES_FOR_SOME_DISKS ) ; retValue = false ; } return retValue && ( validateIsImagesOnDomains ( ) ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) return true ; if ( obj == null ) return false ; if ( ( getClass ( ) ) != ( obj.getClass ( ) ) ) return false ; org.ovirt.engine.ui.uicommonweb.models.ApplySearchStringEvent other = ( ( org.ovirt.engine.ui.uicommonweb.models.ApplySearchStringEvent ) ( obj ) ) ; if ( ( searchString ) == null ) { if ( ( other.searchString ) != null ) return false ; } else if ( ! ( searchString.equals ( other.searchString ) ) ) return false ; return true ; }

Target:
public int hashCode ( ) { return java.util.Objects.hashCode ( searchString ) ; }
Source:
public static void isClusterEmpty ( 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.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public static void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.List < org.ovirt.engine.core.common.businessentities.VmRngDevice > devs = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsRngEnabled ( ) . setEntity ( ( ! ( devs.isEmpty ( ) ) ) ) ; getModel ( ) . setRngDevice ( ( devs.isEmpty ( ) ? new org.ovirt.engine.core.common.businessentities.VmRngDevice ( ) : devs.get ( 0 ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > consoleDevices = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; }
Source:
private java.lang.String getEmulatedMachineOfHostInCluster ( org.ovirt.engine.core.common.businessentities.VDS vds ) { return org.ovirt.engine.core.common.utils.ListUtils.firstMatch ( org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > getValue ( ConfigValues.ClusterEmulatedMachines , org.ovirt.engine.core.bll.UpdateVdsGroupCommand.getParameters ( ) . getVdsGroup ( ) . getCompatibilityVersion ( ) . getValue ( ) ) , vds.getSupportedEmulatedMachines ( ) . split ( "," ) ) ; }

Target:
private java.lang.String getEmulatedMachineOfHostInCluster ( org.ovirt.engine.core.common.businessentities.VDS vds ) { java.util.Set < java.lang.String > emulatedMachinesLookup = new java.util.HashSet ( java.util.Arrays.asList ( vds.getSupportedEmulatedMachines ( ) . split ( "," ) ) ) ; return org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > getValue ( ConfigValues.ClusterEmulatedMachines , org.ovirt.engine.core.bll.UpdateVdsGroupCommand.getParameters ( ) . getVdsGroup ( ) . getCompatibilityVersion ( ) . getValue ( ) ) . stream ( ) . filter ( emulatedMachinesLookup :: contains ) . findFirst ( ) . orElse ( null ) ; }
Source:
public void compare ( ) { org.junit.Assert.assertTrue ( ( ( Version.v3_5.compareTo ( Version.v3_6 ) ) == ( - 1 ) ) ) ; org.junit.Assert.assertTrue ( ( ( Version.v3_6.compareTo ( Version.v3_5 ) ) == 1 ) ) ; org.junit.Assert.assertTrue ( ( ( Version.v3_6.compareTo ( new org.ovirt.engine.core.compat.Version ( "3.6" ) ) ) == 0 ) ) ; }

Target:
public void compare ( ) { org.junit.Assert.assertTrue ( ( ( Version.v3_6.compareTo ( Version.v4_0 ) ) == ( - 1 ) ) ) ; org.junit.Assert.assertTrue ( ( ( Version.v4_0.compareTo ( Version.v3_6 ) ) == 1 ) ) ; org.junit.Assert.assertTrue ( ( ( Version.v3_6.compareTo ( new org.ovirt.engine.core.compat.Version ( "3.6" ) ) ) == 0 ) ) ; }
Source:
public void testShouldCheckVmOnClusterUpgrade ( ) { prepareVmToPassValidate ( ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( inClusterUpgradeValidator ) . isVmReadyForUpgrade ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; group.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 1 ) ) . isVmReadyForUpgrade ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }

Target:
public void testShouldCheckVmOnClusterUpgrade ( ) { prepareVmToPassValidate ( ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( inClusterUpgradeValidator ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; group.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; org.mockito.Mockito.verify ( inClusterUpgradeValidator , org.mockito.Mockito.times ( 1 ) ) . isVmReadyForUpgrade ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; }
Source:
public static void getVmNicList ( 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 < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
public static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { 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.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }

Target:
public static void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }
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:
protected void setUpGetPayloadExpectations ( int times ) 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.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ i ] } , payload ) ; } }
Source:
private boolean isAlreadyInRequestedStatus ( ) { org.ovirt.engine.core.vdsbroker.vdsbroker.FenceStatusReturnForXmlRpc result = fenceNode ( FenceActionType.STATUS ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult actionResult = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType.STATUS , result.getXmlRpcStatus ( ) . code , result.getXmlRpcStatus ( ) . message , result.power , result.operationStatus ) ; return ( ( actionResult.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.SUCCESS ) ) && ( ( actionResult.getPowerStatus ( ) ) == ( getRequestedPowerStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getAction ( ) ) ) ) ; }

Target:
private boolean isAlreadyInRequestedStatus ( ) { org.ovirt.engine.core.vdsbroker.vdsbroker.FenceStatusReturn result = fenceNode ( FenceActionType.STATUS ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult actionResult = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType.STATUS , result.getStatus ( ) . code , result.getStatus ( ) . message , result.power , result.operationStatus ) ; return ( ( actionResult.getStatus ( ) ) == ( FenceOperationResult.Status.SUCCESS ) ) && ( ( actionResult.getPowerStatus ( ) ) == ( getRequestedPowerStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getAction ( ) ) ) ) ; }
Source:
private void queryLabels ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getNetworkLabelsByDataCenterId ( getEntity ( ) . getStoragePoolId ( ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { dcLabels = ( ( java.util.SortedSet < java.lang.String > ) ( returnValue ) ) ; initNicModels ( ) ; stopProgress ( ) ; } } ) ) ; }

Target:
private void queryFreeBonds ( ) { org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; asyncQuery.setModel ( this ) ; asyncQuery.asyncCallback = new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > bonds = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; allBonds = bonds ; queryLabels ( ) ; } } ; org.ovirt.engine.core.common.businessentities.VDS vds = getEntity ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsFreeBondsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vds.getId ( ) ) , asyncQuery ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster net_cluster ) { setEnumTitle ( net_cluster.getstatus ( ) ) ; switch ( net_cluster.getstatus ( ) ) { case Operational : return getApplicationResources ( ) . upImage ( ) ; case NonOperational : return getApplicationResources ( ) . downImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster net_cluster ) { setEnumTitle ( net_cluster.getstatus ( ) ) ; switch ( net_cluster.getstatus ( ) ) { case OPERATIONAL : return getApplicationResources ( ) . upImage ( ) ; case NON_OPERATIONAL : return getApplicationResources ( ) . downImage ( ) ; default : return getApplicationResources ( ) . downImage ( ) ; } }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.UnlabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.NIC_ID , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.UnlabelNic , org.ovirt.engine.core.common.action.LabelNicParameters.class , new java.lang.String [ ] { "NicId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.NIC_ID , org.ovirt.engine.api.restapi.resource.BackendHostNicLabelResourceTest.LABELS [ 0 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; if ( storageListModel.removeConnection ) { storageListModel.cleanConnection ( storageListModel.connection , storageListModel.hostId ) ; storageListModel.removeConnection = false ; } storageListModel.OnFinish ( storageListModel.context , false , storageListModel.storageModel ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; if ( storageListModel.removeConnection ) { storageListModel.cleanConnection ( storageListModel.connection , storageListModel.hostId ) ; storageListModel.removeConnection = false ; } storageListModel.OnFinish ( storageListModel.context , false , storageListModel.storageModel ) ; }