auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void PrepareSanStorageForEdit ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel model ) { org.ovirt.engine.core.common.businessentities.storage_domains storage = ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( getSelectedItem ( ) ) ) ; model.setStorageDomain ( storage ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel sanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > lunList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( returnValue ) ) ; sanStorageModel.ApplyData ( lunList , true ) ; }
Source:
private void rollback5 ( ) { org.ovirt.engine.ui.uicompat.Enlistment enlistment = context.enlistment ; org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext enlistmentContext = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext ) ( enlistment.getContext ( ) ) ) ; if ( ( enlistmentContext.getDataCenterId ( ) ) != null ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveStoragePool , new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( enlistmentContext.getDataCenterId ( ) ) ) ; } context.enlistment = null ; enlistment.Done ( ) ; }

Target:
private void rollback5 ( ) { org.ovirt.engine.ui.uicompat.Enlistment enlistment = context.enlistment ; org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext enlistmentContext = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext ) ( enlistment.getContext ( ) ) ) ; if ( ( enlistmentContext.getDataCenterId ( ) ) != null ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RemoveStoragePool , new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( enlistmentContext.getDataCenterId ( ) ) ) ; } context.enlistment = null ; enlistment.done ( ) ; }
Source:
public static byte [ ] jsonToByteArray ( org.codehaus.jackson.JsonNode json , org.codehaus.jackson.map.ObjectMapper mapper ) { final java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream ( ) ; try { try ( org.codehaus.jackson.JsonGenerator gen = mapper.getJsonFactory ( ) . createJsonGenerator ( os , JsonEncoding.UTF8 ) ) { gen.writeTree ( json ) ; } } catch ( java.io.IOException e ) { org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.log.debug ( "Exception thrown during marshalling json" , e ) ; } return os.toByteArray ( ) ; }

Target:
public static byte [ ] jsonToByteArray ( org.codehaus.jackson.JsonNode json ) { final java.io.ByteArrayOutputStream os = new java.io.ByteArrayOutputStream ( ) ; try { try ( org.codehaus.jackson.JsonGenerator gen = org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.factory.createJsonGenerator ( os , JsonEncoding.UTF8 ) ) { gen.writeTree ( json ) ; } } catch ( java.io.IOException e ) { org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.log.debug ( "Exception thrown during marshalling json" , e ) ; } return os.toByteArray ( ) ; }
Source:
protected void UpdateActionAvailability ( ) { super . UpdateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( getEntity ( ) ) != null ) && ( ( ( getEntity ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( getEntity ( ) . getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown ) ) ) ) && ( org.ovirt.engine.ui.uicommonweb.DataProvider.IsWindowsOsType ( getEntity ( ) . getvm_os ( ) ) ) ) ) ; }

Target:
protected void UpdateActionAvailability ( ) { super . UpdateActionAvailability ( ) ; getConnectCommand ( ) . setIsExecutionAllowed ( ( ( ( ( ( getEntity ( ) ) != null ) && ( ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) || ( ( getEntity ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.PoweringDown ) ) ) ) && ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.IsWindowsOsType ( getEntity ( ) . getVmOs ( ) ) ) ) && ( getConfigurator ( ) . isClientWindownsExplorer ( ) ) ) ) ; }
Source:
protected static org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode createGlusterRoleTree ( ) { return new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . glusterRoleTree ( ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . configureVolumesRoleTree ( ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode [ ] { new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToCreateGlusterVolumesRoleTree ( ) ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.core.common.businessentities.ActionGroup.MANIPULATE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToManipulateGlusterVolumesRoleTree ( ) ) } ) ) ; }

