auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getAAANamespaces ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ) ( source ) ) : new java.util.HashMap < java.lang.String , java.util.List < java.lang.String > > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAvailableNamespaces , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }
Source:
private static java.lang.String getMessageToLog ( java.lang.String loggerString , org.ovirt.engine.core.common.businessentities.AuditLog auditLog ) { if ( loggerString.isEmpty ( ) ) { return auditLog.toStringForLogging ( ) ; } else { return java.text.MessageFormat.format ( loggerString , auditLog.getMessage ( ) ) ; } }

Target:
private static java.lang.String getMessageToLog ( java.lang.String loggerString , org.ovirt.engine.core.common.businessentities.AuditLog auditLog ) { java.lang.String message ; if ( loggerString.isEmpty ( ) ) { message = auditLog.toStringForLogging ( ) ; } else { message = java.text.MessageFormat.format ( loggerString , auditLog.getMessage ( ) ) ; } return java.text.MessageFormat.format ( "EVENT_ID: {0}({1}), {2}" , auditLog.getLogType ( ) , auditLog.getLogType ( ) . getValue ( ) , message ) ; }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , T value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < T > valueUpdater ) { super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; com.google.gwt.dom.client.EventTarget eventTarget = event.getEventTarget ( ) ; if ( ! ( com.google.gwt.dom.client.Element.is ( eventTarget ) ) ) { return ; } if ( BrowserEvents.CLICK.equals ( event.getType ( ) ) ) { onClick ( value ) ; } }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , C value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < C > valueUpdater ) { super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; com.google.gwt.dom.client.EventTarget eventTarget = event.getEventTarget ( ) ; if ( ! ( com.google.gwt.dom.client.Element.is ( eventTarget ) ) ) { return ; } if ( BrowserEvents.CLICK.equals ( event.getType ( ) ) ) { onClick ( value ) ; } }
Source:
public java.lang.String getMemberStyleName ( org.ovirt.api.metamodel.concepts.Name name ) { java.lang.String result = name.words ( ) . map ( java.lang.String :: toLowerCase ) . collect ( java.util.stream.Collectors.joining ( "_" ) ) ; if ( reservedWords.contains ( result ) ) { result += "_" ; } return result ; }

Target:
private java.lang.String avoidReservedWord ( java.lang.String word ) { if ( reservedWords.contains ( word ) ) { word += "_" ; } return word ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveDiskProfile , org.ovirt.engine.core.common.action.DiskProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveDiskProfile , org.ovirt.engine.core.common.action.DiskProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected void executeSave ( ) { final org.ovirt.engine.core.common.action.NetworkQoSParametersBase parameters = new org.ovirt.engine.core.common.action.NetworkQoSParametersBase ( ) ; parameters.setNetworkQoS ( networkQoS ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.AddNetworkQoS , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( succeeded ) ; } } ) ; }

Target:
protected void executeSave ( ) { final org.ovirt.engine.core.common.action.NetworkQoSParametersBase parameters = new org.ovirt.engine.core.common.action.NetworkQoSParametersBase ( ) ; parameters.setNetworkQoS ( networkQoS ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.AddNetworkQoS , parameters , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( succeeded ) ; } } ) ; }
Source:
public void postOnSaveInternalWithImport ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.MultipleHostsModel hostsModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.MultipleHostsModel ) ( getWindow ( ) ) ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { hostsModel.getClusterModel ( ) . setClusterId ( ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) ) ; addHosts ( hostsModel ) ; } }

Target:
public void postOnSaveInternalWithImport ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.hosts.MultipleHostsModel hostsModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.MultipleHostsModel ) ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterListModel.getWindow ( ) ) ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { hostsModel.getClusterModel ( ) . setClusterId ( ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) ) ; addHosts ( hostsModel ) ; } }
Source:
public void customPropertiesBadInput ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; java.util.Map < java.lang.String , java.lang.String > customProperties = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; customProperties.put ( "foo" , "b@r" ) ; iface.setCustomProperties ( customProperties ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_BAD_INPUT , network.getName ( ) ) ; }

