auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusDown ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setstatus ( VMStatus.Down ) ; vm.setguest_os ( "rhel6" ) ; vm.setId ( vmId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDAO ) ; mockGetForDisk ( vm ) ; mockGetVmsListForDisk ( vm ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = mockStoragePool ( Version.v3_1 ) ; vm.setstorage_pool_id ( storagePool.getId ( ) ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VM mockVmStatusDown ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Down ) ; vm.setGuestOs ( "rhel6" ) ; vm.setId ( vmId ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( command , vmDAO ) ; mockGetForDisk ( vm ) ; mockGetVmsListForDisk ( vm ) ; org.ovirt.engine.core.common.businessentities.storage_pool storagePool = mockStoragePool ( Version.v3_1 ) ; vm.setStoragePoolId ( storagePool.getId ( ) ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( vm ) ; return vm ; }
Source:
protected void populateTabMap ( ) { getTabNameMapping ( ) . put ( TabName.GENERAL_TAB , this . generalTab ) ; getTabNameMapping ( ) . put ( TabName.CONSOLE_TAB , this . consoleTab ) ; getTabNameMapping ( ) . put ( TabName.CLUSTER_POLICY_TAB , this . clusterPolicyTab ) ; getTabNameMapping ( ) . put ( TabName.OPTIMIZATION_TAB , this . optimizationTab ) ; getTabNameMapping ( ) . put ( TabName.MIGRATION_TAB , this . migrationTab ) ; }

Target:
protected void populateTabMap ( ) { getTabNameMapping ( ) . put ( TabName.GENERAL_TAB , this . generalTab ) ; getTabNameMapping ( ) . put ( TabName.CONSOLE_TAB , this . consoleTab ) ; getTabNameMapping ( ) . put ( TabName.CLUSTER_POLICY_TAB , this . clusterPolicyTab ) ; getTabNameMapping ( ) . put ( TabName.OPTIMIZATION_TAB , this . optimizationTab ) ; getTabNameMapping ( ) . put ( TabName.MIGRATION_TAB , this . migrationTab ) ; getTabNameMapping ( ) . put ( TabName.MAC_POOL_TAB , macPoolTab ) ; }
Source:
public void diskImagesAlreadyExistOneExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( null ) . when ( validator ) . getExistingDisk ( disk2.getId ( ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk1 ) ) ) ) ) ; }

Target:
public void diskImagesAlreadyExistOneExist ( ) { org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) . when ( validator ) . getExistingDisk ( disk1.getId ( ) ) ; org.mockito.Mockito.doReturn ( null ) . when ( validator ) . getExistingDisk ( disk2.getId ( ) ) ; org.junit.Assert.assertThat ( validator.diskImagesAlreadyExist ( ) , org.hamcrest.CoreMatchers.both ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_IMPORT_DISKS_ALREADY_EXIST ) ) . and ( org.ovirt.engine.core.bll.validator.ValidationResultMatchers.replacements ( org.hamcrest.CoreMatchers.hasItem ( org.ovirt.engine.core.bll.validator.storage.DiskImagesValidatorTest.createAliasReplacements ( disk1 ) ) ) ) ) ; }
Source:
protected java.lang.Double [ ] getRawValue ( T object ) { return new java.lang.Double [ ] { getRate ( object ) , getSpeed ( object ) } ; }

