auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean Validate ( ) { org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation intValidation = new org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation ( ) ; intValidation.setMinimum ( 1 ) ; intValidation.setMaximum ( 65535 ) ; getSpecificStorageValue ( ) . setIsValid ( true ) ; if ( ( ( java.lang.Boolean ) ( getSpecificStorage ( ) . getEntity ( ) ) ) ) { getSpecificStorageValue ( ) . ValidateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { intValidation , new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; } return getSpecificStorageValue ( ) . getIsValid ( ) ; }

Target:
public boolean Validate ( ) { org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation intValidation = new org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation ( ) ; intValidation.setMinimum ( 1 ) ; intValidation.setMaximum ( 65535 ) ; getSpecificStorageValue ( ) . setIsValid ( true ) ; if ( ( ( java.lang.Boolean ) ( getSpecificStorage ( ) . getEntity ( ) ) ) ) { getSpecificStorageValue ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { intValidation , new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; } return getSpecificStorageValue ( ) . getIsValid ( ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ! ( isRngSupportedByCluster ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL ) ; } if ( ! ( getRngDevices ( ) . isEmpty ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_RNG_ALREADY_EXISTS ) ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } if ( ( ! ( isRngSupportedByCluster ( ) ) ) && ( ( getTemplateType ( ) ) != ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL ) ; } if ( ! ( getRngDevices ( ) . isEmpty ( ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_RNG_ALREADY_EXISTS ) ; } return true ; }
Source:
public void setRxDrop ( java.lang.Double value ) { if ( ( ( rxDrop ) == null ) && ( value == null ) ) { return ; } if ( ( ( rxDrop ) == null ) || ( ! ( rxDrop.equals ( value ) ) ) ) { rxDrop = value ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "RxDrop" ) ) ; } }

Target:
public void setRxDrop ( java.lang.Double value ) { if ( ( ( rxDrop ) == null ) && ( value == null ) ) { return ; } if ( ( ( rxDrop ) == null ) || ( ! ( rxDrop.equals ( value ) ) ) ) { rxDrop = value ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "RxDrop" ) ) ; } }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Storage model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionsResourceTest.STORAGE_TYPES_MAPPED [ index ] . toString ( ) . toLowerCase ( ) , model.getType ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.StorageConnection model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionsResourceTest.STORAGE_TYPES_MAPPED [ index ] . toString ( ) . toLowerCase ( ) , model.getType ( ) ) ; verifyLinks ( model ) ; }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filterByArchitecture ( java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters , org.ovirt.engine.core.common.businessentities.ArchitectureType targetArchitecture ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > filteredClusters = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : clusters ) { if ( cluster.getArchitecture ( ) . equals ( targetArchitecture ) ) { filteredClusters.add ( cluster ) ; } } return filteredClusters ; }
Source:
private void handleFailure ( org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking , org.codehaus.jackson.JsonNode id ) { this . runningCalls.remove ( id ) ; removeRequestFromTracking ( id ) ; tracking.getCall ( ) . addResponse ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.buildFailedResponse ( tracking.getRequest ( ) ) ) ; }

Target:
private void handleFailure ( org.ovirt.vdsm.jsonrpc.client.utils.ResponseTracking tracking , org.codehaus.jackson.JsonNode id ) { this . runningCalls.remove ( id ) ; removeRequestFromTracking ( id ) ; tracking.getCall ( ) . addResponse ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.buildFailedResponse ( tracking.getRequest ( ) ) ) ; tracking.getClient ( ) . disconnect ( ) ; }
Source:
private void initCreateOrUpdateBondParameters ( ) { org.ovirt.engine.core.common.utils.NetworkCommonUtils.fillBondSlaves ( allExistingNics ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : allExistingNics ) { if ( nic.isBond ( ) ) { getHostSetupNetworksParametersData ( ) . getBonds ( ) . add ( org.ovirt.engine.core.common.action.CreateOrUpdateBond.fromBond ( ( ( org.ovirt.engine.core.common.businessentities.network.Bond ) ( nic ) ) ) ) ; } } }