Target:
protected static org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode createGlusterRoleTree ( ) { return new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . glusterRoleTree ( ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . configureVolumesRoleTree ( ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode [ ] { new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToCreateGlusterVolumesRoleTree ( ) ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.core.common.businessentities.ActionGroup.DELETE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToDeleteGlusterVolumesRoleTree ( ) ) , new org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleNode ( org.ovirt.engine.core.common.businessentities.ActionGroup.MANIPULATE_GLUSTER_VOLUME , org.ovirt.engine.ui.uicommonweb.models.configure.roles_ui.RoleTreeView.getConstants ( ) . allowToManipulateGlusterVolumesRoleTree ( ) ) } ) ) ; }
Source:
public void testISplitRpm ( ) { java.lang.String [ ] parts = org.ovirt.engine.core.common.utils.RpmVersionUtils.splitRpmToParts ( "ovirt-iso-node-2.6.0-20130820.fc18.x86_64" ) ; org.junit.Assert.assertEquals ( "ovirt-iso-node" , parts [ 0 ] ) ; org.junit.Assert.assertEquals ( "2.6.0" , parts [ 1 ] ) ; org.junit.Assert.assertEquals ( "20130820.fc18.x86_64" , parts [ 2 ] ) ; }

Target:
public void testISplitRpm ( ) { org.junit.Assert.assertArrayEquals ( new java.lang.String [ ] { "ovirt-iso-node" , "2.6.0" , "20130820.fc18.x86_64" } , org.ovirt.engine.core.common.utils.RpmVersionUtils.splitRpmToParts ( "ovirt-iso-node-2.6.0-20130820.fc18.x86_64" ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > returnValueList = result.getReturnValues ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValueList.get ( 0 ) . getReturnValue ( ) ) ) ; initTemplates ( templates ) ; initCdImage ( ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { java.util.List < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > returnValueList = result.getReturnValues ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( returnValueList.get ( 0 ) . getReturnValue ( ) ) ) ; initTemplateWithVersion ( templates ) ; initCdImage ( ) ; }
Source:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.core.common.businessentities.VMStatus status ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendCdRomsResourceTest.PARENT_ID } , ( status != null ? getEntity ( 0 , status ) : getEntity ( 0 ) ) ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.core.common.businessentities.VMStatus status ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendCdRomsResourceTest.PARENT_ID } , ( status != null ? getEntity ( 0 , status ) : getEntity ( 0 ) ) ) ; } }
Source:
public void testInterfaceIsValidSlaveWhenInterfaceIsVlan ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setVlanId ( 1 ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceIsValidSlave ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE ) ) ; }

Target:
public void testInterfaceIsValidSlaveWhenInterfaceIsVlan ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setVlanId ( 1 ) ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_INTERFACE_NAME , vdsNetworkInterface.getName ( ) ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceIsValidSlave ( ) , matcher ) ; }
Source:
private org.ovirt.engine.core.bll.utils.GlusterUtil getGlusterUtil ( ) { return org.ovirt.engine.core.bll.utils.GlusterUtil.getInstance ( ) ; }

Target:
private void addGlusterWebhook ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { backend.runInternalAction ( ActionType.AddGlusterWebhookInternal , new org.ovirt.engine.core.common.action.VdsActionParameters ( vds.getId ( ) ) ) ; } catch ( java.lang.RuntimeException e ) { log.error ( "Could not add gluster webhook for gluster host '{}'" , vds.getName ( ) ) ; log.debug ( "Exception" , e ) ; } }
Source:
public void getHostArchitecture ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < org.ovirt.engine.core.common.businessentities.ArchitectureType > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.ArchitectureType convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( org.ovirt.engine.core.common.businessentities.ArchitectureType ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostArchitecture , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
public static void GetTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > Get64bitOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2003x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008R2x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows2008x64 , org.ovirt.engine.core.common.businessentities.VmOsType.Windows7x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.x64OsTypes ; }
Source:
public void startFailedAutoStartVms ( ) { org.ovirt.engine.core.compat.DateTime now = org.ovirt.engine.core.compat.DateTime.getNow ( ) ; while ( ( ( autoStartVmsToRun.peek ( ) ) != null ) && ( ( now.compareTo ( autoStartVmsToRun.peek ( ) . getFirst ( ) ) ) > 0 ) ) { runVm ( autoStartVmsToRun.poll ( ) . getSecond ( ) ) ; } }

