auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected abstract void performProfilesActions ( org.ovirt.engine.core.compat.Guid networkGuid ) ;

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ! ( newModel.getName ( ) . getEntity ( ) . equals ( getName ( ) . getEntity ( ) ) ) ) { getName ( ) . getEntityChangedEvent ( ) . removeListener ( networkNameListener ) ; newModel.getName ( ) . getEntityChangedEvent ( ) . removeListener ( this ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalDiscoveredHostsListModel = getExternalDiscoveredHosts ( ) ; externalDiscoveredHostsListModel.setItems ( hosts ) ; externalDiscoveredHostsListModel.setIsChangable ( true ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.common.businessentities.Provider > providersListModel = getProviders ( ) ; providersListModel.setItems ( providers , org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( providers ) ) ; providersListModel.setIsChangable ( true ) ; getIsDiscoveredHosts ( ) . setEntity ( null ) ; getIsDiscoveredHosts ( ) . setEntity ( true ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkAttachmentDao , networkDao , vdsDao , org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorHelper.class ) ) ; return validator.validate ( ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkDao , vdsDao , hostSetupNetworksValidatorHelper , vmDao , effectiveHostNetworkQos ) ; return validator.validate ( ) ; }
Source:
public static void getAttachedTagsToVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.setAttachedTagsConverter ( aQuery ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetTagsByVmId , new org.ovirt.engine.core.common.queries.GetTagsByVmIdParameters ( id.toString ( ) ) , aQuery ) ; }

Target:
public static void getDefaultSpmPriority ( 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 ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 5 ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolDao ( ) ; existingPool = dao.get ( new org.ovirt.engine.core.compat.Guid ( "6d849ebf-755f-4552-ad09-9a090cda105d" ) ) ; existingPool.setStatus ( StoragePoolStatus.Up ) ; vds = new org.ovirt.engine.core.compat.Guid ( "afce7a39-8e8c-4819-ba9c-796d316592e6" ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; storageDomain = new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ; newPool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; newPool.setName ( "newPoolDude" ) ; newPool.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getStoragePoolDao ( ) ; existingPool = dao.get ( FixturesTool.DATA_CENTER ) ; existingPool.setStatus ( StoragePoolStatus.Up ) ; vds = new org.ovirt.engine.core.compat.Guid ( "afce7a39-8e8c-4819-ba9c-796d316592e6" ) ; cluster = new org.ovirt.engine.core.compat.Guid ( "b399944a-81ab-4ec5-8266-e19ba7c3c9d1" ) ; storageDomain = new org.ovirt.engine.core.compat.Guid ( "72e3a666-89e1-4005-a7ca-f7548004a9ab" ) ; newPool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; newPool.setName ( "newPoolDude" ) ; newPool.setCompatibilityVersion ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkDao , vdsDao , hostSetupNetworksValidatorHelper , vmDao ) ; return validator.validate ( ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateWithHostSetupNetworksValidator ( org.ovirt.engine.core.common.businessentities.VDS host ) { org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator ( host , org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getParameters ( ) , getExistingNics ( ) , getExistingAttachments ( ) , getNetworkBusinessEntityMap ( ) , managementNetworkUtil , networkClusterDao , networkDao , vdsDao , hostSetupNetworksValidatorHelper , vmDao , networkExclusivenessValidatorResolver ) ; return validator.validate ( ) ; }
Source:
private static void testKeyString ( final java.lang.String keyEncoding , final java.lang.String goodKeyString ) throws java.lang.Exception { final java.security.PublicKey key = org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.decodeKey ( keyEncoding ) ; final java.lang.String keyString = org.ovirt.engine.core.uutils.ssh.OpenSSHUtils.getKeyString ( key , null ) ; org.junit.Assert.assertEquals ( goodKeyString , keyString ) ; }

Target:
private static void testKeyString ( final java.lang.String keyEncoding , final java.lang.String goodKeyString ) throws java.lang.Exception { final java.security.PublicKey key = org.ovirt.engine.core.uutils.ssh.OpenSSHUtilsTest.decodeKey ( keyEncoding ) ; final java.lang.String keyString = org.ovirt.engine.core.uutils.ssh.OpenSSHUtils.getKeyString ( key , null ) ; org.junit.Assert.assertEquals ( goodKeyString , keyString ) ; org.junit.Assert.assertEquals ( key , org.ovirt.engine.core.uutils.ssh.OpenSSHUtils.decodeKeyString ( keyString ) ) ; }
Source:
protected boolean verifyAddVM ( org.ovirt.engine.core.compat.Guid storagePoolId ) { return org.ovirt.engine.core.bll.VmHandler.VerifyAddVm ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , ( ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNetworkInterfaceDAO ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ) , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplate ( ) , storagePoolId , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getpriority ( ) ) ; }

Target:
protected boolean verifyAddVM ( org.ovirt.engine.core.compat.Guid storagePoolId ) { return org.ovirt.engine.core.bll.VmHandler.VerifyAddVm ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , ( ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmsCount ( ) ) * ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmNetworkInterfaceDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplateId ( ) ) . size ( ) ) ) , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getVmTemplate ( ) , storagePoolId , org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getpriority ( ) ) ; }
Source:
public void validateFailsWithForceNotSupported ( ) { org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters parameters = new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( getVolume ( 2 , true ) , true ) ; org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommand command = new org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommand ( parameters ) ; cmd = org.mockito.Mockito.spy ( command ) ; prepareMocks ( cmd ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_ADD_BRICK_FORCE_NOT_SUPPORTED ) ; }

