auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.Disk > getAllForVm ( org.ovirt.engine.core.compat.Guid id , boolean onlyPluggedDisks , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_guid" , id ) . addValue ( "only_plugged" , onlyPluggedDisks ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ; return getCallsHandler ( ) . executeReadList ( "GetDisksVmGuid" , org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.DiskRowMapper.instance , parameterSource ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.Disk mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.Disk disk = org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.DiskRowMapper.instance.mapRow ( rs , rowNum ) ; disk.setPlugged ( rs.getBoolean ( "is_plugged" ) ) ; disk.setReadOnly ( rs.getBoolean ( "is_readonly" ) ) ; disk.setLogicalName ( rs.getString ( "logical_name" ) ) ; return disk ; }
Source:
protected void onCommonModelChange ( ) { popupHandler.addDialogModelListener ( org.ovirt.engine.ui.common.uicommon.model.TabModelProvider.getModel ( ) ) ; org.ovirt.engine.ui.common.uicommon.model.TabModelProvider.getModel ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "WidgetModel" . equals ( propName ) ) { modelBoundWidgetChange ( ) ; } } } ) ; }

Target:
protected void onCommonModelChange ( ) { popupHandler.addDialogModelListener ( org.ovirt.engine.ui.common.uicommon.model.TabModelProvider.getModel ( ) ) ; org.ovirt.engine.ui.common.uicommon.model.TabModelProvider.getModel ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "WidgetModel" . equals ( propName ) ) { modelBoundWidgetChange ( ) ; } } } ) ; org.ovirt.engine.ui.common.uicommon.model.TabModelProvider.getModel ( ) . setEventBus ( getEventBus ( ) ) ; }
Source:
public void replaceBrick ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity oldBrick , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newBrick ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterVolumeBrick" , getCustomMapSqlParameterSource ( ) . addValue ( "id" , oldBrick.getId ( ) ) . addValue ( "new_id" , newBrick.getId ( ) ) . addValue ( "new_server_id" , newBrick.getServerId ( ) ) . addValue ( "new_brick_dir" , newBrick.getBrickDirectory ( ) ) . addValue ( "new_status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( newBrick.getStatus ( ) ) ) ) ; }

Target:
public void replaceBrick ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity oldBrick , org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity newBrick ) { getCallsHandler ( ) . executeModification ( "UpdateGlusterVolumeBrick" , getCustomMapSqlParameterSource ( ) . addValue ( "id" , oldBrick.getId ( ) ) . addValue ( "new_id" , newBrick.getId ( ) ) . addValue ( "new_server_id" , newBrick.getServerId ( ) ) . addValue ( "new_brick_dir" , newBrick.getBrickDirectory ( ) ) . addValue ( "new_status" , org.ovirt.engine.core.common.utils.EnumUtils.nameOrNull ( newBrick.getStatus ( ) ) ) . addValue ( "new_network_id" , newBrick.getNetworkId ( ) ) ) ; }
Source:
public void validateSucceedsWithForceOption ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , true ) , null ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void validateSucceedsWithForceOption ( ) throws java.lang.Exception { command.getParameters ( ) . setForceAction ( true ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomain ( int availableSpace ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setstorage_domain_type ( StorageDomainType.Master ) ; sd.setstatus ( StorageDomainStatus.Active ) ; sd.setavailable_disk_size ( availableSpace ) ; sd.setused_disk_size ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) ; sd.setId ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ; return sd ; }

Target:
protected org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomain ( int availableSpace ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setStorageDomainType ( StorageDomainType.Master ) ; sd.setStatus ( StorageDomainStatus.Active ) ; sd.setAvailableDiskSize ( availableSpace ) ; sd.setUsedDiskSize ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) ; sd.setId ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ; return sd ; }
Source:
private int getTotalMemoryStatesSizeGb ( ) { long sizeInBytes = 0 ; for ( org.ovirt.engine.core.common.businessentities.Snapshot snapshot : snapshotsWithMemory ) { org.ovirt.engine.core.common.businessentities.VM vm = getVmFromSnapshot ( snapshot ) ; sizeInBytes += ( vm.getTotalMemorySizeInBytes ( ) ) + ( org.ovirt.engine.core.bll.memory.MemoryUtils.META_DATA_SIZE_IN_BYTES ) ; } return ( ( int ) ( java.lang.Math.ceil ( ( ( 1.0 * sizeInBytes ) / ( BYTES_IN_GB ) ) ) ) ) ; }