Target:
public void startFailedAutoStartVms ( ) { java.util.LinkedList < org.ovirt.engine.core.compat.Guid > idsToRemove = new java.util.LinkedList < > ( ) ; for ( org.ovirt.engine.core.compat.Guid vmId : autoStartVmsToRun ) { org.ovirt.engine.core.utils.lock.EngineLock runVmLock = createEngineLockForRunVm ( vmId , getLockMessage ( ) ) ; if ( ! ( getLockManager ( ) . acquireLock ( runVmLock ) . getFirst ( ) ) ) { continue ; } runVm ( vmId , runVmLock ) ; idsToRemove.add ( vmId ) ; } autoStartVmsToRun.removeAll ( idsToRemove ) ; }
Source:
private void massNetworksUpdate ( org.ovirt.engine.core.compat.Guid vfsConfigId , java.util.Set < org.ovirt.engine.core.compat.Guid > networks ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > executions = new java.util.ArrayList ( networks.size ( ) ) ; for ( org.ovirt.engine.core.compat.Guid networkId : networks ) { executions.add ( createNetworkParametersMapper ( vfsConfigId , networkId ) ) ; } getCallsHandler ( ) . executeStoredProcAsBatch ( "InsertvfsConfigNetwork" , executions ) ; }

Target:
private void removeAllNetworksByVfsConfigId ( org.ovirt.engine.core.compat.Guid vfsConfigId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = createVfsConfigIdParameter ( vfsConfigId ) ; getCallsHandler ( ) . executeModification ( "DeleteAllVfsConfigNetworks" , parameterSource ) ; }
Source:
public org.ovirt.engine.sdk.decorators.StorageDomain update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.StorageDomain.class , org.ovirt.engine.sdk.decorators.StorageDomain.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.StorageDomain update ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . update ( url , this , org.ovirt.engine.sdk.entities.StorageDomain.class , org.ovirt.engine.sdk.decorators.StorageDomain.class , headers ) ; }
Source:
public void testStorageDomainTemplateLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Template template = new org.ovirt.engine.api.model.Template ( ) ; template.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.TEMPLATE_ID ) ; template.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; template.getStorageDomain ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; template = org.ovirt.engine.api.common.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , template ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_TEMPLATE_HREF , template.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_HREF , template.getStorageDomain ( ) . getHref ( ) ) ; }

Target:
public void testStorageDomainTemplateLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Template template = new org.ovirt.engine.api.model.Template ( ) ; template.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.TEMPLATE_ID ) ; template.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; template.getStorageDomain ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; template = org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , template ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_TEMPLATE_HREF , template.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.STORAGE_DOMAIN_HREF , template.getStorageDomain ( ) . getHref ( ) ) ; }
Source:
public javax.ws.rs.core.Response toResponse ( org.codehaus.jackson.JsonProcessingException exception ) { try { return javax.ws.rs.core.Response.status ( Status.BAD_REQUEST ) . entity ( new org.ovirt.engine.api.restapi.resource.validation.UsageFinder ( ) . getUsageMessage ( application , uriInfo , request ) ) . build ( ) ; } catch ( java.lang.Exception e ) { throw new javax.ws.rs.WebApplicationException ( e , javax.ws.rs.core.Response.status ( Response.Status.INTERNAL_SERVER_ERROR ) . build ( ) ) ; } }

Target:
public javax.ws.rs.core.Response toResponse ( org.codehaus.jackson.JsonProcessingException exception ) { try { org.ovirt.engine.api.restapi.resource.validation.JsonExceptionMapper.log.error ( "JSON exception while processing \"{}\" request for path \"{}\"" , request.getMethod ( ) , uriInfo.getPath ( ) ) ; org.ovirt.engine.api.restapi.resource.validation.JsonExceptionMapper.log.error ( "Exception" , exception ) ; return javax.ws.rs.core.Response.status ( Status.BAD_REQUEST ) . entity ( new org.ovirt.engine.api.restapi.resource.validation.UsageFinder ( ) . getUsageMessage ( application , uriInfo , request ) ) . build ( ) ; } catch ( java.lang.Exception e ) { throw new javax.ws.rs.WebApplicationException ( e , javax.ws.rs.core.Response.status ( Response.Status.INTERNAL_SERVER_ERROR ) . build ( ) ) ; } }
Source:
public void testGetLunsToUpdateInDbForSameLun ( ) { org.ovirt.engine.core.common.businessentities.storage.LUNs lun = new org.ovirt.engine.core.common.businessentities.storage.LUNs ( ) ; org.ovirt.engine.core.compat.Guid lunId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; lun.setLUNId ( lunId.toString ( ) ) ; lun.setPhysicalVolumeId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) . toString ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > upToDateLuns = getLunsToUpdateInDb ( lun , lun ) . get ( command.noOp ) ; assertLunIdInList ( upToDateLuns , lunId ) ; }