Target:
public void customPropertiesBadInput ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; java.util.Map < java.lang.String , java.lang.String > customProperties = new java.util.HashMap < > ( ) ; customProperties.put ( "foo" , "b@r" ) ; iface.setCustomProperties ( customProperties ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_BAD_INPUT , network.getName ( ) ) ; }
Source:
private java.lang.String getOvfOfConvertedVm ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retValue = runVdsCommand ( VDSCommandType.GetConvertedOvf , new org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase ( org.ovirt.engine.core.bll.ConvertVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) ) ) ; if ( ! ( retValue.getSucceeded ( ) ) ) { auditLog ( this , AuditLogType.IMPORTEXPORT_CANNOT_GET_OVF ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( ) ; } return ( ( java.lang.String ) ( retValue.getReturnValue ( ) ) ) ; }

Target:
private java.lang.String getOvfOfConvertedVm ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retValue = runVdsCommand ( VDSCommandType.GetConvertedOvf , new org.ovirt.engine.core.common.vdscommands.VdsAndVmIDVDSParametersBase ( org.ovirt.engine.core.bll.ConvertVmCommand.getVdsId ( ) , org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) ) ) ; if ( ! ( retValue.getSucceeded ( ) ) ) { auditLog ( this , AuditLogType.IMPORTEXPORT_CANNOT_GET_OVF ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( ) ; } return ( ( java.lang.String ) ( retValue.getReturnValue ( ) ) ) ; }
Source:
public static void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }

Target:
public static void getGlusterSwiftServerServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }
Source:
protected int calcHostScore ( float maxMemoryOfVdsInCluster , org.ovirt.engine.core.common.businessentities.VDS vds ) { int maxScore = ( MaxSchedulerWeight ) - 1 ; return maxScore - ( super . calcHostScore ( maxMemoryOfVdsInCluster , vds ) ) ; }

Target:
private int calcHostScore ( float hostSchedulingMem , float maxMemory , float lowMemoryLimit , float highMemoryLimit ) { if ( hostSchedulingMem < lowMemoryLimit ) { float memUnderLimit = lowMemoryLimit - hostSchedulingMem ; hostSchedulingMem = java.lang.Math.min ( maxMemory , ( highMemoryLimit + memUnderLimit ) ) ; } return ( ( int ) ( ( hostSchedulingMem / maxMemory ) * ( ( MaxSchedulerWeight ) - 1 ) ) ) + 1 ; }
Source:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isInternal = getIsInternal ( ) . getEntity ( ) ; if ( isInternal ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.directLUNDiskNotSupported ( ) : "" ) ) ; }

Target:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; if ( getIsShareable ( ) . getIsChangable ( ) ) { getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; } }
Source:
void AddVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; tempVar.setstatus ( VMStatus.Down ) ; tempVar.setvm_host ( "" ) ; tempVar.setvm_ip ( "" ) ; tempVar.setdisplay_type ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getdefault_display_type ( ) ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = tempVar ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . save ( vmDynamic ) ; org.ovirt.engine.core.bll.AddVmCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDynamic ) ; }