Target:
protected java.lang.Double [ ] getRawValue ( T object ) { java.lang.Double rate = ( object != null ) ? getRate ( object ) : null ; java.lang.Double speed = ( object != null ) ? getSpeed ( object ) : null ; return new java.lang.Double [ ] { rate , speed } ; }
Source:
public org.ovirt.engine.core.common.businessentities.VmTemplate getVmTemplate ( ) { if ( ( ( mVmTemplate ) == null ) && ( ( ( mVmTemplateId ) != null ) || ( ( getVm ( ) ) != null ) ) ) { mVmTemplate = getVmTemplateDAO ( ) . get ( ( ( mVmTemplateId ) != null ? getVmTemplateId ( ) : getVm ( ) . getVmtGuid ( ) ) ) ; } return mVmTemplate ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmTemplate getVmTemplate ( ) { if ( ( ( mVmTemplate ) == null ) && ( ( ( mVmTemplateId ) != null ) || ( ( getVm ( ) ) != null ) ) ) { mVmTemplate = getVmTemplateDao ( ) . get ( ( ( mVmTemplateId ) != null ? getVmTemplateId ( ) : getVm ( ) . getVmtGuid ( ) ) ) ; } return mVmTemplate ; }
Source:
public void hostProviderExists ( ) { org.mockito.Mockito.when ( host.getHostProviderId ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( providerDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Provider.class ) ) ; org.mockito.Mockito.when ( dbFacade.getProviderDao ( ) ) . thenReturn ( providerDao ) ; validator = new org.ovirt.engine.core.bll.validator.UpdateHostValidator ( dbFacade , oldHost , host , false ) ; org.junit.Assert.assertThat ( validator.hostProviderExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
private org.ovirt.engine.core.bll.validator.UpdateHostValidator createValidatorForHostInstallation ( ) { return new org.ovirt.engine.core.bll.validator.UpdateHostValidator ( dbFacade , oldHost , host , true , hostedEngineHelper ) ; }
Source:
public void setItems ( java.lang.Iterable < ? > items ) { if ( items != null ) { for ( java.lang.Object i : items ) { itemPanel.add ( new com.google.gwt.user.client.ui.Label ( getItemText ( i ) ) ) ; } } else { itemPanel.clear ( ) ; } }

Target:
public void setItems ( java.lang.Iterable < ? > items ) { if ( items != null ) { addItems ( items ) ; } else { itemPanel.clear ( ) ; } }
Source:
void mockGetVdsCertificateSubjectByVmId ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue hostSubjectReturnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; hostSubjectReturnValue.setReturnValue ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.HOST_SUBJECT ) ; org.mockito.Mockito.doReturn ( hostSubjectReturnValue ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( VdcQueryType.GetVdsCertificateSubjectByVmId ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }

Target:
void mockGetVdsCertificateSubjectByVmId ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue hostSubjectReturnValue = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; hostSubjectReturnValue.setReturnValue ( org.ovirt.engine.core.bll.ConfigureConsoleOptionsQueryTest.HOST_SUBJECT ) ; org.mockito.Mockito.doReturn ( hostSubjectReturnValue ) . when ( backend ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetVdsCertificateSubjectByVmId ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.IdQueryParameters.class ) ) ; }
Source:
private void handleVdsLiveSnapshotFailure ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.warn ( ( "Could not perform live snapshot due to error, VM will still be configured to the new created" + " snapshot: {}" ) , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; addCustomValue ( "SnapshotName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotName ( ) ) ; addCustomValue ( "VmName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ; updateCallStackFromThrowable ( e ) ; auditLogDirector.log ( this , AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE ) ; }

Target:
private void handleVdsLiveSnapshotFailure ( org.ovirt.engine.core.common.errors.EngineException e ) { log.warn ( ( "Could not perform live snapshot due to error, VM will still be configured to the new created" + " snapshot: {}" ) , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; addCustomValue ( "SnapshotName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotName ( ) ) ; addCustomValue ( "VmName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ; updateCallStackFromThrowable ( e ) ; auditLogDirector.log ( this , AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE ) ; }
Source:
public static void getMaxNumOfVmCpus ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmCpus ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { 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.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }
Source:
protected void initContainerDetails ( org.ovirt.engine.core.common.action.ImagesContainterParametersBase parameters ) { }

Target:
public void setUp ( ) { org.mockito.Mockito.when ( iconDefaultsProvider.getVmIconDefaults ( ) ) . thenReturn ( new java.util.HashMap < java.lang.Integer , org.ovirt.engine.core.common.queries.VmIconIdSizePair > ( ) { { put ( 0 , new org.ovirt.engine.core.common.queries.VmIconIdSizePair ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "00000000-0000-0000-0000-00000000000a" ) , org.ovirt.engine.core.compat.Guid.createGuidFromString ( "00000000-0000-0000-0000-00000000000b" ) ) ) ; } } ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.utils.ovf.OvfVmIconDefaultsProvider.class , iconDefaultsProvider ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult validBond ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { if ( ! ( java.lang.Boolean.TRUE.equals ( iface.getBonded ( ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } int slavesCount = getSlaveCount ( nics ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostSetupNetworksValidator.VAR_NETWORK_BONDS_INVALID_SLAVE_COUNT_LIST , iface.getName ( ) ) ) . when ( ( slavesCount < 2 ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validBond ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { if ( ! ( java.lang.Boolean.TRUE.equals ( iface.getBonded ( ) ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } int slavesCount = getSlaveCount ( nics ) ; java.lang.String ifaceName = iface.getName ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( EngineMessage.NETWORK_BONDS_INVALID_SLAVE_COUNT , ifaceName ) ) . when ( ( slavesCount < 2 ) ) ; }
Source:
public static void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public void qosValuesModified ( ) { 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 ) ; iface.setQosOverridden ( true ) ; mockExistingIfaces ( iface ) ; iface.setQos ( createQos ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_4 ) ; validateAndAssertNetworkModified ( helper , network ) ; }

Target:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosValuesTest ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos ) { mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; iface.setQosOverridden ( true ) ; mockExistingIfaces ( iface ) ; iface.setQos ( qos ) ; return createHelper ( createParametersForNics ( iface ) , Version.v3_4 ) ; }
Source:
public void validateSucceedsWithStopActionTypeAndClusterId ( ) { org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters params = new org.ovirt.engine.core.common.action.gluster.GlusterServiceParameters ( ) ; params.setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_STOP ) ; params.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.ManageGlusterServiceCommand ( params , null ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }

Target:
public void validateSucceedsWithStartActionType ( ) { cmd.getParameters ( ) . setActionType ( GlusterConstants.MANAGE_GLUSTER_SERVICE_ACTION_TYPE_START ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.compat.Guid > getDedicatedHostList ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > dedicatedHost = org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getDedicatedHostList ( ) ; if ( ! ( dedicatedHost.isEmpty ( ) ) ) { return dedicatedHost ; } return org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) . getDedicatedVmForVdsList ( ) ; }

Target:
protected final void init ( ) { super . init ( ) ; if ( ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVmId ( ) ) != null ) { setVmId ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVmId ( ) ) ; } else { setVm ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getVm ( ) ) ; } if ( ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) ) != null ) { setVmNumaNodesForValidation ( getVmNumaNodeDao ( ) . getAllVmNumaNodeByVmId ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) . getId ( ) ) ) ; doInit ( ) ; } }
Source:
public void removeQuotaFromCache ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid quotaId ) { org.ovirt.engine.core.bll.quota.QuotaManager.lock.readLock ( ) . lock ( ) ; try { if ( ! ( org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.containsKey ( storagePoolId ) ) ) { return ; } synchronized ( org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.get ( storagePoolId ) ) { org.ovirt.engine.core.bll.quota.QuotaManager.storagePoolQuotaMap.get ( storagePoolId ) . remove ( quotaId ) ; } } finally { org.ovirt.engine.core.bll.quota.QuotaManager.lock.readLock ( ) . unlock ( ) ; } }