Target:
private void setLunsIds ( org.ovirt.engine.core.compat.Guid lunFromVgLunId , org.ovirt.engine.core.compat.Guid lunFromDbLunId , org.ovirt.engine.core.compat.Guid lunFromVgPvId , org.ovirt.engine.core.compat.Guid lunFromDbPvId ) { lunFromVg.setLUNId ( lunFromVgLunId.toString ( ) ) ; lunFromVg.setPhysicalVolumeId ( lunFromVgPvId.toString ( ) ) ; lunFromDb.setLUNId ( lunFromDbLunId.toString ( ) ) ; lunFromDb.setPhysicalVolumeId ( lunFromDbPvId.toString ( ) ) ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel object ) { super . edit ( object ) ; disableAllTabs ( ) ; enableEditPoolFields ( ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel object ) { super . edit ( object ) ; object.getPropertyChangedEvent ( ) . 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 ) { if ( ( object.getProgress ( ) ) == null ) { disableAllTabs ( ) ; enableEditPoolFields ( ) ; } } } ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkQosExistsOrNull ( ) { return ( ( vnicProfile.getNetworkQosId ( ) ) == null ) || ( ( getDbFacade ( ) . getNetworkQosDao ( ) . get ( vnicProfile.getNetworkQosId ( ) ) ) != null ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_EXISTS ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkQosExistsOrNull ( ) { return ( ( vnicProfile.getNetworkQosId ( ) ) == null ) || ( ( org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.dao.network.NetworkQoSDao.class ) . get ( vnicProfile.getNetworkQosId ( ) ) ) != null ) ? org.ovirt.engine.core.bll.ValidationResult.VALID : new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_EXISTS ) ; }
Source:
static com.gwtplatform.mvp.client.TabData getTabData ( org.ovirt.engine.ui.common.uicommon.model.MainModelProvider < org.ovirt.engine.core.common.businessentities.Cluster , org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel < java.lang.Void > > modelProvider , org.ovirt.engine.ui.webadmin.widget.tab.WebadminMenuLayout menuLayout ) { org.ovirt.engine.ui.webadmin.widget.tab.MenuLayoutMenuDetails menuTabDetails = menuLayout.getDetails ( WebAdminApplicationPlaces.clusterMainTabPlace ) ; return new org.ovirt.engine.ui.common.widget.tab.ModelBoundTabData ( menuTabDetails.getSecondaryTitle ( ) , menuTabDetails.getSecondaryPriority ( ) , menuTabDetails.getPrimaryTitle ( ) , menuTabDetails.getPrimaryPriority ( ) , modelProvider , menuTabDetails.getIcon ( ) ) ; }

Target:
static com.gwtplatform.mvp.client.TabData getTabData ( org.ovirt.engine.ui.webadmin.widget.tab.WebadminMenuLayout menuLayout ) { org.ovirt.engine.ui.webadmin.widget.tab.MenuLayoutMenuDetails menuTabDetails = menuLayout.getDetails ( WebAdminApplicationPlaces.clusterMainTabPlace ) ; return new org.ovirt.engine.ui.common.uicommon.model.GroupedTabData ( menuTabDetails.getSecondaryTitle ( ) , menuTabDetails.getPrimaryTitle ( ) , menuTabDetails.getSecondaryPriority ( ) , menuTabDetails.getPrimaryPriority ( ) , menuTabDetails.getIcon ( ) ) ; }
Source:
private static org.ovirt.engine.api.model.QosType mapModelQosType ( java.lang.String type ) { switch ( type ) { case "storage" : return org.ovirt.engine.api.model.QosType.STORAGE ; case "cpu" : return org.ovirt.engine.api.model.QosType.CPU ; case "network" : return org.ovirt.engine.api.model.QosType.NETWORK ; default : throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "QosType %s cannot be mapped to %s: " , type , org.ovirt.engine.api.model.QosType.class ) ) ; } }