Target:
private boolean handleDestStorageDomain ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { ensureDomainMap ( disksList , org.ovirt.engine.core.bll.ExportVmCommand.getStorageDomainId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > dummiesDisksList = createDiskDummiesForSpaceValidations ( disksList ) ; dummiesDisksList.addAll ( getMemoryVolumes ( ) ) ; return validateSpaceRequirements ( dummiesDisksList ) ; }
Source:
protected boolean canDoAction ( ) { boolean returnValue = true ; if ( ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_NOT_EXIST ) ; returnValue = false ; } if ( returnValue && ( ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_ALREADY_UP ) ; returnValue = false ; } return returnValue ; }

Target:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_NOT_EXIST ) ; } if ( ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) { return failCanDoAction ( VdcBllMessages.VDS_CANNOT_ACTIVATE_VDS_ALREADY_UP ) ; } return true ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.VmBackupModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else if ( ( source.getConfirmWindow ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.ImportCloneModel ) { return importClonePopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.storage.TemplateBackupModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else if ( ( source.getConfirmWindow ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.storage.ImportCloneModel ) { return importClonePopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.VolumeType getMemoryVolumeTypeForStorageDomain ( org.ovirt.engine.core.common.businessentities.StorageType storageType ) { return storageType.isFileDomain ( ) ? org.ovirt.engine.core.common.businessentities.VolumeType.Sparse : org.ovirt.engine.core.common.businessentities.VolumeType.Preallocated ; }

Target:
private org.ovirt.engine.core.common.action.AddDiskParameters buildAddDiskParameters ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.AddDiskParameters parameters = new org.ovirt.engine.core.common.action.AddDiskParameters ( org.ovirt.engine.core.compat.Guid.Empty , disk ) ; parameters.setStorageDomainId ( getStorageDomainId ( ) ) ; parameters.setParentCommand ( org.ovirt.engine.core.bll.HibernateVmCommand.getActionType ( ) ) ; parameters.setParentParameters ( org.ovirt.engine.core.bll.HibernateVmCommand.getParameters ( ) ) ; parameters.setShouldBeLogged ( false ) ; return parameters ; }
Source:
public static void GetVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void GetVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats profileDetails = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats ) ( obj ) ) ; if ( ! ( java.util.Objects.equals ( getName ( ) , profileDetails.getName ( ) ) ) ) { return false ; } if ( ! ( java.util.Objects.equals ( getProfileStats ( ) , profileDetails.getProfileStats ( ) ) ) ) { return false ; } return true ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats other = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeProfileStats ) ( obj ) ) ; return ( java.util.Objects.equals ( name , other.name ) ) && ( java.util.Objects.equals ( profileStats , other.profileStats ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateAddedStorageConnections ( java.util.Collection < java.lang.String > addedStorageConnections , org.ovirt.engine.core.compat.Guid dataCenterId ) { if ( ! ( addedStorageConnections.isEmpty ( ) ) ) { java.util.List < java.lang.String > connectionsNotInDataCenter = getStorageConnectionsMissingInDataCenter ( addedStorageConnections , dataCenterId ) ; if ( ! ( connectionsNotInDataCenter.isEmpty ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTIONS_CANNOT_BE_ADDED_TO_ISCSI_BOND , java.lang.String.format ( "$connectionIds %s" , org.apache.commons.lang.StringUtils.join ( connectionsNotInDataCenter , "," ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateAddedStorageConnections ( java.util.Collection < java.lang.String > addedStorageConnections , org.ovirt.engine.core.compat.Guid dataCenterId ) { if ( ! ( addedStorageConnections.isEmpty ( ) ) ) { java.util.List < java.lang.String > connectionsNotInDataCenter = getStorageConnectionsMissingInDataCenter ( addedStorageConnections , dataCenterId ) ; if ( ! ( connectionsNotInDataCenter.isEmpty ( ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTIONS_CANNOT_BE_ADDED_TO_ISCSI_BOND , java.lang.String.format ( "$connectionIds %s" , org.apache.commons.lang.StringUtils.join ( connectionsNotInDataCenter , "," ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateQos ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure ) { org.ovirt.engine.core.bll.ValidationResult vr = org.ovirt.engine.core.bll.ValidationResult.VALID ; vr = ( skipValidation ( vr ) ) ? vr : validateQosOverriddenInterfaces ( ) ; vr = ( skipValidation ( vr ) ) ? vr : validateQosNotPartiallyConfigured ( attachmentsToConfigure ) ; vr = ( skipValidation ( vr ) ) ? vr : validateQosCommitment ( attachmentsToConfigure ) ; return vr ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult attachmentsDontReferenceSameNetworkDuplicately ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachments ) { return new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( attachments , networkBusinessEntityMap , networkExclusivenessValidator ) . verifyUserAttachmentsDoesNotReferenceSameNetworkDuplicately ( ) ; }
Source:
protected boolean isVirtioScsiEnabled ( ) { java.lang.Boolean virtioScsiEnabled = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isVirtioScsiEnabled ( ) ; boolean isOsSupportedForVirtIoScsi = org.ovirt.engine.core.bll.validator.VmValidationUtils.isDiskInterfaceSupportedByOs ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVm ( ) . getOs ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) , DiskInterface.VirtIO_SCSI ) ; return virtioScsiEnabled != null ? virtioScsiEnabled : ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) && isOsSupportedForVirtIoScsi ; }

Target:
protected boolean checkCpuSockets ( ) { return org.ovirt.engine.core.bll.AddVmCommand.checkCpuSockets ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getNumOfSockets ( ) , org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getCpuPerSocket ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) . toString ( ) , org.ovirt.engine.core.bll.AddVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
public java.lang.String toString ( ) { return java.lang.String.format ( "%s, force=%s, checkConnectivity=%s, conectivityTimeout=%s,\n\tnetworks=%s,\n\tbonds=%s,\n\tinterfaces=%s,\n\tremovedNetworks=%s,\n\tremovedBonds=%s" , super . toString ( ) , isForce ( ) , isCheckConnectivity ( ) , getConectivityTimeout ( ) , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getNetworks ( ) , "\t\t" ) , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getBonds ( ) , "\t\t" ) , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getInterfaces ( ) , "\t\t" ) , getRemovedNetworks ( ) , getRemovedBonds ( ) ) ; }

Target:
public java.lang.String toString ( ) { return java.lang.String.format ( "%s, force=%s, checkConnectivity=%s, conectivityTimeout=%s,%n\tnetworks=%s,%n\tbonds=%s,%n\tinterfaces=%s,%n\tremovedNetworks=%s,%n\tremovedBonds=%s" , super . toString ( ) , isForce ( ) , isCheckConnectivity ( ) , getConectivityTimeout ( ) , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getNetworks ( ) , "\t\t" ) , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getBonds ( ) , "\t\t" ) , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getInterfaces ( ) , "\t\t" ) , getRemovedNetworks ( ) , getRemovedBonds ( ) ) ; }
Source:
public void gatewayChanged ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "net" ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBootProtocol ( NetworkBootProtocol.STATIC_IP ) ; nic.setGateway ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; mockExistingIfaces ( nic ) ; nic.setGateway ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndAssertNetworkModified ( helper , net ) ; }

Target:
public void externalNetworkAttached ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "net" ) ; net.setProvidedBy ( new org.ovirt.engine.core.common.businessentities.network.ProviderNetwork ( ) ) ; mockExistingNetworks ( net ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; nic.setNetworkName ( net.getName ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_EXTERNAL_NETWORKS_CANNOT_BE_PROVISIONED ) ; }
Source:
protected void setClientTokenProvider ( com.woorea.openstack.quantum.Quantum client ) { com.woorea.openstack.base.client.OpenStackTokenProvider tokenProvider = new org.ovirt.engine.core.bll.provider.network.openstack.ExternalNetworkTokenProvider ( provider ) ; client.setTokenProvider ( tokenProvider ) ; }

Target:
protected void setClientTokenProvider ( com.woorea.openstack.quantum.Quantum client ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( provider.getAdditionalProperties ( ) . getTenantName ( ) ) ) { com.woorea.openstack.base.client.OpenStackTokenProvider tokenProvider = new org.ovirt.engine.core.bll.provider.network.openstack.ExternalNetworkTokenProvider ( provider ) ; client.setTokenProvider ( tokenProvider ) ; } else { super . setClientTokenProvider ( client ) ; } }
Source:
public void getAAAProfilesListViaPublic ( 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getAAAProfilesEntriesList ( 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.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.aaa.ProfileEntry > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAAAProfileList , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public static void GetPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.MultilevelAdministrationByAdElementIdParameters ( userId ) , aQuery ) ; }

Target:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
private void initParetResource ( org.ovirt.engine.api.restapi.resource.AbstractBackendUsersResource resource , javax.ws.rs.core.UriInfo uriInfo ) { initResource ( resource ) ; resource.setUriInfo ( uriInfo ) ; }

Target:
private void setUpEntityQueryExpectations ( int index , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDirectoryUserById , org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters.class , new java.lang.String [ ] { "Domain" , "Id" } , new java.lang.Object [ ] { DOMAIN , GUIDS [ index ] } , ( notFound ? null : getEntity ( index ) ) ) ; }
Source:
public void testListFailure ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpEntityQueryExpectations ( 1 , org.ovirt.engine.api.restapi.resource.FAILURE ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae ) ; } }

