auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean validate ( ) { boolean result = true ; if ( ( ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) ) == null ) || ( org.ovirt.engine.core.bll.AddExternalEventCommand.getParameters ( ) . getEvent ( ) . getOrigin ( ) . equalsIgnoreCase ( org.ovirt.engine.core.bll.AddExternalEventCommand.OVIRT ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_EVENT_ILLEGAL_ORIGIN ) ; result = false ; } if ( ! result ) { addValidationMessage ( EngineMessage.VAR__ACTION__ADD ) ; addValidationMessage ( EngineMessage.VAR__TYPE__EXTERNAL_EVENT ) ; } return result ; }

Target:
protected void setActionMessageParameters ( ) { addValidationMessage ( EngineMessage.VAR__ACTION__ADD ) ; addValidationMessage ( EngineMessage.VAR__TYPE__EXTERNAL_EVENT ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.Object > constructStringAttributes ( ) { java.util.Map < java.lang.String , java.lang.Object > attributes = super . constructStringAttributes ( ) ; attributes.put ( "macAddress" , getMacAddress ( ) ) ; attributes.put ( "bondName" , getBondName ( ) ) ; attributes.put ( "speed" , getSpeed ( ) ) ; attributes.put ( "labels" , getLabels ( ) ) ; return attributes ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "macAddress" , getMacAddress ( ) ) . append ( "bondName" , getBondName ( ) ) . append ( "speed" , getSpeed ( ) ) . append ( "labels" , getLabels ( ) ) ; }
Source:
public void formatValue ( java.lang.String fieldName , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > pair , boolean caseSensitive ) { if ( "CREATION_DATE" . equals ( fieldName ) ) { java.util.Date tmp = new java.util.Date ( java.util.Date.parse ( org.ovirt.engine.core.compat.StringHelper.trim ( pair.getSecond ( ) , '\'' ) ) ) ; pair.setSecond ( org.ovirt.engine.core.compat.StringFormat.format ( "'%1$s'" , tmp ) ) ; } else { super . formatValue ( fieldName , pair , caseSensitive ) ; } }

Target:
public void formatValue ( java.lang.String fieldName , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > pair , boolean caseSensitive ) { if ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.CREATION_DATE.equals ( fieldName ) ) { java.util.Date tmp = new java.util.Date ( java.util.Date.parse ( org.ovirt.engine.core.compat.StringHelper.trim ( pair.getSecond ( ) , '\'' ) ) ) ; pair.setSecond ( org.ovirt.engine.core.compat.StringFormat.format ( "'%1$s'" , tmp ) ) ; } else { super . formatValue ( fieldName , pair , caseSensitive ) ; } }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.Job model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; org.junit.Assert.assertTrue ( model.isExternal ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Job model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( DESCRIPTIONS [ index ] , model.getDescription ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( model.isExternal ( ) ) ; verifyLinks ( model ) ; }
Source:
private void initImportSources ( ) { importSources.setItems ( java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.values ( ) ) ) ; importSources.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { clearVms ( ) ; clearValidations ( ) ; loadProviders ( ) ; } } ) ; importSources.setSelectedItem ( ImportSource.EXPORT_DOMAIN ) ; }

Target:
private void initImportSources ( ) { importSources.setItems ( java.util.Arrays.asList ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportSource.values ( ) ) ) ; importSources.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { validateSource ( ) ; clearVms ( ) ; clearValidations ( ) ; loadProviders ( ) ; } } ) ; importSources.setSelectedItem ( ImportSource.EXPORT_DOMAIN ) ; validateSource ( ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getActionType ( ) . getActionGroup ( ) ) ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getVmTemplateId ( ) , org.ovirt.engine.core.common.VdcObjectType.VmTemplate , org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getParameters ( ) . getVmStaticData ( ) . getVdsGroupId ( ) , org.ovirt.engine.core.common.VdcObjectType.VdsGroups , org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getActionType ( ) . getActionGroup ( ) ) ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AddVmPoolWithVmsCommand.getVmTemplateId ( ) , org.ovirt.engine.core.common.VdcObjectType.VmTemplate , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_VM ) ) ; return permissionList ; }
Source:
public void testNotManagementNetworkPositive ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( DEFAULT_GUID ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( DEFAULT_GUID ) ) . thenReturn ( true ) ; org.junit.Assert.assertThat ( validator.notManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK ) ) ; }