Target:
private static org.ovirt.engine.api.model.QosType mapModelQosType ( java.lang.String type ) { switch ( type ) { case "storage" : return org.ovirt.engine.api.model.QosType.STORAGE ; case "cpu" : return org.ovirt.engine.api.model.QosType.CPU ; case "network" : return org.ovirt.engine.api.model.QosType.NETWORK ; case "hostnetwork" : return org.ovirt.engine.api.model.QosType.HOSTNETWORK ; default : throw new java.lang.IllegalArgumentException ( java.lang.String.format ( "QosType %s cannot be mapped to %s: " , type , org.ovirt.engine.api.model.QosType.class ) ) ; } }
Source:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }

Target:
public void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private void testSetStatusForRequiredNetwork ( java.lang.String networkNameOnNic ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = createHosts ( false , true ) ; final org.ovirt.engine.core.common.businessentities.VDS activeHost = hosts.get ( 1 ) ; org.mockito.Mockito.when ( vdsDao.getAllForCluster ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID ) ) . thenReturn ( hosts ) ; org.mockito.Mockito.when ( hostNicsUtil.findHostNics ( activeHost.getId ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( createNic ( networkNameOnNic ) ) ) ; underTest.setStatus ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME ) ) ; }

Target:
public void testSetStatusForNonRequiredNetworkAlreadyOperational ( ) { networkCluster.setRequired ( false ) ; networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; underTest.setStatus ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.CLUSTER_ID , createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID1 , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME1 ) ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . updateStatus ( org.mockito.ArgumentMatchers.same ( networkCluster ) ) ; }
Source:
public void onSuccess ( java.lang.String result ) { if ( result != null ) { restApiSessionId = result ; processSessionId ( result ) ; } else { processSessionIdException ( ) ; } }

Target:
public void reuseSession ( ) { if ( ( restApiSessionId ) != null ) { processSessionId ( restApiSessionId ) ; } else { getSessionIdFromHttpSession ( new org.ovirt.engine.ui.frontend.communication.StorageCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.String result ) { if ( result != null ) { setSessionId ( result , false ) ; processSessionId ( result ) ; } else { processSessionIdException ( ) ; } } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { processSessionIdException ( ) ; } } ) ; } }
Source:
public void invalidDefaultManagementNetworkAttachement ( ) { newDefaultManagementNetworkFound ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage expected = org.ovirt.engine.core.common.errors.EngineMessage.Unassigned ; org.mockito.Mockito.when ( networkClusterValidator.managementNetworkChange ( ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( expected ) ) ; createCommandWithDefaultVdsGroup ( ) ; oldGroupIsDetachedDefault ( ) ; setupCpu ( ) ; validateFailedWithReason ( expected ) ; }

Target:
public void invalidDefaultManagementNetworkAttachement ( ) { newDefaultManagementNetworkFound ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage expected = org.ovirt.engine.core.common.errors.EngineMessage.Unassigned ; org.mockito.Mockito.when ( networkClusterValidator.managementNetworkChange ( ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( expected ) ) ; createCommandWithDefaultCluster ( ) ; oldGroupIsDetachedDefault ( ) ; setupCpu ( ) ; validateFailedWithReason ( expected ) ; }
Source:
public void validateIsoPrefixNameForInitrdAndNullForKernel ( ) throws java.lang.Exception { java.lang.String initrd = "initrd" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ) + initrd ) , null ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ACTIVE_ISO_PREFIX ) + "/" ) + initrd ) ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , null ) ; }

