auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.api.model.AffinityLabel update ( org.ovirt.engine.api.model.AffinityLabel incoming ) { org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > labelResolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetLabelById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.core.common.businessentities.Label entity = getEntity ( labelResolver , true ) ; org.ovirt.engine.api.model.AffinityLabel label = performUpdate ( incoming , entity , map ( entity ) , labelResolver , ActionType.UpdateLabel , new org.ovirt.engine.api.restapi.resource.BackendAffinityLabelResource.UpdateParametersProvider ( ) ) ; return label ; }

Target:
public org.ovirt.engine.api.model.AffinityLabel update ( org.ovirt.engine.api.model.AffinityLabel incoming ) { org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > labelResolver = new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.QueryType.GetLabelById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ; org.ovirt.engine.core.common.businessentities.Label entity = getEntity ( labelResolver , true ) ; org.ovirt.engine.api.model.AffinityLabel label = performUpdate ( incoming , entity , map ( entity ) , labelResolver , ActionType.UpdateLabel , new org.ovirt.engine.api.restapi.resource.BackendAffinityLabelResource.UpdateParametersProvider ( ) ) ; return label ; }
Source:
public void getVolumeSnapshotSchedule ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { 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.GetGlusterVolumeSnapshotScheduleByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }

Target:
public void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
private void logHostFailToRespond ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ex , long timeoutToFence ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.info ( ( "Server failed to respond, vds_id='{}', vds_name='{}', vm_count={}, " + "spm_status='{}', non-responsive_timeout (seconds)={}, error: {}" ) , cachedVds.getId ( ) , cachedVds.getName ( ) , cachedVds.getVmCount ( ) , cachedVds.getSpmStatus ( ) , java.util.concurrent.TimeUnit.MILLISECONDS.toSeconds ( timeoutToFence ) , ex.getMessage ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ; logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( cachedVds.getId ( ) ) ; logable.updateCallStackFromThrowable ( ex ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VDS_FAILURE ) ; }

Target:
private void logHostFailToRespond ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException ex , long timeoutToFence ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.info ( ( "Server failed to respond, vds_id='{}', vds_name='{}', vm_count={}, " + "spm_status='{}', non-responsive_timeout (seconds)={}, error: {}" ) , cachedVds.getId ( ) , cachedVds.getName ( ) , cachedVds.getVmCount ( ) , cachedVds.getSpmStatus ( ) , java.util.concurrent.TimeUnit.MILLISECONDS.toSeconds ( timeoutToFence ) , ex.getMessage ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable ; logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( cachedVds.getId ( ) ) ; logable.updateCallStackFromThrowable ( ex ) ; auditLogDirector.log ( logable , AuditLogType.VDS_FAILURE ) ; }
Source:
public void validateVmDuringSnapshot ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , null , diskImageId ) ; org.mockito.Mockito.when ( snapshotDao.exists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( Snapshot.SnapshotStatus.LOCKED ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT ) ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IS_DURING_SNAPSHOT ) ; }

Target:
public void validateFailsOnPassDiscardSupport ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.common.businessentities.StorageDomain srcSd = initStorageDomain ( srcStorageId ) ; srcSd.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstSd = initStorageDomain ( dstStorageId ) ; dstSd.setStatus ( StorageDomainStatus.Active ) ; org.mockito.Mockito.when ( diskVmElementValidator.isPassDiscardSupported ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( ( ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) || ( lastExecutedCommand == ( getModel ( ) . getStopCommand ( ) ) ) ) || ( lastExecutedCommand == ( getModel ( ) . getShutdownCommand ( ) ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel , org.ovirt.engine.ui.uicommonweb.models.vms.VmSessionsModel > getVmSessionsProvider ( org.ovirt.engine.ui.webadmin.gin.ClientGinjector ginjector ) { return new org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel , org.ovirt.engine.ui.uicommonweb.models.vms.VmSessionsModel > ( ginjector , org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.class , org.ovirt.engine.ui.uicommonweb.models.vms.VmSessionsModel.class ) ; }
Source:
public void testValidateModifiedBondSlaves_whenSlaveIsNotValid ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidateModifiedBondSlaves ( bond , null , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) , false , VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
private void clusterHasVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setstatus ( VDSStatus.Up ) ; vds.setsupported_cluster_levels ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1.toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDAO.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }

Target:
private void clusterHasVds ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setSupportedClusterLevels ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1.toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDAO.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }
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 ( ) . name ( ) ) . 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.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 ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc fenceSpmStorage ( java.lang.String spUUID , int prevID , java.lang.String prevLVER ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StoragePool.fence" ) . withParameter ( "storagepoolID" , spUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc updateVmPolicy ( java.util.Map params ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.updateVmPolicy" ) . withParameter ( "params" , params ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.column.Context context , com.google.gwt.resources.client.ImageResource value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { sb.append ( org.ovirt.engine.ui.common.widget.table.column.StyledImageResourceCell.template.imageContainerWithStyleClass ( style , styleClass , com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( value ) . getHTML ( ) ) ) ) ; } }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.resources.client.ImageResource value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { sb.append ( org.ovirt.engine.ui.common.widget.table.cell.StyledImageResourceCell.template.imageContainerWithStyleClass ( style , styleClass , com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( value ) . getHTML ( ) ) ) ) ; } }
Source:
private void InitCache ( ) { if ( ( fenceOptionMapping ) == null ) { org.ovirt.engine.core.utils.pm.VdsFenceOptions.fenceAgentInstanceOptions = new java.util.HashMap < > ( ) ; fenceOptionMapping = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fenceOptionTypes = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fenceSpecialParams = new java.util.HashSet < > ( ) ; cacheFenceAgentsOptionMapping ( ) ; cacheFenceAgentsOptionTypes ( ) ; } }

Target:
private void initCache ( ) { if ( ( fenceOptionMapping ) == null ) { org.ovirt.engine.core.utils.pm.VdsFenceOptions.fenceAgentInstanceOptions = new java.util.HashMap < > ( ) ; fenceOptionMapping = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fenceOptionTypes = new java.util.HashMap < > ( ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fenceSpecialParams = new java.util.HashSet < > ( ) ; cacheFenceAgentsOptionMapping ( ) ; cacheFenceAgentsOptionTypes ( ) ; } }
Source:
public void testNotRemovingUsedPoolRecordNotUsed ( ) throws java.lang.Exception { macPool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( macPoolDaoMock.getDcUsageCount ( org.mockito.Matchers.eq ( macPool.getId ( ) ) ) ) . thenReturn ( 0 ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.MacPoolValidator ( macPool ) . notRemovingUsedPool ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testMacPoolExistsEntityDoesExist ( ) throws java.lang.Exception { org.junit.Assert.assertThat ( macPoolValidator.macPoolExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByStoragePoolId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; control.replay ( ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; control.replay ( ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.AbstractBackendNetworksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void nameNotUsed ( ) { org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( null ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void setup ( ) { mockConfigRule.mockConfigValue ( ConfigValues.MaxVdsNameLength , org.ovirt.engine.core.bll.validator.HostValidatorTest.HOST_NAME_SIZE ) ; mockConfigRule.mockConfigValue ( ConfigValues.EncryptHostCommunication , java.lang.Boolean.TRUE ) ; org.mockito.Mockito.when ( dbFacade.getClusterDao ( ) ) . thenReturn ( clusterDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; }

Target:
public static org.ovirt.engine.core.common.businessentities.DiskInterface GetDefaultDiskInterface ( org.ovirt.engine.core.common.businessentities.VmOsType osType , java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks ) { return osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.WindowsXP ) ? org.ovirt.engine.core.common.businessentities.DiskInterface.IDE : ( disks != null ) && ( ( disks.size ( ) ) > 0 ) ? disks.get ( 0 ) . getDiskInterface ( ) : org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO ; }
Source:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; }

Target:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }
Source:
public void getAllErrata ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Erratum > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetErrataForEngine , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getAllErrata ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Erratum > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetErrataForEngine , new org.ovirt.engine.core.common.queries.GetErrataCountsParameters ( ) , aQuery ) ; }
Source:
private void addVmToPool ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmToPoolParameters parameters = new org.ovirt.engine.core.common.action.AddVmToPoolParameters ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getPoolId ( ) , vmStatic.getId ( ) ) ; parameters.setShouldBeLogged ( false ) ; setSucceeded ( runInternalActionWithTasksContext ( VdcActionType.AddVmToPool , parameters ) . getSucceeded ( ) ) ; org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.addVmPermission ( ) ; }

Target:
private void addVmToPool ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.AddVmToPoolParameters parameters = new org.ovirt.engine.core.common.action.AddVmToPoolParameters ( org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.getParameters ( ) . getPoolId ( ) , vmStatic.getId ( ) ) ; parameters.setShouldBeLogged ( false ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = runInternalActionWithTasksContext ( VdcActionType.AddVmToPool , parameters ) ; setSucceeded ( result.getSucceeded ( ) ) ; org.ovirt.engine.core.bll.AddVmAndAttachToPoolCommand.addVmPermission ( ) ; }
Source:
private static void convertAAAProfilesResult ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , final boolean passwordBasedOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.List < java.lang.String > results = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; } } ; }

Target:
private static void convertAAAProfilesResult ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , final boolean passwordBasedOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.List < java.lang.String > results = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.aaa.ProfileEntry profileEntry : ( ( java.util.Collection < org.ovirt.engine.core.aaa.ProfileEntry > ) ( source ) ) ) { if ( ( ! passwordBasedOnly ) || ( profileEntry.getSupportsPasswordAuthenication ( ) ) ) { results.add ( profileEntry.getProfile ( ) ) ; } } return results ; } } ; }
Source:
public static java.lang.Object [ ] [ ] namesParams ( ) { return new java.lang.Object [ ] [ ] { new java.lang.Object [ ] { "a.a.a.a" , false , false } , new java.lang.Object [ ] { "253.0.0.32/26" , true , false } , new java.lang.Object [ ] { "255.255.255.255/32" , true , true } } ; }

Target:
public static java.util.stream.Stream < org.junit.jupiter.params.provider.Arguments > namesParams ( ) { return java.util.stream.Stream.of ( org.junit.jupiter.params.provider.Arguments.of ( "a.a.a.a" , false , false ) , org.junit.jupiter.params.provider.Arguments.of ( "253.0.0.32/26" , true , false ) , org.junit.jupiter.params.provider.Arguments.of ( "255.255.255.255/32" , true , true ) ) ; }
Source:
public static void GetStorageDomainListByTemplate ( 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.storage_domains > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.GetStorageDomainsByVmTemplateIdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void GetTemplateListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesByStoragePoolId , new org.ovirt.engine.core.common.queries.GetVmTemplatesByStoragePoolIdParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel createModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior ) { return new org.ovirt.engine.ui.uicommonweb.models.pools.PoolModel ( behavior ) ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel createModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior ) { final org.ovirt.engine.core.common.businessentities.VDSGroup cluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; cluster.setCompatibilityVersion ( org.ovirt.engine.ui.uicommonweb.models.vms.CLUSTER_VERSION ) ; org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = new org.ovirt.engine.ui.uicommonweb.models.pools.PoolModel ( behavior ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.VDSGroup getSelectedCluster ( ) { return cluster ; } } ; mockAsyncDataProvider ( model ) ; return model ; }
Source:
protected < T > T getFenceConfigurationValue ( java.lang.Class < T > clz , org.ovirt.engine.core.common.queries.ConfigurationValues config , final org.ovirt.engine.api.model.Version version ) { return getEntity ( clz , VdcQueryType.GetFenceConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( config , org.ovirt.engine.api.restapi.resource.BackendResource.asString ( version ) ) , config.toString ( ) ) ; }

Target:
protected < T > T getConfigurationValueDefault ( org.ovirt.engine.core.common.queries.ConfigurationValues config ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( config , org.ovirt.engine.core.common.config.ConfigCommon.defaultConfigurationVersion ) ) ; if ( result.getSucceeded ( ) ) { return ( ( T ) ( result.getReturnValue ( ) ) ) ; } return null ; }
Source:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue runQuery ( org.ovirt.engine.core.common.queries.VdcQueryType search , org.ovirt.engine.core.common.queries.VdcQueryParametersBase searchParameters ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunQuery invoked!" ) ; debugQuery ( search , searchParameters ) ; searchParameters.setSessionId ( getEngineSessionId ( ) ) ; return getBackend ( ) . runQuery ( search , searchParameters ) ; }

Target:
public org.ovirt.engine.core.common.queries.VdcQueryReturnValue runQuery ( org.ovirt.engine.core.common.queries.VdcQueryType search , org.ovirt.engine.core.common.queries.VdcQueryParametersBase searchParameters ) { org.ovirt.engine.ui.frontend.server.gwt.GenericApiGWTServiceImpl.log.debug ( "Server: RunQuery invoked!" ) ; debugQuery ( search , searchParameters ) ; searchParameters.setSessionId ( getEngineSessionId ( ) ) ; if ( ( searchParameters.getCorrelationId ( ) ) == null ) { searchParameters.setCorrelationId ( org.ovirt.engine.core.utils.CorrelationIdTracker.getCorrelationId ( ) ) ; } return getBackend ( ) . runQuery ( search , searchParameters ) ; }
Source:
public void testSetDetectEmulatedMachine ( ) { boolean preUpdate = existingCluster.isDetectEmulatedMachine ( ) ; boolean updateValue = false ; org.junit.Assert.assertNotEquals ( updateValue , preUpdate ) ; dao.setEmulatedMachine ( existingCluster.getId ( ) , existingCluster.getEmulatedMachine ( ) , updateValue ) ; org.junit.Assert.assertEquals ( updateValue , dao.get ( existingCluster.getId ( ) ) . isDetectEmulatedMachine ( ) ) ; }

Target:
public void testSetDetectEmulatedMachine ( ) { boolean preUpdate = existingCluster.isDetectEmulatedMachine ( ) ; boolean updateValue = false ; org.junit.jupiter.api.Assertions.assertNotEquals ( updateValue , preUpdate ) ; dao.setEmulatedMachine ( existingCluster.getId ( ) , existingCluster.getEmulatedMachine ( ) , updateValue ) ; org.junit.jupiter.api.Assertions.assertEquals ( updateValue , dao.get ( existingCluster.getId ( ) ) . isDetectEmulatedMachine ( ) ) ; }
Source:
private static java.lang.String getUnsafeInterrupts ( org.ovirt.engine.core.common.utils.CpuVendor cpuVendor , boolean unsafeInterrupts ) { if ( ! unsafeInterrupts ) { return "" ; } switch ( cpuVendor ) { case AMD : case INTEL : return "vfio_iommu_type1.allow_unsafe_interrupts=on " ; case IBM : return "" ; default : throw new java.lang.RuntimeException ( ( "Unknown CpuType: " + cpuVendor ) ) ; } }

Target:
private static java.lang.String getUnsafeInterrupts ( org.ovirt.engine.core.common.utils.CpuVendor cpuVendor , boolean unsafeInterrupts ) { if ( ! unsafeInterrupts ) { return "" ; } switch ( cpuVendor ) { case AMD : case INTEL : return "vfio_iommu_type1.allow_unsafe_interrupts=1 " ; case IBM : return "" ; default : throw new java.lang.RuntimeException ( ( "Unknown CpuType: " + cpuVendor ) ) ; } }
Source:
void transmitOperation ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < ? , ? > operation ) { if ( ( operation.getOperation ( ) ) instanceof org.ovirt.engine.core.common.action.VdcActionType ) { runAction ( operation ) ; } else { if ( operation.isPublic ( ) ) { runPublicQuery ( operation ) ; } else { runQuery ( operation ) ; } } }

Target:
void transmitOperation ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < ? , ? > operation ) { if ( operation.isAction ( ) ) { runAction ( operation ) ; } else { if ( operation.isPublic ( ) ) { runPublicQuery ( operation ) ; } else { runQuery ( operation ) ; } } }
Source:
protected org.ovirt.engine.core.compat.Guid getHostId ( org.ovirt.engine.api.model.Host host ) { return host.isSetId ( ) ? new org.ovirt.engine.core.compat.Guid ( host.getId ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.VDS.class , VdcQueryType.GetVdsByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( host.getName ( ) ) , host.getName ( ) ) . getId ( ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid getHostId ( org.ovirt.engine.api.model.Host host ) { return host.isSetId ( ) ? asGuid ( host.getId ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.VDS.class , VdcQueryType.GetVdsByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( host.getName ( ) ) , host.getName ( ) ) . getId ( ) ; }
Source:
public final void initialize ( ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock lock = writeLockResource ( ) ) { if ( initialized ) { org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.log.error ( "Trying to initialize multiple times." ) ; return ; } final java.util.List < org.ovirt.engine.core.common.businessentities.MacPool > macPools = getMacPoolDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.MacPool macPool : macPools ) { initializeMacPool ( macPool ) ; } initialized = true ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.log.info ( "successfully initialized" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.log.error ( "not initialized." ) ; throw e ; } }

Target:
void initialize ( ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock lock = writeLockResource ( ) ) { if ( initialized ) { org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.log.error ( "Trying to initialize multiple times." ) ; return ; } final java.util.List < org.ovirt.engine.core.common.businessentities.MacPool > macPools = macPoolDao.getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.MacPool macPool : macPools ) { initializeMacPool ( macPool ) ; } initialized = true ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.log.info ( "Successfully initialized" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.log.error ( "Error initializing: {}" , e.getMessage ( ) ) ; throw e ; } }
Source:
protected static java.util.Set < org.ovirt.engine.core.common.businessentities.BaseDisk > getDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.BaseDisk > diskMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.BaseDisk > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Disk diskImage : diskImages ) { diskMap.put ( diskImage.getId ( ) , diskImage ) ; } return new java.util.HashSet < org.ovirt.engine.core.common.businessentities.BaseDisk > ( diskMap.values ( ) ) ; }

Target:
protected static java.util.Set < org.ovirt.engine.core.common.businessentities.storage.BaseDisk > getDisks ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.BaseDisk > diskMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk diskImage : diskImages ) { diskMap.put ( diskImage.getId ( ) , diskImage ) ; } return new java.util.HashSet ( diskMap.values ( ) ) ; }
Source:
public static 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 ) ; }

Target:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public void getGlusterVolumeSnapshotsForVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid volumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotsByVolumeId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( volumeId ) , aQuery ) ; }
Source:
public void testValidRemovedBondsWhenReferencedInterfaceIsNotBond ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface notABond = createNic ( "nicName" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedBonds ( notABond.getId ( ) ) ) . addExistingInterfaces ( java.util.Collections.singletonList ( notABond ) ) . build ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , notABond.getName ( ) ) ) ) ; }

Target:
public void testValidRemovedBondsWhenReferencedInterfaceIsNotBond ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface notABond = createNic ( "nicName" ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedBonds ( notABond.getId ( ) ) ) . addExistingInterfaces ( java.util.Collections.singletonList ( notABond ) ) . build ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_IS_NOT_BOND ; org.hamcrest.MatcherAssert.assertThat ( validator.validRemovedBonds ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , notABond.getName ( ) ) ) ) ; }
Source:
public void testRunningVmSerialization ( ) throws java.lang.Exception { org.ovirt.optimizer.setup.JacksonContextResolver contextResolver = new org.ovirt.optimizer.setup.JacksonContextResolver ( ) ; org.codehaus.jackson.map.ObjectMapper mapper = contextResolver.getContext ( org.ovirt.engine.sdk.decorators.Host.class ) ; org.ovirt.optimizer.service.facts.RunningVm original = new org.ovirt.optimizer.service.facts.RunningVm ( "test" ) ; org.ovirt.optimizer.service.facts.RunningVm other = mapper.reader ( ) . withType ( org.ovirt.optimizer.service.facts.RunningVm.class ) . readValue ( mapper.writeValueAsString ( original ) ) ; org.junit.Assert.assertEquals ( original.getId ( ) , other.getId ( ) ) ; }

Target:
public void testRunningVmSerialization ( ) throws java.lang.Exception { org.ovirt.optimizer.setup.JacksonContextResolver contextResolver = new org.ovirt.optimizer.setup.JacksonContextResolver ( ) ; org.codehaus.jackson.map.ObjectMapper mapper = contextResolver.getContext ( org.ovirt.engine.sdk.decorators.Host.class ) ; org.ovirt.optimizer.solver.facts.RunningVm original = new org.ovirt.optimizer.solver.facts.RunningVm ( "test" ) ; org.ovirt.optimizer.solver.facts.RunningVm other = mapper.reader ( ) . withType ( org.ovirt.optimizer.solver.facts.RunningVm.class ) . readValue ( mapper.writeValueAsString ( original ) ) ; org.junit.Assert.assertEquals ( original.getId ( ) , other.getId ( ) ) ; }
Source:
public void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public 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.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn < org.ovirt.engine.core.common.businessentities.Disk > getSnapshotSizeColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn < org.ovirt.engine.core.common.businessentities.Disk > ( ) { @ java.lang.Override protected java.lang.Long getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) . getActualSizeInBytes ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > getSnapshotSizeColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractDiskSizeColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) { @ java.lang.Override protected java.lang.Long getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) . getActualSizeInBytes ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
protected static org.ovirt.engine.core.common.businessentities.VM buildVmOnNewTemplate ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VM tempVar = new org.ovirt.engine.core.common.businessentities.VM ( ) ; tempVar.setId ( vm.getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonUnitToVmBaseBuilder ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( vm.getStaticData ( ) , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.UsbPolicyVmBaseToVmBaseBuilder ( ) ) ; return tempVar ; }

Target:
protected static org.ovirt.engine.core.common.businessentities.VM buildVmOnNewTemplate ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.core.common.businessentities.VM tempVar = new org.ovirt.engine.core.common.businessentities.VM ( ) ; tempVar.setId ( vm.getId ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( model , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.CommonUnitToVmBaseBuilder < org.ovirt.engine.core.common.businessentities.VmStatic > ( ) ) ; org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( vm.getStaticData ( ) , tempVar.getStaticData ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.KernelParamsVmBaseToVmBaseBuilder ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.UsbPolicyVmBaseToVmBaseBuilder ( ) ) ; return tempVar ; }
Source:
private static void mapNetworkQosToModel ( org.ovirt.engine.core.common.businessentities.qos.QosBase entity , org.ovirt.engine.api.model.QoS model ) { org.ovirt.engine.core.common.businessentities.network.NetworkQoS networkQos = org.ovirt.engine.api.restapi.types.QosMapper.verifyAndCast ( entity , org.ovirt.engine.core.common.businessentities.network.NetworkQoS.class ) ; if ( networkQos != null ) { model.setInboundAverage ( networkQos.getInboundAverage ( ) ) ; model.setInboundPeak ( networkQos.getInboundPeak ( ) ) ; model.setInboundBurst ( networkQos.getInboundBurst ( ) ) ; model.setOutboundAverage ( networkQos.getOutboundAverage ( ) ) ; model.setOutboundPeak ( networkQos.getOutboundPeak ( ) ) ; model.setOutboundBurst ( networkQos.getOutboundBurst ( ) ) ; } }

Target:
private static void mapNetworkQosToModel ( org.ovirt.engine.core.common.businessentities.qos.QosBase entity , org.ovirt.engine.api.model.Qos model ) { org.ovirt.engine.core.common.businessentities.network.NetworkQoS networkQos = org.ovirt.engine.api.restapi.types.QosMapper.verifyAndCast ( entity , org.ovirt.engine.core.common.businessentities.network.NetworkQoS.class ) ; if ( networkQos != null ) { model.setInboundAverage ( networkQos.getInboundAverage ( ) ) ; model.setInboundPeak ( networkQos.getInboundPeak ( ) ) ; model.setInboundBurst ( networkQos.getInboundBurst ( ) ) ; model.setOutboundAverage ( networkQos.getOutboundAverage ( ) ) ; model.setOutboundPeak ( networkQos.getOutboundPeak ( ) ) ; model.setOutboundBurst ( networkQos.getOutboundBurst ( ) ) ; } }
Source:
public boolean equals ( java.lang.Object o ) { return ( ( o != null ) && ( ( getClass ( ) ) == ( o.getClass ( ) ) ) ) && ( map.equals ( ( ( org.ovirt.engine.api.extensions.ExtMap ) ( o ) ) . map ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.api.extensions.ExtMap ) ) { return false ; } org.ovirt.engine.api.extensions.ExtMap other = ( ( org.ovirt.engine.api.extensions.ExtMap ) ( obj ) ) ; return java.util.Objects.equals ( map , other.map ) ; }