Target:
public void removeQuotaFromCache ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid quotaId ) { removeQuotaFromCache ( storagePoolId , java.util.Arrays.asList ( quotaId ) ) ; }
Source:
public void getMaxVmPriority ( 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 ) { if ( source == null ) { return 100 ; } return source ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPriorityMaxValue , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > getModeSpecificEventNotificationTypeList ( ) { java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > subList = new java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > ( ) ; for ( org.ovirt.engine.core.common.EventNotificationEntity entity : org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetEventNotificationTypeList ( ) ) { if ( ( ( entity.getAvailableInModes ( ) ) & ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.UI_MODE.getValue ( ) ) ) > 0 ) { subList.add ( entity ) ; } } return subList ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > getModeSpecificEventNotificationTypeList ( ) { java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > subList = new java.util.ArrayList < org.ovirt.engine.core.common.EventNotificationEntity > ( ) ; for ( org.ovirt.engine.core.common.EventNotificationEntity entity : org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getEventNotificationTypeList ( ) ) { if ( ( ( entity.getAvailableInModes ( ) ) & ( org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.UI_MODE.getValue ( ) ) ) > 0 ) { subList.add ( entity ) ; } } return subList ; }
Source:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , java.lang.String value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { com.google.gwt.safehtml.shared.SafeHtml escapedValue = getEscapedValue ( value ) ; com.google.gwt.safehtml.shared.SafeHtml renderedValue = getRenderedValue ( escapedValue ) ; sb.append ( org.ovirt.engine.ui.common.widget.table.cell.TextCellWithTooltip.template.textContainer ( styleClass , org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) , renderedValue ) ) ; } }