Target:
public void validateIsoPrefixNameForInitrdAndNullForKernel ( ) throws java.lang.Exception { java.lang.String initrd = "initrd" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( ( ( RunVmCommand.ISO_PREFIX ) + initrd ) , null ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ACTIVE_ISO_PREFIX ) + "/" ) + initrd ) ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , null ) ; }
Source:
protected org.ovirt.engine.api.model.Job getEntity ( int index ) { org.ovirt.engine.api.model.Job job = new org.ovirt.engine.api.model.Job ( ) ; job.setId ( GUIDS [ index ] ) ; job.setDescription ( DESCRIPTIONS [ index ] ) ; job.setActionType ( VdcActionType.AddExternalJob ) ; job.setStartTime ( new java.util.Date ( ) ) ; job.setExternal ( true ) ; job.setAutoCleared ( true ) ; return job ; }

Target:
protected org.ovirt.engine.api.model.Job getEntity ( int index ) { org.ovirt.engine.api.model.Job job = new org.ovirt.engine.api.model.Job ( ) ; job.setId ( GUIDS [ index ] ) ; job.setDescription ( DESCRIPTIONS [ index ] ) ; job.setActionType ( ActionType.AddExternalJob ) ; job.setStartTime ( new java.util.Date ( ) ) ; job.setExternal ( true ) ; job.setAutoCleared ( true ) ; return job ; }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesSubtract ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesToSubtract ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > subtract = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { if ( ( org.ovirt.engine.ui.uicommonweb.Linq.getDiskImageById ( image.getId ( ) , imagesToSubtract ) ) == null ) { subtract.add ( image ) ; } } return subtract ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesSubtract ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesToSubtract ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > subtract = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { if ( ( org.ovirt.engine.ui.uicommonweb.Linq.getDiskImageById ( image.getId ( ) , imagesToSubtract ) ) == null ) { subtract.add ( image ) ; } } return subtract ; }
Source:
protected org.ovirt.engine.core.bll.SPMAsyncTask ConcreteCreateTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , new org.ovirt.engine.core.common.businessentities.async_tasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getTaskID ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getCommandId ( ) ) ) ; p.setEntityId ( org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getParameters ( ) . getEntityId ( ) ) ; return org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CreateTask ( AsyncTaskType.mergeSnapshots , p ) ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { return java.util.Collections.singletonMap ( VdcObjectType.Disk.name ( ) . toLowerCase ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . getDiskAlias ( ) ) ; }
Source:
private void setErrorMessageAtReturn ( org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.Integer > result ) { org.ovirt.engine.core.common.errors.EngineFault fault = new org.ovirt.engine.core.common.errors.EngineFault ( ) ; fault.setError ( result.getSecond ( ) ) ; if ( ( fault.getError ( ) ) != null ) { fault.setMessage ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getVdsErrorsTranslator ( ) . TranslateErrorTextSingle ( fault.getError ( ) . toString ( ) ) ) ; } org.ovirt.engine.core.bll.storage.connection.ConnectStorageToVdsCommand.getReturnValue ( ) . setFault ( fault ) ; }

Target:
private void setErrorMessageAtReturn ( org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.Integer > result ) { org.ovirt.engine.core.common.errors.EngineFault fault = new org.ovirt.engine.core.common.errors.EngineFault ( ) ; fault.setError ( result.getSecond ( ) ) ; if ( ( fault.getError ( ) ) != null ) { fault.setMessage ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getVdsErrorsTranslator ( ) . translateErrorTextSingle ( fault.getError ( ) . toString ( ) ) ) ; } org.ovirt.engine.core.bll.storage.connection.ConnectStorageToVdsCommand.getReturnValue ( ) . setFault ( fault ) ; }
Source:
private void resetTabsValidity ( ) { setIsGeneralTabValid ( true ) ; setIsSystemTabValid ( true ) ; setIsFirstRunTabValid ( true ) ; setIsDisplayTabValid ( true ) ; setIsHostTabValid ( true ) ; setIsAllocationTabValid ( true ) ; setIsBootSequenceTabValid ( true ) ; setRngTabValid ( true ) ; setIsCustomPropertiesTabValid ( true ) ; getValid ( ) . setEntity ( true ) ; }

