auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , boolean isRefresh ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public void testVmFailNoDisks ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( vm , null , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , false , VdcBllMessages.VM_CANNOT_RUN_FROM_DISK_WITHOUT_DISK ) ; }

Target:
public void canRunVmFailVmRunning ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; org.mockito.Mockito.doReturn ( false ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }
Source:
public void getMaxNumOfCPUsPerSocket ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getMaxNumOfCPUsPerSocket ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected boolean canDoAction ( ) { boolean retValue = true ; if ( ( disk ) == null ) { retValue = false ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } if ( retValue ) { buildSharedLockMap ( ) ; retValue = org.ovirt.engine.core.bll.RemoveDiskCommand.acquireLockInternal ( ) ; } retValue = retValue && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? canRemoveDiskBasedOnImageStorageCheck ( ) : canRemoveLunDisk ( ) ) ; return retValue ; }

Target:
protected boolean canDoAction ( ) { boolean retValue = true ; if ( ( getDisk ( ) ) == null ) { retValue = false ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } if ( retValue ) { buildSharedLockMap ( ) ; retValue = org.ovirt.engine.core.bll.RemoveDiskCommand.acquireLockInternal ( ) ; } retValue = retValue && ( ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? canRemoveDiskBasedOnImageStorageCheck ( ) : canRemoveLunDisk ( ) ) ; return retValue ; }
Source:
public void testGetByServerId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > services = dao.getByServerId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVER1_ID ) ) ; org.junit.Assert.assertNotNull ( services ) ; org.junit.Assert.assertEquals ( 1 , services.size ( ) ) ; verifyServiceOnServer1 ( services.get ( 0 ) ) ; }

Target:
public void testGetByServerId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > services = dao.getByServerId ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.SERVER1_ID ) ) ; org.junit.Assert.assertNotNull ( services ) ; org.junit.Assert.assertEquals ( 1 , services.size ( ) ) ; verifyServiceOnServer1 ( services.get ( 0 ) ) ; }
Source:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }

Target:
public static 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 ) ; }
Source:
public void testValidateFieldValueWithTime ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AuditLogConditionFieldAutoCompleter ( ) ; java.lang.String dateString = "01/12/1972" ; org.junit.Assert.assertTrue ( dateString , comp.validateFieldValue ( "TIME" , dateString ) ) ; org.junit.Assert.assertFalse ( "SOME_RANDOM_TEXT" , comp.validateFieldValue ( "TIME" , "SOME_RANDOM_TEXT" ) ) ; }