Target:
private void setVolume ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity ) { cmd.getParameters ( ) . setVolume ( volumeEntity ) ; cmd.setGlusterVolumeId ( volumeEntity.getId ( ) ) ; }
Source:
public void validateVmShareableDisk ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED ) ; }

Target:
public void validateVmShareableDisk ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED ) ; }
Source:
protected void asyncSearch ( ) { super . asyncSearch ( ) ; syncSearch ( ) ; }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command.getName ( ) . equals ( "OnRemove" ) ) { onRemove ( ) ; } else if ( command.getName ( ) . equals ( "OnRestore" ) ) { onRestore ( ) ; } else if ( command.getName ( ) . equals ( "onClone" ) ) { onClone ( ) ; } else if ( command.getName ( ) . equals ( "closeClone" ) ) { closeClone ( ) ; } }
Source:
public void mapVmWatchdog ( ) { org.ovirt.engine.core.common.businessentities.VmWatchdog entity = new org.ovirt.engine.core.common.businessentities.VmWatchdog ( ) ; entity.setAction ( VmWatchdogAction.RESET ) ; entity.setModel ( VmWatchdogType.i6300esb ) ; entity.setId ( Guid.Empty ) ; org.ovirt.engine.api.model.WatchDog model = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( entity , null ) ; org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertEquals ( model.getAction ( ) , "reset" ) ; org.junit.Assert.assertEquals ( model.getModel ( ) , "i6300esb" ) ; }

Target:
public void mapVmWatchdog ( ) { org.ovirt.engine.core.common.businessentities.VmWatchdog entity = new org.ovirt.engine.core.common.businessentities.VmWatchdog ( ) ; entity.setAction ( VmWatchdogAction.RESET ) ; entity.setModel ( VmWatchdogType.i6300esb ) ; entity.setId ( Guid.Empty ) ; org.ovirt.engine.api.model.Watchdog model = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( entity , null ) ; org.junit.Assert.assertNotNull ( model ) ; org.junit.Assert.assertEquals ( model.getAction ( ) , "reset" ) ; org.junit.Assert.assertEquals ( model.getModel ( ) , "i6300esb" ) ; }
Source:
protected org.ovirt.engine.api.model.Host deprecatedPopulate ( org.ovirt.engine.api.model.Host model , org.ovirt.engine.core.common.businessentities.VDS entity ) { org.ovirt.engine.api.model.Host host = addStatistics ( model , entity , uriInfo , httpHeaders ) ; addCertificateInfo ( host ) ; return host ; }