Target:
private void initCreateOrUpdateBondParameters ( ) { org.ovirt.engine.core.common.utils.NetworkCommonUtils.fillBondSlaves ( allExistingNics ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : allExistingNics ) { if ( nic.isBond ( ) ) { getHostSetupNetworksParametersData ( ) . getBonds ( ) . add ( org.ovirt.engine.core.common.action.CreateOrUpdateBond.fromBond ( ( ( org.ovirt.engine.core.common.businessentities.network.Bond ) ( nic ) ) ) ) ; } } hostSetupNetworksParametersData.setOriginalBondsByName ( org.ovirt.engine.core.common.businessentities.Entities.entitiesByName ( hostSetupNetworksParametersData.getBonds ( ) ) ) ; }
Source:
private void validateDomainInProcess ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus masterStatus , org.ovirt.engine.core.common.businessentities.StorageDomainStatus regularStatus , org.ovirt.engine.core.common.businessentities.StorageDomainStatus expectedStatus ) { masterDomainIsoMap.setStatus ( masterStatus ) ; regularDomainIsoMap.setStatus ( regularStatus ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; java.util.List < java.lang.String > messages = cmd.getReturnValue ( ) . getValidationMessages ( ) ; org.junit.Assert.assertEquals ( messages.get ( 0 ) , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2.toString ( ) ) ; org.junit.Assert.assertEquals ( messages.get ( 1 ) , java.lang.String.format ( "$status %1$s" , expectedStatus ) ) ; }

Target:
private void validateDomainInProcess ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus masterStatus , org.ovirt.engine.core.common.businessentities.StorageDomainStatus regularStatus , org.ovirt.engine.core.common.businessentities.StorageDomainStatus expectedStatus ) { masterDomainIsoMap.setStatus ( masterStatus ) ; regularDomainIsoMap.setStatus ( regularStatus ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2 ) ; java.util.List < java.lang.String > messages = cmd.getReturnValue ( ) . getValidationMessages ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( messages.get ( 0 ) , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2.toString ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( messages.get ( 1 ) , java.lang.String.format ( "$status %1$s" , expectedStatus ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > getNetworkBusinessEntityMap ( ) { if ( ( networkBusinessEntityMap ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getNetworkDAO ( ) . getAllForCluster ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getVdsGroupId ( ) ) ; networkBusinessEntityMap = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networks ) ; } return networkBusinessEntityMap ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > getClusterNetworks ( ) { if ( ( clusterNetworks ) == null ) { clusterNetworks = org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getNetworkDao ( ) . getAllForCluster ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getVdsGroupId ( ) ) ; } return clusterNetworks ; }
Source:
private boolean resizeDiskImageRequested ( ) { return ( ( ( getNewDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) && ( ( vmDeviceForVm.getSnapshotId ( ) ) == null ) ) && ( ( getNewDisk ( ) . getSize ( ) ) != ( getOldDisk ( ) . getSize ( ) ) ) ; }

Target:
private boolean resizeDiskImageRequested ( ) { boolean sizeChanged = ( getNewDisk ( ) . getSize ( ) ) != ( getOldDisk ( ) . getSize ( ) ) ; switch ( getNewDisk ( ) . getDiskStorageType ( ) ) { case IMAGE : return sizeChanged && ( ( vmDeviceForVm.getSnapshotId ( ) ) == null ) ; case CINDER : return sizeChanged ; } return false ; }
Source:
public void testEmptyHealthReport ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < > ( ) ; struct.put ( VdsProperties.MULTIPATH_HEALTH , new java.util.HashMap < > ( ) ) ; multipathHealthHandler.handleMultipathHealthReport ( vds , struct ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 1 ) ) . log ( org.mockito.ArgumentMatchers.any ( ) , logTypeCaptor.capture ( ) ) ; org.junit.Assert.assertTrue ( logTypeCaptor.getAllValues ( ) . contains ( AuditLogType.NO_FAULTY_MULTIPATHS_ON_HOST ) ) ; }

Target:
public void testEmptyHealthReport ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < > ( ) ; struct.put ( VdsProperties.MULTIPATH_HEALTH , new java.util.HashMap < > ( ) ) ; multipathHealthHandler.handleMultipathHealthReport ( vds , struct ) ; org.mockito.Mockito.verify ( auditLogDirector , org.mockito.Mockito.times ( 1 ) ) . log ( org.mockito.ArgumentMatchers.any ( ) , logTypeCaptor.capture ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( logTypeCaptor.getAllValues ( ) . contains ( AuditLogType.NO_FAULTY_MULTIPATHS_ON_HOST ) ) ; }
Source:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void countAllTemplates ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = org.ovirt.engine.ui.uicommonweb.Linq.disksToDiskModelList ( disks ) ; getAttachableDisksMap ( ) . get ( DiskStorageType.IMAGE ) . setItems ( org.ovirt.engine.ui.uicommonweb.Linq.toEntityModelList ( org.ovirt.engine.ui.uicommonweb.Linq.filterDisksByType ( diskModels , Disk.DiskStorageType.IMAGE ) ) ) ; }

Target:
protected void doLoadAttachableDisks ( org.ovirt.engine.ui.uicommonweb.models.vms.AttachDiskModel.GetDisksCallback imageCallback , org.ovirt.engine.ui.uicommonweb.models.vms.AttachDiskModel.GetDisksCallback lunCallback ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllAttachableDisks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , imageCallback ) , getVm ( ) . getStoragePoolId ( ) , getVm ( ) . getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getAllAttachableDisks ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , lunCallback ) , null , getVm ( ) . getId ( ) ) ; }
Source:
public void validatePatternBasedPoolName ( ) { java.lang.String patternBaseName = "aa-??bb" ; command.getParameters ( ) . getVmStaticData ( ) . setName ( patternBaseName ) ; command.getParameters ( ) . getVmPool ( ) . setName ( patternBaseName ) ; org.junit.Assert.assertTrue ( command.validateInputs ( ) ) ; }