Target:
public void testNotManagementNetworkPositive ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( DEFAULT_GUID ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( DEFAULT_GUID ) ) . thenReturn ( true ) ; org.junit.Assert.assertThat ( validator.notManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK ) ) ; }
Source:
public static void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public static void getRedirectServletReportsPage ( 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.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void doInit ( org.ovirt.engine.api.extensions.ExtMap inputMap , org.ovirt.engine.api.extensions.ExtMap outputMap ) { context = inputMap.< org.ovirt.engine.api.extensions.ExtMap > get ( Base.InvokeKeys.CONTEXT ) ; configuration = context.< java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) ; broker = org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapFactory.getInstance ( getDirectoryName ( ) ) ; context.mput ( Base.ContextKeys.AUTHOR , "The oVirt Project" ) . mput ( Base.ContextKeys.EXTENSION_NAME , "Kerberos/Ldap Authz (Built-in)" ) . mput ( Base.ContextKeys.LICENSE , "ASL 2.0" ) . mput ( Base.ContextKeys.HOME_URL , "http://www.ovirt.org" ) . mput ( Base.ContextKeys.VERSION , "N/A" ) . mput ( Authz.ContextKeys.QUERY_MAX_FILTER_SIZE , configuration.get ( "config.query.filter.size" ) ) . mput ( Base.ContextKeys.BUILD_INTERFACE_VERSION , Base.INTERFACE_VERSION_CURRENT ) ; }

Target:
private void doLoad ( org.ovirt.engine.api.extensions.ExtMap inputMap , org.ovirt.engine.api.extensions.ExtMap outputMap ) { context = inputMap.< org.ovirt.engine.api.extensions.ExtMap > get ( Base.InvokeKeys.CONTEXT ) ; configuration = context.< java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) ; broker = org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapFactory.getInstance ( getDirectoryName ( ) ) ; org.ovirt.engine.extensions.aaa.builtin.kerberosldap.Utils.setDefaults ( configuration , getDirectoryName ( ) ) ; context.mput ( Base.ContextKeys.AUTHOR , "The oVirt Project" ) . mput ( Base.ContextKeys.EXTENSION_NAME , "Kerberos/Ldap Authz (Built-in)" ) . mput ( Base.ContextKeys.LICENSE , "ASL 2.0" ) . mput ( Base.ContextKeys.HOME_URL , "http://www.ovirt.org" ) . mput ( Base.ContextKeys.VERSION , "N/A" ) . mput ( Authz.ContextKeys.QUERY_MAX_FILTER_SIZE , java.lang.Integer.parseInt ( configuration.getProperty ( "config.query.filter.size" ) ) ) . mput ( Base.ContextKeys.BUILD_INTERFACE_VERSION , Base.INTERFACE_VERSION_CURRENT ) . mput ( Authz.ContextKeys.AVAILABLE_NAMESPACES , java.util.Arrays.asList ( "*" ) ) ; }
Source:
protected boolean validate ( ) { if ( ! ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . isSkipDomainChecks ( ) ) ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getStorageDomain ( ) ) ; if ( ! ( validate ( storageDomainValidator.isDomainExistAndActive ( ) ) ) ) { return false ; } } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getParameters ( ) . isSkipDomainChecks ( ) ) ) { org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = new org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator ( org.ovirt.engine.core.bll.storage.ovfstore.ProcessOvfUpdateForStorageDomainCommand.getStorageDomain ( ) ) ; return ( validate ( storageDomainValidator.isDomainExistAndActive ( ) ) ) && ( validate ( storageDomainValidator.isDataDomain ( ) ) ) ; } return true ; }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetworkDAO ( ) . get ( getNetwork ( ) . getId ( ) ) ) ; return ( ( ( ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notManagementNetwork ( ) ) ) ) && ( validate ( validator.notIscsiBondNetwork ( ) ) ) ) && ( validate ( validator.networkNotUsedByVms ( ) ) ) ) && ( validate ( validator.networkNotUsedByTemplates ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.NetworkValidator validator = new org.ovirt.engine.core.bll.validator.NetworkValidator ( org.ovirt.engine.core.bll.network.dc.RemoveNetworkCommand.getNetworkDAO ( ) . get ( getNetwork ( ) . getId ( ) ) ) ; return ( ( ( ( validate ( validator.networkIsSet ( ) ) ) && ( validate ( validator.notRemovingManagementNetwork ( ) ) ) ) && ( validate ( validator.notIscsiBondNetwork ( ) ) ) ) && ( validate ( validator.networkNotUsedByVms ( ) ) ) ) && ( validate ( validator.networkNotUsedByTemplates ( ) ) ) ; }
Source:
public org.ovirt.engine.api.model.VM get ( ) { org.ovirt.engine.api.model.VM vm ; if ( isNextRunRequested ( ) ) { vm = performGet ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) ) ; } else { vm = performGet ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) ) ; } return removeRestrictedInfo ( vm ) ; }