Target:
public void testListFailure ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; setUpEntityQueryExpectations ( 1 , org.ovirt.engine.api.restapi.resource.FAILURE ) ; collection.setUriInfo ( uriInfo ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) ) ; }
Source:
public static org.ovirt.engine.api.model.StorageDomainStatus map ( org.ovirt.engine.api.model.StorageDomainStatus status , org.ovirt.engine.api.model.StorageDomainStatus template ) { switch ( status ) { case Unattached : return org.ovirt.engine.api.model.StorageDomainStatus.UNATTACHED ; case Active : return org.ovirt.engine.api.model.StorageDomainStatus.ACTIVE ; case InActive : return org.ovirt.engine.api.model.StorageDomainStatus.INACTIVE ; case Locked : return org.ovirt.engine.api.model.StorageDomainStatus.LOCKED ; case PreparingForMaintenance : return org.ovirt.engine.api.model.StorageDomainStatus.PREPARING_FOR_MAINTENANCE ; case Maintenance : return org.ovirt.engine.api.model.StorageDomainStatus.MAINTENANCE ; case Unknown : return org.ovirt.engine.api.model.StorageDomainStatus.UNKNOWN ; case Uninitialized : return null ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.StorageDomainStatus map ( org.ovirt.engine.api.model.StorageDomainStatus status , org.ovirt.engine.api.model.StorageDomainStatus template ) { switch ( status ) { case Unattached : return org.ovirt.engine.api.model.StorageDomainStatus.UNATTACHED ; case Active : return org.ovirt.engine.api.model.StorageDomainStatus.ACTIVE ; case Inactive : return org.ovirt.engine.api.model.StorageDomainStatus.INACTIVE ; case Locked : return org.ovirt.engine.api.model.StorageDomainStatus.LOCKED ; case PreparingForMaintenance : return org.ovirt.engine.api.model.StorageDomainStatus.PREPARING_FOR_MAINTENANCE ; case Maintenance : return org.ovirt.engine.api.model.StorageDomainStatus.MAINTENANCE ; case Unknown : return org.ovirt.engine.api.model.StorageDomainStatus.UNKNOWN ; case Uninitialized : return null ; default : return null ; } }
Source:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void setRefreshRate ( int interval ) { if ( ( getRefreshRate ( ) ) == interval ) { return ; } org.ovirt.engine.ui.uicommonweb.models.GridTimer.logger.fine ( ( ( ( "GridTimer[" + ( name ) ) + "]: Refresh Rate set to: " ) + interval ) ) ; normalInterval = interval ; org.ovirt.engine.ui.uicommonweb.models.GridTimerStateChangeEvent.fire ( this , getRefreshRate ( ) ) ; }

Target:
public void setRefreshRate ( int interval , boolean fireEvent ) { if ( ( getRefreshRate ( ) ) == interval ) { return ; } org.ovirt.engine.ui.uicommonweb.models.GridTimer.logger.fine ( ( ( ( "GridTimer[" + ( name ) ) + "]: Refresh Rate set to: " ) + interval ) ) ; normalInterval = interval ; if ( fireEvent ) { org.ovirt.engine.ui.uicommonweb.models.GridTimerStateChangeEvent.fire ( this , getRefreshRate ( ) ) ; } }
Source:
public void testGroups ( ) { org.ovirt.engine.core.compat.Match match = org.ovirt.engine.core.compat.Regex.match ( "ABC,123" , "([A-Z]+),([0-9]+)" ) ; org.junit.Assert.assertEquals ( "First Group" , "ABC" , match.groups ( ) . get ( 0 ) . getValue ( ) ) ; org.junit.Assert.assertEquals ( "Second Group" , "123" , match.groups ( ) . get ( 1 ) . getValue ( ) ) ; }

Target:
public void testGroups ( ) { org.ovirt.engine.core.compat.Match match = org.ovirt.engine.core.compat.Regex.match ( "ABC,123" , "([A-Z]+),([0-9]+)" ) ; org.junit.jupiter.api.Assertions.assertEquals ( "ABC" , match.groups ( ) . get ( 0 ) . getValue ( ) , "First Group" ) ; org.junit.jupiter.api.Assertions.assertEquals ( "123" , match.groups ( ) . get ( 1 ) . getValue ( ) , "Second Group" ) ; }
Source:
private boolean validateAttachment ( ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator validator = new org.ovirt.engine.core.bll.network.cluster.NetworkClusterValidator ( getNetworkCluster ( ) , org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ; return ( ( ( ! ( org.ovirt.engine.core.utils.NetworkUtils.isManagementNetwork ( getNetwork ( ) ) ) ) || ( validate ( validator.managementNetworkAttachment ( getNetworkName ( ) ) ) ) ) && ( validate ( validator.migrationPropertySupported ( getNetworkName ( ) ) ) ) ) && ( ( ! ( getPersistedNetwork ( ) . isExternal ( ) ) ) || ( validateExternalNetwork ( validator ) ) ) ; }

Target:
private boolean validateAttachment ( ) { final org.ovirt.engine.core.bll.network.cluster.AttachNetworkClusterValidator networkClusterValidator = new org.ovirt.engine.core.bll.network.cluster.AttachNetworkClusterValidator ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getNetworkCluster ( ) , getClusterVersion ( ) ) ; return ( validate ( networkClusterValidator.networkBelongsToClusterDataCenter ( org.ovirt.engine.core.bll.network.cluster.AttachNetworkToVdsGroupCommand.getVdsGroup ( ) , getNetwork ( ) ) ) ) && ( validateAttachment ( networkClusterValidator ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.DbGroup getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DbGroup entity = new org.ovirt.engine.core.common.businessentities.DbGroup ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setName ( NAMES [ index ] ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; entity.setExternalId ( new org.ovirt.engine.core.common.utils.ExternalId ( GUIDS [ index ] . toByteArray ( ) ) ) ; return entity ; }

Target:
protected org.ovirt.engine.core.common.businessentities.DbGroup getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.DbGroup entity = new org.ovirt.engine.core.common.businessentities.DbGroup ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setExternalId ( EXTERNAL_IDS [ index ] ) ; entity.setName ( NAMES [ index ] ) ; entity.setDomain ( org.ovirt.engine.api.restapi.resource.DOMAIN ) ; return entity ; }
Source:
public void testNetworksOnNicMatchMtu_networkMtuDoesNotMatch ( ) throws java.lang.Exception { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = java.util.Arrays.asList ( createNetwork ( 1 , false ) , createNetwork ( 2 , false ) ) ; java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > > networksOnNics = java.util.Collections.singletonMap ( "nicName" , networks ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator hostSetupNetworksValidator = createHostSetupNetworksValidator ( ) ; org.junit.Assert.assertThat ( hostSetupNetworksValidator.validateMtu ( networksOnNics ) , org.hamcrest.CoreMatchers.is ( false ) ) ; org.junit.Assert.assertThat ( hostSetupNetworksValidator.containsViolation ( VdcBllMessages.NETWORK_MTU_DIFFERENCES ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testNotRemovingLabeledNetworksReferencingUnlabeledNetworkRemovalIsOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network unlabeledNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unlabeledNetwork.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( unlabeledNetwork ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( java.util.Collections.singletonList ( unlabeledNetwork ) ) ; org.junit.Assert.assertThat ( validator.notRemovingLabeledNetworks ( networkAttachment , null ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static void getClusterById ( 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.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }
Source:
protected void initWidget ( T widget ) { super . initWidget ( widget ) ; widget.setModal ( true ) ; widget.setGlassEnabled ( true ) ; widget.addStyleName ( org.ovirt.engine.ui.common.view.AbstractPopupView.POPUP_CONTENT_STYLE_NAME ) ; }

Target:
protected void initWidget ( T widget ) { super . initWidget ( widget ) ; widget.setModal ( true ) ; widget.setGlassEnabled ( true ) ; widget.addStyleName ( org.ovirt.engine.ui.common.view.AbstractPopupView.POPUP_CONTENT_STYLE_NAME ) ; widget.removeStyleName ( org.ovirt.engine.ui.common.view.AbstractPopupView.GWT_POPUPPANEL ) ; widget.getElement ( ) . getStyle ( ) . setZIndex ( org.ovirt.engine.ui.common.view.AbstractPopupView.BOOTSTRAP_MODAL_ZINDEX ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetworkDAO ( ) . save ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) ) ; org.ovirt.engine.core.bll.network.cluster.NetworkHelper.addPermissions ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getCurrentUser ( ) . getUserId ( ) , org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) , org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getParameters ( ) . isPublicUse ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetworkDAO ( ) . save ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) ) ; org.ovirt.engine.core.bll.network.cluster.NetworkHelper.addPermissionsOnNetwork ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getCurrentUser ( ) . getUserId ( ) , org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.getNetwork ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.dc.AddNetworkCommand.setSucceeded ( true ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > getAllAsyncTasksFromDb ( org.ovirt.engine.core.bll.tasks.interfaces.CommandCoordinator coco ) { java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > asyncTasks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask : asyncTasks ) { map ( coco.getCommandEntity ( asyncTask.getCommandId ( ) ) , asyncTask ) ; } return asyncTasks ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTask > getAllAsyncTasksFromDb ( org.ovirt.engine.core.bll.tasks.interfaces.CommandCoordinator coco ) { java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTask > asyncTasks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.AsyncTask asyncTask : asyncTasks ) { asyncTask.setRootCmdEntity ( getCommandEntity ( asyncTask.getRootCommandId ( ) ) ) ; asyncTask.setChildCmdEntity ( getCommandEntity ( asyncTask.getCommandId ( ) ) ) ; } return asyncTasks ; }
Source:
public org.ovirt.engine.sdk.decorators.HostNICStatistic getById ( java.lang.String id ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ) + ( SLASH ) ) + id ; return getProxy ( ) . get ( url , org.ovirt.engine.sdk.entities.Statistic.class , org.ovirt.engine.sdk.decorators.HostNICStatistic.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.HostHostNicStatistic getById ( java.lang.String id ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ) + ( SLASH ) ) + id ; return getProxy ( ) . get ( url , org.ovirt.engine.sdk.entities.Statistic.class , org.ovirt.engine.sdk.decorators.HostHostNicStatistic.class ) ; }
Source:
public static java.lang.String mapToJson ( java.util.Map < java.lang.String , java.lang.Object > input , boolean prettyPrint ) throws java.io.IOException { org.codehaus.jackson.map.ObjectMapper mapper = new org.codehaus.jackson.map.ObjectMapper ( ) ; org.codehaus.jackson.JsonFactory factory = new org.codehaus.jackson.JsonFactory ( ) ; java.io.StringWriter writer = new java.io.StringWriter ( ) ; org.codehaus.jackson.JsonGenerator generator = factory.createJsonGenerator ( writer ) ; if ( prettyPrint ) { generator.useDefaultPrettyPrinter ( ) ; } mapper.writeValue ( generator , input ) ; return writer.toString ( ) ; }

Target:
public static java.lang.String mapToJson ( java.util.Map < java.lang.String , java.lang.Object > input , boolean prettyPrint ) throws java.io.IOException { return org.ovirt.engine.core.utils.JsonHelper.objectToJson ( input , prettyPrint ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) != null ) && ( getIsImportGlusterConfiguration ( ) . getEntity ( ) ) ) { getGlusterHostAddress ( ) . setIsChangable ( true ) ; getGlusterHostPassword ( ) . setIsChangable ( true ) ; } else { getGlusterHostAddress ( ) . setIsChangable ( false ) ; getGlusterHostPassword ( ) . setIsChangable ( false ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setIsFingerprintVerified ( false ) ; if ( ( ( getGlusterHostAddress ( ) . getEntity ( ) ) == null ) || ( ( getGlusterHostAddress ( ) . getEntity ( ) . trim ( ) . length ( ) ) == 0 ) ) { getGlusterHostFingerprint ( ) . setEntity ( "" ) ; return ; } fetchFingerprint ( getGlusterHostAddress ( ) . getEntity ( ) ) ; }
Source:
public void qosNotConfiguredOnAllNetworks ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = setupCompositeQosConfiguration ( false ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_INTERFACES_WITHOUT_QOS , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME ) ; }

Target:
public void customPropertiesNotSupported ( ) { 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.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_NOT_SUPPORTED , network.getName ( ) ) ; }
Source:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , boolean returnNull ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { entityId } , ( returnNull ? null : getEntity ( 0 ) ) ) ; }

Target:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , boolean returnNull ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { entityId } , ( returnNull ? null : getEntity ( 0 ) ) ) ; }
Source:
public void testExecuteQueryCommand ( ) { org.ovirt.engine.core.common.queries.IdQueryParameters params = getQueryParameters ( ) ; org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( storageDoaminId ) ; org.ovirt.engine.core.bll.snapshots.GetAllDiskSnapshotsByStorageDomainIdQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = getQuery ( ) ; query.executeQueryCommand ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = query.getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.Assert.assertEquals ( "There should be two images returned" , 2 , diskImages.size ( ) ) ; org.junit.Assert.assertEquals ( "DiskImage should contain the VmSnapshotDescription" , org.ovirt.engine.core.bll.snapshots.GetAllDiskSnapshotsByStorageDomainIdQueryTest.snapshotDescription , diskImages.get ( 0 ) . getVmSnapshotDescription ( ) ) ; }