Target:
protected org.ovirt.engine.api.model.Host deprecatedPopulate ( org.ovirt.engine.api.model.Host model , org.ovirt.engine.core.common.businessentities.VDS entity ) { java.util.Set < java.lang.String > details = org.ovirt.engine.api.common.util.DetailHelper.getDetails ( httpHeaders , uriInfo ) ; if ( details.contains ( "statistics" ) ) { addStatistics ( model , entity ) ; } addCertificateInfo ( model ) ; return model ; }
Source:
private static org.ovirt.engine.core.common.businessentities.qos.QosBase createNewQosEntityForQosType ( org.ovirt.engine.api.model.QosType qosType ) { switch ( qosType ) { case STORAGE : return new org.ovirt.engine.core.common.businessentities.qos.StorageQos ( ) ; case CPU : return new org.ovirt.engine.core.common.businessentities.qos.CpuQos ( ) ; case NETWORK : return new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; default : throw new java.lang.IllegalArgumentException ( "Unsupported QoS type" ) ; } }

Target:
private static org.ovirt.engine.core.common.businessentities.qos.QosBase createNewQosEntityForQosType ( org.ovirt.engine.api.model.QosType qosType ) { switch ( qosType ) { case STORAGE : return new org.ovirt.engine.core.common.businessentities.qos.StorageQos ( ) ; case CPU : return new org.ovirt.engine.core.common.businessentities.qos.CpuQos ( ) ; case NETWORK : return new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; case HOSTNETWORK : return new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; default : throw new java.lang.IllegalArgumentException ( "Unsupported QoS type" ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { if ( ( listPermissionSubjects ) == null ) { listPermissionSubjects = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; org.ovirt.engine.core.compat.Guid diskId = ( ( oldDisk ) == null ) ? null : oldDisk.getId ( ) ; listPermissionSubjects.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( diskId , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.EDIT_DISK_PROPERTIES ) ) ; } return listPermissionSubjects ; }

Target:
private org.ovirt.engine.core.common.businessentities.Disk getOldDisk ( ) { if ( ( oldDisk ) == null ) { oldDisk = org.ovirt.engine.core.bll.UpdateVmDiskCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getParameters ( ) . getDiskId ( ) ) ; } return oldDisk ; }
Source:
public void generateVersion ( ) { java.lang.String moduleName = rubyNames.getModuleName ( ) ; java.lang.String version = rubyNames.getVersion ( ) ; buffer.beginModule ( moduleName ) ; buffer.addLine ( "VERSION = '%1$s'" , version ) ; buffer.endModule ( moduleName ) ; }

Target:
public void generateVersion ( ) { java.lang.String moduleName = rubyNames.getModuleName ( ) ; java.lang.String version = rubyNames.getVersion ( ) ; buffer.beginModule ( moduleName ) ; buffer.addLine ( "VERSION = '%1$s'" , version.toLowerCase ( ) ) ; buffer.endModule ( moduleName ) ; }
Source:
private void internalEndWithFailure ( ) { log.errorFormat ( "Ending command with failure: {0}" , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { if ( hasStepsToRevert ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; } startPollingAsyncTasks ( ) ; } else { endWithFailure ( ) ; } rollbackQuota ( ) ; }

Target:
private void internalEndWithFailure ( ) { log.errorFormat ( "Ending command with failure: {0}" , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { if ( hasStepsToRevert ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; } else { getReturnValue ( ) . setEndActionTryAgain ( false ) ; } startPollingAsyncTasks ( ) ; } else { endWithFailure ( ) ; } rollbackQuota ( ) ; }
Source:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public void getAncestorImagesByImagesIds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.util.List < org.ovirt.engine.core.compat.Guid > imagesIds ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) { @ java.lang.Override public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.IdsQueryParameters params = new org.ovirt.engine.core.common.queries.IdsQueryParameters ( imagesIds ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAncestorImagesByImagesIds , params , aQuery ) ; }
Source:
public void testGetDisplayLocalesWithUnsupportedHiding2 ( ) { java.util.List < java.lang.String > unSupportedLocales = new java.util.ArrayList < > ( ) ; unSupportedLocales.add ( "de_DE" ) ; java.util.List < java.lang.String > locales = org.ovirt.engine.core.utils.servlet.UnsupportedLocaleHelper.getDisplayedLocales ( allLocales , new java.util.ArrayList < > ( ) , unSupportedLocales ) ; org.junit.Assert.assertNotNull ( "Result should not be null" , locales ) ; org.junit.Assert.assertEquals ( "There should be 7 locales" , 7 , locales.size ( ) ) ; org.junit.Assert.assertFalse ( "Locales should not contain 'de_DE'" , locales.contains ( "de_DE" ) ) ; }

Target:
public void testGetDisplayLocalesWithUnsupportedHiding2 ( ) { java.util.List < java.lang.String > unSupportedLocales = new java.util.ArrayList < > ( ) ; unSupportedLocales.add ( "de_DE" ) ; java.util.List < java.lang.String > locales = org.ovirt.engine.core.utils.servlet.UnsupportedLocaleHelper.getDisplayedLocales ( allLocales , new java.util.ArrayList < > ( ) , unSupportedLocales ) ; org.junit.jupiter.api.Assertions.assertNotNull ( locales , "Result should not be null" ) ; org.junit.jupiter.api.Assertions.assertEquals ( 7 , locales.size ( ) , "There should be 7 locales" ) ; org.junit.jupiter.api.Assertions.assertFalse ( locales.contains ( "de_DE" ) , "Locales should not contain 'de_DE'" ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > prepareServiceInfo ( java.util.Map < java.lang.String , java.lang.Object > statusInfo ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > serviceInfoList = new java.util.ArrayList < > ( ) ; prepareServiceInfo ( statusInfo , serviceInfoList , org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeStatusReturnForXmlRpc.NFS_KEY ) ; prepareServiceInfo ( statusInfo , serviceInfoList , org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeStatusReturnForXmlRpc.SHD_KEY ) ; return serviceInfoList ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > prepareServiceInfo ( java.util.Map < java.lang.String , java.lang.Object > statusInfo ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > serviceInfoList = new java.util.ArrayList < > ( ) ; prepareServiceInfo ( statusInfo , serviceInfoList , org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeStatusReturn.NFS_KEY ) ; prepareServiceInfo ( statusInfo , serviceInfoList , org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeStatusReturn.SHD_KEY ) ; return serviceInfoList ; }
Source:
public void testParamsUpdated ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage readyImage = initReadyImageForUpload ( ) ; transferImageCommand.handleImageIsReadyForTransfer ( ) ; org.junit.Assert.assertEquals ( transferImageCommand.getParameters ( ) . getStorageDomainId ( ) , readyImage.getStorageIds ( ) . get ( 0 ) ) ; org.junit.Assert.assertEquals ( transferImageCommand.getParameters ( ) . getTransferSize ( ) , readyImage.getSize ( ) ) ; }

Target:
public void testParamsUpdated ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage readyImage = initReadyImageForUpload ( ) ; transferImageCommand.handleImageIsReadyForTransfer ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( transferImageCommand.getParameters ( ) . getStorageDomainId ( ) , readyImage.getStorageIds ( ) . get ( 0 ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( transferImageCommand.getParameters ( ) . getTransferSize ( ) , readyImage.getSize ( ) ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Nic device ) { validateEnums ( org.ovirt.engine.api.model.Nic.class , device ) ; return super . add ( device ) ; }

Target:
public org.ovirt.engine.api.model.Nics list ( ) { org.ovirt.engine.api.model.Nics nics = new org.ovirt.engine.api.model.Nics ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > entities = getBackendCollection ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity : entities ) { org.ovirt.engine.api.model.Nic nic = populate ( map ( entity ) , entity ) ; nics.getNics ( ) . add ( addLinks ( nic ) ) ; } return nics ; }
Source:
public void labelNotInVfsConfigNotValid ( ) { labelInVfsConfigCommonTest ( true ) ; org.junit.Assert.assertThat ( validator.labelNotInVfsConfig ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.LABEL ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_LABEL_ALREADY_IN_VFS_CONFIG , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.LABEL_REPLACEMENT , org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.LABEL ) ) ) ; }

Target:
public void labelNotInVfsConfigNotValid ( ) { labelInVfsConfigCommonTest ( true ) ; org.junit.Assert.assertThat ( validator.labelNotInVfsConfig ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.LABEL ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_LABEL_ALREADY_IN_VFS_CONFIG , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.LABEL_REPLACEMENT , org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.LABEL ) ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroupWithOlderVersion ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createNewVdsGroup ( ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_0 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DC_ID1 ) ; return group ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VDSGroup createVdsGroupWithOlderVersion ( boolean supportsVirtService , boolean supportsGlusterService ) { org.ovirt.engine.core.common.businessentities.VDSGroup group = org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createNewVdsGroup ( ) ; group.setCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_0 ) ; group.setStoragePoolId ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.DC_ID1 ) ; group.setVirtService ( supportsVirtService ) ; group.setGlusterService ( supportsGlusterService ) ; return group ; }
Source:
protected void executeVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.getParameters ( ) . setEntityId ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getId ( ) ) ; if ( ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . gethibernation_vol_handle ( ) ) ) ) ) { setSuspendedVm ( true ) ; setSucceeded ( StopSuspendedVm ( ) ) ; } else { super . executeVmCommand ( ) ; } removeStatelessVmUnmanagedDevices ( ) ; }