Target:
void addVmDynamic ( ) { org.ovirt.engine.core.common.businessentities.VmDynamic tempVar = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; tempVar.setId ( org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) ) ; tempVar.setstatus ( VMStatus.Down ) ; tempVar.setvm_host ( "" ) ; tempVar.setvm_ip ( "" ) ; tempVar.setdisplay_type ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getdefault_display_type ( ) ) ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = tempVar ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDynamicDAO ( ) . save ( vmDynamic ) ; org.ovirt.engine.core.bll.AddVmCommand.getCompensationContext ( ) . snapshotNewEntity ( vmDynamic ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.Disk mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.Disk disk = org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.DiskRowMapper.instance.mapRow ( rs , rowNum ) ; disk.setPlugged ( rs.getBoolean ( "is_plugged" ) ) ; disk.setReadOnly ( rs.getBoolean ( "is_readonly" ) ) ; disk.setLogicalName ( rs.getString ( "logical_name" ) ) ; return disk ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.Disk mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.DiskRowMapper.instance.mapRow ( rs , rowNum ) ; disk.setPlugged ( rs.getBoolean ( "is_plugged" ) ) ; disk.setReadOnly ( rs.getBoolean ( "is_readonly" ) ) ; disk.setLogicalName ( rs.getString ( "logical_name" ) ) ; return disk ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.AffinityGroup affinityGroup ) { org.ovirt.engine.api.model.AffinityGroup backendEntity = getMapper ( org.ovirt.engine.api.model.AffinityGroup.class , org.ovirt.engine.api.model.AffinityGroup.class ) . map ( affinityGroup , null ) ; backendEntity.setClusterId ( asGuid ( clusterId ) ) ; return performCreate ( ActionType.AddAffinityGroup , new org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters ( null , backendEntity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetAffinityGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) , true ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.AffinityGroup affinityGroup ) { org.ovirt.engine.api.model.AffinityGroup backendEntity = getMapper ( org.ovirt.engine.api.model.AffinityGroup.class , org.ovirt.engine.api.model.AffinityGroup.class ) . map ( affinityGroup , null ) ; backendEntity.setClusterId ( asGuid ( clusterId ) ) ; return performCreate ( ActionType.AddAffinityGroup , new org.ovirt.engine.core.common.scheduling.parameters.AffinityGroupCRUDParameters ( null , backendEntity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.QueryType.GetAffinityGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) , true ) ; }
Source:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.action.RemoveDiskParameters params = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( asGuid ( id ) ) ; boolean force = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResource.FORCE , true , false ) ; if ( force ) { params.setForceDelete ( force ) ; } java.lang.String storageDomain = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResource.STORAGE_DOMAIN ) ; if ( storageDomain != null ) { params.setStorageDomainId ( asGuid ( storageDomain ) ) ; } return performAction ( VdcActionType.RemoveDisk , params ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; org.ovirt.engine.core.common.action.RemoveDiskParameters params = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( asGuid ( id ) ) ; boolean force = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResource.FORCE , true , false ) ; if ( force ) { params.setForceDelete ( force ) ; } java.lang.String storageDomain = org.ovirt.engine.api.restapi.util.ParametersHelper.getParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendTemplateDiskResource.STORAGE_DOMAIN ) ; if ( storageDomain != null ) { params.setStorageDomainId ( asGuid ( storageDomain ) ) ; } return performAction ( ActionType.RemoveDisk , params ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.VdsStatic vds ) { org.ovirt.engine.core.compat.Guid id = vds.getId ( ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( id ) ) { id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; vds.setId ( id ) ; } super . save ( vds ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.VdsStatic vds ) { org.ovirt.engine.core.compat.Guid id = vds.getId ( ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( id ) ) { id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; vds.setId ( id ) ; } new org.springframework.jdbc.core.simple.SimpleJdbcCall ( getJdbcTemplate ( ) ) . withProcedureName ( "InsertVdsStatic" ) . execute ( getInsertOrUpdateParams ( vds ) ) ; }
Source:
public static void isSoundcardEnabled ( 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 ) { if ( source != null ) { return ( ( ( java.util.List < java.lang.String > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void isVirtioScsiEnabledForVm ( 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 ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }
Source:
public void vdsNonOperational ( org.ovirt.engine.core.compat.Guid vdsId , org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , boolean logCommand , boolean saveToDb , org.ovirt.engine.core.compat.Guid domainId , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.bll.job.ExecutionHandler.updateSpecificActionJobCompleted ( vdsId , VdcActionType.MaintananceVds , false ) ; org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( vdsId , reason , customLogValues ) ; tempVar.setSaveToDb ( saveToDb ) ; tempVar.setStorageDomainId ( domainId ) ; tempVar.setShouldBeLogged ( logCommand ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }

Target:
public void vdsNonOperational ( org.ovirt.engine.core.compat.Guid vdsId , org.ovirt.engine.core.common.businessentities.NonOperationalReason reason , boolean logCommand , boolean saveToDb , org.ovirt.engine.core.compat.Guid domainId , java.util.Map < java.lang.String , java.lang.String > customLogValues ) { org.ovirt.engine.core.bll.job.ExecutionHandler.updateSpecificActionJobCompleted ( vdsId , VdcActionType.MaintenanceVds , false ) ; org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters tempVar = new org.ovirt.engine.core.common.action.SetNonOperationalVdsParameters ( vdsId , reason , customLogValues ) ; tempVar.setSaveToDb ( saveToDb ) ; tempVar.setStorageDomainId ( domainId ) ; tempVar.setShouldBeLogged ( logCommand ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetNonOperationalVds , tempVar , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; }
Source:
private java.lang.String getTemplateExclusiveLockMessage ( ) { return new java.lang.StringBuilder ( EngineMessage.ACTION_TYPE_FAILED_TEMPLATE_IS_BEING_REMOVED.name ( ) ) . append ( java.lang.String.format ( "$TemplateName %1$s" , org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplate ( ) . getName ( ) ) ) . toString ( ) ; }

Target:
private java.lang.String getTemplateExclusiveLockMessage ( ) { return new java.lang.StringBuilder ( EngineMessage.ACTION_TYPE_FAILED_TEMPLATE_IS_BEING_REMOVED.name ( ) ) . append ( java.lang.String.format ( "$templateName %s$templateId %s" , org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplate ( ) . getName ( ) , org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplate ( ) . getId ( ) ) ) . toString ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepMountBrokerSetup ( java.lang.String remoteVolumeName , java.lang.String remoteUserName , java.lang.String remoteGroupName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepMountBrokerSetup" ) . withParameter ( "remoteVolumeName" , remoteVolumeName ) . withOptionalParameter ( "remoteUserName" , remoteUserName ) . withOptionalParameter ( "remoteGroupName" , remoteGroupName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepMountBrokerSetup ( java.lang.String remoteVolumeName , java.lang.String userName , java.lang.String remoteGroupName , java.lang.Boolean partial ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepMountBrokerSetup" ) . withParameter ( "remoteVolumeName" , remoteVolumeName ) . withParameter ( "partial" , partial ) . withOptionalParameter ( "remoteUserName" , userName ) . withOptionalParameter ( "remoteGroupName" , remoteGroupName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getBroker ( ) . glusterVolumeReset ( org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . getVolumeName ( ) , ( ( org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . getVolumeOption ( ) ) == null ? "" : org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . getVolumeOption ( ) . getKey ( ) ) , org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . isforceAction ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.ProceedProxyReturnValue ( ) ; }

Target:
protected void ExecuteVdsBrokerCommand ( ) { status = org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getBroker ( ) . glusterVolumeReset ( org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . getVolumeName ( ) , ( ( org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . getVolumeOption ( ) ) == null ? "" : org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . getVolumeOption ( ) . getKey ( ) ) , org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.getParameters ( ) . isforceAction ( ) ) ; org.ovirt.engine.core.vdsbroker.gluster.ResetGlusterVolumeOptionsVDSCommand.proceedProxyReturnValue ( ) ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.host.provider.HostProviderProxy proxy = systemProviderFinder.findSystemProvider ( ) ; if ( proxy == null ) { org.ovirt.engine.core.bll.GetErrataForSystemQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.bll.GetErrataForSystemQuery.getQueryReturnValue ( ) . setExceptionString ( EngineMessage.NO_FOREMAN_PROVIDER_FOR_ENGINE.name ( ) ) ; } else { setReturnValue ( proxy.getErrataForHost ( systemProviderFinder.getSystemHostName ( ) ) ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.host.provider.HostProviderProxy proxy = systemProviderFinder.findSystemProvider ( ) ; if ( proxy == null ) { org.ovirt.engine.core.bll.GetErrataForEngineQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.bll.GetErrataForEngineQuery.getQueryReturnValue ( ) . setExceptionString ( EngineMessage.NO_FOREMAN_PROVIDER_FOR_ENGINE.name ( ) ) ; } else { setReturnValue ( proxy.getErrataForHost ( systemProviderFinder.getSystemHostName ( ) ) ) ; } }
Source:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , java.lang.Boolean returnNull ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetAdGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { entityId } , ( returnNull ? null : getEntity ( 0 ) ) ) ; }

Target:
private void setUpGetEntityExpectations ( org.ovirt.engine.core.compat.Guid entityId , boolean returnNull ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDbGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { entityId } , ( returnNull ? null : getEntity ( 0 ) ) ) ; }
Source:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } oldMacPool = getMacPoolDao ( ) . get ( getMacPoolId ( ) ) ; final org.ovirt.engine.core.bll.MacPoolValidator validator = new org.ovirt.engine.core.bll.MacPoolValidator ( oldMacPool , getMacPool ( ) ) ; return ( ( validate ( validator.macPoolExists ( ) ) ) && ( validate ( validator.hasUniqueName ( ) ) ) ) && ( validate ( validator.defaultFlagIsNotChanged ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } oldMacPool = getMacPoolDao ( ) . get ( getMacPoolId ( ) ) ; return ( ( validate ( new org.ovirt.engine.core.bll.MacPoolValidator ( oldMacPool ) . macPoolExists ( ) ) ) && ( validate ( new org.ovirt.engine.core.bll.MacPoolValidator ( getMacPoolEntity ( ) ) . hasUniqueName ( ) ) ) ) && ( validate ( org.ovirt.engine.core.bll.UpdateMacPoolCommand.validateDefaultFlagIsNotChanged ( oldMacPool , getMacPoolEntity ( ) ) ) ) ; }
Source:
private void UpdateSwapUsed ( ) { setUsedSwap ( null ) ; if ( ( ( getEntity ( ) . getSwapTotal ( ) ) != null ) && ( ( getEntity ( ) . getSwapFree ( ) ) != null ) ) { setUsedSwap ( ( ( getEntity ( ) . getSwapTotal ( ) ) - ( getEntity ( ) . getSwapFree ( ) ) ) ) ; } }

Target:
private void updateSwapUsed ( ) { setUsedSwap ( null ) ; if ( ( ( getEntity ( ) . getSwapTotal ( ) ) != null ) && ( ( getEntity ( ) . getSwapFree ( ) ) != null ) ) { setUsedSwap ( ( ( getEntity ( ) . getSwapTotal ( ) ) - ( getEntity ( ) . getSwapFree ( ) ) ) ) ; } }
Source:
protected void saveSnapshotIfNotExists ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { if ( ! ( getSnapshotDao ( ) . exists ( getVm ( ) . getId ( ) , snapshotId ) ) ) { getSnapshotDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.Snapshot ( snapshotId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , getVm ( ) . getId ( ) , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR , disk.getdescription ( ) , disk.getlast_modified_date ( ) , disk.getappList ( ) ) ) ; } }

Target:
protected void saveSnapshotIfNotExists ( org.ovirt.engine.core.compat.Guid snapshotId , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { if ( ! ( getSnapshotDao ( ) . exists ( getVm ( ) . getId ( ) , snapshotId ) ) ) { getSnapshotDao ( ) . save ( new org.ovirt.engine.core.common.businessentities.Snapshot ( snapshotId , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus.OK , getVm ( ) . getId ( ) , null , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType.REGULAR , disk.getDescription ( ) , disk.getLastModifiedDate ( ) , disk.getAppList ( ) ) ) ; } }
Source:
public java.lang.Boolean getValue ( ) { for ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model : getNetworksTableItems ( ) ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkManageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel ) ( model ) ) ; if ( canEditRequired ( clusterNetworkManageModel ) ) { if ( ! ( clusterNetworkManageModel.isRequired ( ) ) ) { return false ; } } } return true ; }

Target:
public java.lang.Boolean getValue ( ) { for ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel : getNetworksTableItems ( ) ) { if ( canEditRequired ( clusterNetworkModel ) ) { if ( ! ( clusterNetworkModel.isRequired ( ) ) ) { return false ; } } } return true ; }
Source:
private java.lang.String replaceLocaleWithUSLocale ( java.lang.String originalString , java.util.Locale locale ) { java.lang.String regex = ( ( "/" + ( locale.toLanguageTag ( ) . replaceAll ( "-" , "\\\\-" ) ) ) + "|/" ) + ( locale.toString ( ) ) ; return originalString.replaceAll ( regex , ( "/" + ( java.util.Locale.US.toLanguageTag ( ) ) ) ) ; }

Target:
private java.lang.String replaceLocaleWithOtherLocale ( java.lang.String originalString , java.util.Locale searchLocale , java.util.Locale targetLocale ) { java.lang.String regex = ( ( "/" + ( searchLocale.toLanguageTag ( ) . replaceAll ( "-" , "\\\\-" ) ) ) + "|/" ) + ( searchLocale.toString ( ) ) ; return originalString.replaceAll ( regex , ( "/" + ( targetLocale.toLanguageTag ( ) ) ) ) ; }
Source:
private java.lang.String getManagementUser ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { java.lang.String managementUser = "" ; if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Primary ) ) { managementUser = _vds.getPmUser ( ) ; } else if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Secondary ) ) { managementUser = _vds.getPmSecondaryuser ( ) ; } return managementUser ; }