Target:
public org.ovirt.engine.api.model.VM get ( ) { org.ovirt.engine.api.model.VM vm ; if ( isNextRunRequested ( ) ) { org.ovirt.engine.api.model.VM entity = getEntity ( org.ovirt.engine.api.model.VM.class , VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , id , true ) ; vm = addLinks ( populate ( org.ovirt.engine.api.restapi.types.VmMapper.map ( entity , null , false ) , entity ) ) ; } else { vm = performGet ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) ) ; } org.ovirt.engine.api.restapi.util.DisplayHelper.adjustDisplayData ( this , vm ) ; return removeRestrictedInfo ( vm ) ; }
Source:
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.storage.DiskImage > ( ) ; } return source ; }

Target:
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 > ( ) ; }
Source:
public void getStorageDomainList ( 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 ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , 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.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.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected void setUpNetworkQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.GetAllNetworkQueryParamenters.class , new java.lang.String [ ] { "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , asList ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.getNetwork ( ) ) ) ; } }

Target:
protected void setUpNetworkQueryExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworks , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.core.compat.Guid.Empty } , asList ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.getNetwork ( ) ) ) ; } }
Source:
public void testSave ( ) { newVmStatistics.setId ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.NEW_VM_ID ) ; newVmStatistics.setCpuSys ( 22.0 ) ; newVmStatistics.setCpuUser ( 35.0 ) ; newVmStatistics.setUsageCpuPercent ( 44 ) ; newVmStatistics.setUsageMemPercent ( 67 ) ; newVmStatistics.setDisksUsage ( "disk_usage" ) ; newVmStatistics.setGuestMemoryBuffered ( 32L ) ; newVmStatistics.setGuestMemoryCached ( 34L ) ; dao.save ( newVmStatistics ) ; org.ovirt.engine.core.common.businessentities.VmStatistics stats = dao.get ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.NEW_VM_ID ) ; org.junit.Assert.assertNotNull ( stats ) ; org.junit.Assert.assertEquals ( newVmStatistics , stats ) ; }

Target:
public void testSave ( ) { newVmStatistics.setId ( FixturesTool.VM_RHEL5_POOL_50_ID ) ; newVmStatistics.setCpuSys ( 22.0 ) ; newVmStatistics.setCpuUser ( 35.0 ) ; newVmStatistics.setUsageCpuPercent ( 44 ) ; newVmStatistics.setUsageMemPercent ( 67 ) ; newVmStatistics.setDisksUsage ( "disk_usage" ) ; newVmStatistics.setGuestMemoryBuffered ( 32L ) ; newVmStatistics.setGuestMemoryCached ( 34L ) ; dao.save ( newVmStatistics ) ; org.ovirt.engine.core.common.businessentities.VmStatistics stats = dao.get ( FixturesTool.VM_RHEL5_POOL_50_ID ) ; org.junit.Assert.assertNotNull ( stats ) ; org.junit.Assert.assertEquals ( newVmStatistics , stats ) ; }
Source:
private void validateParameters ( org.ovirt.engine.api.model.VM incoming ) { if ( ( incoming.isSetDomain ( ) ) && ( ! ( incoming.getDomain ( ) . isSetName ( ) ) ) ) { throw new org.ovirt.engine.api.restapi.resource.WebFaultException ( null , localize ( Messages.INCOMPLETE_PARAMS_REASON ) , localize ( Messages.INCOMPLETE_PARAMS_CONDITIONAL , "Domain" , "Domain name" ) , Response.Status.BAD_REQUEST ) ; } }

Target:
private void validateParameters ( org.ovirt.engine.api.model.VM incoming ) { if ( ( incoming.isSetDomain ( ) ) && ( ! ( incoming.getDomain ( ) . isSetName ( ) ) ) ) { throw new org.ovirt.engine.api.restapi.resource.WebFaultException ( null , localize ( Messages.INCOMPLETE_PARAMS_REASON ) , localize ( Messages.INCOMPLETE_PARAMS_CONDITIONAL , "Domain" , "Domain name" ) , Response.Status.BAD_REQUEST ) ; } if ( ! ( org.ovirt.engine.api.restapi.util.IconHelper.validateIconParameters ( incoming ) ) ) { throw new org.ovirt.engine.api.restapi.resource.BaseBackendResource.WebFaultException ( null , localize ( Messages.INVALID_ICON_PARAMETERS ) , Response.Status.BAD_REQUEST ) ; } }
Source:
private void assertGetAllRelevantQuoatsForStorage ( org.ovirt.engine.core.compat.Guid storageId , int expectedQuotas ) { java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = dao.getAllRelevantQuotasForStorage ( storageId , org.ovirt.engine.core.dao.PRIVILEGED_USER_SESSION_ID , false ) ; org.junit.Assert.assertEquals ( "Wrong number of quotas retuend" , expectedQuotas , quotas.size ( ) ) ; }

Target:
private void assertGetAllRelevantQuoatsForVdsGroup ( org.ovirt.engine.core.compat.Guid vdsGroupId , int expectedQuotas ) { org.junit.Assert.assertNotNull ( privilegedUserSession ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Quota > quotas = dao.getAllRelevantQuotasForVdsGroup ( vdsGroupId , privilegedUserSession.getId ( ) , false ) ; org.junit.Assert.assertEquals ( "Wrong number of quotas retuend" , expectedQuotas , quotas.size ( ) ) ; }
Source:
private void pause ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.HibernateVmParameters ( a.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.HibernateVm , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
private void pause ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VM a = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VmOperationParameterBase ( a.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.HibernateVm , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRestoreCommand ( ) ) ) { restore ( ) ; return ; } if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; return ; } switch ( command.getName ( ) ) { case CANCEL_COMMAND : cancel ( ) ; break ; case CANCEL_CONFIRMATION_COMMAND : cancelConfirm ( ) ; break ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRestoreCommand ( ) ) ) { restore ( ) ; return ; } if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; return ; } switch ( command.getName ( ) ) { case org.ovirt.engine.ui.uicommonweb.models.storage.ManageBackupModel.CANCEL_COMMAND : cancel ( ) ; break ; case org.ovirt.engine.ui.uicommonweb.models.storage.ManageBackupModel.CANCEL_CONFIRMATION_COMMAND : cancelConfirm ( ) ; break ; } }
Source:
public void testParseIngoreValues ( ) { java.util.List < org.ovirt.engine.api.model.PowerManagement > ret = org.ovirt.engine.api.restapi.util.FencingOptionsParser.parse ( "foo:one=1,two=2,three=3" , "one=bool,two=int,three=bool" , true ) ; assertNotNull ( ret ) ; assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , null , "two" , "int" , null , "three" , "bool" , null ) ; }

Target:
public void testParseIngoreValues ( ) { java.util.List < org.ovirt.engine.api.model.PowerManagement > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1,two=2,three=3" , "one=bool,two=int,three=bool" , true ) ; assertNotNull ( ret ) ; assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , null , "two" , "int" , null , "three" , "bool" , null ) ; }
Source:
public void onTimeout ( ) { if ( org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler._nonOperationalPools.containsKey ( poolId ) ) { try { org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( poolId ) ; if ( ( pool != null ) && ( ( pool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational ) ) ) { org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.NonOperationalPoolTreatment ( pool ) ; } } catch ( java.lang.Exception e ) { } } }

Target:
public void onTimeout ( ) { if ( org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler._nonOperationalPools.containsKey ( poolId ) ) { try { org.ovirt.engine.core.common.businessentities.StoragePool pool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( poolId ) ; if ( ( pool != null ) && ( ( pool.getstatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational ) ) ) { org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.nonOperationalPoolTreatment ( pool ) ; } } catch ( java.lang.Exception e ) { } } }
Source:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getNetworkList ( 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 ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private com.google.gwt.user.client.ui.PushButton createMinusButton ( final org.ovirt.engine.core.common.utils.Pair < T , V > item ) { final com.google.gwt.user.client.ui.PushButton button = createPushButton ( org.ovirt.engine.ui.common.widget.AddRemoveRowWidget.resources.decreaseIcon ( ) ) ; button.addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { final T value = item.getFirst ( ) ; final V widget = item.getSecond ( ) ; if ( vetoRemoveWidget ( item , value , widget ) ) { return ; } doRemoveItem ( item , value , widget ) ; } } ) ; return button ; }

Target:
private org.gwtbootstrap3.client.ui.Button createMinusButton ( final org.ovirt.engine.core.common.utils.Pair < T , V > item ) { final org.gwtbootstrap3.client.ui.Button button = createButton ( IconType.MINUS , new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { final T value = item.getFirst ( ) ; final V widget = item.getSecond ( ) ; if ( vetoRemoveWidget ( item , value , widget ) ) { return ; } doRemoveItem ( item , value , widget ) ; } } ) ; return button ; }
Source:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( _vds.getstatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "ResourceManager::refreshVdsRunTimeInfo::Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getvds_name ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warnFormat ( "ResourceManager::refreshVdsRunTimeInfo::Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getvds_name ( ) , e.getMessage ( ) ) ; } }

Target:
private void logNetworkException ( org.ovirt.engine.core.vdsbroker.vdsbroker.VDSNetworkException e ) { switch ( _vds.getStatus ( ) ) { case Down : break ; case NonResponsive : org.ovirt.engine.core.vdsbroker.VdsManager.log.debugFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getVdsName ( ) , e.getMessage ( ) ) ; break ; default : org.ovirt.engine.core.vdsbroker.VdsManager.log.warnFormat ( "Failed to refresh VDS , vds = {0} : {1}, VDS Network Error, continuing.\n{2}" , _vds.getId ( ) , _vds.getVdsName ( ) , e.getMessage ( ) ) ; } }
Source:
public static void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public void insertAsyncTaskEntity ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.compat.Guid entityId , org.ovirt.engine.core.common.VdcObjectType entityType ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) ; parameterSource.addValue ( "task_id" , taskId ) . addValue ( "entity_id" , entityId ) . addValue ( "entity_type" , entityType ) ; getCallsHandler ( ) . executeModification ( "InsertAsyncTaskEntities" , parameterSource ) ; }

Target:
public org.springframework.jdbc.core.namedparam.MapSqlParameterSource map ( org.ovirt.engine.core.common.businessentities.AsyncTaskEntity entity ) { org.ovirt.engine.core.dal.dbbroker.CustomMapSqlParameterSource paramSource = getCustomMapSqlParameterSource ( ) ; paramSource.addValue ( "task_id" , entity.getTaskId ( ) ) . addValue ( "entity_id" , entity.getEntityId ( ) ) . addValue ( "entity_type" , entity.getEntityType ( ) . toString ( ) ) ; return paramSource ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVdsDynamicDAO ( ) ) ; staticDao = prepareDAO ( dbFacade.getVdsStaticDAO ( ) ) ; statisticsDao = prepareDAO ( dbFacade.getVdsStatisticsDAO ( ) ) ; existingVds = staticDao.get ( org.ovirt.engine.core.dao.VdsDynamicDAOTest.EXISTING_VDS_ID ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.sethost_name ( "farkle.redhat.com" ) ; newStaticVds.setvds_group_id ( existingVds.getvds_group_id ( ) ) ; newDynamicVds = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = prepareDAO ( dbFacade.getVdsDynamicDao ( ) ) ; staticDao = prepareDAO ( dbFacade.getVdsStaticDao ( ) ) ; statisticsDao = prepareDAO ( dbFacade.getVdsStatisticsDao ( ) ) ; existingVds = staticDao.get ( org.ovirt.engine.core.dao.VdsDynamicDAOTest.EXISTING_VDS_ID ) ; newStaticVds = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; newStaticVds.sethost_name ( "farkle.redhat.com" ) ; newStaticVds.setvds_group_id ( existingVds.getvds_group_id ( ) ) ; newDynamicVds = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; }
Source:
public boolean isGlusterPeerProbeNeeded ( ) { return this . glusterPeerProbeNeeded ; }

Target:
public void initVdsActionParametersForProvision ( org.ovirt.engine.core.compat.Guid providerId , org.ovirt.engine.core.common.businessentities.ExternalHostGroup hostGroup , org.ovirt.engine.core.common.businessentities.ExternalComputeResource computeResource , java.lang.String hostMac , java.lang.String discoverName , java.lang.String discoverIp ) { provisioned = true ; this . hostMac = hostMac ; this . hostGroup = hostGroup ; this . getVdsStaticData ( ) . setHostProviderId ( providerId ) ; this . discoverName = discoverName ; this . computeResource = computeResource ; this . discoverIp = discoverIp ; }
Source:
public void getMaxNumOfVmSockets ( 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 ) ) : 1 ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxNumOfVmSockets ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void getVmsRunningOnOrMigratingToVds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { return true ; }

Target:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) ; org.ovirt.engine.core.common.businessentities.Disk disk = diskModel.getDisk ( ) ; boolean lunIscsiLimitation = ( ( disk.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI ) ) && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ) ; boolean ideLimitation = ( disk.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.IDE ) ; return ( ! lunIscsiLimitation ) && ( ! ideLimitation ) ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values ) { return setUpActionExpectations ( task , clz , names , values , true , true , null , null , true ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.ActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values ) { return setUpActionExpectations ( task , clz , names , values , true , true , null , null , true ) ; }
Source:
public void testListCrashClientLocale ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpMacPoolsQueryExpectations ( t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }

Target:
public void testListCrashClientLocale ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpMacPoolsQueryExpectations ( t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } finally { locales.clear ( ) ; } }
Source:
private java.lang.String renderMemory ( double memory ) { if ( memory <= 0 ) { return "0" ; } return memory > ( java.lang.Math.abs ( ( ( org.ovirt.engine.ui.userportal.widget.QuotaMemoryProgressBar.MB_GB_THRESHOLD ) * ( org.ovirt.engine.ui.userportal.widget.QuotaMemoryProgressBar.GIGA ) ) ) ) ? org.ovirt.engine.ui.userportal.widget.QuotaMemoryProgressBar.diskSizeRenderer.render ( ( memory / ( org.ovirt.engine.ui.userportal.widget.QuotaMemoryProgressBar.GIGA ) ) ) : ( ( int ) ( memory ) ) + "MB" ; }