Target:
protected void executeVmCommand ( ) { org.ovirt.engine.core.bll.StopVmCommandBase.getParameters ( ) . setEntityId ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getId ( ) ) ; if ( ( ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Suspended ) ) || ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( org.ovirt.engine.core.bll.StopVmCommandBase.getVm ( ) . gethibernation_vol_handle ( ) ) ) ) ) { setSuspendedVm ( true ) ; setSucceeded ( stopSuspendedVm ( ) ) ; } else { super . executeVmCommand ( ) ; } removeStatelessVmUnmanagedDevices ( ) ; }
Source:
public void testStop ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.StopVm , org.ovirt.engine.core.common.action.StopVmParameters.class , new java.lang.String [ ] { "VmId" , "StopVmType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.action.StopVmTypeEnum.NORMAL } ) ) ; verifyActionResponse ( resource.stop ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testStop ( ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( ActionType.StopVm , org.ovirt.engine.core.common.action.StopVmParameters.class , new java.lang.String [ ] { "VmId" , "StopVmType" } , new java.lang.Object [ ] { GUIDS [ 0 ] , org.ovirt.engine.core.common.action.StopVmTypeEnum.NORMAL } ) ) ; verifyActionResponse ( resource.stop ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.AuditLog log ) { switch ( log.getseverity ( ) ) { case NORMAL : return getCommonResources ( ) . logNormalImage ( ) ; case WARNING : return getCommonResources ( ) . logWarningImage ( ) ; case ERROR : return getCommonResources ( ) . logErrorImage ( ) ; case ALERT : default : return getCommonResources ( ) . alertConfigureImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.AuditLog log ) { switch ( log.getSeverity ( ) ) { case NORMAL : return getCommonResources ( ) . logNormalImage ( ) ; case WARNING : return getCommonResources ( ) . logWarningImage ( ) ; case ERROR : return getCommonResources ( ) . logErrorImage ( ) ; case ALERT : default : return getCommonResources ( ) . alertConfigureImage ( ) ; } }
Source:
private java.lang.String getVmIsBeingRemovedFromExportDomainMessage ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_BEING_REMOVED_FROM_EXPORT_DOMAIN.name ( ) ) ; if ( ( org.ovirt.engine.core.bll.storage.export.RemoveVmFromImportExportCommand.getVmName ( ) ) != null ) { builder.append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.storage.export.RemoveVmFromImportExportCommand.getVmName ( ) ) ) ; } return builder.toString ( ) ; }