Target:
public void testExecuteQueryCommand ( ) { org.ovirt.engine.core.common.queries.IdQueryParameters params = getQueryParameters ( ) ; org.mockito.Mockito.when ( params.getId ( ) ) . thenReturn ( storageDoaminId ) ; org.ovirt.engine.core.bll.snapshots.GetAllDiskSnapshotsByStorageDomainIdQuery < org.ovirt.engine.core.common.queries.IdQueryParameters > query = getQuery ( ) ; query.executeQueryCommand ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = query.getQueryReturnValue ( ) . getReturnValue ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , diskImages.size ( ) , "There should be two images returned" ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.bll.snapshots.GetAllDiskSnapshotsByStorageDomainIdQueryTest.snapshotDescription , diskImages.get ( 0 ) . getVmSnapshotDescription ( ) , "DiskImage should contain the VmSnapshotDescription" ) ; }
Source:
public void testFilterWithNotExistingPLugin ( ) throws org.apache.xmlrpc.XmlRpcException { proxy.filter ( new java.lang.String [ ] { "NOTEXISTINGPLUGIN-" + ( java.lang.System.currentTimeMillis ( ) ) } , org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ARRAY , org.ovirt.schedulerproxy.SchedulerProxyTest.VM_ID , "" ) ; }

Target:
public void testFilterWithNotExistingPlugin ( ) throws org.apache.xmlrpc.XmlRpcException { java.lang.String notExistingPluginName = "NOTEXISTINGPLUGIN-" + ( java.lang.System.currentTimeMillis ( ) ) ; org.ovirt.schedulerproxy.FilteringResult result = proxy.filter ( new java.lang.String [ ] { notExistingPluginName } , org.ovirt.schedulerproxy.SchedulerProxyTest.HOST_ARRAY , org.ovirt.schedulerproxy.SchedulerProxyTest.VM_ID , "" ) ; org.junit.Assert.assertTrue ( result.getPluginErrors ( ) . containsKey ( notExistingPluginName ) ) ; org.junit.Assert.assertTrue ( ( ( result.getResultCode ( ) ) != 0 ) ) ; }
Source:
private static void setGatewayIfNecessary ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String gateway ) { if ( ( ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( host.getVdsGroupCompatibilityVersion ( ) ) ) || ( org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) . equals ( iface.getNetworkName ( ) ) ) ) || ( iface.getName ( ) . equals ( host.getActiveNic ( ) ) ) ) { iface.setGateway ( gateway ) ; } }

Target:
private static void setGatewayIfNecessary ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String gateway ) { if ( ( ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( host.getVdsGroupCompatibilityVersion ( ) ) ) || ( org.ovirt.engine.core.utils.NetworkUtils.getDefaultManagementNetworkName ( ) . equals ( iface.getNetworkName ( ) ) ) ) || ( iface.getName ( ) . equals ( host.getActiveNic ( ) ) ) ) { iface.setGateway ( gateway ) ; } }
Source:
private void warnIfNotAllDisksPermitSnapshots ( ) { for ( org.ovirt.engine.core.common.businessentities.Disk disk : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) { if ( ! ( disk.isAllowSnapshot ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.USER_RUN_VM_AS_STATELESS_WITH_DISKS_NOT_ALLOWING_SNAPSHOT ) ; break ; } } }

Target:
private void warnIfNotAllDisksPermitSnapshots ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) { if ( ! ( disk.isAllowSnapshot ( ) ) ) { new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( this , AuditLogType.USER_RUN_VM_AS_STATELESS_WITH_DISKS_NOT_ALLOWING_SNAPSHOT ) ; break ; } } }