auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( getClusterConfigOptions ( ) ) == null ? 0 : getClusterConfigOptions ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getVolumeConfigOptions ( ) ) == null ? 0 : getVolumeConfigOptions ( ) . hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( clusterConfigOptions , volumeConfigOptions ) ; }
Source:
private boolean isGatewayInSync ( ) { java.lang.String gatewayDesiredValue = getPrimaryAddress ( ) . getGateway ( ) ; java.lang.String gatewayActualValue = iface.getGateway ( ) ; boolean bothBlank = ( org.apache.commons.lang.StringUtils.isBlank ( gatewayDesiredValue ) ) && ( org.apache.commons.lang.StringUtils.isBlank ( gatewayActualValue ) ) ; return bothBlank || ( java.util.Objects.equals ( gatewayDesiredValue , gatewayActualValue ) ) ; }

Target:
private boolean isGatewayInSync ( ) { java.lang.String gatewayDesiredValue = getPrimaryAddress ( ) . getGateway ( ) ; java.lang.String gatewayActualValue = iface.getIpv4Gateway ( ) ; boolean bothBlank = ( org.apache.commons.lang.StringUtils.isBlank ( gatewayDesiredValue ) ) && ( org.apache.commons.lang.StringUtils.isBlank ( gatewayActualValue ) ) ; return bothBlank || ( java.util.Objects.equals ( gatewayDesiredValue , gatewayActualValue ) ) ; }
Source:
private void prepare2 ( ) { org.ovirt.engine.ui.uicompat.PreparingEnlistment enlistment = ( ( org.ovirt.engine.ui.uicompat.PreparingEnlistment ) ( context.enlistment ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = context.activateVdsReturnValue ; if ( ( returnValue == null ) || ( ! ( returnValue.getSucceeded ( ) ) ) ) { context.enlistment = null ; enlistment.ForceRollback ( ) ; } else { prepare3 ( ) ; } }

Target:
private void prepare2 ( ) { org.ovirt.engine.ui.uicompat.PreparingEnlistment enlistment = ( ( org.ovirt.engine.ui.uicompat.PreparingEnlistment ) ( context.enlistment ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = context.activateVdsReturnValue ; if ( ( returnValue == null ) || ( ! ( returnValue.getSucceeded ( ) ) ) ) { context.enlistment = null ; enlistment.forceRollback ( ) ; } else { prepare3 ( ) ; } }
Source:
public javax.ws.rs.core.Response maintenance ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "maintenanceEnabled" ) ; org.ovirt.engine.api.model.VM entity = getEntity ( org.ovirt.engine.api.model.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , id ) ; if ( ! ( entity.isHostedEngine ( ) ) ) { throw new javax.ws.rs.WebApplicationException ( javax.ws.rs.core.Response.status ( Response.Status.BAD_REQUEST ) . entity ( "Moving to maintenance mode is currently only available for the VM containing the hosted engine." ) . build ( ) ) ; } return doAction ( VdcActionType.SetHaMaintenance , new org.ovirt.engine.core.common.action.SetHaMaintenanceParameters ( entity.getRunOnVds ( ) , org.ovirt.engine.core.common.businessentities.HaMaintenanceMode.GLOBAL , action.isMaintenanceEnabled ( ) ) , action ) ; }

Target:
public javax.ws.rs.core.Response maintenance ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "maintenanceEnabled" ) ; org.ovirt.engine.api.restapi.resource.VM entity = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , id ) ; if ( ! ( entity.isHostedEngine ( ) ) ) { throw new javax.ws.rs.WebApplicationException ( javax.ws.rs.core.Response.status ( Response.Status.BAD_REQUEST ) . entity ( "Moving to maintenance mode is currently only available for the VM containing the hosted engine." ) . build ( ) ) ; } return doAction ( VdcActionType.SetHaMaintenance , new org.ovirt.engine.core.common.action.SetHaMaintenanceParameters ( entity.getRunOnVds ( ) , org.ovirt.engine.core.common.businessentities.HaMaintenanceMode.GLOBAL , action.isMaintenanceEnabled ( ) ) , action ) ; }
Source:
private void initCPU ( ) { if ( ( ! ( isCPUinitialized ) ) && ( getIsEdit ( ) ) ) { isCPUinitialized = true ; getCPU ( ) . setSelectedItem ( null ) ; for ( org.ovirt.engine.core.common.businessentities.ServerCpu a : getCPU ( ) . getItems ( ) ) { if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( a.getCpuName ( ) , getEntity ( ) . getcpu_name ( ) ) ) { getCPU ( ) . setSelectedItem ( a ) ; break ; } } } }