Target:
private java.lang.String getManagementUser ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder order ) { java.lang.String managementUser = "" ; if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Primary ) ) { managementUser = _vds.getPmUser ( ) ; } else if ( order == ( org.ovirt.engine.core.common.businessentities.FenceAgentOrder.Secondary ) ) { managementUser = _vds.getPmSecondaryUser ( ) ; } return managementUser ; }
Source:
public static void addDiskToVmIfNotExists ( org.ovirt.engine.core.common.businessentities.storage.BaseDisk disk , org.ovirt.engine.core.compat.Guid vmId ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getBaseDiskDao ( ) . exists ( disk.getId ( ) ) ) ) { org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.addDiskToVm ( disk , vmId ) ; } }

Target:
public void addDiskImage ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image , org.ovirt.engine.core.compat.Guid vmId ) { addDiskImage ( image , image.getActive ( ) , new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( image.getImageId ( ) , image.getStorageIds ( ) . get ( 0 ) , image.getQuotaId ( ) , image.getDiskProfileId ( ) ) , vmId ) ; }
Source:
protected boolean canAddVm ( ) { boolean exists = ( ( java.lang.Boolean ) ( getBackend ( ) . runInternalQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmWithSameNameExistParameters ( getVm ( ) . getName ( ) ) ) . getReturnValue ( ) ) ) ; if ( exists ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_IMPORT_VM_NAME_EXISTS ) ; } return ! exists ; }