Target:
public void testValidateFieldValueWithTime ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AuditLogConditionFieldAutoCompleter ( ) ; java.lang.String dateString = "01/12/1972" ; org.junit.jupiter.api.Assertions.assertTrue ( comp.validateFieldValue ( "TIME" , dateString ) , dateString ) ; org.junit.jupiter.api.Assertions.assertFalse ( comp.validateFieldValue ( "TIME" , "SOME_RANDOM_TEXT" ) , "SOME_RANDOM_TEXT" ) ; }
Source:
public void isConnWithSameDetailsExistCheckSameConn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "user1" , "mypassword123" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; connections.add ( newISCSIConnection ) ; org.mockito.Mockito.when ( storageConnDao.getAllForConnection ( newISCSIConnection ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }

Target:
public void isConnWithSameDetailsExistBlockDomains ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection1 = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; connections.add ( connection1 ) ; org.mockito.Mockito.when ( storageConnDao.getAllForConnection ( newISCSIConnection ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertTrue ( isExists ) ; }
Source:
public void run ( ) { updateDestinationVdsOnTimer ( vdsManager , vm ) ; }

Target:
public void run ( ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDynamicDao ( ) . updatePartialVdsDynamicCalc ( dstVdsId , 1 , vm.getNumOfCpus ( ) , vm.getMinAllocatedMem ( ) , 0 , 0 ) ; org.ovirt.engine.core.vdsbroker.MigrateVDSCommand.log.debugFormat ( "IncreasePendingVms::MigrateVm Increasing vds {0} pending vcpu count, in {1}, and pending vmem size, in {2}. Vm: {3}" , dstVdsId , vm.getNumOfCpus ( ) , vm.getMinAllocatedMem ( ) , vm.getName ( ) ) ; }
Source:
public void refuseBalloonOnPPC ( ) { setupCanAddPpcTest ( ) ; cmd.getParameters ( ) . setBalloonEnabled ( true ) ; org.mockito.Mockito.when ( osRepository.isBalloonEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getCluster ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; }

Target:
public void refuseBalloonOnPPC ( ) { setupCanAddPpcTest ( ) ; cmd.getParameters ( ) . setBalloonEnabled ( true ) ; org.mockito.Mockito.when ( osRepository.isBalloonEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getCluster ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; }
Source:
public void getStorageDomainList ( 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.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase removeVmImages ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalAction ( VdcActionType.RemoveAllVmImages , buildRemoveAllVmImagesParameters ( images ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContexForTasks ( getExecutionContext ( ) ) ) ; if ( vdcRetValue.getSucceeded ( ) ) { getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return vdcRetValue ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase removeVmImages ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.RemoveAllVmImages , buildRemoveAllVmImagesParameters ( images ) ) ; if ( vdcRetValue.getSucceeded ( ) ) { getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } return vdcRetValue ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getBroker ( ) . connectStorageServer ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , BuildStructFromConnectionListObject ( ) ) ; proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.String > returnValue = _result.convertToStatusList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.setReturnValue ( returnValue ) ; logFailedStorageConnections ( returnValue ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getBroker ( ) . connectStorageServer ( org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStorageType ( ) . getValue ( ) , org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.getParameters ( ) . getStoragePoolId ( ) . toString ( ) , BuildStructFromConnectionListObject ( ) ) ; proceedProxyReturnValue ( ) ; java.util.Map < java.lang.String , java.lang.String > returnValue = _result.convertToStatusList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ConnectStorageServerVDSCommand.setReturnValue ( returnValue ) ; logFailedStorageConnections ( returnValue ) ; }
Source:
public void testBootProtocolSetForRoleNetworkWhenIpConfigurationIsNull ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , true , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenIpConfigurationIsNull ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( Ipv4BootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , true , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }
Source:
public void testSave ( ) { newVmStatistics.setId ( newVmStatic.getId ( ) ) ; dao.save ( newVmStatistics ) ; org.ovirt.engine.core.common.businessentities.VmStatistics stats = dao.get ( newVmStatic.getId ( ) ) ; org.junit.Assert.assertNotNull ( stats ) ; org.junit.Assert.assertEquals ( newVmStatistics , stats ) ; }

Target:
public void testSave ( ) { newVmStatistics.setId ( newVmStatic.getId ( ) ) ; newVmStatistics.setMigrationProgressPercent ( 0 ) ; dao.save ( newVmStatistics ) ; org.ovirt.engine.core.common.businessentities.VmStatistics stats = dao.get ( newVmStatic.getId ( ) ) ; org.junit.Assert.assertNotNull ( stats ) ; org.junit.Assert.assertEquals ( newVmStatistics , stats ) ; }
Source:
public void setSelectedItem ( T value ) { if ( ( selectedItem ) != value ) { onSelectedItemChanging ( value , selectedItem ) ; selectedItem = value ; onSelectedItemChanged ( ) ; getSelectedItemChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SelectedItem" ) ) ; } }

Target:
public void setSelectedItem ( T value ) { if ( ( selectedItem ) != value ) { onSelectedItemChanging ( value , selectedItem ) ; selectedItem = value ; onSelectedItemChanged ( ) ; getSelectedItemChangedEvent ( ) . raise ( this , EventArgs.EMPTY ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "SelectedItem" ) ) ; } }
Source:
public void providerIsDefaultProviderOfCluster ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster0 = mockCluster ( "0" ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster1 = mockCluster ( "1" ) ; org.junit.Assert.assertThat ( validator.providerIsNoDefaultProvider ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_PROVIDER_USED_IN_CLUSTER ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( cluster0.getName ( ) ) ) ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( cluster1.getName ( ) ) ) ) ) ) ; }

Target:
public void providerIsDefaultProviderOfCluster ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster0 = mockCluster ( "0" ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster1 = mockCluster ( "1" ) ; org.hamcrest.MatcherAssert.assertThat ( validator.providerIsNoDefaultProvider ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_PROVIDER_USED_IN_CLUSTER ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( cluster0.getName ( ) ) ) ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.hamcrest.CoreMatchers.containsString ( cluster1.getName ( ) ) ) ) ) ) ; }
Source:
public void processOnVmStop ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.bll.VmPoolHandler.processVmPoolOnStopVm ( vmId , null ) ; }