Target:
private void initCPU ( ) { if ( ( ! ( isCPUinitialized ) ) && ( getIsEdit ( ) ) ) { isCPUinitialized = true ; getCPU ( ) . setSelectedItem ( null ) ; for ( org.ovirt.engine.core.common.businessentities.ServerCpu a : getCPU ( ) . getItems ( ) ) { if ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( a.getCpuName ( ) , getEntity ( ) . getcpu_name ( ) ) ) { getCPU ( ) . setSelectedItem ( a ) ; break ; } } } }
Source:
public void validateSimpleInitrdAndKernelName ( ) throws java.lang.Exception { java.lang.String Initrd = "/boot/initrd.initrd" ; java.lang.String Kernel = "/boot/kernel.image" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( Initrd , Kernel ) ; org.junit.Assert.assertEquals ( vm.getinitrd_url ( ) , Initrd ) ; org.junit.Assert.assertEquals ( vm.getkernel_url ( ) , Kernel ) ; }

Target:
public void validateSimpleInitrdAndKernelName ( ) throws java.lang.Exception { java.lang.String Initrd = "/boot/initrd.initrd" ; java.lang.String Kernel = "/boot/kernel.image" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( Initrd , Kernel ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , Initrd ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , Kernel ) ; }
Source:
private void doTest ( java.lang.Boolean expectedResult ) { final org.ovirt.engine.core.bll.common.predicates.RunningVmPredicate underTest = new org.ovirt.engine.core.bll.common.predicates.RunningVmPredicate ( ) ; org.mockito.Mockito.when ( mockVm.isRunning ( ) ) . thenReturn ( expectedResult ) ; final boolean actual = underTest.eval ( mockVm ) ; org.mockito.Mockito.verify ( mockVm ) . isRunning ( ) ; org.junit.Assert.assertThat ( actual , org.hamcrest.CoreMatchers.is ( expectedResult ) ) ; }

Target:
private void doTest ( java.lang.Boolean expectedResult ) { final org.ovirt.engine.core.bll.common.predicates.RunningVmPredicate underTest = new org.ovirt.engine.core.bll.common.predicates.RunningVmPredicate ( ) ; org.mockito.Mockito.when ( mockVm.isRunning ( ) ) . thenReturn ( expectedResult ) ; final boolean actual = underTest.test ( mockVm ) ; org.mockito.Mockito.verify ( mockVm ) . isRunning ( ) ; org.junit.Assert.assertThat ( actual , org.hamcrest.CoreMatchers.is ( expectedResult ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isGlusterSupportedInDC ( ) { if ( ( ! ( storagePool.isLocal ( ) ) ) && ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.GlusterFsStorageEnabled , storagePool.getCompatibilityVersion ( ) . toString ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.DATA_CENTER_GLUSTER_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isGlusterSupportedInDC ( ) { if ( ( ! ( storagePool.isLocal ( ) ) ) && ( ! ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.GlusterFsStorageEnabled , storagePool.getCompatibilityVersion ( ) . toString ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.DATA_CENTER_GLUSTER_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static 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 ) ; }
Source:
public < T > void executeStoredProcAsBatch ( final java.lang.String procedureName , java.util.Collection < T > paramValues , org.ovirt.engine.core.dal.dbbroker.MapSqlParameterMapper < T > mapper ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > sqlParams = new java.util.ArrayList < > ( ) ; for ( T param : paramValues ) { sqlParams.add ( mapper.map ( param ) ) ; } executeStoredProcAsBatch ( procedureName , sqlParams ) ; }

Target:
public < T > void executeStoredProcAsBatch ( final java.lang.String procedureName , java.util.Collection < T > paramValues , org.ovirt.engine.core.dal.dbbroker.MapSqlParameterMapper < T > mapper ) { java.util.List < org.springframework.jdbc.core.namedparam.MapSqlParameterSource > sqlParams = paramValues.stream ( ) . map ( mapper :: map ) . collect ( java.util.stream.Collectors.toList ( ) ) ; executeStoredProcAsBatch ( procedureName , sqlParams ) ; }
Source:
protected boolean canDoAction ( ) { boolean retValue = super . canDoAction ( ) ; if ( ( ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_STATUS_NOT_VALID_FOR_STOP ) ; retValue = false ; } return retValue ; }

Target:
protected boolean canDoAction ( ) { boolean retValue = true ; if ( ( org.ovirt.engine.core.bll.StopVdsCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) { retValue = super . canDoAction ( ) ; if ( ( ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) . getstatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) ) { addCanDoActionMessage ( VdcBllMessages.VDS_STATUS_NOT_VALID_FOR_STOP ) ; retValue = false ; } } return retValue ; }
Source:
public org.ovirt.engine.ui.common.uicommon.model.SearchableDetailModelProvider < org.ovirt.engine.core.common.businessentities.Permissions , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel , org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel > getNetworkPermissionListProvider ( com.google.gwt.event.shared.EventBus eventBus , com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider , final com.google.inject.Provider < org.ovirt.engine.ui.webadmin.section.main.presenter.popup.PermissionsPopupPresenterWidget > popupProvider , final com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.RolePermissionsRemoveConfirmationPopupPresenterWidget > removeConfirmPopupProvider ) { return new org.ovirt.engine.ui.webadmin.uicommon.model.PermissionModelProvider < org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel > ( eventBus , defaultConfirmPopupProvider , removeConfirmPopupProvider , popupProvider , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel.class ) ; }

Target:
public org.ovirt.engine.ui.common.uicommon.model.DetailModelProvider < org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkGeneralModel > getNetworkGeneralProvider ( com.google.gwt.event.shared.EventBus eventBus , com.google.inject.Provider < org.ovirt.engine.ui.common.presenter.popup.DefaultConfirmationPopupPresenterWidget > defaultConfirmPopupProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel > mainModelProvider , final com.google.inject.Provider < org.ovirt.engine.ui.uicommonweb.models.networks.NetworkGeneralModel > modelProvider ) { org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkGeneralModel > result = new org.ovirt.engine.ui.common.uicommon.model.DetailTabModelProvider < org.ovirt.engine.ui.uicommonweb.models.networks.NetworkListModel , org.ovirt.engine.ui.uicommonweb.models.networks.NetworkGeneralModel > ( eventBus , defaultConfirmPopupProvider ) ; result.setMainModelProvider ( mainModelProvider ) ; result.setModelProvider ( modelProvider ) ; return result ; }
Source:
public void hasSharedDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdc = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; sdc.setStorageType ( StorageType.NFS ) ; org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( sdc ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }

Target:
public void hasSharedDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdc = new org.ovirt.engine.core.common.businessentities.StorageDomainStatic ( ) ; sdc.setStorageType ( StorageType.NFS ) ; org.mockito.Mockito.when ( sdDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singletonList ( sdc ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
private void map ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity , org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask ) { if ( cmdEntity != null ) { asyncTask.setActionParameters ( cmdEntity.getActionParameters ( ) ) ; asyncTask.setRootCommandId ( cmdEntity.getRootCommandId ( ) ) ; asyncTask.setCommandStatus ( cmdEntity.getCommandStatus ( ) ) ; asyncTask.setCommandType ( cmdEntity.getCommandType ( ) ) ; asyncTask.setCreatedAt ( cmdEntity.getCreatedAt ( ) ) ; asyncTask.setCallBackEnabled ( cmdEntity.isCallBackEnabled ( ) ) ; } }

Target:
private void map ( org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity , org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask ) { if ( cmdEntity != null ) { asyncTask.setTaskParameters ( cmdEntity.getCommandParameters ( ) ) ; asyncTask.setRootCommandId ( cmdEntity.getRootCommandId ( ) ) ; asyncTask.setCommandStatus ( cmdEntity.getCommandStatus ( ) ) ; asyncTask.setCommandType ( cmdEntity.getCommandType ( ) ) ; asyncTask.setCreatedAt ( cmdEntity.getCreatedAt ( ) ) ; asyncTask.setCallBackEnabled ( cmdEntity.isCallBackEnabled ( ) ) ; } }
Source:
private void testUpdateInterface ( org.ovirt.engine.core.compat.Guid interface_id ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = dao.get ( interface_id ) ; iface.setName ( iface.getName ( ) . toUpperCase ( ) ) ; iface.setQos ( newQos ) ; dao.updateInterfaceForVds ( iface ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ifaced = dao.get ( interface_id ) ; org.junit.Assert.assertEquals ( iface.getName ( ) , ifaced.getName ( ) ) ; org.junit.Assert.assertEquals ( iface.getQos ( ) , ifaced.getQos ( ) ) ; }

Target:
private void testUpdateInterface ( org.ovirt.engine.core.compat.Guid interface_id ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = dao.get ( interface_id ) ; iface.setName ( iface.getName ( ) . toUpperCase ( ) ) ; iface.setQos ( newQos ) ; dao.updateInterfaceForVds ( iface ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ifaced = dao.get ( interface_id ) ; org.junit.Assert.assertEquals ( iface.getName ( ) , ifaced.getName ( ) ) ; org.junit.Assert.assertEquals ( iface.getQos ( ) , ifaced.getQos ( ) ) ; verifyIpv6Properties ( iface , ifaced ) ; }
Source:
public void vdsGroupWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; canDoActionFailedWithReason ( VdcBllMessages.VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }

Target:
public void vdsGroupWithVirtGlusterServicesNotAllowed ( ) { createCommandWithVirtGlusterEnabled ( ) ; org.mockito.Mockito.when ( vdsGroupDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; org.mockito.Mockito.when ( vdsGroupDao.getByName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createVdsGroupWithNoCpuName ( ) ) ; mcr.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , java.lang.Boolean.FALSE ) ; mcr.mockConfigValue ( ConfigValues.GlusterSupport , org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_1 , java.lang.Boolean.TRUE ) ; cpuExists ( ) ; allQueriesForVms ( ) ; canDoActionFailedWithReason ( EngineMessage.VDS_GROUP_ENABLING_BOTH_VIRT_AND_GLUSTER_SERVICES_NOT_ALLOWED ) ; }
Source:
public void testRemoveStorageDomainNull ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveStorageDomainNull ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setUriInfo ( uriInfo ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertEquals ( 400 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
private void commitLabelChanges ( org.ovirt.engine.ui.uicommonweb.models.hosts.NicLabelModel labelModel , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > potentialNetworks ) { labelModel.commit ( iface ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel ifaceModel = nicMap.get ( iface.getName ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.clearNetworks ( ifaceModel , allNics ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.attachNetworks ( ifaceModel , new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( potentialNetworks ) , allNics ) ; }

Target:
private void commitNetworkChanges ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.util.List < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > networks ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkInterfaceModel bondModel = nicMap.get ( iface.getName ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.attachNetworks ( bondModel , new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel > ( networks ) , allNics ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc getDeviceList ( int storageType , java.lang.String [ ] devicesList ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = null ; if ( devicesList != null ) { xmlRpcReturnValue = vdsServer.getDeviceList ( storageType , devicesList ) ; } else { xmlRpcReturnValue = vdsServer.getDeviceList ( storageType ) ; } org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.LUNListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc remove_image_ticket ( java.lang.String ticketId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.remove_image_ticket ( ticketId ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public org.ovirt.engine.api.model.Networks list ( ) { org.ovirt.engine.api.model.Networks networks ; if ( isFiltered ( ) ) { networks = mapCollection ( getBackendCollection ( queryType , getQueryParameters ( ) , SearchType.Network ) ) ; } else { networks = mapCollection ( getBackendCollection ( SearchType.Network ) ) ; } for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }

Target:
public org.ovirt.engine.api.model.Networks list ( ) { java.util.List < org.ovirt.engine.api.model.Network > entities ; if ( isFiltered ( ) ) { org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( org.ovirt.engine.core.compat.Guid.Empty ) ; entities = getBackendCollection ( VdcQueryType.GetAllNetworks , parameters , SearchType.Network ) ; } else { entities = getBackendCollection ( SearchType.Network ) ; } org.ovirt.engine.api.model.Networks networks = mapCollection ( entities ) ; for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }
Source:
public 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 ) ; }

Target:
public void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( 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.Cluster > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetClustersByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > getNonEligibilityReasonsForSlaveVolume2 ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > nonEligibilityreasons = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ( ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.SLAVE_VOLUME_SHOULD_BE_UP ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.SLAVE_VOLUME_SIZE_SHOULD_BE_GREATER_THAN_MASTER_VOLUME_SIZE ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.SLAVE_VOLUME_SHOULD_NOT_BE_SLAVE_OF_ANOTHER_GEO_REP_SESSION ) ; return nonEligibilityreasons ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > getNonEligibilityReasonsForSlaveVolume2 ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > nonEligibilityreasons = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason > ( ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.SLAVE_VOLUME_SHOULD_BE_UP ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.SLAVE_VOLUME_SIZE_SHOULD_BE_GREATER_THAN_MASTER_VOLUME_SIZE ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.SLAVE_VOLUME_SHOULD_NOT_BE_SLAVE_OF_ANOTHER_GEO_REP_SESSION ) ; nonEligibilityreasons.add ( GlusterGeoRepNonEligibilityReason.SLAVE_VOLUME_TO_BE_EMPTY ) ; return nonEligibilityreasons ; }
Source:
private java.lang.Object getVmsFromExternalProvider ( ) { try { return org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.GetVmsFromExternalProvider , buildGetRemoteVmsInfoParameters ( ) ) . getReturnValue ( ) ; } catch ( java.lang.RuntimeException e ) { if ( ! ( e instanceof java.lang.IllegalArgumentException ) ) { logFailureToGetVms ( ) ; } throw e ; } }

Target:
private java.lang.Object getVmsFromExternalProvider ( ) { try { return runVdsCommand ( VDSCommandType.GetVmsFromExternalProvider , buildGetRemoteVmsInfoParameters ( ) ) . getReturnValue ( ) ; } catch ( java.lang.RuntimeException e ) { if ( ! ( e instanceof java.lang.IllegalArgumentException ) ) { logFailureToGetVms ( ) ; } throw e ; } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.lang.String prefix = ( ( java.lang.String ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel ) ( target ) ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( prefix ) ) ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel pathModel = model.getStorage ( ) . getPath ( ) ; pathModel.setEntity ( prefix ) ; pathModel.setIsChangable ( false ) ; } configureLocalStorage3 ( model ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel ) ( ev.getContext ( ) ) ) ; model.StopProgress ( ) ; Cancel ( ) ; }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public < T > org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations add ( org.ovirt.engine.core.common.businessentities.network.ReportedConfigurationType type , T actual , T expected , boolean inSync ) { java.lang.String actualValue = ( actual == null ) ? null : actual.toString ( ) ; java.lang.String expectedValue = ( expected == null ) ? null : expected.toString ( ) ; reportedConfigurationList.add ( new org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration ( type , actualValue , expectedValue , inSync ) ) ; return this ; }

Target:
public < T > org.ovirt.engine.core.common.businessentities.network.ReportedConfigurations add ( org.ovirt.engine.core.common.businessentities.network.ReportedConfigurationType type , T actual , T expected , boolean inSync ) { java.lang.String actualValue = java.util.Objects.toString ( actual , null ) ; java.lang.String expectedValue = java.util.Objects.toString ( expected , null ) ; reportedConfigurationList.add ( new org.ovirt.engine.core.common.businessentities.network.ReportedConfiguration ( type , actualValue , expectedValue , inSync ) ) ; return this ; }
Source:
protected org.ovirt.engine.ui.uicommonweb.models.profiles.DiskProfileListModel getMainModel ( ) { return getCommonModel ( ) . getStorageList ( ) . getDiskProfileListModel ( ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.configure.PermissionListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand.equals ( getModel ( ) . getAddCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc shutdownHost ( int reboot ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.shutdownHost ( reboot ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public java.util.concurrent.Future < java.util.Map < java.lang.String , java.lang.Object > > setupNetworks ( java.util.Map networks , java.util.Map bonds , java.util.Map options ) { return vdsServer.futureSetupNetworks ( networks , bonds , options ) ; }
Source:
public void unmanagedVlanNetworkWithVmNetworkDenied ( ) { org.ovirt.engine.core.common.businessentities.network.Network net1 = createNetwork ( "net1" ) ; org.ovirt.engine.core.common.businessentities.network.Network net2 = createNetwork ( "net2" ) ; net2.setVlanId ( 100 ) ; mockExistingNetworks ( net1 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net1 ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanNic = createVlan ( nic.getName ( ) , net2.getVlanId ( ) , net2.getName ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , vlanNic ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , nic.getName ( ) ) ; }

Target:
public void nonVmNetworkWithVlanVmNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.Network net1 = createNetwork ( "net1" ) ; net1.setVmNetwork ( false ) ; org.ovirt.engine.core.common.businessentities.network.Network net2 = createNetwork ( "net2" ) ; net2.setVlanId ( 200 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net1 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlan = createVlan ( nic , net2.getVlanId ( ) , net2.getName ( ) ) ; mockExistingNetworks ( net1 , net2 ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , vlan ) ) ; validateAndExpectNoViolations ( helper ) ; }
Source:
protected static org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain currDomain : domainsInPool ) { org.ovirt.engine.core.bll.VmHandler.updateDisksStorage ( currDomain , disksList ) ; if ( ( ( currDomain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( ( currDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) && ( org.ovirt.engine.core.bll.VmHandler.validateSpaceRequirements ( currDomain , disksList ) ) ) { return currDomain ; } } return null ; }

Target:
public static void updateOperationProgress ( final org.ovirt.engine.core.common.businessentities.VM vm ) { vm.setBackgroundOperationDescription ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getVmManager ( vm.getId ( ) ) . getConvertOperationDescription ( ) ) ; vm.setBackgroundOperationProgress ( org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getVmManager ( vm.getId ( ) ) . getConvertOperationProgress ( ) ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalBasicListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( windowModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.VncInfoModel ) { return vncInfoPopupProvider.get ( ) ; } return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalBasicListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( windowModel instanceof org.ovirt.engine.ui.uicommonweb.models.vms.VncInfoModel ) { return vncInfoPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getEditConsoleCommand ( ) ) ) { return consolePopupProvider.get ( ) ; } return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; }
Source:
public void getVdsGroupName ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDSGroup g = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; g.setname ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVdsGroup ( g ) ; final java.lang.String n = b.getVdsGroupName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }

Target:
public void getVdsGroupName ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDSGroup g = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; g.setName ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ) ; b.setVdsGroup ( g ) ; final java.lang.String n = b.getVdsGroupName ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME , n ) ; }
Source:
public void setSelectedItem ( org.ovirt.engine.core.common.businessentities.VDS value ) { if ( value == null ) { setSelectedItems ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ) ; } else { setSelectedItems ( new java.util.ArrayList ( java.util.Arrays.asList ( value ) ) ) ; } }

Target:
public void setSelectedItem ( java.lang.Integer value ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . osNameExists ( value ) ) ) { org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList ( ) . getSelectedItem ( ) ; org.ovirt.engine.core.common.businessentities.Cluster cluster = ( dataCenterWithCluster == null ) ? null : dataCenterWithCluster.getCluster ( ) ; if ( cluster == null ) { return ; } super . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getDefaultOs ( cluster.getArchitecture ( ) ) ) ; } else { super . setSelectedItem ( value ) ; } }
Source:
public void testSaveAndGet ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = dao.get ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ) ; org.junit.Assert.assertNull ( service ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService newService = insertTestService ( ) ; service = dao.get ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( newService , service ) ; }

Target:
public void testSaveAndGet ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService service = dao.get ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ) ; org.junit.Assert.assertNull ( service ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService newService = insertTestService ( ) ; service = dao.get ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( org.ovirt.engine.core.dao.gluster.GlusterServerServiceDaoTest.NEW_SERVICE_ID ) ) ; org.junit.Assert.assertNotNull ( service ) ; org.junit.Assert.assertEquals ( newService , service ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { 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 ( 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 ) ; } }
Source:
public static java.util.Date UtcDateStringToLocaDate ( java.lang.String str ) { if ( org.apache.commons.lang.StringUtils.isBlank ( str ) ) { return null ; } try { return org.ovirt.engine.core.utils.ovf.OvfParser.getDateFormat ( org.ovirt.engine.core.utils.ovf.OvfParser.utcDateFormatStr ) . parse ( str ) ; } catch ( java.text.ParseException e1 ) { try { return org.ovirt.engine.core.utils.ovf.OvfParser.getDateFormat ( org.ovirt.engine.core.utils.ovf.OvfParser.utcFallbackDateFormatStr ) . parse ( str ) ; } catch ( java.text.ParseException e ) { org.ovirt.engine.core.utils.ovf.OvfParser.log.error ( "OVF DateTime format Error, Expected: yyyy/M/dd hh:mm:ss" , e ) ; return null ; } } }

Target:
public static java.util.Date UtcDateStringToLocaDate ( java.lang.String str ) { if ( org.apache.commons.lang.StringUtils.isBlank ( str ) ) { return null ; } try { return org.ovirt.engine.core.utils.ovf.OvfParser.getDateFormat ( org.ovirt.engine.core.utils.ovf.OvfParser.utcDateFormatStr ) . parse ( str ) ; } catch ( java.text.ParseException e1 ) { try { return org.ovirt.engine.core.utils.ovf.OvfParser.getDateFormat ( org.ovirt.engine.core.utils.ovf.OvfParser.utcFallbackDateFormatStr ) . parse ( str ) ; } catch ( java.text.ParseException e ) { org.ovirt.engine.core.utils.ovf.OvfParser.log.error ( "OVF DateTime format error: '{}', Expected: yyyy/M/dd hh:mm:ss" , e.getMessage ( ) ) ; org.ovirt.engine.core.utils.ovf.OvfParser.log.debug ( "Exception" , e ) ; return null ; } } }
Source:
public void hostStatusInvalid ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.UpdateHostValidator ( dbFacade , oldHost , host , false ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . isUpdateValid ( ) ; org.junit.Assert.assertThat ( validator.hostStatusValid ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_STATUS_NOT_VALID_FOR_UPDATE ) ) ; }

Target:
public void hostStatusInvalid ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.UpdateHostValidator ( dbFacade , oldHost , host , false , hostedEngineHelper ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . isUpdateValid ( ) ; org.junit.Assert.assertThat ( validator.hostStatusValid ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_STATUS_NOT_VALID_FOR_UPDATE ) ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.Object > findDirectoryUserById ( ) { return org.ovirt.engine.core.aaa.SSOOAuthServiceUtils.findDirectoryUserById ( org.ovirt.engine.core.bll.aaa.GetDirectoryUserByIdQuery.getSessionDataContainer ( ) . getSsoAccessToken ( org.ovirt.engine.core.bll.aaa.GetDirectoryUserByIdQuery.getParameters ( ) . getSessionId ( ) ) , org.ovirt.engine.core.bll.aaa.GetDirectoryUserByIdQuery.getParameters ( ) . getDomain ( ) , org.ovirt.engine.core.bll.aaa.GetDirectoryUserByIdQuery.getParameters ( ) . getNamespace ( ) , org.ovirt.engine.core.bll.aaa.GetDirectoryUserByIdQuery.getParameters ( ) . getId ( ) , false , false ) ; }

Target:
public java.util.Map < java.lang.String , java.lang.Object > findDirectoryUserById ( ) { return org.ovirt.engine.core.aaa.SsoOAuthServiceUtils.findDirectoryUserById ( org.ovirt.engine.core.bll.aaa.GetDirectoryUserByIdQuery.getSessionDataContainer ( ) . getSsoAccessToken ( org.ovirt.engine.core.bll.aaa.GetDirectoryUserByIdQuery.getParameters ( ) . getSessionId ( ) ) , org.ovirt.engine.core.bll.aaa.GetDirectoryUserByIdQuery.getParameters ( ) . getDomain ( ) , org.ovirt.engine.core.bll.aaa.GetDirectoryUserByIdQuery.getParameters ( ) . getNamespace ( ) , org.ovirt.engine.core.bll.aaa.GetDirectoryUserByIdQuery.getParameters ( ) . getId ( ) , false , false ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsedByVms ( ) { java.lang.String networkName = getNetworkName ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterAttachment : getClusterAttachments ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vms = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVmStaticDAO ( ) . getAllByGroupAndNetworkName ( clusterAttachment.getClusterId ( ) , networkName ) ; if ( ( vms.size ( ) ) > 0 ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_INTERFACE_IN_USE_BY_VM ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsedByVms ( final org.ovirt.engine.core.common.businessentities.network.Network network ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVmDAO ( ) . getAllForNetwork ( network.getId ( ) ) ; if ( vms.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWithNameable ( "ENTITIES_USING_NETWORK" , vms ) ; replacements.add ( VdcBllMessages.VAR__ENTITIES__VMS.name ( ) ) ; return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_IN_USE , replacements ) ; }