Target:
private java.lang.String renderMemory ( double memory ) { if ( memory <= 0 ) { return "0" ; } return memory > ( java.lang.Math.abs ( ( ( org.ovirt.engine.ui.userportal.widget.QuotaMemoryProgressBar.MB_GB_THRESHOLD ) * ( org.ovirt.engine.ui.userportal.widget.QuotaMemoryProgressBar.GIGA ) ) ) ) ? org.ovirt.engine.ui.userportal.widget.QuotaMemoryProgressBar.diskSizeRenderer.render ( ( memory / ( org.ovirt.engine.ui.userportal.widget.QuotaMemoryProgressBar.GIGA ) ) ) : org.ovirt.engine.ui.userportal.widget.QuotaMemoryProgressBar.messages.megabytes ( java.lang.String.valueOf ( ( ( int ) ( memory ) ) ) ) ; }
Source:
private void initListeners ( final org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { model.getAdvancedMode ( ) . getPropertyChangedEvent ( ) . 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 ) { storeAdvancedModeToLocalStorage ( model ) ; swithAccordingToMode ( model ) ; } } ) ; model.getAttachedToInstanceType ( ) . getPropertyChangedEvent ( ) . 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 ) { swithAttachToInstanceType ( model ) ; } } ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { switchToAdvancedIfNeeded ( model ) ; }
Source:
public void starting ( org.junit.runner.Description description ) { java.lang.String seedProperty = java.lang.System.getProperty ( org.ovirt.engine.core.utils.RandomUtilsSeedingRule.RANDOM_SEED_PROPERTY ) ; java.lang.Long seed = org.ovirt.engine.core.compat.LongCompat.tryParse ( seedProperty ) ; if ( seed == null ) { org.ovirt.engine.core.utils.RandomUtilsSeedingRule.log.infoFormat ( "Property \"{0}\" was not set, using System.currentTimeMillis() as a seed." , org.ovirt.engine.core.utils.RandomUtilsSeedingRule.RANDOM_SEED_PROPERTY ) ; seed = java.lang.System.currentTimeMillis ( ) ; } org.ovirt.engine.core.utils.RandomUtils.instance ( ) . setSeed ( seed ) ; org.ovirt.engine.core.utils.RandomUtilsSeedingRule.log.info ( ( "Running test with random seed: " + ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . getSeed ( ) ) ) ) ; }

Target:
public void starting ( org.junit.runner.Description description ) { java.lang.String seedProperty = java.lang.System.getProperty ( org.ovirt.engine.core.utils.RandomUtilsSeedingRule.RANDOM_SEED_PROPERTY ) ; java.lang.Long seed ; try { seed = java.lang.Long.parseLong ( seedProperty ) ; } catch ( java.lang.NumberFormatException e ) { org.ovirt.engine.core.utils.RandomUtilsSeedingRule.log.infoFormat ( "Property \"{0}\" was not set, using System.currentTimeMillis() as a seed." , org.ovirt.engine.core.utils.RandomUtilsSeedingRule.RANDOM_SEED_PROPERTY ) ; seed = java.lang.System.currentTimeMillis ( ) ; } org.ovirt.engine.core.utils.RandomUtils.instance ( ) . setSeed ( seed ) ; org.ovirt.engine.core.utils.RandomUtilsSeedingRule.log.info ( ( "Running test with random seed: " + ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . getSeed ( ) ) ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addDiskDevice ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid deviceId ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addDiskDevice ( vmId , deviceId , true , false , "" , false ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmDevice addDiskDevice ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid deviceId , java.lang.Boolean isPlugged , java.lang.Boolean isReadOnly , java.lang.String address , boolean isUsingScsiReservation ) { return addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vmId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , org.ovirt.engine.core.bll.utils.VmDeviceUtils.EMPTY_SPEC_PARAMS , isPlugged , isReadOnly , address , null , isUsingScsiReservation ) ; }
Source:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskAndSnapshotsByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.DISK_ID } , getEntity ( 1 , true ) ) ; try { resource.get ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskAndSnapshotsByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.DISK_ID } , getEntity ( 1 , true ) ) ; verifyNotFoundException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , resource :: get ) ) ; }
Source:
public static void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void isClusterEmpty ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public java.lang.String getItemsCountString ( ) { if ( ( getItems ( ) ) == null ) { return "" ; } int fromItemCount = ( ( getSearchPageSize ( ) ) * ( ( getSearchPageNumber ( ) ) - 1 ) ) + 1 ; int toItemCount = ( fromItemCount - 1 ) + ( ( ( java.util.Collection ) ( getItems ( ) ) ) . size ( ) ) ; if ( ( toItemCount == 0 ) || ( fromItemCount > toItemCount ) ) { return "" ; } return ( fromItemCount + "-" ) + toItemCount ; }

Target:
public void setCaseSensitiveSearch ( boolean value ) { caseSensitiveSearch = value ; }
Source:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( domain.getStorageType ( ) ) . storageDomainRemoved ( domain.getStorageStaticData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . remove ( domain.getId ( ) ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( domain.getStorageType ( ) ) . storageDomainRemoved ( domain.getStorageStaticData ( ) ) ; getStorageDomainDAO ( ) . remove ( domain.getId ( ) ) ; return null ; }