Target:
public void validatePatternBasedPoolName ( ) { java.lang.String patternBaseName = "aa-??bb" ; command.getParameters ( ) . getVmStaticData ( ) . setName ( patternBaseName ) ; command.getParameters ( ) . getVmPool ( ) . setName ( patternBaseName ) ; org.junit.jupiter.api.Assertions.assertTrue ( command.validateInputs ( ) ) ; }
Source:
private org.ovirt.engine.core.compat.Guid findExportDomainId ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { if ( ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) && ( ( storageDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return ( exportDomain = storageDomain ) . getId ( ) ; } } return null ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StorageDomain getExportDomain ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { if ( ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) && ( ( storageDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) { return storageDomain ; } } return null ; }
Source:
public void testUnknownTypeLunCantBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; disk.getLun ( ) . setLunType ( StorageType.UNKNOWN ) ; org.junit.Assert.assertFalse ( "checkIfLunDiskCanBeAdded() succeded for LUN with UNKNOWN type" , command.checkIfLunDiskCanBeAdded ( spyDiskValidator ( disk ) ) ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed but correct can do action hasn't been added to the return response" , verifyCanDoActionMessagesContainMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.storage.LunDisk createISCSILunDisk ( org.ovirt.engine.core.common.businessentities.storage.ScsiGenericIO sgio , boolean isUsingScsiReservation , org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface ) { org.ovirt.engine.core.common.businessentities.storage.LunDisk disk = org.ovirt.engine.core.bll.AddDiskCommandTest.createISCSILunDisk ( ) ; disk.setSgio ( sgio ) ; disk.setUsingScsiReservation ( isUsingScsiReservation ) ; disk.setDiskInterface ( diskInterface ) ; return disk ; }
Source:
public boolean disconnectHostFromStoragePoolServersCommandCompleted ( org.ovirt.engine.core.common.action.HostStoragePoolParametersBase parameters ) { return unregisterLibvirtSecrets ( parameters.getVds ( ) , parameters.getStoragePool ( ) ) ; }

Target:
private boolean isActiveStorageDomainAvailable ( final org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.compat.Guid poolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . getAllForStoragePool ( poolId ) ; return org.apache.commons.collections.CollectionUtils.exists ( storageDomains , new org.apache.commons.collections.Predicate ( ) { @ java.lang.Override public boolean evaluate ( java.lang.Object o ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( o ) ) ; return ( ( storageDomain.getStorageType ( ) ) == storageType ) && ( ( storageDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ; } } ) ; }
Source:
public void qosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; iface.setQos ( createQos ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void qosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; iface.setQos ( createQos ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
Source:
protected void processOldImageFromDb ( ) { org.ovirt.engine.core.bll.CreateSnapshotCommand.getParameters ( ) . setOldLastModifiedValue ( org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . getLastModified ( ) ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . setLastModified ( new java.util.Date ( ) ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . setActive ( false ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.getImageDao ( ) . update ( org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . getImage ( ) ) ; }

Target:
protected void processOldImageFromDb ( ) { org.ovirt.engine.core.bll.CreateSnapshotCommand.getCompensationContext ( ) . snapshotEntity ( org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . getImage ( ) ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.getParameters ( ) . setOldLastModifiedValue ( org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . getLastModified ( ) ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . setLastModified ( new java.util.Date ( ) ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . setActive ( false ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.getImageDao ( ) . update ( org.ovirt.engine.core.bll.CreateSnapshotCommand.getDiskImage ( ) . getImage ( ) ) ; org.ovirt.engine.core.bll.CreateSnapshotCommand.getCompensationContext ( ) . stateChanged ( ) ; }
Source:
public void testAllDomainsHaveSpaceForNewDisksSuccess ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }

Target:
public void testAllDomainsHaveSpaceForNewDisksSuccess ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( disksList ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; org.mockito.Mockito.verify ( multipleStorageDomainsValidator ) . allDomainsHaveSpaceForNewDisks ( disksList ) ; }
Source:
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.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.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 ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > Get64bitOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008R2x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows7x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { optimizationForDesktopExplanationLabel.setText ( org.ovirt.engine.core.compat.StringFormat.format ( optimizationForDesktopExplanationLabel.getText ( ) , ( ( model.getCluster ( ) . getOptimizationForDesktop ( ) . getEntity ( ) . toString ( ) ) + "%" ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { optimizationForDesktopFormatter ( model ) ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , 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 ) { setUpEntityQueryExpectations ( 2 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.networkId } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void subscribe ( org.ovirt.engine.core.common.businessentities.event_subscriber subscriber ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "event_up_name" , subscriber.getevent_up_name ( ) ) . addValue ( "notification_method" , subscriber.getevent_notification_method ( ) . getAsString ( ) ) . addValue ( "method_address" , subscriber.getmethod_address ( ) ) . addValue ( "subscriber_id" , subscriber.getsubscriber_id ( ) ) . addValue ( "tag_name" , subscriber.gettag_name ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertevent_subscriber" , parameterSource ) ; }

Target:
public void subscribe ( org.ovirt.engine.core.common.businessentities.EventSubscriber subscriber ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "event_up_name" , subscriber.getEventUpName ( ) ) . addValue ( "notification_method" , subscriber.getEventNotificationMethod ( ) . getAsString ( ) ) . addValue ( "method_address" , subscriber.getMethodAddress ( ) ) . addValue ( "subscriber_id" , subscriber.getSubscriberId ( ) ) . addValue ( "tag_name" , subscriber.getTagName ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertevent_subscriber" , parameterSource ) ; }
Source:
public void testVmInPreview ( ) { setUpGeneralValidations ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW.name ( ) ) ) ; }

Target:
public void testVmInPreview ( ) { setUpGeneralValidations ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) . when ( snapshotsValidator ) . vmNotInPreview ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW.name ( ) ) ) ; }
Source:
public static void getGlusterVolumeOptionInfoList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeOptionsInfo , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public void setEntity ( java.lang.Object value ) { if ( ( entity ) != value ) { EntityChanging ( value , entity ) ; entity = value ; OnEntityChanged ( ) ; getEntityChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.core.compat.PropertyChangedEventArgs ( "Entity" ) ) ; } }

Target:
public void setEntity ( java.lang.Object value ) { if ( ( entity ) != value ) { EntityChanging ( value , entity ) ; entity = value ; OnEntityChanged ( ) ; getEntityChangedEvent ( ) . raise ( this , EventArgs.Empty ) ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "Entity" ) ) ; } }
Source:
private static void assertGetAllForStoragePoolResult ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result , org.ovirt.engine.core.compat.Guid expectedStoragePoolId ) { org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : result ) { org.junit.Assert.assertEquals ( expectedStoragePoolId , domain.getStoragePoolId ( ) ) ; } }

Target:
private static void assertGetAllForStoragePoolResult ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result , org.ovirt.engine.core.compat.Guid expectedStoragePoolId ) { org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : result ) { org.junit.Assert.assertEquals ( expectedStoragePoolId , domain.getStoragePoolId ( ) ) ; org.junit.Assert.assertEquals ( "Wrong shared status" , StorageDomainSharedStatus.Active , domain.getStorageDomainSharedStatus ( ) ) ; } }
Source:
private java.util.List < org.ovirt.engine.api.restapi.model.Directory > getCollection ( ) { java.util.List < org.ovirt.engine.api.restapi.model.Directory > dsl = new java.util.ArrayList < org.ovirt.engine.api.restapi.model.Directory > ( ) ; for ( java.lang.String domain : getDomainList ( ) ) { org.ovirt.engine.api.restapi.model.Directory ds = new org.ovirt.engine.api.restapi.model.Directory ( ) ; ds.setDomain ( domain ) ; org.ovirt.engine.core.compat.Guid guid = new org.ovirt.engine.core.compat.Guid ( domain.getBytes ( ) , true ) ; ds.setId ( guid.toString ( ) ) ; dsl.add ( ds ) ; } return dsl ; }

Target:
private java.util.List < org.ovirt.engine.api.restapi.model.Directory > getCollection ( ) { java.util.List < org.ovirt.engine.api.restapi.model.Directory > dsl = new java.util.ArrayList < org.ovirt.engine.api.restapi.model.Directory > ( ) ; for ( java.lang.String domain : getDomainList ( ) ) { org.ovirt.engine.api.restapi.model.Directory ds = new org.ovirt.engine.api.restapi.model.Directory ( ) ; ds.setDomain ( domain ) ; org.ovirt.engine.core.compat.Guid guid = asGuid ( domain.getBytes ( ) , true ) ; ds.setId ( guid.toString ( ) ) ; dsl.add ( ds ) ; } return dsl ; }
Source:
private void persistBlockJobPlaceholder ( org.ovirt.engine.core.compat.Guid jobId ) { org.ovirt.engine.core.common.businessentities.VmBlockJob blockJob = new org.ovirt.engine.core.common.businessentities.VmBlockJob ( ) ; blockJob.setVmId ( org.ovirt.engine.core.bll.MergeCommand.getParameters ( ) . getVmId ( ) ) ; blockJob.setId ( jobId ) ; blockJob.setJobType ( VmJobType.BLOCK ) ; blockJob.setJobState ( VmJobState.UNKNOWN ) ; blockJob.setImageGroupId ( org.ovirt.engine.core.bll.MergeCommand.getParameters ( ) . getImageGroupId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmJobDao ( ) . save ( blockJob ) ; org.ovirt.engine.core.bll.MergeCommand.log.infoFormat ( "Stored placeholder for job id {0}" , blockJob.getId ( ) ) ; }

Target:
private void persistBlockJobPlaceholder ( org.ovirt.engine.core.compat.Guid jobId ) { org.ovirt.engine.core.common.businessentities.VmBlockJob blockJob = new org.ovirt.engine.core.common.businessentities.VmBlockJob ( ) ; blockJob.setVmId ( org.ovirt.engine.core.bll.MergeCommand.getParameters ( ) . getVmId ( ) ) ; blockJob.setId ( jobId ) ; blockJob.setJobType ( VmJobType.BLOCK ) ; blockJob.setJobState ( VmJobState.UNKNOWN ) ; blockJob.setImageGroupId ( org.ovirt.engine.core.bll.MergeCommand.getParameters ( ) . getImageGroupId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmJobDao ( ) . save ( blockJob ) ; org.ovirt.engine.core.bll.MergeCommand.log.info ( "Stored placeholder for job id '{}'" , blockJob.getId ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.storage.DiskInterface getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return object.getDiskInterface ( ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.DiskInterface getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( ( object.getDiskVmElements ( ) . size ( ) ) == 1 ) { return object.getDiskVmElements ( ) . iterator ( ) . next ( ) . getDiskInterface ( ) ; } return null ; }
Source:
protected void buildVmSoundDevices ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmSoundDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.SOUND ) ; if ( ! ( vmSoundDevices.isEmpty ( ) ) ) { createInfo.put ( VdsProperties.soundDevice , OsRepositoryImpl.INSTANCE.getSoundDevice ( vm.getStaticData ( ) . getOsId ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ; } }

Target:
protected void buildVmSoundDevices ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmSoundDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( vm.getId ( ) , VmDeviceGeneralType.SOUND ) ; if ( ! ( vmSoundDevices.isEmpty ( ) ) ) { createInfo.put ( VdsProperties.soundDevice , osRepository.getSoundDevice ( vm.getStaticData ( ) . getOsId ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ; } }
Source:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMClearTaskVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case UnknownTask : log.error ( java.lang.String.format ( "Trying to remove unknown task: %1$s" , org.ovirt.engine.core.vdsbroker.vdsbroker.HSMClearTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; return ; case TaskStateError : initializeVdsError ( returnStatus ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HSMClearTaskVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; return ; } super . proceedProxyReturnValue ( ) ; }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.HSMClearTaskVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case UnknownTask : log.error ( java.lang.String.format ( "Trying to remove unknown task: %1$s" , org.ovirt.engine.core.vdsbroker.vdsbroker.HSMClearTaskVDSCommand.getParameters ( ) . getTaskId ( ) ) ) ; return ; case TaskStateError : initializeVdsError ( returnStatus ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.HSMClearTaskVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; return ; } super . proceedProxyReturnValue ( ) ; }
Source:
private java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > searchDirectoryUsers ( ) { org.ovirt.engine.core.bll.QueryData data = initQueryData ( true ) ; if ( data == null ) { return java.util.Collections.emptyList ( ) ; } java.lang.String directoryName = data.getDomain ( ) ; org.ovirt.engine.core.extensions.mgr.ExtensionProxy authz = org.ovirt.engine.core.aaa.AuthenticationProfileRepository.getInstance ( ) . getAuthz ( directoryName ) ; if ( authz == null ) { return java.util.Collections.emptyList ( ) ; } return org.ovirt.engine.core.aaa.AuthzUtils.findPrincipalsByQuery ( authz , data.getQuery ( ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > searchDirectoryUsers ( ) { org.ovirt.engine.core.bll.QueryData data = initQueryData ( true ) ; if ( data == null ) { return java.util.Collections.emptyList ( ) ; } java.lang.String directoryName = data.getDomain ( ) ; org.ovirt.engine.core.extensions.mgr.ExtensionProxy authz = org.ovirt.engine.core.utils.extensionsmgr.EngineExtensionsManager.getInstance ( ) . getExtensionByName ( directoryName ) ; if ( authz == null ) { return java.util.Collections.emptyList ( ) ; } return org.ovirt.engine.core.aaa.AuthzUtils.findPrincipalsByQuery ( authz , data.getQuery ( ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult evaluate ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator > entry ) { org.ovirt.engine.core.compat.Guid sdId = entry.getKey ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = disksMap.get ( sdId ) ; return getStorageDomainValidator ( entry ) . hasSpaceForClonedDisks ( disksList ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult allDomainsWithinThresholds ( ) { return validOrFirstFailure ( ( entry ) -> getStorageDomainValidator ( entry ) . isDomainWithinThresholds ( ) ) ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tags : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ) ( source ) ) ) { if ( ( tags.gettype ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { ret.add ( tags ) ; } } return ret ; } return new org.ovirt.engine.core.common.businessentities.Tags ( ) ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tags : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ) ( source ) ) ) { if ( ( tags.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { ret.add ( tags ) ; } } return ret ; } return new org.ovirt.engine.core.common.businessentities.Tags ( ) ; }
Source:
public static void GetLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String dataCenterName ) { 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 ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable item : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) { return item ; } } return null ; } } ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , sp , aQuery ) ; }

Target:
public static void getLocalStorageHost ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String dataCenterName ) { 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 ) { for ( org.ovirt.engine.core.common.businessentities.IVdcQueryable item : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) { return item ; } } return null ; } } ; org.ovirt.engine.core.common.queries.SearchParameters sp = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "hosts: datacenter=" + dataCenterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , sp , aQuery ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getGeoRepSession ( ) { if ( ( geoRepSession ) == null ) { if ( ( org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getParameters ( ) . getGeoRepSessionId ( ) ) != null ) { geoRepSession = getGlusterGeoRepDao ( ) . getById ( org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getParameters ( ) . getGeoRepSessionId ( ) ) ; } else { geoRepSession = getGlusterGeoRepDao ( ) . getGeoRepSession ( org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getGlusterVolumeId ( ) , org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getParameters ( ) . getSlaveHostId ( ) , org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getParameters ( ) . getSlaveVolumeName ( ) ) ; } } return geoRepSession ; }

Target:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getGeoRepSession ( ) { if ( ( geoRepSession ) == null ) { if ( ( org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getParameters ( ) . getGeoRepSessionId ( ) ) != null ) { geoRepSession = glusterGeoRepDao.getById ( org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getParameters ( ) . getGeoRepSessionId ( ) ) ; } else { geoRepSession = glusterGeoRepDao.getGeoRepSession ( org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getGlusterVolumeId ( ) , org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getParameters ( ) . getSlaveHostId ( ) , org.ovirt.engine.core.bll.gluster.GeoRepSessionCommandBase.getParameters ( ) . getSlaveVolumeName ( ) ) ; } } return geoRepSession ; }
Source:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.UnlabelNetwork , org.ovirt.engine.core.common.action.UnlabelNetworkParameters.class , new java.lang.String [ ] { "NetworkId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelResourceTest.NETWORK_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.UnlabelNetwork , org.ovirt.engine.core.common.action.UnlabelNetworkParameters.class , new java.lang.String [ ] { "NetworkId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelResourceTest.NETWORK_ID } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.compat.Guid networkId = entity.getId ( ) ; org.ovirt.engine.core.common.businessentities.IscsiBond bond = getBond ( ) ; bond.getNetworkIds ( ) . add ( networkId ) ; return performCreate ( VdcActionType.EditIscsiBond , new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( bond ) , new org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworksResource.AddedNetworkResolver ( networkId ) ) ; }

Target:
public org.ovirt.engine.api.resource.NetworkResource getNetworkResource ( java.lang.String id ) { return inject ( new org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResource ( id , this ) ) ; }
Source:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( QueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpGetEntityExpectations ( QueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }