auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.util.concurrent.Future < java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse > > batchCall ( java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest > requests ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.internal.BatchCall call = new org.ovirt.vdsm.jsonrpc.client.internal.BatchCall ( requests ) ; for ( final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request : requests ) { this . tracker.registerCall ( request , call ) ; } try { this . getClient ( ) . sendMessage ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.jsonToByteArray ( requests ) ) ; } finally { retryBatchCall ( requests , call ) ; } return call ; }

Target:
public java.util.concurrent.Future < java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse > > batchCall ( java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest > requests ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.internal.BatchCall call = new org.ovirt.vdsm.jsonrpc.client.internal.BatchCall ( requests ) ; for ( final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request : requests ) { this . tracker.registerCall ( request , call ) ; retryCall ( request , call ) ; } try { this . getClient ( ) . sendMessage ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.jsonToByteArray ( requests ) ) ; } finally { retryBatchCall ( requests , call ) ; } return call ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo host = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo ) ( obj ) ) ; return ( ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getUuid ( ) , host.getUuid ( ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getHostnameOrIp ( ) , host.getHostnameOrIp ( ) ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( getStatus ( ) , host.getStatus ( ) ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo host = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo ) ( obj ) ) ; return ( ( java.util.Objects.equals ( getUuid ( ) , host.getUuid ( ) ) ) && ( java.util.Objects.equals ( getHostnameOrIp ( ) , host.getHostnameOrIp ( ) ) ) ) && ( java.util.Objects.equals ( getStatus ( ) , host.getStatus ( ) ) ) ; }
Source:
public void initialize ( ) { super . initialize ( ) ; if ( ( getVm ( ) ) != null ) { updateSuggestedDiskAliasFromServer ( ) ; getIsPlugged ( ) . setIsAvailable ( true ) ; } else { getIsReadOnly ( ) . setIsAvailable ( false ) ; getIsPlugged ( ) . setEntity ( false ) ; } getSizeExtend ( ) . setIsAvailable ( false ) ; }

Target:
public void initialize ( ) { super . initialize ( ) ; if ( ( getVm ( ) ) != null ) { updateSuggestedDiskAliasFromServer ( ) ; getIsPlugged ( ) . setIsAvailable ( true ) ; } else { getIsReadOnly ( ) . setIsAvailable ( false ) ; getIsPlugged ( ) . setEntity ( false ) ; getIsUsingScsiReservation ( ) . setIsAvailable ( false ) ; getIsUsingScsiReservation ( ) . setEntity ( false ) ; } getSizeExtend ( ) . setIsAvailable ( false ) ; }
Source:
public void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { 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.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
protected void endWithFailure ( ) { setVm ( null ) ; if ( ( getVm ( ) ) != null ) { removeVmSnapshots ( getVm ( ) ) ; endActionOnAllImageGroups ( ) ; removeVmNetworkInterfaces ( ) ; getVmDynamicDAO ( ) . remove ( getVmId ( ) ) ; getVmStatisticsDAO ( ) . remove ( getVmId ( ) ) ; getVmStaticDAO ( ) . remove ( getVmId ( ) ) ; setSucceeded ( true ) ; } else { setVm ( getParameters ( ) . getVm ( ) ) ; getReturnValue ( ) . setEndActionTryAgain ( false ) ; } }

Target:
private void addVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( getVmId ( ) ) ; tempVar.setStatus ( VMStatus.ImageLocked ) ; tempVar.setVmHost ( "" ) ; tempVar.setVmIp ( "" ) ; tempVar.setAppList ( getParameters ( ) . getVm ( ) . getDynamicData ( ) . getAppList ( ) ) ; org.ovirt.engine.core.bll.ImportVmCommand.getVmDynamicDAO ( ) . save ( tempVar ) ; org.ovirt.engine.core.bll.ImportVmCommand.getCompensationContext ( ) . snapshotNewEntity ( tempVar ) ; }
Source:
public void PostOnAddCluster ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { Cancel ( ) ; PostAction ( ) ; } }

Target:
public void postOnAddCluster ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; postAction ( ) ; } }
Source:
public void refreshAllUsers ( ) { org.ovirt.engine.core.bll.SyncUsers.sync ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . getAll ( ) ) ; }

Target:
public void refreshAllUsers ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DbUser > activeUsers = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DbUser dbUser : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . getAll ( ) ) { if ( dbUser.isActive ( ) ) { activeUsers.add ( dbUser ) ; } } for ( org.ovirt.engine.core.common.businessentities.DbUser user : org.ovirt.engine.core.bll.SyncUsers.sync ( activeUsers ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . update ( user ) ; } }
Source:
public void setRefreshRate ( int interval ) { if ( ( getRefreshRate ( ) ) == interval ) { return ; } reset ( ) ; org.ovirt.engine.ui.uicommonweb.models.GridTimer.logger.fine ( ( ( ( "GridTimer[" + ( name ) ) + "]: Refresh Rate set to: " ) + interval ) ) ; normalInterval = interval ; com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( this , getRefreshRate ( ) ) ; }

Target:
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 ( ) ) ; }
Source:
public void checkCidrCidrIsNotANetworkAddress ( ) { org.mockito.Mockito.doReturn ( true ) . when ( mockedCidrValidator ) . isCidrFormatValid ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.mockito.Mockito.doReturn ( false ) . when ( mockedCidrValidator ) . isCidrNetworkAddressValid ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult actualResult = underTest.validate ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult expectedResult = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( false , java.util.Collections.singletonList ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR_IS_NOT_A_NETWORK_ADDRESS ) ) ; org.junit.Assert.assertEquals ( expectedResult , actualResult ) ; }

Target:
public void checkCidrCidrIsNotANetworkAddress ( ) { org.mockito.Mockito.doReturn ( true ) . when ( mockedCidrValidator ) . isCidrFormatValid ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.mockito.Mockito.doReturn ( false ) . when ( mockedCidrValidator ) . isCidrNetworkAddressValid ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult actualResult = underTest.validate ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult expectedResult = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( false , java.util.Collections.singletonList ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR_IS_NOT_A_NETWORK_ADDRESS ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( expectedResult , actualResult ) ; }
Source:
public void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , 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 getIsGlusterVolumeSnapshotCliScheduleEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeSnapshotCliScheduleFlag , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
public void freeMac ( long mac ) { checkIfMacIsFromWithinRange ( mac ) ; int arrayIndex = macToArrayIndex ( mac ) ; if ( ! ( usedMacs.get ( arrayIndex ) ) ) { return ; } final boolean duplicatesExist = ( macDuplicityCount.count ( arrayIndex ) ) != 0 ; if ( duplicatesExist ) { macDuplicityCount.remove ( arrayIndex ) ; } else { usedMacs.set ( arrayIndex , false ) ; ( availableMacsCount ) ++ ; } }

Target:
public void freeMac ( long mac ) { checkIfMacIsFromWithinRange ( mac ) ; int arrayIndex = macToArrayIndex ( mac ) ; if ( ! ( usedMacs.get ( arrayIndex ) ) ) { return ; } final boolean duplicatesExist = ( macDuplicityCount.count ( arrayIndex ) ) != 0 ; if ( duplicatesExist ) { macDuplicityCount.decrease ( arrayIndex ) ; } else { usedMacs.set ( arrayIndex , false ) ; ( availableMacsCount ) ++ ; } }
Source:
private void Edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , ( ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ) ( getSelectedItem ( ) ) ) , this ) ; setWindow ( model ) ; }

Target:
private void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditVmInterfaceModel.createInstance ( getEntity ( ) . getStaticData ( ) , getEntity ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , ( ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ) ( getSelectedItem ( ) ) ) , this ) ; setWindow ( model ) ; }
Source:
public void getConfigurationValueBoolean ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.queries.ConfigurationValues configVal ) { 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.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( configVal , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery < java.lang.Boolean > aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.IsNonEmptyCollectionConverter ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void getAAANamespaces ( 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.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getAAANamespaces ( 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.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.lang.String pk = ( ( java.lang.String ) ( result ) ) ; if ( ( pk != null ) && ( ( pk.length ( ) ) > 0 ) ) { getPublicKey ( ) . setEntity ( result ) ; } }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.maxSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; initSpmPriorities1 ( ) ; }
Source:
public void validateFailedVirtIODisk ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; org.mockito.Mockito.when ( osRepository.getOsName ( 0 ) ) . thenReturn ( "RHEL6" ) ; createNotVirtIODisk ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.HOT_PLUG_IDE_DISK_IS_NOT_SUPPORTED.toString ( ) ) ) ; }

Target:
public void validateFailedWrongPlugStatus ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeDiskWrongPlug ( true ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.HOT_PLUG_DISK_IS_NOT_UNPLUGGED ) ; }
Source:
protected void syncSearch ( ) { org.ovirt.engine.core.common.queries.SearchParameters tempVar = new org.ovirt.engine.core.common.queries.SearchParameters ( applySortOptions ( getSearchString ( ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS , isCaseSensitiveSearch ( ) ) ; tempVar.setMaxCount ( getSearchPageSize ( ) ) ; super . syncSearch ( VdcQueryType.Search , tempVar ) ; }

Target:
protected void syncSearch ( ) { org.ovirt.engine.core.common.queries.SearchParameters tempVar = new org.ovirt.engine.core.common.queries.SearchParameters ( applySortOptions ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSearchString ( ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS , org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.isCaseSensitiveSearch ( ) ) ; tempVar.setMaxCount ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSearchPageSize ( ) ) ; super . syncSearch ( VdcQueryType.Search , tempVar ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeBrickAdd ( java.lang.String volumeName , java.lang.String [ ] bricks , int replicaCount , int stripeCount ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.addBrick" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "brickList" , new java.util.ArrayList < > ( java.util.Arrays.asList ( bricks ) ) ) . withParameter ( "replicaCount" , replicaCount ) . withParameter ( "stripeCount" , stripeCount ) . 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.HostJobsReturnForXmlRpc getHostJobs ( java.lang.String jobType , java.util.List < java.lang.String > jobIds ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getJobs" ) . withOptionalParameter ( "job_type" , jobType ) . withOptionalParameterAsList ( "job_ids" , jobIds ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "jobs" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.HostJobsReturnForXmlRpc ( response ) ; }
Source:
private org.ovirt.engine.core.bll.context.CompensationContext createCompensationContext ( org.ovirt.engine.core.compat.TransactionScopeOption transactionScopeOption , boolean forceCompensation ) { if ( ( transactionScopeOption == ( org.ovirt.engine.core.compat.TransactionScopeOption.Suppress ) ) && ( ! forceCompensation ) ) { return org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) ; } org.ovirt.engine.core.bll.context.DefaultCompensationContext defaultContext = new org.ovirt.engine.core.bll.context.DefaultCompensationContext ( ) ; defaultContext.setCommandId ( commandId ) ; defaultContext.setCommandType ( getClass ( ) . getName ( ) ) ; defaultContext.setBusinessEntitySnapshotDAO ( getBusinessEntitySnapshotDAO ( ) ) ; defaultContext.setSnapshotSerializer ( org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) ) ; return defaultContext ; }

Target:
private org.ovirt.engine.core.bll.context.CompensationContext createCompensationContext ( org.ovirt.engine.core.compat.TransactionScopeOption transactionScopeOption , boolean forceCompensation ) { if ( ( transactionScopeOption == ( org.ovirt.engine.core.compat.TransactionScopeOption.Suppress ) ) && ( ! forceCompensation ) ) { return org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) ; } return createDefaultCompensationContext ( commandId ) ; }
Source:
public void testDeleteAllUnusedIcons ( ) { reinitializeDatabase ( ) ; prepareDao ( ) . removeAllUnusedIcons ( ) ; final org.ovirt.engine.core.common.businessentities.VmIcon unusedIcon = prepareDao ( ) . get ( org.ovirt.engine.core.dao.VmIconDaoTest.UNUSED_ICON_ID ) ; org.junit.Assert.assertNull ( unusedIcon ) ; final org.ovirt.engine.core.common.businessentities.VmIcon usedIcon = prepareDao ( ) . get ( FixturesTool.SMALL_ICON_ID ) ; org.junit.Assert.assertNotNull ( usedIcon ) ; reinitializeDatabase ( ) ; }

Target:
public void testExistsExisting ( ) { org.junit.Assert.assertTrue ( dao.exists ( org.ovirt.engine.core.dao.VmIconDaoTest.UNUSED_ICON_ID ) ) ; }
Source:
public static org.ovirt.engine.core.bll.tasks.SPMAsyncTask construct ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType taskType , org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters asyncTaskParams , boolean duringInit ) { try { org.ovirt.engine.core.bll.tasks.SPMAsyncTask result = null ; if ( taskType == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.unknown ) ) { result = new org.ovirt.engine.core.bll.tasks.SPMAsyncTask ( asyncTaskParams ) ; } else { result = new org.ovirt.engine.core.bll.tasks.CommandAsyncTask ( asyncTaskParams , duringInit ) ; } return result ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskFactory.log.error ( java.lang.String.format ( "AsyncTaskFactory: Failed to get type information using reflection for AsyncTask type: %1$s." , taskType ) , e ) ; return null ; } }

Target:
public static org.ovirt.engine.core.bll.tasks.SPMAsyncTask construct ( org.ovirt.engine.core.bll.tasks.interfaces.CommandCoordinator coco , org.ovirt.engine.core.common.asynctasks.AsyncTaskType taskType , org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters asyncTaskParams , boolean duringInit ) { try { org.ovirt.engine.core.bll.tasks.SPMAsyncTask result = null ; if ( taskType == ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.unknown ) ) { result = new org.ovirt.engine.core.bll.tasks.SPMAsyncTask ( coco , asyncTaskParams ) ; } else { result = new org.ovirt.engine.core.bll.tasks.CommandAsyncTask ( coco , asyncTaskParams , duringInit ) ; } return result ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.tasks.AsyncTaskFactory.log.error ( java.lang.String.format ( "AsyncTaskFactory: Failed to get type information using reflection for AsyncTask type: %1$s." , taskType ) , e ) ; return null ; } }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.storage.StorageConnectionValidator storageConnectionValidator = createStorageConnectionValidator ( ) ; if ( ( ( ! ( validate ( storageConnectionValidator.isConnectionExists ( ) ) ) ) || ( ! ( validate ( storageConnectionValidator.isDomainOfConnectionExistsAndInactive ( org.ovirt.engine.core.bll.storage.connection.AttachStorageConnectionToStorageDomainCommand.getStorageDomain ( ) ) ) ) ) ) || ( ! ( validate ( storageConnectionValidator.isISCSIConnectionAndDomain ( org.ovirt.engine.core.bll.storage.connection.AttachStorageConnectionToStorageDomainCommand.getStorageDomain ( ) ) ) ) ) ) { return false ; } if ( storageConnectionValidator.isConnectionForISCSIDomainAttached ( org.ovirt.engine.core.bll.storage.connection.AttachStorageConnectionToStorageDomainCommand.getStorageDomain ( ) ) ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_ALREADY_EXISTS ) ; } return true ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.validator.storage.StorageConnectionValidator storageConnectionValidator = createStorageConnectionValidator ( ) ; if ( ( ( ! ( validate ( storageConnectionValidator.isConnectionExists ( ) ) ) ) || ( ! ( validate ( storageConnectionValidator.isDomainOfConnectionExistsAndInactive ( org.ovirt.engine.core.bll.storage.connection.AttachStorageConnectionToStorageDomainCommand.getStorageDomain ( ) ) ) ) ) ) || ( ! ( validate ( storageConnectionValidator.isISCSIConnectionAndDomain ( org.ovirt.engine.core.bll.storage.connection.AttachStorageConnectionToStorageDomainCommand.getStorageDomain ( ) ) ) ) ) ) { return false ; } if ( storageConnectionValidator.isConnectionForISCSIDomainAttached ( org.ovirt.engine.core.bll.storage.connection.AttachStorageConnectionToStorageDomainCommand.getStorageDomain ( ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_FOR_DOMAIN_ALREADY_EXISTS ) ; } return true ; }
Source:
public void testUpdateDnsResolverConfiguration ( ) { org.ovirt.engine.core.common.businessentities.VdsDynamic before = dao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; before.getReportedDnsResolverConfiguration ( ) . getNameServers ( ) . add ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "1.1.1.1" ) ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic after = dao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.Assert.assertEquals ( before.getReportedDnsResolverConfiguration ( ) , after.getReportedDnsResolverConfiguration ( ) ) ; }

Target:
protected void updateExistingEntity ( ) { existingEntity.setGlusterVersion ( new org.ovirt.engine.core.compat.RpmVersion ( "glusterfs-3.4.0.34.1u2rhs-1.el6rhs" ) ) ; existingEntity.setLibrbdVersion ( new org.ovirt.engine.core.compat.RpmVersion ( "librbd1-0.80.9-1.fc21.x86_64_updated" ) ) ; existingEntity.getReportedDnsResolverConfiguration ( ) . setNameServers ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "1.1.1.1" ) ) ) ; }
Source:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = dao.get ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.EXISTING_STORAGE_DEVICE_ID_2 ) ; org.junit.Assert.assertNotNull ( "storage device doesn't exists" , storageDevice ) ; dao.remove ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.EXISTING_STORAGE_DEVICE_ID_2 ) ; storageDevice = dao.get ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.EXISTING_STORAGE_DEVICE_ID_2 ) ; org.junit.Assert.assertNull ( "Failed to remove storage device" , storageDevice ) ; }

Target:
public void testRemove ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice = dao.get ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.EXISTING_STORAGE_DEVICE_ID_2 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( storageDevice , "storage device doesn't exists" ) ; dao.remove ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.EXISTING_STORAGE_DEVICE_ID_2 ) ; storageDevice = dao.get ( org.ovirt.engine.core.dao.gluster.StoageDeviceDaoTest.EXISTING_STORAGE_DEVICE_ID_2 ) ; org.junit.jupiter.api.Assertions.assertNull ( storageDevice , "Failed to remove storage device" ) ; }
Source:
private void addSELinuxModes ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.SELinuxMode [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_5 ) ) { version.setSelinuxModes ( new org.ovirt.engine.api.model.SELinuxModes ( ) ) ; for ( org.ovirt.engine.api.model.SELinuxMode mode : values ) { version.getSelinuxModes ( ) . getSELinuxModes ( ) . add ( mode.value ( ) ) ; } } }