Target:
private void onNumaSupport ( ) { if ( ( getWindow ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VmNumaSupportModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.numa.VmNumaSupportModel ) ( getWindow ( ) ) ) ; setVmNumaNodes ( model.getVm ( ) . getvNumaNodeList ( ) ) ; }
Source:
protected javax.ws.rs.core.UriInfo setUpChangeCdUriExpectations ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; javax.ws.rs.core.MultivaluedMap < java.lang.String , java.lang.String > queries = control.createMock ( javax.ws.rs.core.MultivaluedMap.class ) ; org.easymock.EasyMock.expect ( queries.containsKey ( "current" ) ) . andReturn ( true ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( uriInfo.getQueryParameters ( ) ) . andReturn ( queries ) . anyTimes ( ) ; return uriInfo ; }

Target:
protected javax.ws.rs.core.UriInfo setUpChangeCdUriQueryExpectations ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; javax.ws.rs.core.MultivaluedMap < java.lang.String , java.lang.String > queries = control.createMock ( javax.ws.rs.core.MultivaluedMap.class ) ; org.easymock.EasyMock.expect ( queries.containsKey ( "current" ) ) . andReturn ( true ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( uriInfo.getQueryParameters ( ) ) . andReturn ( queries ) . anyTimes ( ) ; return uriInfo ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateQos ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > attachmentsToConfigure ) { org.ovirt.engine.core.bll.ValidationResult vr = org.ovirt.engine.core.bll.ValidationResult.VALID ; vr = ( skipValidation ( vr ) ) ? vr : validateQosOverriddenInterfaces ( ) ; vr = ( skipValidation ( vr ) ) ? vr : validateQosNotPartiallyConfigured ( attachmentsToConfigure ) ; return vr ; }

Target:
org.ovirt.engine.core.bll.ValidationResult validateNotRemovingUsedNetworkByVms ( java.lang.String removedNetworkName ) { final java.util.List < java.lang.String > removedNetworkNames = java.util.Collections.singletonList ( removedNetworkName ) ; final java.util.List < java.lang.String > vmsNames = findActiveVmsUsingNetwork.findNamesOfActiveVmsUsingNetworks ( host.getId ( ) , removedNetworkNames ) ; org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator detachNetworkUsedByVmValidator = new org.ovirt.engine.core.bll.validator.network.DetachNetworkUsedByVmValidator ( vmsNames , removedNetworkNames ) ; return detachNetworkUsedByVmValidator.validate ( ) ; }
Source:
private void persistTopology ( org.ovirt.engine.core.common.businessentities.VDS host , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredData ) { final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersister networkInterfacesPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersisterImpl ( interfaceDao , host.getInterfaces ( ) , dbNics , userConfiguredData.getUserOverriddenNicValuesByNicName ( ) ) ; networkInterfacesPersister.persistTopology ( ) ; createHostNetworkAttachmentsPersister ( host , clusterNetworks , userConfiguredData ) . persistNetworkAttachments ( ) ; }

Target:
private void persistTopology ( org.ovirt.engine.core.common.businessentities.VDS host , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > dbNics , java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > clusterNetworks , org.ovirt.engine.core.common.vdscommands.UserConfiguredNetworkData userConfiguredData ) { vdsDynamicDao.updateDnsResolverConfiguration ( host.getId ( ) , host.getReportedDnsResolverConfiguration ( ) ) ; final org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersister networkInterfacesPersister = new org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkInterfacesPersisterImpl ( interfaceDao , host.getInterfaces ( ) , dbNics , userConfiguredData.getUserOverriddenNicValuesByNicName ( ) ) ; networkInterfacesPersister.persistTopology ( ) ; createHostNetworkAttachmentsPersister ( host , clusterNetworks , userConfiguredData ) . persistNetworkAttachments ( ) ; }
Source:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }

Target:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( org.ovirt.engine.core.bll.ImportVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ) ) { return failCanDoAction ( VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; } } return true ; }
Source:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }

Target:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > > aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }
Source:
private void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetProviderById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getProvider ( ) ) ; setUpGetEntityExpectations ( VdcQueryType.GetComputeResourceFromExternalProvider , org.ovirt.engine.core.common.queries.ProviderQueryParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getResources ( ) ) ) ; }

Target:
private void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetProviderById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getProvider ( ) ) ; setUpGetEntityExpectations ( QueryType.GetComputeResourceFromExternalProvider , org.ovirt.engine.core.common.queries.ProviderQueryParameters.class , new java.lang.String [ ] { "Provider.Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getResources ( ) ) ) ; }
Source:
protected void gatherChangedVms ( org.ovirt.engine.core.common.businessentities.VM dbVm , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vdsmVm ) { changedVms.add ( new org.ovirt.engine.core.common.utils.Pair ( dbVm , vdsmVm ) ) ; logBuilder.append ( java.lang.String.format ( " %s:%s" , vdsmVm.getVmDynamic ( ) . getId ( ) . toString ( ) . substring ( 0 , 8 ) , vdsmVm.getVmDynamic ( ) . getStatus ( ) ) ) ; }

Target:
protected void gatherChangedVms ( org.ovirt.engine.core.common.businessentities.VM dbVm , org.ovirt.engine.core.vdsbroker.vdsbroker.entities.VmInternalData vdsmVm ) { changedVms.add ( new org.ovirt.engine.core.common.utils.Pair ( dbVm , vdsmVm ) ) ; if ( org.ovirt.engine.core.vdsbroker.monitoring.VmsStatisticsFetcher.log.isDebugEnabled ( ) ) { logBuilder.append ( java.lang.String.format ( "%s:%s" , vdsmVm.getVmDynamic ( ) . getId ( ) . toString ( ) . substring ( 0 , 8 ) , vdsmVm.getVmDynamic ( ) . getStatus ( ) ) ) ; } }
Source:
private javax.ws.rs.core.Response addSAN ( org.ovirt.engine.api.model.StorageDomain model , org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.core.common.businessentities.storage_domain_static entity , org.ovirt.engine.core.compat.Guid hostId ) { return performCreation ( VdcActionType.AddSANStorageDomain , getSanAddParams ( entity , hostId , getLunIds ( model.getStorage ( ) , storageType , hostId ) ) , ID_RESOLVER ) ; }

Target:
private javax.ws.rs.core.Response addSAN ( org.ovirt.engine.api.model.StorageDomain model , org.ovirt.engine.core.common.businessentities.StorageType storageType , org.ovirt.engine.core.common.businessentities.storage_domain_static entity , org.ovirt.engine.core.compat.Guid hostId ) { boolean overrideLuns = ( model.getStorage ( ) . isSetOverrideLuns ( ) ) ? model.getStorage ( ) . isOverrideLuns ( ) : false ; return performCreation ( VdcActionType.AddSANStorageDomain , getSanAddParams ( entity , hostId , getLunIds ( model.getStorage ( ) , storageType , hostId ) , overrideLuns ) , ID_RESOLVER ) ; }
Source:
public void setForceLabelMessage ( org.ovirt.engine.ui.uicommonweb.models.gluster.GlusterVolumeGeoRepActionConfirmationModel object ) { forceEditor.setLabel ( ( ( object.getForceLabel ( ) ) == null ? constants.notAvailableLabel ( ) : object.getForceLabel ( ) ) ) ; forceEditor.setVisible ( ( ( object.getForceLabel ( ) ) != null ) ) ; }

Target:
public void setForceLabelMessage ( java.lang.String forceLabelMessage ) { forceEditor.setLabel ( ( forceLabelMessage == null ? constants.notAvailableLabel ( ) : forceLabelMessage ) ) ; forceEditor.setVisible ( ( forceLabelMessage != null ) ) ; }
Source:
protected void executeCommand ( ) { getProvider ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.getDbFacade ( ) . getProviderDao ( ) . save ( getProvider ( ) ) ; org.ovirt.engine.core.bll.provider.ProviderProxy providerProxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( getProvider ( ) ) ; if ( providerProxy != null ) { providerProxy.onAddition ( ) ; } org.ovirt.engine.core.bll.provider.AddProviderCommand.getReturnValue ( ) . setActionReturnValue ( getProvider ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.provider.AddProviderCommand.setSucceeded ( true ) ; }

Target:
public org.ovirt.engine.core.bll.provider.ProviderProxy getProviderProxy ( ) { if ( ( providerProxy ) == null ) { providerProxy = org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( getProvider ( ) ) ; } return providerProxy ; }