Target:
public void processOnVmStop ( final java.util.Collection < org.ovirt.engine.core.compat.Guid > vmIds ) { org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmIds ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.ProcessDownVm , new org.ovirt.engine.core.common.action.IdParameters ( vmId ) ) ; } } } ) ; }
Source:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.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.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }

Target:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.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.GetAllVmsWithNumaByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findPrincipalsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.util.List < java.lang.String > ids ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipals ( extension , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.PRINCIPAL ) , true ) ) ; } return results ; }

Target:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > findPrincipalsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.util.List < java.lang.String > ids ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipals ( extension , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.PRINCIPAL ) , true ) ) ; } return results ; }
Source:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_PLACE ) ; bindResourceConfiguration ( org.ovirt.engine.ui.webadmin.ApplicationConstants.class , org.ovirt.engine.ui.webadmin.ApplicationMessages.class , org.ovirt.engine.ui.webadmin.ApplicationResources.class , org.ovirt.engine.ui.webadmin.ApplicationTemplates.class , org.ovirt.engine.ui.webadmin.ApplicationDynamicMessages.class ) ; }

Target:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( WebAdminApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( WebAdminApplicationPlaces.DEFAULT_MAIN_SECTION_PLACE ) ; bindResourceConfiguration ( org.ovirt.engine.ui.webadmin.ApplicationConstants.class , org.ovirt.engine.ui.webadmin.ApplicationMessages.class , org.ovirt.engine.ui.webadmin.ApplicationResources.class , org.ovirt.engine.ui.webadmin.ApplicationTemplates.class , org.ovirt.engine.ui.webadmin.ApplicationDynamicMessages.class ) ; }
Source:
private static void getIrsImageList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < java.lang.String > > aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean forceRefresh , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageFileType , org.ovirt.engine.ui.frontend.Converter < java.util.List < java.lang.String > , java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > > converterCallBack ) { aQuery.converterCallback = converterCallBack ; org.ovirt.engine.core.common.queries.GetImagesListByStoragePoolIdParameters parameters = new org.ovirt.engine.core.common.queries.GetImagesListByStoragePoolIdParameters ( storagePoolId , imageFileType ) ; parameters.setForceRefresh ( forceRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( QueryType.GetImagesListByStoragePoolId , parameters , aQuery ) ; }

Target:
private static < T > void getIrsImageList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < T > > aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean forceRefresh , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageFileType , org.ovirt.engine.ui.frontend.Converter < java.util.List < T > , java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > > converterCallBack ) { if ( converterCallBack != null ) { aQuery.converterCallback = converterCallBack ; } org.ovirt.engine.core.common.queries.GetImagesListByStoragePoolIdParameters parameters = new org.ovirt.engine.core.common.queries.GetImagesListByStoragePoolIdParameters ( storagePoolId , imageFileType ) ; parameters.setForceRefresh ( forceRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( QueryType.GetImagesListByStoragePoolId , parameters , aQuery ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.OpenStackSubnet model , int index ) { org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.utils.HexUtils.string2hex ( NAMES [ index ] ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.OpenStackSubnet model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.utils.HexUtils.string2hex ( NAMES [ index ] ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( NAMES [ index ] , model.getName ( ) ) ; verifyLinks ( model ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( asList ( getEntity ( 1 ) ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveSnapshot , org.ovirt.engine.core.common.action.RemoveSnapshotParameters.class , new java.lang.String [ ] { "SnapshotId" , "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.SNAPSHOT_ID , org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.VM_ID } , 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 ) { setUpGetEntityExpectations ( asList ( getEntity ( 1 ) ) ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveSnapshot , org.ovirt.engine.core.common.action.RemoveSnapshotParameters.class , new java.lang.String [ ] { "SnapshotId" , "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.SNAPSHOT_ID , org.ovirt.engine.api.restapi.resource.BackendSnapshotResourceTest.VM_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private static org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion computeTemplateWithVersionToSelect ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion > newItems , org.ovirt.engine.core.compat.Guid previousTemplateId , boolean useLatest ) { if ( previousTemplateId == null ) { return org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.computeNewTemplateWithVersionToSelect ( newItems ) ; } org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion oldTemplateToSelect = org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.TemplateWithVersionPredicate ( previousTemplateId , useLatest ) ) ; return oldTemplateToSelect != null ? oldTemplateToSelect : org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.computeNewTemplateWithVersionToSelect ( newItems ) ; }

Target:
private static org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion computeTemplateWithVersionToSelect ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion > newItems , org.ovirt.engine.core.compat.Guid previousTemplateId , boolean useLatest , boolean addLatest ) { if ( previousTemplateId == null ) { return org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.computeNewTemplateWithVersionToSelect ( newItems , addLatest ) ; } org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion oldTemplateToSelect = org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( newItems , new org.ovirt.engine.ui.uicommonweb.Linq.TemplateWithVersionPredicate ( previousTemplateId , useLatest ) ) ; return oldTemplateToSelect != null ? oldTemplateToSelect : org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.computeNewTemplateWithVersionToSelect ( newItems , addLatest ) ; }
Source:
public java.lang.Boolean getValue ( ) { boolean allEntriesDisabled = ! ( isEnabled ( ) ) ; for ( org.ovirt.engine.ui.uicommonweb.models.hosts.VfsConfigNetwork vfsConfigNetwork : getNetworksTableItems ( ) ) { if ( allEntriesDisabled || ( canEditAssign ( vfsConfigNetwork ) ) ) { if ( ! ( vfsConfigNetwork.isAttached ( ) ) ) { return false ; } } } return true ; }

Target:
private boolean shouldNetworkBeDisplayedAsAttached ( org.ovirt.engine.ui.uicommonweb.models.hosts.VfsConfigNetwork vfsConfigNetwork ) { return ( vfsConfigNetwork.isAttached ( ) ) || ( vfsConfigNetwork.isAttachedViaLabel ( ) ) ; }
Source:
public void testFindSingleDcNetwork ( ) { org.mockito.Mockito.when ( mockNetworkDao.getAllForDataCenter ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( java.util.Collections.singletonList ( mockNetwork ) ) ; org.mockito.Mockito.when ( mockManagementNetworkCandidatePredicate.eval ( mockNetwork ) ) . thenReturn ( true ) ; final org.ovirt.engine.core.common.businessentities.network.Network actual = underTest.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ; org.junit.Assert.assertSame ( actual , mockNetwork ) ; }

Target:
public void testFindSingleDcNetwork ( ) { org.mockito.Mockito.when ( mockNetworkDao.getAllForDataCenter ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ) . thenReturn ( java.util.Collections.singletonList ( mockNetwork ) ) ; org.mockito.Mockito.when ( mockManagementNetworkCandidatePredicate.test ( mockNetwork ) ) . thenReturn ( true ) ; final org.ovirt.engine.core.common.businessentities.network.Network actual = underTest.findDefaultManagementNetwork ( org.ovirt.engine.core.bll.network.cluster.DefaultManagementNetworkFinderImplTest.TEST_DC_ID ) ; org.junit.Assert.assertSame ( actual , mockNetwork ) ; }
Source:
public void mapBackendModel ( ) { for ( org.ovirt.engine.core.common.businessentities.VmWatchdogType type : org.ovirt.engine.core.common.businessentities.VmWatchdogType.values ( ) ) { org.ovirt.engine.api.restapi.types.WatchdogModel model = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( type , null ) ; org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertEquals ( model.name ( ) . toLowerCase ( ) , type.name ( ) . toLowerCase ( ) ) ; } }

Target:
public void mapBackendModel ( ) { for ( org.ovirt.engine.core.common.businessentities.VmWatchdogType type : org.ovirt.engine.core.common.businessentities.VmWatchdogType.values ( ) ) { org.ovirt.engine.api.model.WatchdogModel model = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( type , null ) ; org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertEquals ( model.name ( ) . toLowerCase ( ) , type.name ( ) . toLowerCase ( ) ) ; } }
Source:
public void onChange ( com.google.gwt.event.dom.client.ChangeEvent event ) { int selectedIndex = bootSequenceBox.getSelectedIndex ( ) ; bootSequenceModel.setSelectedItem ( bootSequenceModel.getItems ( ) . get ( selectedIndex ) ) ; bootSequenceUpButton.setEnabled ( bootSequenceModel.getMoveItemUpCommand ( ) . getIsExecutionAllowed ( ) ) ; bootSequenceDownButton.setEnabled ( bootSequenceModel.getMoveItemDownCommand ( ) . getIsExecutionAllowed ( ) ) ; localizeBootSequenceButtons ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean isEnabled = bootSequenceModel.getNetworkOption ( ) . getIsChangable ( ) ; java.lang.String itemName = bootSequenceModel.getNetworkOption ( ) . getTitle ( ) ; updateItemAvailability ( itemName , isEnabled ) ; }
Source:
public void onSucceeded ( ) { syncDbRecords ( true ) ; org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.log.info ( "Successfully merged snapshot '{}' images '{}'..'{}'" , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDiskImage ( ) . getImage ( ) . getSnapshotId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDiskImage ( ) . getImageId ( ) , ( ( org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDestinationDiskImage ( ) ) != null ? org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDestinationDiskImage ( ) . getImageId ( ) : "(n/a)" ) ) ; }

Target:
public void onSucceeded ( ) { syncDbRecords ( getTargetImageInfoFromVdsm ( ) , true ) ; org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.log.info ( "Successfully merged snapshot '{}' images '{}'..'{}'" , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDiskImage ( ) . getImage ( ) . getSnapshotId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDiskImage ( ) . getImageId ( ) , ( ( org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDestinationDiskImage ( ) ) != null ? org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskLiveCommand.getDestinationDiskImage ( ) . getImageId ( ) : "(n/a)" ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isStorageDomainCompatibleWithDC ( ) { if ( ( storageDomainStatic.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) { return isGlusterSupportedInDC ( ) ; } if ( ( storageDomainStatic.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.POSIXFS ) ) { return isPosixSupportedInDC ( ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isStorageDomainTypeSupportedInPool ( ) { if ( ( storageDomainStatic.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) { return isGlusterSupportedInDC ( ) ; } if ( ( storageDomainStatic.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.POSIXFS ) ) { return isPosixSupportedInDC ( ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static java.util.List < java.lang.Integer > getOsIds ( ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.osIds ; }

Target:
public static java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > getIsoStorageModels ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > models = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel nfsIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.NfsStorageModel ( ) ; models.add ( nfsIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel posixIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.PosixStorageModel ( ) ; models.add ( posixIsoModel ) ; org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel localIsoModel = new org.ovirt.engine.ui.uicommonweb.models.storage.LocalStorageModel ( ) ; models.add ( localIsoModel ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.addTypeToStorageModels ( StorageDomainType.ISO , models ) ; return models ; }
Source:
public static java.util.List < org.ovirt.engine.core.compat.Guid > fetchDomainsReportedAsProblematic ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainsData ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { return proxy.obtainDomainsReportedAsProblematic ( vdsDomainsData ) ; } return java.util.Collections.emptyList ( ) ; }

Target:
public static java.util.List < org.ovirt.engine.core.compat.Guid > fetchDomainsReportedAsProblematic ( org.ovirt.engine.core.compat.Guid storagePoolId , java.util.List < org.ovirt.engine.core.common.businessentities.VDSDomainsData > vdsDomainsData ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxy = org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( storagePoolId ) ; if ( proxy != null ) { return proxy.obtainDomainsReportedAsProblematic ( vdsDomainsData ) ; } return java.util.Collections.emptyList ( ) ; }
Source:
private void createStorageDomain ( ) { storageDomain = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; storageDomain.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; }

Target:
public void validateFailsDiscardFunctionalityBreaks ( ) { passAllValidations ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( discardHelper ) . isExistingDiscardFunctionalityPreserved ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.LUNs.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_LUN_BREAKS_STORAGE_DOMAIN_DISCARD_SUPPORT ) ; }
Source:
public void testAddSetAndUploadIconFailure ( ) throws java.lang.Exception { final org.ovirt.engine.api.model.Template restModel = getRestModel ( 0 ) ; restModel.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; restModel.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( restModel ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }

Target:
public void testAddSetAndUploadIconFailure ( ) throws java.lang.Exception { final org.ovirt.engine.api.model.Template restModel = getRestModel ( 0 ) ; restModel.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; restModel.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( restModel ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }
Source:
private void updateActionAvailability ( ) { boolean isItemSelected = ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItems ( ) ) != null ) ) && ( ( getSelectedItems ( ) . size ( ) ) > 0 ) ; boolean isDomainActive = ( ( getEntity ( ) ) != null ) && ( ( getEntity ( ) . getStorageDomainSharedStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Active ) ) ; getImportCommand ( ) . setIsExecutionAllowed ( ( isItemSelected && isDomainActive ) ) ; }

Target:
private void updateActionAvailability ( ) { boolean isItemSelected = ( ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterEntityListModel.getSelectedItems ( ) ) != null ) && ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterEntityListModel.getSelectedItems ( ) ) != null ) ) && ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterEntityListModel.getSelectedItems ( ) . size ( ) ) > 0 ) ; boolean isDomainActive = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterEntityListModel.getEntity ( ) ) != null ) && ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageRegisterEntityListModel.getEntity ( ) . getStorageDomainSharedStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainSharedStatus.Active ) ) ; getImportCommand ( ) . setIsExecutionAllowed ( ( isItemSelected && isDomainActive ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > setUpLuns ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun.setLUN_id ( GUIDS [ 2 ] . toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = new java.util.ArrayList < > ( ) ; luns.add ( lun ) ; return luns ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > setUpLuns ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun.setLUNId ( GUIDS [ 2 ] . toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns = new java.util.ArrayList < > ( ) ; luns.add ( lun ) ; return luns ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.permissions > getAllForAdElement ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "ad_element_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetPermissionsByAdElementId" , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.permissions > getAllForAdElement ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { java.lang.Integer appMode = org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.ApplicationMode ) ; org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "ad_element_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) . addValue ( "app_mode" , appMode.intValue ( ) ) ; return getCallsHandler ( ) . executeReadList ( "GetPermissionsByAdElementId" , org.ovirt.engine.core.dao.PermissionDAODbFacadeImpl.PermissionRowMapper.instance , parameterSource ) ; }
Source:
public static void getMaximalVmMemSize32OS ( 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 ) ) . intValue ( ) : 20480 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , 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:
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 ) ; } }

Target:
private void setUpGetSoundcardExpectations ( int ... idxs ) throws java.lang.Exception { for ( int i = 0 ; i < ( idxs.length ) ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetSoundDevices , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ idxs [ i ] ] } , new java.util.ArrayList < > ( ) ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > getCommandsWithCallBackEnabled ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > cmdEntities = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ; for ( org.ovirt.engine.core.compat.Guid cmdId : commandsCache.keySet ( ) ) { cmdEntity = commandsCache.get ( cmdId ) ; if ( commandsCache.get ( cmdId ) . isCallBackEnabled ( ) ) { cmdEntities.add ( cmdEntity ) ; } } return cmdEntities ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > getCommandsWithCallbackEnabled ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > cmdEntities = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ; for ( org.ovirt.engine.core.compat.Guid cmdId : commandsCache.keySet ( ) ) { cmdEntity = commandsCache.get ( cmdId ) ; if ( commandsCache.get ( cmdId ) . isCallbackEnabled ( ) ) { cmdEntities.add ( cmdEntity ) ; } } return cmdEntities ; }