Target:
protected boolean canAddVm ( ) { boolean exists = org.ovirt.engine.core.bll.VmHandler.isVmWithSameNameExistStatic ( getVm ( ) . getName ( ) ) ; if ( exists ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_IMPORT_VM_NAME_EXISTS ) ; } return ! exists ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) : 1 ; }
Source:
protected void handleError ( ) { if ( ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getSpmStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) { log.info ( "Fence failed on vds '{}' which is spm of pool '{}' - moving pool to non operational" , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getName ( ) , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) ) ; runInternalAction ( VdcActionType.SetStoragePoolStatus , new org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational , org.ovirt.engine.core.common.AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_NO_HOST_FOR_SPM ) ) ; } log.error ( "Failed to run Fence script on vds '{}'." , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsName ( ) ) ; org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.AlertIfPowerManagementOperationSkipped ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.RESTART , null ) ; }

Target:
protected void handleError ( ) { if ( ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getSpmStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) { log.info ( "Fence failed on vds '{}' which is spm of pool '{}' - moving pool to non operational" , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getName ( ) , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) ) ; runInternalAction ( VdcActionType.SetStoragePoolStatus , new org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational , org.ovirt.engine.core.common.AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_NO_HOST_FOR_SPM ) ) ; } log.error ( "Failed to run Fence script on vds '{}'." , org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.getVdsName ( ) ) ; org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.alertIfPowerManagementOperationSkipped ( org.ovirt.engine.core.bll.VdsNotRespondingTreatmentCommand.RESTART , null ) ; }
Source:
public void testValidRemovedBondsWhenBondIsNotRequired ( ) { java.lang.String nicName = "nicName" ; bond.setName ( nicName ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedBonds ( bond.getId ( ) ) ) . addExistingInterfaces ( java.util.Collections.singletonList ( bond ) ) . build ( ) ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidRemovedBondsWhenBondIsNotRequired ( ) { java.lang.String nicName = "nicName" ; bond.setName ( nicName ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedBonds ( bond.getId ( ) ) ) . addExistingInterfaces ( java.util.Collections.singletonList ( bond ) ) . build ( ) ; org.hamcrest.MatcherAssert.assertThat ( validator.validRemovedBonds ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected abstract void onNoNicsDefinedOnVm ( ) ;

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.UpdateVmInterface , updateVnicParameters , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.RemoveVmInterface , removeVnicParameters , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { callback.vnicCreated ( vmId ) ; } } , this ) ; } } , this ) ; }
Source:
public java.util.List < java.lang.String > convert ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > source ) { if ( source != null ) { java.util.ArrayList < java.lang.String > fileNameList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.RepoImage repoImage : source ) { if ( imagePredicate.test ( repoImage ) ) { fileNameList.add ( transform.apply ( repoImage ) ) ; } } java.util.Collections.sort ( fileNameList , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) ; return fileNameList ; } return new java.util.ArrayList < > ( ) ; }