Target:
private void addSELinuxModes ( org.ovirt.engine.api.model.VersionCaps version , org.ovirt.engine.api.model.SeLinuxMode [ ] values ) { if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_5 ) ) { version.setSelinuxModes ( new org.ovirt.engine.api.model.SeLinuxModes ( ) ) ; for ( org.ovirt.engine.api.model.SeLinuxMode mode : values ) { version.getSelinuxModes ( ) . getSeLinuxModes ( ) . add ( mode.value ( ) ) ; } } }
Source:
protected void addCustomModelsDetailModelList ( org.ovirt.engine.core.compat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel diskListModel = new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel ( ) ; diskListModel.setSystemTreeContext ( this ) ; list.add ( 3 , diskListModel ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateEventListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; }

Target:
protected void addCustomModelsDetailModelList ( org.ovirt.engine.ui.uicompat.ObservableCollection < org.ovirt.engine.ui.uicommonweb.models.EntityModel > list ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel diskListModel = new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateDiskListModel ( ) ; diskListModel.setSystemTreeContext ( this ) ; list.add ( 3 , diskListModel ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.templates.TemplateEventListModel ( ) ) ; list.add ( new org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel ( ) ) ; }
Source:
private void issueTokenForAuthCode ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.lang.String clientId , java.lang.String scope ) throws java.lang.Exception { org.ovirt.engine.core.sso.servlets.OAuthTokenServlet.log.debug ( "Entered issueTokenForAuthCode" ) ; java.lang.String authCode = org.ovirt.engine.core.sso.utils.SSOUtils.getRequestParameter ( request , SSOConstants.HTTP_PARAM_AUTHORIZATION_CODE , SSOConstants.HTTP_PARAM_AUTHORIZATION_CODE ) ; java.lang.String accessToken = ssoContext.getTokenForAuthCode ( authCode ) ; org.ovirt.engine.core.sso.utils.SSOUtils.validateRequestScope ( request , accessToken , scope ) ; org.ovirt.engine.core.sso.utils.SSOSession ssoSession = org.ovirt.engine.core.sso.utils.SSOUtils.getSsoSession ( request , clientId , accessToken , true ) ; org.ovirt.engine.core.sso.servlets.OAuthTokenServlet.log.debug ( "Sending json response" ) ; org.ovirt.engine.core.sso.utils.SSOUtils.sendJsonData ( response , buildResponse ( ssoSession ) ) ; }

Target:
private void issueTokenForAuthCode ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response , java.lang.String clientId , java.lang.String scope ) throws java.lang.Exception { org.ovirt.engine.core.sso.servlets.OAuthTokenServlet.log.debug ( "Entered issueTokenForAuthCode" ) ; java.lang.String authCode = org.ovirt.engine.core.sso.utils.SsoUtils.getRequestParameter ( request , SsoConstants.HTTP_PARAM_AUTHORIZATION_CODE , SsoConstants.HTTP_PARAM_AUTHORIZATION_CODE ) ; java.lang.String accessToken = ssoContext.getTokenForAuthCode ( authCode ) ; org.ovirt.engine.core.sso.utils.SsoUtils.validateRequestScope ( request , accessToken , scope ) ; org.ovirt.engine.core.sso.utils.SsoSession ssoSession = org.ovirt.engine.core.sso.utils.SsoUtils.getSsoSession ( request , clientId , accessToken , true ) ; org.ovirt.engine.core.sso.servlets.OAuthTokenServlet.log.debug ( "Sending json response" ) ; org.ovirt.engine.core.sso.utils.SsoUtils.sendJsonData ( response , buildResponse ( ssoSession ) ) ; }
Source:
public static void getVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , 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.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
private void addDisk ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalActionWithTasksContext ( VdcActionType.AddDisk , buildAddDiskParameters ( disk ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getFault ( ) . getError ( ) , java.lang.String.format ( "Failed to create disk! %s" , disk.getDiskAlias ( ) ) ) ; } org.ovirt.engine.core.bll.HibernateVmCommand.getTaskIdList ( ) . addAll ( returnValue.getInternalVdsmTaskIdList ( ) ) ; }

Target:
private void addDisk ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalActionWithTasksContext ( ActionType.AddDisk , buildAddDiskParameters ( disk ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( returnValue.getFault ( ) . getError ( ) , java.lang.String.format ( "Failed to create disk! %s" , disk.getDiskAlias ( ) ) ) ; } org.ovirt.engine.core.bll.HibernateVmCommand.getTaskIdList ( ) . addAll ( returnValue.getInternalVdsmTaskIdList ( ) ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.StopRemoveGlusterVolumeBricksVDSCommand.getBroker ( ) . glusterVolumeRemoveBricksStop ( org.ovirt.engine.core.vdsbroker.gluster.StopRemoveGlusterVolumeBricksVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.StopRemoveGlusterVolumeBricksVDSCommand.getParameters ( ) . getBrickDirectories ( ) . toArray ( new java.lang.String [ 0 ] ) , org.ovirt.engine.core.vdsbroker.gluster.StopRemoveGlusterVolumeBricksVDSCommand.getParameters ( ) . getReplicaCount ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.StopRemoveGlusterVolumeBricksVDSCommand.proceedProxyReturnValue ( ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { result = org.ovirt.engine.core.vdsbroker.gluster.StopRemoveGlusterVolumeBricksVDSCommand.getBroker ( ) . glusterVolumeRemoveBricksStop ( org.ovirt.engine.core.vdsbroker.gluster.StopRemoveGlusterVolumeBricksVDSCommand.getParameters ( ) . getVolumeName ( ) , org.ovirt.engine.core.vdsbroker.gluster.StopRemoveGlusterVolumeBricksVDSCommand.getParameters ( ) . getBrickDirectories ( ) . toArray ( new java.lang.String [ 0 ] ) , org.ovirt.engine.core.vdsbroker.gluster.StopRemoveGlusterVolumeBricksVDSCommand.getParameters ( ) . getReplicaCount ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.StopRemoveGlusterVolumeBricksVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeTaskStatusEntity entity = result.getStatusDetails ( ) ; entity.setStatusTime ( new java.util.Date ( ) ) ; setReturnValue ( entity ) ; }
Source:
public void testBootProtocolSetForDisplayNetworkWhenNetworkIsNonDisplay ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForDisplayNetworkWhenNullValuedIpConfigurationAndWhenNetworkClusterDisplay ( false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenIpConfigurationIsNull ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( NetworkBootProtocol.NONE , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , true , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , network.getName ( ) ) ) , network , attachment ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.Permissions mapCollection ( java.util.Set < org.ovirt.engine.core.common.businessentities.Permissions > entities ) { org.ovirt.engine.core.common.businessentities.Permissions collection = new org.ovirt.engine.core.common.businessentities.Permissions ( ) ; for ( org.ovirt.engine.core.common.businessentities.Permissions entity : entities ) { castEveryonePermissionsToUser ( entity ) ; org.ovirt.engine.api.restapi.resource.Permission permission = map ( entity , getUserById ( entity.getAdElementId ( ) ) ) ; collection.getPermissions ( ) . add ( addLinks ( permission , ( ( permission.getUser ( ) ) != null ? suggestedParentType : org.ovirt.engine.api.model.Group.class ) ) ) ; } return collection ; }

Target:
protected org.ovirt.engine.api.model.Permissions mapCollection ( java.util.Set < org.ovirt.engine.api.model.Permission > entities ) { org.ovirt.engine.api.model.Permissions collection = new org.ovirt.engine.api.model.Permissions ( ) ; for ( org.ovirt.engine.api.model.Permission entity : entities ) { castEveryonePermissionsToUser ( entity ) ; org.ovirt.engine.api.model.Permission permission = map ( entity , getUserById ( entity.getAdElementId ( ) ) ) ; collection.getPermissions ( ) . add ( addLinks ( permission , ( ( permission.getUser ( ) ) != null ? suggestedParentType : org.ovirt.engine.api.model.Group.class ) ) ) ; } return collection ; }
Source:
public boolean isEmpty ( ) { return ( ( ( getOutAverageLinkshare ( ) ) == null ) && ( ( getOutAverageUpperlimit ( ) ) == null ) ) && ( ( getOutAverageRealtime ( ) ) == null ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.HostNetworkQos fromAnonymousHostNetworkQos ( org.ovirt.engine.core.common.businessentities.network.AnonymousHostNetworkQos hostNetworkQos ) { if ( hostNetworkQos == null ) { return null ; } org.ovirt.engine.core.common.businessentities.network.HostNetworkQos result = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; result.setId ( hostNetworkQos.getId ( ) ) ; result.hostNetworkQosProperties = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQosProperties ( hostNetworkQos.getHostNetworkQosProperties ( ) ) ; return result ; }
Source:
private org.ovirt.engine.core.compat.Guid mockSourceImage ( ) { org.ovirt.engine.core.compat.Guid imageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setImageId ( imageId ) ; java.util.ArrayList < org.ovirt.engine.core.compat.Guid > list = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; list.add ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; image.setStorageIds ( list ) ; image.setActualSize ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; image.setSize ( 40 ) ; org.mockito.Mockito.doReturn ( java.util.Collections.singletonList ( image ) ) . when ( cmd ) . getSourceImages ( ) ; return imageId ; }

Target:
private org.ovirt.engine.core.common.businessentities.DiskImage mockSourceImage ( ) { org.ovirt.engine.core.common.businessentities.DiskImage image = createDiskImage ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; org.mockito.Mockito.doReturn ( java.util.Collections.singletonList ( image ) ) . when ( cmd ) . getSourceImages ( ) ; org.mockito.Mockito.when ( diskImageDAO.get ( image.getImageId ( ) ) ) . thenReturn ( image ) ; return image ; }
Source:
public void testGetAllStorageDomainsByImageId ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getAllStorageDomainsByImageId ( FixturesTool.TEMPLATE_IMAGE_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( 1 , result.size ( ) ) ; org.junit.Assert.assertEquals ( FixturesTool.STORAGE_DOAMIN_SCALE_SD5 , result.get ( 0 ) . getId ( ) ) ; }

Target:
public void testGetAll ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result = dao.getAll ( ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; }
Source:
public org.ovirt.engine.core.dao.VdsGroupDao getVdsGroupDao ( ) { final org.ovirt.engine.core.dao.VdsGroupDao v = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsGroupDao.class ) ; final org.ovirt.engine.core.common.businessentities.VDSGroup g = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; g.setVdsGroupId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; org.mockito.Mockito.when ( v.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ) . thenReturn ( g ) ; return v ; }

Target:
public org.ovirt.engine.core.dao.ClusterDao getClusterDao ( ) { final org.ovirt.engine.core.dao.ClusterDao v = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.ClusterDao.class ) ; final org.ovirt.engine.core.common.businessentities.Cluster g = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; g.setClusterId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; org.mockito.Mockito.when ( v.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ) . thenReturn ( g ) ; return v ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Permission user ) { switch ( user.getRoleType ( ) ) { case ADMIN : return getCommonResources ( ) . adminImage ( ) ; case USER : return getCommonResources ( ) . userImage ( ) ; default : return getCommonResources ( ) . userImage ( ) ; } }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Permission user ) { switch ( user.getRoleType ( ) ) { case ADMIN : return org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn.resources.adminImage ( ) ; case USER : return org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn.resources.userImage ( ) ; default : return org.ovirt.engine.ui.common.widget.table.column.PermissionTypeColumn.resources.userImage ( ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; providers.add ( 0 , null ) ; getExternalProviders ( ) . setItems ( providers ) ; getExternalProviders ( ) . setSelectedItem ( null ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.List < org.ovirt.engine.core.common.businessentities.Provider > providers = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.Provider > ) ( result ) ) ; providers.add ( 0 , null ) ; getNetworkProviders ( ) . setItems ( providers ) ; getNetworkProviders ( ) . setSelectedItem ( null ) ; }
Source:
public static org.ovirt.engine.core.common.action.VdcReturnValueBase canDoAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , org.ovirt.engine.core.bll.job.ExecutionContext executionContext , boolean isInternal ) { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.tasks.CommandHelper.buildCommand ( actionType , parameters , executionContext , CommandStatus.NOT_STARTED ) ; command.setInternalExecution ( isInternal ) ; return command.validateOnly ( ) ; }

Target:
public static org.ovirt.engine.core.common.action.VdcReturnValueBase canDoAction ( org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , org.ovirt.engine.core.bll.context.CommandContext commandContext ) { return org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters , commandContext ) . validateOnly ( ) ; }