Target:
public void render ( org.ovirt.engine.ui.common.widget.table.cell.Context context , java.lang.String value , com.google.gwt.safehtml.shared.SafeHtmlBuilder sb ) { if ( value != null ) { com.google.gwt.safehtml.shared.SafeHtml escapedValue = getEscapedValue ( value ) ; com.google.gwt.safehtml.shared.SafeHtml renderedValue = getRenderedValue ( escapedValue ) ; sb.append ( org.ovirt.engine.ui.common.widget.table.cell.TextCell.template.textContainer ( styleClass , org.ovirt.engine.ui.common.utils.ElementIdUtils.createTableCellElementId ( elementIdPrefix , columnId , context ) , renderedValue ) ) ; } }
Source:
public void getClusterList ( 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 ) { 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 > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public java.net.Socket createSocket ( java.net.InetAddress address , int port , java.net.InetAddress localAddress , int localPort ) throws java.io.IOException { if ( ( ( address.toString ( ) . charAt ( 0 ) ) == '/' ) || ( org.ovirt.engineextensions.aaa.ldap.Resolver.isAddress ( address.getHostName ( ) ) ) ) { throw new java.lang.IllegalArgumentException ( ) ; } return createSocket ( address.getHostName ( ) , port , localAddress , localPort ) ; }

Target:
private boolean checkAddress ( java.net.InetAddress address ) { boolean ret = false ; ret = ( ( address.toString ( ) . charAt ( 0 ) ) == '/' ) || ( org.ovirt.engineextensions.aaa.ldap.Resolver.isAddress ( address.getHostName ( ) ) ) ; if ( ret && ( ! ( enableAddressOnly ) ) ) { throw new java.lang.IllegalArgumentException ( ) ; } return ret ; }
Source:
private java.lang.String getValue ( ) { return ( ( ( ( ( ( ( isActive ( ) ? "Refresh Status: Active(" : "Inactive(" ) + ( isPaused ( ) ? "paused)" : "running)" ) ) + ":" ) + " Rate: " ) + ( rateCycle [ currentRate ] ) ) + "(" ) + ( ( getRefreshRate ( ) ) / 1000 ) ) + " sec)" ; }

Target:
private java.lang.String getValue ( ) { org.ovirt.engine.ui.uicommonweb.models.GridTimer.logger.fine ( ( ( ( ( ( ( ( ( isActive ( ) ? "Refresh Status: Active(" : "Inactive(" ) + ( isPaused ( ) ? "paused)" : "running)" ) ) + ":" ) + " Rate: " ) + ( rateCycle [ currentRate ] ) ) + "(" ) + ( ( getRefreshRate ( ) ) / 1000 ) ) + " sec)" ) ) ; return org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . refreshInterval ( ( ( getRefreshRate ( ) ) / 1000 ) ) ; }
Source:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.EngineError returnStatus = getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case StoragePoolUnknown : case SpmStatusError : break ; case TaskInProgress : org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( returnStatus , org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) . mMessage ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . proceedProxyReturnValue ( ) ; initializeVdsError ( returnStatus ) ; break ; } }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.EngineError returnStatus = getReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case StoragePoolUnknown : case SpmStatusError : break ; case TaskInProgress : org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setVdsError ( new org.ovirt.engine.core.common.errors.VDSError ( returnStatus , org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getReturnStatus ( ) . message ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.SpmStopVDSCommand.getVDSReturnValue ( ) . setSucceeded ( false ) ; break ; default : super . proceedProxyReturnValue ( ) ; initializeVdsError ( returnStatus ) ; break ; } }
Source:
public void canDoActionFailsForNoStorageDevice ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.Raid0 , null , null , java.util.Collections.EMPTY_LIST ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void canDoActionFailsForNoStorageDevice ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.gluster.StorageDevice > emptyList ( ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }
Source:
public com.google.gwt.editor.client.adapters.TakesValueEditor < org.ovirt.engine.ui.uicommonweb.models.vms.VnicInstanceType > asEditor ( ) { return com.google.gwt.editor.client.adapters.TakesValueEditor.of ( this ) ; }

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.core.common.businessentities.network.VnicProfileView profile = ( ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView ) ( model.getSelectedItem ( ) ) ) ; vnic.setVnicProfileId ( ( profile != null ? profile.getId ( ) : null ) ) ; vnic.setNetworkName ( ( profile != null ? profile.getNetworkName ( ) : null ) ) ; com.google.gwt.event.logical.shared.ValueChangeEvent.fire ( this , model ) ; }
Source:
public javax.ws.rs.core.Response cloneVm ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "vm.name" ) ; org.ovirt.engine.api.model.VM vm = getEntity ( org.ovirt.engine.api.model.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , ( "VM: id=" + ( guid ) ) ) ; org.ovirt.engine.core.common.action.CloneVmParameters cloneVmParameters = new org.ovirt.engine.core.common.action.CloneVmParameters ( vm , action.getVm ( ) . getName ( ) ) ; cloneVmParameters.setMakeCreatorExplicitOwner ( isFiltered ( ) ) ; javax.ws.rs.core.Response response = doAction ( VdcActionType.CloneVm , cloneVmParameters , action ) ; return response ; }

Target:
public javax.ws.rs.core.Response cloneVm ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "vm.name" ) ; org.ovirt.engine.api.restapi.resource.VM vm = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , ( "VM: id=" + ( guid ) ) ) ; org.ovirt.engine.core.common.action.CloneVmParameters cloneVmParameters = new org.ovirt.engine.core.common.action.CloneVmParameters ( vm , action.getVm ( ) . getName ( ) ) ; cloneVmParameters.setMakeCreatorExplicitOwner ( isFiltered ( ) ) ; javax.ws.rs.core.Response response = doAction ( VdcActionType.CloneVm , cloneVmParameters , action ) ; return response ; }
Source:
public java.util.List < java.lang.String > findViolatedNics ( java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypesMap ) { java.util.List < java.lang.String > violatedNics = new java.util.ArrayList < > ( ) ; for ( java.util.Map.Entry < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > > nicNameToNetworkTypes : nicNameToNetworkTypesMap.entrySet ( ) ) { java.lang.String nicName = nicNameToNetworkTypes.getKey ( ) ; java.util.List < org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.NetworkType > networkTypes = nicNameToNetworkTypes.getValue ( ) ; if ( ! ( validateNetworkTypesOnNic ( networkTypes ) ) ) { violatedNics.add ( nicName ) ; } } return violatedNics ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult validateNetworkExclusiveOnNics ( ) { java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.bll.validator.network.NetworkType > > nicNameToNetworkTypesMap = createNicNameToNetworkTypesMap ( ) ; java.util.List < java.lang.String > violatedNics = findViolatedNics ( nicNameToNetworkTypesMap ) ; if ( violatedNics.isEmpty ( ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } else { final org.ovirt.engine.core.common.errors.EngineMessage violationMessage = networkExclusivenessValidator.getViolationMessage ( ) ; return new org.ovirt.engine.core.bll.ValidationResult ( violationMessage , org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( ( violationMessage + ( org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator.LIST_SUFFIX ) ) , violatedNics ) ) ; } }
Source:
private boolean validateNics ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > interfaces , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : interfaces ) { org.ovirt.engine.core.bll.validator.VmNicValidator nicValidator = new org.ovirt.engine.core.bll.validator.VmNicValidator ( iface , clusterCompatibilityVersion ) ; if ( ( ! ( parentCommand.validate ( nicValidator.emptyNetworkValid ( ) ) ) ) || ( ! ( parentCommand.validate ( nicValidator.linkedCorrectly ( ) ) ) ) ) { return false ; } } return true ; }

Target:
private boolean validateNics ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > interfaces , org.ovirt.engine.core.compat.Version clusterCompatibilityVersion ) { for ( org.ovirt.engine.core.common.businessentities.network.VmNic iface : interfaces ) { org.ovirt.engine.core.bll.validator.VmNicValidator nicValidator = new org.ovirt.engine.core.bll.validator.VmNicValidator ( iface , clusterCompatibilityVersion ) ; if ( ( ! ( parentCommand.validate ( nicValidator.emptyNetworkValid ( ) ) ) ) || ( ! ( parentCommand.validate ( nicValidator.linkedOnlyIfSupported ( ) ) ) ) ) { return false ; } } return true ; }
Source:
public java.lang.Void runInTransaction ( ) { saveTaskAndPutInMap ( taskKey , task ) ; return null ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase convertToVdcReturnValueBase ( final org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnValue ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; returnValue.setSucceeded ( false ) ; returnValue.setActionReturnValue ( vdsReturnValue.getReturnValue ( ) ) ; returnValue.setExecuteFailedMessages ( new java.util.ArrayList < java.lang.String > ( ) { { add ( vdsReturnValue.getVdsError ( ) . getMessage ( ) ) ; } } ) ; return returnValue ; }
Source:
private void initializeOsRepository ( int osId , org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface ) { java.util.ArrayList < java.lang.String > supportedDiskInterfaces = new java.util.ArrayList < > ( ) ; supportedDiskInterfaces.add ( diskInterface.name ( ) ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( 1 , null ) ) . thenReturn ( supportedDiskInterfaces ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( 2 , null ) ) . thenReturn ( new java.util.ArrayList < java.lang.String > ( ) ) ; org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }

Target:
private void initializeOsRepository ( int osId , org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface ) { java.util.ArrayList < java.lang.String > supportedDiskInterfaces = new java.util.ArrayList < > ( ) ; supportedDiskInterfaces.add ( diskInterface.name ( ) ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( 1 , null ) ) . thenReturn ( supportedDiskInterfaces ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( 2 , null ) ) . thenReturn ( new java.util.ArrayList < java.lang.String > ( ) ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > findGroupsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.util.List < java.lang.String > ids ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryGroups ( extension , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , QueryEntity.GROUP ) ) ) ; } return results ; }

Target:
public static java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > findGroupsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.List < java.lang.String > ids ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryGroups ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , QueryEntity.GROUP ) ) ) ; } return results ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( bricks.getItems ( ) ) != null ) && ( bricks.getItems ( ) . iterator ( ) . hasNext ( ) ) ) { getRemoveAllBricksCommand ( ) . setIsExecutionAllowed ( true ) ; } else { getRemoveAllBricksCommand ( ) . setIsExecutionAllowed ( false ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateSelectedBricksActions ( ) ; }
Source:
public void quota_storageSelectedItemChanged ( final org.ovirt.engine.core.compat.Guid defaultQuotaId ) { org.ovirt.engine.core.common.businessentities.storage_domains storageDomain = ( ( org.ovirt.engine.core.common.businessentities.storage_domains ) ( getStorageDomain ( ) . getSelectedItem ( ) ) ) ; if ( storageDomain != null ) { getStorageQuota ( defaultQuotaId ) ; } getStorageDomain ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { getStorageQuota ( defaultQuotaId ) ; } } ) ; }

Target:
public void quota_storageSelectedItemChanged ( final org.ovirt.engine.core.compat.Guid defaultQuotaId ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( getStorageDomain ( ) . getSelectedItem ( ) ) ) ; if ( storageDomain != null ) { getStorageQuota ( defaultQuotaId ) ; } getStorageDomain ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getStorageQuota ( defaultQuotaId ) ; } } ) ; }
Source:
private void prepare3 ( ) { org.ovirt.engine.ui.uicompat.PreparingEnlistment enlistment = ( ( org.ovirt.engine.ui.uicompat.PreparingEnlistment ) ( context.enlistment ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext enlistmentContext = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext ) ( enlistment.getContext ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = context.addDataCenterReturnValue ; context.enlistment = null ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { enlistmentContext.setDataCenterId ( ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) ) ; enlistment.Prepared ( ) ; } else { enlistment.ForceRollback ( ) ; } }

Target:
private void prepare3 ( ) { org.ovirt.engine.ui.uicompat.PreparingEnlistment enlistment = ( ( org.ovirt.engine.ui.uicompat.PreparingEnlistment ) ( context.enlistment ) ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext enlistmentContext = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.EnlistmentContext ) ( enlistment.getContext ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = context.addDataCenterReturnValue ; context.enlistment = null ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { enlistmentContext.setDataCenterId ( ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) ) ; enlistment.prepared ( ) ; } else { enlistment.forceRollback ( ) ; } }
Source:
public void init ( ) { broker = org.ovirt.engine.core.bll.adbroker.LdapFactory.getInstance ( getProfileName ( ) ) ; }

Target:
public void init ( ) { broker = org.ovirt.engine.core.bll.adbroker.LdapFactory.getInstance ( getProfileName ( ) ) ; context.put ( ExtensionProperties.AUTHOR , "The oVirt Project" ) ; context.put ( ExtensionProperties.EXTENSION_NAME , "Internal Kerberos/LDAP authorization (Built-in)" ) ; context.put ( ExtensionProperties.LICENSE , "ASL 2.0" ) ; context.put ( ExtensionProperties.HOME , "http://www.ovirt.org" ) ; context.put ( ExtensionProperties.VERSION , "N/A" ) ; }
Source:
public final void setData ( java.lang.String sessionId , java.lang.String key , java.lang.Object value ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; if ( sessionInfo == null ) { sessionInfo = new org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo ( ) ; org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo oldSessionInfo = sessionInfoMap.putIfAbsent ( sessionId , sessionInfo ) ; if ( oldSessionInfo != null ) { sessionInfo = oldSessionInfo ; } } sessionInfo.contentOfSession.put ( key , value ) ; }

Target:
public final void setData ( java.lang.String sessionId , java.lang.String key , java.lang.Object value ) { org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; if ( sessionInfo == null ) { sessionInfo = new org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo ( ) ; sessionInfo.contentOfSession.put ( org.ovirt.engine.core.bll.aaa.SessionDataContainer.ENGINE_SESSION_ID , sessionId ) ; org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo oldSessionInfo = sessionInfoMap.putIfAbsent ( sessionId , sessionInfo ) ; if ( oldSessionInfo != null ) { sessionInfo = oldSessionInfo ; } } sessionInfo.contentOfSession.put ( key , value ) ; }
Source:
public void testLogEntryLogsWhenLogLevelActive ( ) throws java.lang.Exception { java.lang.String id = "" ; org.ovirt.engine.core.utils.log.Log log = org.mockito.Mockito.mock ( org.ovirt.engine.core.utils.log.Log.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logEntry ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) ) ; org.mockito.Mockito.verify ( log ) . debugFormat ( org.mockito.Matchers.eq ( LoggedUtils.ENTRY_LOG ) , org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.eq ( id ) ) ; }

Target:
public void testLogEntryLogsWhenLogLevelActive ( ) throws java.lang.Exception { java.lang.String id = "" ; org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; org.mockito.Mockito.when ( log.isDebugEnabled ( ) ) . thenReturn ( true ) ; org.ovirt.engine.core.utils.log.LoggedUtils.logEntry ( log , id , new org.ovirt.engine.core.utils.log.LoggedUtilsTest.LoggedOverridingSubclass ( ) ) ; org.mockito.Mockito.verify ( log ) . debug ( org.mockito.Matchers.eq ( LoggedUtils.ENTRY_LOG ) , new java.lang.Object [ ] { org.mockito.Matchers.anyObject ( ) , org.mockito.Matchers.eq ( id ) } ) ; }
Source:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUpEntityQueryExpectations ( java.util.Collections.emptyList ( ) ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepStatus ( volumeName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName , java.lang.String userName ) { try { java.util.Map < java.lang.String , java.lang.Object > response ; response = vdsServer.glusterVolumeGeoRepSessionList ( volumeName , slaveHost , slaveVolumeName , userName ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testReadLatency ( ) { java.lang.String doubleValue = "2" ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = getVmDynamic ( ) ; java.util.Map < java.lang.String , java.lang.Object > diskData = setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_read_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = setMockForTesting ( diskData ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xml ) ; org.junit.Assert.assertEquals ( vmDynamic.getDisks ( ) . get ( 0 ) . getReadLatency ( ) , new java.lang.Double ( "0.000000002" ) ) ; }

Target:
public void testReadLatency ( ) { java.lang.String doubleValue = "2" ; org.ovirt.engine.core.common.businessentities.VmDynamic vmDynamic = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVmDynamic ( ) ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_read_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setMockForTesting ( diskData ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.updateVMDynamicData ( vmDynamic , xml ) ; org.junit.Assert.assertEquals ( vmDynamic.getDisks ( ) . get ( 0 ) . getReadLatency ( ) , new java.lang.Double ( "0.000000002" ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult ipConfiguredForStaticBootProtocol ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( ( ipConfiguration != null ) && ( ( ipConfiguration.getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) ) && ( unsetAddress ( ipConfiguration ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( VdcBllMessages.NETWORK_ADDR_MANDATORY_IN_STATIC_IP ) . when ( failWhen ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult ipConfiguredForStaticBootProtocol ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( ( ( ipConfiguration != null ) && ( ipConfiguration.hasPrimaryAddressSet ( ) ) ) && ( ( ipConfiguration.getPrimaryAddress ( ) . getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) ) && ( unsetAddress ( ipConfiguration ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_ADDR_MANDATORY_IN_STATIC_IP ) . when ( failWhen ) ; }