Target:
public java.util.List < java.lang.String > convert ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > source ) { if ( source != null ) { return source.stream ( ) . filter ( imagePredicate ) . map ( transform ) . sorted ( new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator ( ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; } return new java.util.ArrayList < > ( ) ; }
Source:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public void getMaxSpmPriority ( 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 ) ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { org.ovirt.engine.ui.frontend.Frontend.setLoggedInUser ( null ) ; callback.asyncCallback.onSuccess ( callback.getModel ( ) , null ) ; } }

Target:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { org.ovirt.engine.ui.frontend.Frontend.clearLoggedInUser ( ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , null ) ; } }
Source:
public java.lang.Void runInTransaction ( ) { if ( ! ( numaNodesToRemove.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsNumaNodeDAO ( ) . massRemoveNumaNodeByNumaNodeId ( numaNodesToRemove ) ; } if ( ! ( numaNodesToUpdate.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsNumaNodeDAO ( ) . massUpdateNumaNode ( numaNodesToUpdate ) ; } if ( ! ( numaNodesToSave.isEmpty ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsNumaNodeDAO ( ) . massSaveNumaNode ( numaNodesToSave , vds.getId ( ) , null ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { if ( ! ( numaNodesToRemove.isEmpty ( ) ) ) { dbFacade.getVdsNumaNodeDAO ( ) . massRemoveNumaNodeByNumaNodeId ( numaNodesToRemove ) ; } if ( ! ( numaNodesToUpdate.isEmpty ( ) ) ) { dbFacade.getVdsNumaNodeDAO ( ) . massUpdateNumaNode ( numaNodesToUpdate ) ; } if ( ! ( numaNodesToSave.isEmpty ( ) ) ) { dbFacade.getVdsNumaNodeDAO ( ) . massSaveNumaNode ( numaNodesToSave , vds.getId ( ) , null ) ; } return null ; }