Target:
private java.lang.String getVmIsBeingRemovedFromExportDomainMessage ( ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( EngineMessage.ACTION_TYPE_FAILED_VM_IS_BEING_REMOVED_FROM_EXPORT_DOMAIN.name ( ) ) ; if ( ( org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getVmName ( ) ) != null ) { builder.append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.exportimport.RemoveVmFromImportExportCommand.getVmName ( ) ) ) ; } return builder.toString ( ) ; }
Source:
private void validateAndAssertResult ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > listOfInterfaces , boolean isValid ) { org.ovirt.engine.core.common.validation.NoRepetitiveStaticIpInListConstraintTest.NoRepetitiveStaticIpInListContainer container = new org.ovirt.engine.core.common.validation.NoRepetitiveStaticIpInListConstraintTest.NoRepetitiveStaticIpInListContainer ( listOfInterfaces ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.validation.NoRepetitiveStaticIpInListConstraintTest.NoRepetitiveStaticIpInListContainer > > validate = validator.validate ( container ) ; junit.framework.Assert.assertEquals ( isValid , validate.isEmpty ( ) ) ; }

Target:
private void validateAndAssertResult ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > listOfInterfaces , boolean isValid ) { org.ovirt.engine.core.common.validation.NoRepetitiveStaticIpInListConstraintTest.NoRepetitiveStaticIpInListContainer container = new org.ovirt.engine.core.common.validation.NoRepetitiveStaticIpInListConstraintTest.NoRepetitiveStaticIpInListContainer ( listOfInterfaces ) ; java.util.Set < javax.validation.ConstraintViolation < org.ovirt.engine.core.common.validation.NoRepetitiveStaticIpInListConstraintTest.NoRepetitiveStaticIpInListContainer > > validate = validator.validate ( container ) ; org.junit.Assert.assertEquals ( isValid , validate.isEmpty ( ) ) ; }
Source:
public void AttachTask ( org.ovirt.engine.core.bll.CommandAsyncTask asyncTask ) { synchronized ( _listTasks ) { if ( ! ( _listTasks.containsKey ( asyncTask.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.CommandMultiAsyncTasks.log.infoFormat ( "CommandMultiAsyncTasks::AttachTask: Attaching task '{0}' to command '{1}'." , asyncTask.getVdsmTaskId ( ) , getCommandId ( ) ) ; _listTasks.put ( asyncTask.getVdsmTaskId ( ) , asyncTask ) ; } } }

Target:
public void AttachTask ( org.ovirt.engine.core.bll.tasks.CommandAsyncTask asyncTask ) { synchronized ( _listTasks ) { if ( ! ( _listTasks.containsKey ( asyncTask.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.CommandMultiAsyncTasks.log.infoFormat ( "CommandMultiAsyncTasks::AttachTask: Attaching task '{0}' to command '{1}'." , asyncTask.getVdsmTaskId ( ) , getCommandId ( ) ) ; _listTasks.put ( asyncTask.getVdsmTaskId ( ) , asyncTask ) ; } } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { stopProgress ( ) ; if ( ( ( result != null ) && ( ( result.getReturnValue ( ) ) != null ) ) && ( result.getReturnValue ( ) . getSucceeded ( ) ) ) { cancel ( ) ; } }

Target:
public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList ) { java.util.List < org.ovirt.engine.core.compat.Guid > vmIds = getAffinityGroup ( ) . getVmIds ( ) ; getVmsSelectionModel ( ) . init ( vmList , ( vmIds != null ? vmIds : new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ) ) ; stopProgressOnVmsAndHostsInit ( ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > getEligibleVolumes ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity masterVolume ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > possiblyEligibleVolumes = getAllGlusterVolumesWithMasterCompatibleVersion ( masterVolume.getId ( ) ) ; java.util.Map < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason , org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > > eligibilityPredicateMap = getGeoRepUtilInstance ( ) . getEligibilityPredicates ( masterVolume ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason , org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > > eligibilityPredicateMapEntries : eligibilityPredicateMap.entrySet ( ) ) { possiblyEligibleVolumes = org.ovirt.engine.core.utils.linq.LinqUtils.filter ( possiblyEligibleVolumes , eligibilityPredicateMapEntries.getValue ( ) ) ; } return possiblyEligibleVolumes ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > getEligibleVolumes ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity masterVolume ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > possiblyEligibleVolumes = getAllGlusterVolumesWithMasterCompatibleVersion ( masterVolume.getId ( ) ) ; java.util.Map < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason , java.util.function.Predicate < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > > eligibilityPredicateMap = getGeoRepUtilInstance ( ) . getEligibilityPredicates ( masterVolume ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason , java.util.function.Predicate < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > > eligibilityPredicateMapEntries : eligibilityPredicateMap.entrySet ( ) ) { possiblyEligibleVolumes = possiblyEligibleVolumes.stream ( ) . filter ( eligibilityPredicateMapEntries.getValue ( ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; } return possiblyEligibleVolumes ; }
Source:
public static void GetHostById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters ( id ) , aQuery ) ; }

Target:
public static void getHostById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getView ( ) . updateReportsPanel ( getModel ( ) . getUrl ( ) , getModel ( ) . getParams ( ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.reportsWebappDeployed ) { getView ( ) . updateReportsPanel ( getModel ( ) . getUrl ( ) , getModel ( ) . getParams ( ) ) ; } else { checkUpdateReportsPanel ( getModel ( ) . getUrl ( ) , getModel ( ) . getParams ( ) ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.VM createVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic dynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.common.businessentities.VmStatic stat = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; stat.setVmtGuid ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; stat.setName ( "testVm" ) ; stat.setPriority ( 1 ) ; vm.setStaticData ( stat ) ; vm.setDynamicData ( dynamic ) ; return vm ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VM createVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic dynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.common.businessentities.VmStatic stat = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; stat.setVmtGuid ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; stat.setName ( "testVm" ) ; stat.setPriority ( 1 ) ; vm.setStaticData ( stat ) ; vm.setDynamicData ( dynamic ) ; vm.setSingleQxlPci ( false ) ; return vm ; }
Source:
public void testValidateVmDown ( ) { prepareForVmValidatorTests ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotValidator ) . vmSnapshotDisksNotDuringMerge ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; cmd.getVm ( ) . setStatus ( VMStatus.Down ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }

Target:
public void testValidateVmMigrating ( ) { prepareForVmValidatorTests ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotValidator ) . vmSnapshotDisksNotDuringMerge ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; cmd.getVm ( ) . setStatus ( VMStatus.MigratingTo ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP ) ; }
Source:
protected void baseTemplateSelectedItemChanged ( ) { }

Target:
protected void buildModel ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.BuilderExecutionFinished < org.ovirt.engine.core.common.businessentities.VmBase , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel > callback ) { super . buildModel ( vmBase , callback ) ; if ( ! ( instanceTypeManager.isActive ( ) ) ) { org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( vmBase , getModel ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.HwOnlyVmBaseToUnitBuilder ( ) ) ; } }
Source:
public static boolean VerifyAddVm ( java.util.List < java.lang.String > reasons , int nicsCount , int vmPriority ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.bll.MacPoolManager.getInstance ( ) . getavailableMacsCount ( ) ) < nicsCount ) { if ( reasons != null ) { reasons.add ( VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES.toString ( ) ) ; } returnValue = false ; } else if ( ! ( org.ovirt.engine.core.bll.VmTemplateCommand.IsVmPriorityValueLegal ( vmPriority , reasons ) ) ) { returnValue = false ; } return returnValue ; }

Target:
public static boolean VerifyAddVm ( java.util.List < java.lang.String > reasons , int nicsCount , int vmPriority ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . getavailableMacsCount ( ) ) < nicsCount ) { if ( reasons != null ) { reasons.add ( VdcBllMessages.MAC_POOL_NOT_ENOUGH_MAC_ADDRESSES.toString ( ) ) ; } returnValue = false ; } else if ( ! ( org.ovirt.engine.core.bll.VmTemplateCommand.IsVmPriorityValueLegal ( vmPriority , reasons ) ) ) { returnValue = false ; } return returnValue ; }
Source:
public static 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 ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public static void getCPUList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Version version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllServerCpuList , new org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ( version ) , aQuery ) ; }
Source:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , 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 ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters params = new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public static void getDefaultTimeZone ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.TimeZoneType timeZoneType ) { 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 source ; } return "" ; } } ; org.ovirt.engine.core.common.queries.TimeZoneQueryParams params = new org.ovirt.engine.core.common.queries.TimeZoneQueryParams ( ) ; params.setTimeZoneType ( timeZoneType ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetDefaultTimeZone , params , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { updateVms ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( returnValue ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) ; if ( queryReturnValue.getSucceeded ( ) ) { org.ovirt.engine.core.common.businessentities.VM vm = queryReturnValue.getReturnValue ( ) ; updateVms ( java.util.Collections.singletonList ( vm ) ) ; clearError ( ) ; } else { setError ( messages.failedToLoadOva ( getOvaPath ( ) . getEntity ( ) ) ) ; } stopProgress ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc glusterSnapshotInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName , java.lang.String snapshotName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue ; if ( snapshotName == null ) { xmlRpcReturnValue = vdsServer.glusterSnapshotInfo ( "" , volumeName ) ; } else { xmlRpcReturnValue = vdsServer.glusterSnapshotInfo ( snapshotName , volumeName ) ; } org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeSnapshotInfoReturnForXmlRpc ( clusterId , volumeName , 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.VMListReturnForXmlRpc getExternalVmList ( java.lang.String uri , java.lang.String username , java.lang.String password ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMs ( uri , username , password ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private void validateAndExpectViolation ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper , org.ovirt.engine.core.dal.VdcBllMessages violation ) { java.util.List < java.lang.String > violations = helper.validate ( ) ; junit.framework.Assert.assertTrue ( java.text.MessageFormat.format ( "Expected violation {0} but only got {1}." , violation , violations ) , violations.contains ( violation.name ( ) ) ) ; }

Target:
private void validateAndExpectViolation ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper , org.ovirt.engine.core.common.errors.VdcBllMessages violation ) { java.util.List < java.lang.String > violations = helper.validate ( ) ; junit.framework.Assert.assertTrue ( java.text.MessageFormat.format ( "Expected violation {0} but only got {1}." , violation , violations ) , violations.contains ( violation.name ( ) ) ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) throws java.lang.Exception { assert query.equals ( "" ) ; setUpEntityQueryExpectations ( VdcQueryType.GetAllAdGroups , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpGroups ( ) , failure ) ; control.replay ( ) ; }

Target:
public void testAddGroupWithoutDirectoryName ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; org.ovirt.engine.api.model.Group model = new org.ovirt.engine.api.model.Group ( ) ; model.setName ( NAMES [ 0 ] ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }