auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.VAR_NETWORK_ATTACHMENT_NOT_EXISTS_ENTITY , networkAttachmentId.toString ( ) ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult referencedNetworkAttachmentActuallyExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { boolean doesNotReferenceExistingNetworkAttachment = networkAttachmentId == null ; if ( doesNotReferenceExistingNetworkAttachment ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { sourceListModel.getSearchCommand ( ) . Execute ( ) ; }

Target:
private void onSave ( ) { if ( ! ( validate ( ) ) ) { return ; } org.ovirt.engine.core.common.businessentities.Provider provider = new org.ovirt.engine.core.common.businessentities.Provider ( ) ; provider.setName ( ( ( java.lang.String ) ( privateName.getEntity ( ) ) ) ) ; provider.setDescription ( ( ( java.lang.String ) ( privateDescription.getEntity ( ) ) ) ) ; provider.setUrl ( ( ( java.lang.String ) ( privateUrl.getEntity ( ) ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.AddProvider , new org.ovirt.engine.core.common.action.ProviderParameters ( provider ) ) ; cancel ( ) ; }
Source:
private boolean IsLocalDataCenterEmpty ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter ) { if ( ( ( dataCenter != null ) && ( ( dataCenter.getstorage_pool_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) && ( ( dataCenter.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Uninitialized ) ) ) { return true ; } return false ; }

Target:
private boolean isLocalDataCenterEmpty ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter ) { if ( ( ( dataCenter != null ) && ( ( dataCenter.getstorage_pool_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.LOCALFS ) ) ) && ( ( dataCenter.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.Uninitialized ) ) ) { return true ; } return false ; }
Source:
private org.ovirt.engine.ui.frontend.server.dashboard.Dashboard populateUtilizationCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { long startTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.Dashboard dashboard = getDashboard ( ) ; long endTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.dashboardCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_KEY , dashboard , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.UTILIZATION_CACHE_UPDATE_INTERVAL , java.util.concurrent.TimeUnit.SECONDS ) ; org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.log.debug ( "Dashboard utilization cache updated in {}ms" , ( endTime - startTime ) ) ; return dashboard ; }

Target:
private org.ovirt.engine.ui.frontend.server.dashboard.Inventory populateInventoryCache ( ) throws org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataException { long startTime = java.lang.System.currentTimeMillis ( ) ; org.ovirt.engine.ui.frontend.server.dashboard.Inventory inventory = lookupInventory ( ) ; long endTime = java.lang.System.currentTimeMillis ( ) ; if ( enableBackgroundCacheUpdate ) { inventoryCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_KEY , inventory ) ; } else { inventoryCache.put ( org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_KEY , inventory , org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.INVENTORY_CACHE_UPDATE_INTERVAL , java.util.concurrent.TimeUnit.SECONDS ) ; } org.ovirt.engine.ui.frontend.server.dashboard.DashboardDataServlet.log.debug ( "Dashboard inventoy cache updated in {}ms" , ( endTime - startTime ) ) ; return inventory ; }
Source:
protected void initFrontend ( ) { org.ovirt.engine.ui.frontend.Frontend.setEventsHandler ( frontendEventsHandler ) ; org.ovirt.engine.ui.frontend.Frontend.getFrontendFailureEvent ( ) . addListener ( frontendFailureEventListener ) ; org.ovirt.engine.ui.frontend.Frontend.getFrontendNotLoggedInEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { user.logout ( ) ; } } ) ; org.ovirt.engine.ui.frontend.Frontend.setFilterQueries ( filterFrontendQueries ( ) ) ; }

Target:
protected void initFrontend ( ) { org.ovirt.engine.ui.frontend.Frontend.setEventsHandler ( frontendEventsHandler ) ; org.ovirt.engine.ui.frontend.Frontend.getFrontendFailureEvent ( ) . addListener ( frontendFailureEventListener ) ; org.ovirt.engine.ui.frontend.Frontend.getFrontendNotLoggedInEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { user.logout ( ) ; } } ) ; org.ovirt.engine.ui.frontend.Frontend.setFilterQueries ( filterFrontendQueries ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.DbUser addUserToThreadContext ( java.lang.String sessionId , boolean refresh ) { org.ovirt.engine.core.common.businessentities.DbUser dbUser = org.ovirt.engine.core.utils.ThreadLocalParamsContainer.getUser ( ) ; if ( dbUser == null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( sessionId ) ) ) { dbUser = getUser ( sessionId , refresh ) ; org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setHttpSessionId ( sessionId ) ; } else { dbUser = getUser ( refresh ) ; } org.ovirt.engine.core.utils.ThreadLocalParamsContainer.setUser ( dbUser ) ; } return dbUser ; }

Target:
public void refresh ( java.lang.String sessionId ) { refresh ( getSessionInfo ( sessionId ) ) ; }
Source:
public void canDoActionLunsNotPartOfStorageDomain ( ) { java.util.List lunsFromDb = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setLUN_id ( "111" ) ; lun1.setStorageDomainId ( sdId ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setLUN_id ( "222" ) ; lun2.setStorageDomainId ( sdId ) ; lunsFromDb.add ( lun1 ) ; lunsFromDb.add ( lun2 ) ; org.mockito.Mockito.when ( lunsDao.getAllForVolumeGroup ( org.ovirt.engine.core.bll.storage.domain.RefreshLunsSizeCommandTest.STORAGE ) ) . thenReturn ( lunsFromDb ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_LUNS_NOT_PART_OF_STORAGE_DOMAIN ) ; }

Target:
public void canDoActionLunsNotPartOfStorageDomain ( ) { java.util.List lunsFromDb = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun1 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun1.setLUNId ( "111" ) ; lun1.setStorageDomainId ( sdId ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun2 = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; lun2.setLUNId ( "222" ) ; lun2.setStorageDomainId ( sdId ) ; lunsFromDb.add ( lun1 ) ; lunsFromDb.add ( lun2 ) ; org.mockito.Mockito.when ( lunsDao.getAllForVolumeGroup ( org.ovirt.engine.core.bll.storage.domain.RefreshLunsSizeCommandTest.STORAGE ) ) . thenReturn ( lunsFromDb ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_LUNS_NOT_PART_OF_STORAGE_DOMAIN ) ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.VdsValidator validator = new org.ovirt.engine.core.bll.VdsValidator ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) ) ; return ( ( validate ( validator.exists ( ) ) ) && ( validate ( validator.validateStatusForActivation ( ) ) ) ) && ( validate ( validator.validateUniqueId ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.HostValidator validator = new org.ovirt.engine.core.bll.validator.HostValidator ( org.ovirt.engine.core.bll.ActivateVdsCommand.getVds ( ) ) ; return ( ( validate ( validator.hostExists ( ) ) ) && ( validate ( validator.validateStatusForActivation ( ) ) ) ) && ( validate ( validator.validateUniqueId ( ) ) ) ; }
Source:
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 ) ) . intValue ( ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void contextInitialized ( javax.servlet.ServletContextEvent event ) { java.lang.System.out.println ( "Application initialized." ) ; final org.ovirt.vdsmfake.task.TaskProcessor taskProcessor = org.ovirt.vdsmfake.task.TaskProcessor.getInstance ( ) ; taskProcessor.init ( ) ; int jsonPort = org.ovirt.vdsmfake.AppConfig.getInstance ( ) . getJsonListenPort ( ) ; boolean encrypted = org.ovirt.vdsmfake.AppConfig.getInstance ( ) . isJsonSecured ( ) ; java.lang.String hostName = org.ovirt.vdsmfake.AppConfig.getInstance ( ) . getJsonHost ( ) ; org.ovirt.vdsmfake.rpc.json.JsonRpcServer.initMonitoring ( ) ; org.ovirt.vdsmfake.rpc.json.JsonRpcServer server = new org.ovirt.vdsmfake.rpc.json.JsonRpcServer ( hostName , jsonPort , encrypted ) ; server.start ( ) ; }

Target:
public void contextInitialized ( javax.servlet.ServletContextEvent event ) { java.lang.System.out.println ( "Application initialized." ) ; final org.ovirt.vdsmfake.task.TaskProcessor taskProcessor = org.ovirt.vdsmfake.task.TaskProcessor.getInstance ( ) ; taskProcessor.init ( ) ; jsonRpcServerInstance.get ( ) . initMonitoring ( ) ; jsonRpcServerInstance.get ( ) . start ( ) ; }
Source:
public void unsubscribe ( 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 ( "method_id" , subscriber.getmethod_id ( ) ) . addValue ( "subscriber_id" , subscriber.getsubscriber_id ( ) ) . addValue ( "tag_name" , subscriber.gettag_name ( ) ) ; getCallsHandler ( ) . executeModification ( "Deleteevent_subscriber" , parameterSource ) ; }

Target:
public void unsubscribe ( 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 ( "subscriber_id" , subscriber.getsubscriber_id ( ) ) . addValue ( "tag_name" , subscriber.gettag_name ( ) ) ; getCallsHandler ( ) . executeModification ( "Deleteevent_subscriber" , parameterSource ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isUsingScsiReservationValid ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.LunDisk lunDisk ) { if ( ( vm == null ) && ( java.lang.Boolean.TRUE.equals ( lunDisk.isUsingScsiReservation ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_SCSI_RESERVATION_NOT_VALID_FOR_FLOATING_DISK ) ; } if ( ( java.lang.Boolean.TRUE.equals ( lunDisk.isUsingScsiReservation ( ) ) ) && ( ( lunDisk.getSgio ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ScsiGenericIO.FILTERED ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_SGIO_IS_FILTERED ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isUsingScsiReservationValid ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.LunDisk lunDisk ) { if ( ( vm == null ) && ( java.lang.Boolean.TRUE.equals ( lunDisk.isUsingScsiReservation ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_SCSI_RESERVATION_NOT_VALID_FOR_FLOATING_DISK ) ; } if ( ( java.lang.Boolean.TRUE.equals ( lunDisk.isUsingScsiReservation ( ) ) ) && ( ( lunDisk.getSgio ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ScsiGenericIO.FILTERED ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_SGIO_IS_FILTERED ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void setVirtioScsiController ( org.ovirt.engine.api.model.VM model ) { if ( ! ( model.isSetVirtioScsi ( ) ) ) { model.setVirtioScsi ( new org.ovirt.engine.api.model.VirtIOSCSI ( ) ) ; } model.getVirtioScsi ( ) . setEnabled ( ( ! ( org.ovirt.engine.api.restapi.util.VmHelper.getVirtioScsiControllersForEntity ( this , new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) . isEmpty ( ) ) ) ) ; }

Target:
protected void setVirtioScsiController ( org.ovirt.engine.api.model.Vm model ) { if ( ! ( model.isSetVirtioScsi ( ) ) ) { model.setVirtioScsi ( new org.ovirt.engine.api.model.VirtioScsi ( ) ) ; } model.getVirtioScsi ( ) . setEnabled ( ( ! ( org.ovirt.engine.api.restapi.util.VmHelper.getVirtioScsiControllersForEntity ( this , new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) . isEmpty ( ) ) ) ) ; }
Source:
private float extractNtVersion ( java.lang.String userAgentType ) { com.google.gwt.regexp.shared.RegExp pattern = com.google.gwt.regexp.shared.RegExp.compile ( ".*windows nt (\\d+\\.\\d+).*" ) ; com.google.gwt.regexp.shared.MatchResult matcher = pattern.exec ( userAgentType.toLowerCase ( ) ) ; boolean matchFound = matcher != null ; if ( matchFound ) { return java.lang.Float.parseFloat ( matcher.getGroup ( 1 ) ) ; } return - 1 ; }

Target:
public boolean isSpiceProxyDefined ( ) { java.lang.String spiceProxy = ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.SpiceProxyDefault ) ) ) ; return ( spiceProxy != null ) && ( ! ( "" . equals ( spiceProxy ) ) ) ; }
Source:
private void logDelayedDomain ( final org.ovirt.engine.core.compat.Guid vdsId , org.ovirt.engine.core.common.businessentities.VDSDomainsData tempData ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVdsId ( vdsId ) ; logable.setStorageDomainId ( tempData.getDomainId ( ) ) ; logable.AddCustomValue ( "Delay" , java.lang.Double.toString ( tempData.getDelay ( ) ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VDS_DOMAIN_DELAY_INTERVAL ) ; }

Target:
private void logDelayedDomain ( final org.ovirt.engine.core.compat.Guid vdsId , org.ovirt.engine.core.common.businessentities.VDSDomainsData tempData ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.setVdsId ( vdsId ) ; logable.setStorageDomainId ( tempData.getDomainId ( ) ) ; logable.addCustomValue ( "Delay" , java.lang.Double.toString ( tempData.getDelay ( ) ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( logable , AuditLogType.VDS_DOMAIN_DELAY_INTERVAL ) ; }
Source:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.compat.Guid asyncTaskId : getReturnValue ( ) . getTaskPlaceHolderIdList ( ) ) { org.ovirt.engine.core.common.businessentities.AsyncTasks task = getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( ( task != null ) && ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( task.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; } } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.compat.Guid asyncTaskId : getReturnValue ( ) . getTaskPlaceHolderIdList ( ) ) { org.ovirt.engine.core.common.businessentities.AsyncTasks task = getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( ( task != null ) && ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( task.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; } } return null ; }
Source:
protected void setUpEntityQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkLabelsByNetworkId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { BackendNetworkLabelsResourceTest.networkId } , java.util.Arrays.asList ( getEntity ( 0 ) ) ) ; } }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( getEntityList ( ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UnlabelNetwork , org.ovirt.engine.core.common.action.UnlabelNetworkParameters.class , new java.lang.String [ ] { "NetworkId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelResourceTest.NETWORK_ID } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void StartPollingTask ( ) { org.ovirt.engine.core.bll.AsyncTaskState state = getState ( ) ; if ( ( ( state != ( AsyncTaskState.AttemptingEndAction ) ) && ( state != ( AsyncTaskState.Cleared ) ) ) && ( state != ( AsyncTaskState.ClearFailed ) ) ) { org.ovirt.engine.core.bll.SPMAsyncTask.log.infoFormat ( "BaseAsyncTask::StartPollingTask: Starting to poll task '{0}'." , getTaskID ( ) ) ; ConcreteStartPollingTask ( ) ; } }

Target:
public void StartPollingTask ( ) { org.ovirt.engine.core.bll.AsyncTaskState state = getState ( ) ; if ( ( ( state != ( AsyncTaskState.AttemptingEndAction ) ) && ( state != ( AsyncTaskState.Cleared ) ) ) && ( state != ( AsyncTaskState.ClearFailed ) ) ) { org.ovirt.engine.core.bll.SPMAsyncTask.log.infoFormat ( "BaseAsyncTask::StartPollingTask: Starting to poll task '{0}'." , getVdsmTaskId ( ) ) ; ConcreteStartPollingTask ( ) ; } }
Source:
public void testAddVersionNoBaseTemplateId ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Template t = org.ovirt.engine.api.restapi.resource.BackendTemplatesResourceTest.getModel ( 2 ) ; t.getVersion ( ) . setBaseTemplate ( null ) ; try { collection.add ( t ) ; fail ( "Should have failed with 400 error due to a missing base template" ) ; } catch ( javax.ws.rs.WebApplicationException e ) { assertNotNull ( e.getResponse ( ) ) ; assertEquals ( 400 , e.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testAddVersionNoBaseTemplateId ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Template t = org.ovirt.engine.api.restapi.resource.BackendTemplatesResourceTest.getModel ( 2 ) ; t.getVersion ( ) . setBaseTemplate ( null ) ; try { collection.add ( t ) ; org.junit.Assert.fail ( "Should have failed with 400 error due to a missing base template" ) ; } catch ( javax.ws.rs.WebApplicationException e ) { org.junit.Assert.assertNotNull ( e.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 400 , e.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private void handlePut ( java.lang.String prefix , java.util.Collection < org.ovirt.engine.api.model.DetailedLink > results , java.lang.String returnValueStr ) { org.ovirt.engine.api.model.DetailedLink link = new org.ovirt.engine.api.rsdl.RsdlBuilder.LinkBuilder ( ) . url ( prefix ) . rel ( org.ovirt.engine.api.rsdl.RsdlBuilder.UPDATE ) . requestParameter ( returnValueStr ) . responseType ( returnValueStr ) . httpMethod ( HttpMethod.PUT ) . build ( ) ; addAsyncMatrixParameter ( link ) ; results.add ( link ) ; }

Target:
private void handlePut ( java.lang.String prefix , java.util.Collection < org.ovirt.engine.api.model.DetailedLink > results , java.lang.Class < ? > returnType ) { java.lang.String returnTypeStr = getReturnTypeStr ( returnType ) ; org.ovirt.engine.api.model.DetailedLink link = new org.ovirt.engine.api.rsdl.RsdlBuilder.LinkBuilder ( ) . url ( prefix ) . rel ( org.ovirt.engine.api.rsdl.RsdlBuilder.UPDATE ) . requestParameter ( returnTypeStr ) . responseType ( returnTypeStr ) . httpMethod ( HttpMethod.PUT ) . build ( ) ; addAsyncMatrixParameter ( link ) ; results.add ( link ) ; }
Source:
private static org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo nextAsyncTaskCreationInfo ( ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo info = new org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo ( ) ; info.setStepId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; info.setStoragePoolID ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; info.setTaskID ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; info.setTaskType ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.class ) ) ; return info ; }

Target:
private static org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo nextAsyncTaskCreationInfo ( ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo info = new org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo ( ) ; info.setStepId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; info.setStoragePoolID ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; info.setVdsmTaskId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; info.setTaskType ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.asynctasks.AsyncTaskType.class ) ) ; return info ; }
Source:
public org.ovirt.engine.core.common.businessentities.CommandEntity createCommandEntity ( org.ovirt.engine.core.compat.Guid cmdId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = new org.ovirt.engine.core.common.businessentities.CommandEntity ( ) ; cmdEntity.setId ( cmdId ) ; cmdEntity.setCommandType ( actionType ) ; cmdEntity.setCommandParameters ( params ) ; return cmdEntity ; }

Target:
public org.ovirt.engine.core.common.businessentities.CommandEntity createCommandEntity ( org.ovirt.engine.core.compat.Guid cmdId , org.ovirt.engine.core.common.action.ActionType actionType , org.ovirt.engine.core.common.action.ActionParametersBase params ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = new org.ovirt.engine.core.common.businessentities.CommandEntity ( ) ; cmdEntity.setId ( cmdId ) ; cmdEntity.setCommandType ( actionType ) ; cmdEntity.setCommandParameters ( params ) ; return cmdEntity ; }
Source:
public void validateFailsWithForceNotSupported ( ) { org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters parameters = new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( getVolume ( 2 , true ) , true ) ; org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommand command = new org.ovirt.engine.core.bll.gluster.CreateGlusterVolumeCommand ( parameters ) ; cmd = org.mockito.Mockito.spy ( command ) ; prepareMocks ( cmd ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_ADD_BRICK_FORCE_NOT_SUPPORTED ) ; }

Target:
public void validateFailsWithDuplicateBricks ( ) { setVolume ( getVolume ( 2 , true ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_DUPLICATE_BRICKS ) ; }
Source:
public static < T extends org.ovirt.engine.core.common.businessentities.VmBase > void updateVmDevices ( T entity , org.ovirt.engine.core.compat.Guid newId ) { if ( entity != null ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateCdInVmDevice ( entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateBootOrderInVmDeviceAndStoreToDB ( entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateNumOfMonitorsInVmDevice ( null , entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateUSBSlots ( null , entity ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.updateMemoryBalloon ( null , entity , true ) ; } }

Target:
public static void updateSmartcardDevice ( org.ovirt.engine.core.compat.Guid vmId , boolean smartcardEnabled ) { if ( ! smartcardEnabled ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceType.SMARTCARD.getName ( ) , VmDeviceType.SMARTCARD.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : vmDevices ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } else { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addSmartcardDevice ( vmId ) ; } }
Source:
private static void doTestNoStringSubstitution ( java.lang.String name ) { org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( name ) ; java.lang.String error = et.TranslateErrorTextSingle ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) ; org.junit.Assert.assertEquals ( "String should equal" , "VM not found" , error ) ; }

Target:
private static void doTestNoStringSubstitution ( java.lang.String name ) { java.util.Locale locale = java.util.Locale.ENGLISH ; try { java.util.Locale.setDefault ( java.util.Locale.ENGLISH ) ; org.ovirt.engine.core.common.interfaces.ErrorTranslator et = new org.ovirt.engine.core.utils.ErrorTranslatorImpl ( name ) ; java.lang.String error = et.TranslateErrorTextSingle ( org.ovirt.engine.core.utils.ErrorTranslatorTest.TEST_KEY_NO_REPLACEMENT ) ; org.junit.Assert.assertEquals ( "String should equal" , "VM not found" , error ) ; } finally { java.util.Locale.setDefault ( locale ) ; } }
Source:
protected boolean setAndValidateCpuProfile ( ) { if ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getTemplateType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { return true ; } return validate ( cpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getMasterVm ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getUserId ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { if ( ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getTemplateType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { return true ; } return validate ( cpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.AddVmTemplateCommand.getParameters ( ) . getMasterVm ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) , org.ovirt.engine.core.bll.AddVmTemplateCommand.getUserIdIfExternal ( ) ) ) ; }
Source:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void invalidQosMissingValues ( ) { org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; qos.setOutAverageUpperlimit ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.HIGH_BANDWIDTH ) ; qos.setOutAverageRealtime ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.LOW_BANDWIDTH ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosValuesTest ( qos ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_SETUP_NETWORKS_MISSING_VALUES , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void unsyncedNetworkModified ( ) { org.ovirt.engine.core.common.businessentities.network.Network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net ) ; nic.setBridged ( ( ! ( net.isVmNetwork ( ) ) ) ) ; nic.setBootProtocol ( NetworkBootProtocol.NONE ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; nic.setBootProtocol ( NetworkBootProtocol.DHCP ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORKS_NOT_IN_SYNC , net.getName ( ) ) ; }
Source:
private void InitCPU ( ) { if ( ( ! ( isCPUinitialized ) ) && ( getIsEdit ( ) ) ) { isCPUinitialized = true ; getCPU ( ) . setSelectedItem ( null ) ; for ( org.ovirt.engine.core.common.businessentities.ServerCpu a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( getCPU ( ) . getItems ( ) ) ) ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( a.getCpuName ( ) , getEntity ( ) . getcpu_name ( ) ) ) { getCPU ( ) . setSelectedItem ( a ) ; break ; } } } }

Target:
private void initCPU ( ) { if ( ( ! ( isCPUinitialized ) ) && ( getIsEdit ( ) ) ) { isCPUinitialized = true ; getCPU ( ) . setSelectedItem ( null ) ; for ( org.ovirt.engine.core.common.businessentities.ServerCpu a : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ServerCpu > ) ( getCPU ( ) . getItems ( ) ) ) ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( a.getCpuName ( ) , getEntity ( ) . getcpu_name ( ) ) ) { getCPU ( ) . setSelectedItem ( a ) ; break ; } } } }
Source:
public static void getMaxVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean is64 ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return 262144 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( ( is64 ? org.ovirt.engine.core.common.queries.ConfigurationValues.VM64BitMaxMemorySizeInMB : org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB ) , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
public static void RunAction ( final org.ovirt.engine.core.common.action.VdcActionType actionType , final org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , final org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback callback , final java.lang.Object state , final boolean showErrorDialog ) { final org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync service = GenericApiGWTServiceAsync.Util.getInstance ( ) ; org.ovirt.engine.ui.frontend.Frontend.runActionImpl ( actionType , parameters , ( callback != null ? callback : org.ovirt.engine.ui.frontend.Frontend.NULLABLE_ASYNC_CALLBACK ) , state , showErrorDialog , service ) ; }

Target:
public void onSuccess ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Frontend: sucessfully executed runAction, determining result!" ) ; handleActionResult ( actionType , parameters , result , ( callback != null ? callback : org.ovirt.engine.ui.frontend.Frontend.NULLABLE_ASYNC_CALLBACK ) , state , showErrorDialog ) ; }
Source:
public void setListValue ( java.util.List < T > value ) { ( ( org.ovirt.engine.ui.common.widget.editor.TakesListValue < T > ) ( peer ) ) . setListValue ( new java.util.ArrayList < > ( value ) ) ; }

Target:
public void setListValue ( java.util.List < T > value ) { java.util.List < T > listValue = ( value == null ) ? java.util.Collections.< T > emptyList ( ) : new java.util.ArrayList < > ( value ) ; ( ( org.ovirt.engine.ui.common.widget.editor.TakesListValue < T > ) ( peer ) ) . setListValue ( listValue ) ; }
Source:
private java.util.List < org.ovirt.engine.api.model.StorageType > getStorageTypes ( org.ovirt.engine.api.model.Version version ) { java.util.List < org.ovirt.engine.api.model.StorageType > ret = new java.util.ArrayList < org.ovirt.engine.api.model.StorageType > ( ) ; ret.add ( StorageType.ISCSI ) ; ret.add ( StorageType.FCP ) ; ret.add ( StorageType.NFS ) ; if ( localStorageEnabled ( version ) ) { ret.add ( StorageType.LOCALFS ) ; } return ret ; }

Target:
private java.util.List < org.ovirt.engine.api.model.StorageType > getStorageTypes ( org.ovirt.engine.api.model.Version version ) { java.util.List < org.ovirt.engine.api.model.StorageType > ret = new java.util.ArrayList < org.ovirt.engine.api.model.StorageType > ( ) ; ret.add ( StorageType.ISCSI ) ; ret.add ( StorageType.FCP ) ; ret.add ( StorageType.NFS ) ; if ( localStorageEnabled ( version ) ) { ret.add ( StorageType.LOCALFS ) ; } if ( org.ovirt.engine.api.restapi.utils.VersionUtils.greaterOrEqual ( version , org.ovirt.engine.api.restapi.resource.BackendCapabilitiesResource.VERSION_3_1 ) ) { ret.add ( StorageType.POSIXFS ) ; } return ret ; }
Source:
protected com.google.gwt.user.cellview.client.CellTree createDataDisplayWidget ( org.ovirt.engine.ui.webadmin.uicommon.model.SystemTreeModelProvider modelProvider ) { com.google.gwt.user.cellview.client.CellTree display = new org.ovirt.engine.ui.common.widget.tree.ElementIdCellTree < org.ovirt.engine.ui.webadmin.uicommon.model.SystemTreeModelProvider > ( modelProvider , null , org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.res ) { @ java.lang.Override protected void onLoad ( ) { expandTree ( getDataDisplayWidget ( ) . getRootTreeNode ( ) , org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.ITEM_LEVEL ) ; } } ; display.setAnimationEnabled ( true ) ; display.setKeyboardSelectionPolicy ( KeyboardSelectionPolicy.BOUND_TO_SELECTION ) ; return display ; }

Target:
protected com.google.gwt.user.cellview.client.CellTree createDataDisplayWidget ( org.ovirt.engine.ui.webadmin.uicommon.model.SystemTreeModelProvider modelProvider ) { com.google.gwt.user.cellview.client.CellTree display = new org.ovirt.engine.ui.common.widget.tree.ElementIdCellTree < org.ovirt.engine.ui.webadmin.uicommon.model.SystemTreeModelProvider > ( modelProvider , null , org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.res ) { @ java.lang.Override protected void onLoad ( ) { expandTree ( getDataDisplayWidget ( ) . getRootTreeNode ( ) , org.ovirt.engine.ui.webadmin.widget.tree.SystemTree.ITEM_LEVEL ) ; } } ; display.setAnimationEnabled ( true ) ; display.setKeyboardSelectionPolicy ( KeyboardSelectionPolicy.BOUND_TO_SELECTION ) ; modelProvider.setDataDisplay ( display ) ; return display ; }
Source:
public void serializeParametersMap ( ) { java.util.Map < java.lang.String , java.io.Serializable > data = new java.util.HashMap < > ( ) ; data.put ( "NEXT_COMMAND_TYPE" , ActionType.DestroyImage ) ; org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer serializer = new org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer ( ) ; org.junit.Assert.assertTrue ( ( ( serializer.serialize ( data ) . length ( ) ) > 0 ) ) ; }

Target:
public void serializeParametersMap ( ) { java.util.Map < java.lang.String , java.io.Serializable > data = new java.util.HashMap < > ( ) ; data.put ( "NEXT_COMMAND_TYPE" , ActionType.DestroyImage ) ; org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer serializer = new org.ovirt.engine.core.utils.serialization.json.JsonObjectSerializer ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( serializer.serialize ( data ) . length ( ) ) > 0 ) ) ; }
Source:
public void canDoActionSpaceValidationSucceeds ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void canDoActionSpaceValidationSucceeds ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , VolumeType.Preallocated ) ; mockVm ( ) ; mockEntities ( storageId ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }
Source:
private static < R extends org.ovirt.engine.api.model.BaseResource > org.ovirt.engine.api.model.BaseResource getParentModel ( R model , java.lang.Class < ? > parentType ) { for ( org.ovirt.engine.api.model.BaseResource inline : org.ovirt.engine.api.utils.LinkHelper.getInlineResources ( model ) ) { if ( parentType.isAssignableFrom ( inline.getClass ( ) ) ) { return inline ; } } return null ; }

Target:
private static < R extends org.ovirt.engine.api.model.BaseResource > org.ovirt.engine.api.model.BaseResource getParentModel ( R model , java.lang.Class < ? > parentType ) { for ( org.ovirt.engine.api.model.BaseResource inline : org.ovirt.engine.api.restapi.util.LinkHelper.getInlineResources ( model ) ) { if ( parentType.isAssignableFrom ( inline.getClass ( ) ) ) { return inline ; } } return null ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setReturnValue ( getUserRequestForStorageDomainRepoFileList ( ) ) ; }

Target:
protected void executeQueryCommand ( ) { try { org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setReturnValue ( getUserRequestForStorageDomainRepoFileList ( ) ) ; } catch ( java.lang.Exception e ) { java.lang.String message = java.util.Optional.of ( e.getCause ( ) ) . map ( java.lang.Throwable :: getMessage ) . orElse ( "" ) ; log.error ( "Failed to retrieve image list: {}" , message ) ; org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setExceptionString ( message ) ; org.ovirt.engine.core.bll.storage.repoimage.GetImagesListQueryBase.getQueryReturnValue ( ) . setSucceeded ( false ) ; } }
Source:
private void doTestBadAddNetworkAttachment ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpVerifyHostExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.AddNetworkAttachment , org.ovirt.engine.core.common.action.NetworkAttachmentParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddNetworkAttachment ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpVerifyHostExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.AddNetworkAttachment , org.ovirt.engine.core.common.action.NetworkAttachmentParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentsResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public java.lang.RuntimeException error ( java.lang.Throwable t ) { log.error ( org.ovirt.vdsmfake.service.AbstractService.ERROR , t ) ; return new java.lang.RuntimeException ( org.ovirt.vdsmfake.service.AbstractService.ERROR , t ) ; }

Target:
public java.lang.RuntimeException error ( java.lang.Throwable t ) { java.lang.String message = ( ( t.getMessage ( ) ) == null ) ? t.getClass ( ) . getName ( ) : t.getMessage ( ) ; log.error ( message , t ) ; return new java.lang.RuntimeException ( message , t ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return validateCoherentIdentification ( bond.getId ( ) , nicId , nicName , message , existingInterfacesMap ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( java.lang.String.valueOf ( attachment.getId ( ) ) , attachment.getNicId ( ) , attachment.getNicName ( ) , EngineMessage.NETWORK_ATTACHMENT_REFERENCES_NICS_INCOHERENTLY , existingInterfacesMap ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc getVGList ( ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getVGList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc getDeviceList ( int storageType , java.lang.String [ ] devicesList , boolean checkStatus ) { try { java.lang.String [ ] idsList = ( devicesList == null ) ? new java.lang.String [ ] { } : devicesList ; java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getDeviceList ( storageType , idsList , checkStatus ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.businessentities.ActionGroup entity = parent.lookupId ( id ) ; if ( entity == null ) { notFound ( ) ; return null ; } return performAction ( VdcActionType.DetachActionGroupsFromRole , new org.ovirt.engine.core.common.action.ActionGroupsToRoleParameter ( parent.roleId , asList ( entity ) ) ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.businessentities.ActionGroup entity = parent.lookupId ( id ) ; if ( entity == null ) { notFound ( ) ; return null ; } return performAction ( ActionType.DetachActionGroupsFromRole , new org.ovirt.engine.core.common.action.ActionGroupsToRoleParameter ( parent.roleId , asList ( entity ) ) ) ; }