auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public 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 ) ; getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public void getMaxNumOfCPUsPerSocket ( 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.MaxNumOfCpuPerSocket ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }
Source:
private boolean insertSharedLock ( java.lang.String key , boolean isCheckOnly ) { boolean result = true ; org.ovirt.engine.core.bll.lock.InMemoryLockManager.InternalLockView lock = locks.get ( key ) ; if ( lock != null ) { if ( ! isCheckOnly ) { lock.increaseCount ( ) ; } else if ( lock.getExclusive ( ) ) { result = false ; } } else if ( ! isCheckOnly ) { locks.put ( key , new org.ovirt.engine.core.bll.lock.InMemoryLockManager.InternalLockView ( 1 , false ) ) ; } return result ; }

Target:
private org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.util.Set < java.lang.String > > insertExclusiveLock ( java.lang.String key , java.lang.String message , boolean isCheckOnly ) { org.ovirt.engine.core.bll.lock.InMemoryLockManager.InternalLockView lock = locks.get ( key ) ; if ( lock != null ) { return new org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.util.Set < java.lang.String > > ( java.lang.Boolean.FALSE , lock.getMessages ( ) ) ; } if ( ! isCheckOnly ) { locks.put ( key , new org.ovirt.engine.core.bll.lock.InMemoryLockManager.InternalLockView ( 0 , message , true ) ) ; } return org.ovirt.engine.core.bll.lock.InMemoryLockManager.LOCK_INSERT_SUCCESS_RESULT ; }
Source:
public void getoVirtISOsList ( 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 != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public 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 ) ) : "" ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static void updateVirtioScsiController ( org.ovirt.engine.core.compat.Guid vmId , java.lang.Boolean isVirtioScsiEnabled ) { if ( isVirtioScsiEnabled == null ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > controllers = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.CONTROLLER , VmDeviceType.VIRTIOSCSI.getName ( ) ) ; if ( isVirtioScsiEnabled ) { if ( controllers.isEmpty ( ) ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addVirtioScsiController ( vmId ) ; } } else { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : controllers ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > getVirtioScsiControllers ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.CONTROLLER , VmDeviceType.VIRTIOSCSI.getName ( ) , userID , isFiltered ) ; }
Source:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
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.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void initLoginModel ( ) { super . initLoginModel ( ) ; final org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel = getLoginModel ( ) ; loginModel.getIsENGINEUser ( ) . 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 ) { java.lang.Boolean isEngineUser = ( ( java.lang.Boolean ) ( loginModel.getIsENGINEUser ( ) . getEntity ( ) ) ) ; if ( isEngineUser != null ) { userRole.setEngineUser ( isEngineUser ) ; performLogin ( loginModel ) ; } } } ) ; }

Target:
protected void initLoginModel ( ) { super . initLoginModel ( ) ; final org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalLoginModel loginModel = getLoginModel ( ) ; loginModel.getIsENGINEUser ( ) . getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { java.lang.Boolean isEngineUser = loginModel.getIsENGINEUser ( ) . getEntity ( ) ; if ( isEngineUser != null ) { userRole.setEngineUser ( isEngineUser ) ; performLogin ( loginModel ) ; } } } ) ; }
Source:
private void UpdateSwapUsed ( ) { setUsedSwap ( null ) ; if ( ( ( getEntity ( ) . getswap_total ( ) ) != null ) && ( ( getEntity ( ) . getswap_free ( ) ) != null ) ) { setUsedSwap ( ( ( getEntity ( ) . getswap_total ( ) ) - ( getEntity ( ) . getswap_free ( ) ) ) ) ; } }

Target:
private void UpdateSwapUsed ( ) { setUsedSwap ( null ) ; if ( ( ( getEntity ( ) . getSwapTotal ( ) ) != null ) && ( ( getEntity ( ) . getSwapFree ( ) ) != null ) ) { setUsedSwap ( ( ( getEntity ( ) . getSwapTotal ( ) ) - ( getEntity ( ) . getSwapFree ( ) ) ) ) ; } }
Source:
private void applyStyles ( ) { runVMOnSpecificHostEditor.addContentWidgetStyleName ( style.longCheckboxContent ( ) ) ; dontMigrateVMEditor.addContentWidgetStyleName ( style.longCheckboxContent ( ) ) ; allowConsoleReconnectEditor.addContentWidgetStyleName ( style.longCheckboxContent ( ) ) ; provisioningEditor.addContentWidgetStyleName ( style.provisioningEditorContent ( ) ) ; provisioningThinEditor.addContentWidgetStyleName ( style.provisioningRadioContent ( ) ) ; provisioningCloneEditor.addContentWidgetStyleName ( style.provisioningRadioContent ( ) ) ; cdAttachedEditor.addContentWidgetStyleName ( style.cdAttachedLabelWidth ( ) ) ; }

Target:
private void applyStyles ( ) { runVMOnSpecificHostEditor.addContentWidgetStyleName ( style.longCheckboxContent ( ) ) ; hostCpuEditor.addContentWidgetStyleName ( style.longCheckboxContent ( ) ) ; dontMigrateVMEditor.addContentWidgetStyleName ( style.longCheckboxContent ( ) ) ; allowConsoleReconnectEditor.addContentWidgetStyleName ( style.longCheckboxContent ( ) ) ; provisioningEditor.addContentWidgetStyleName ( style.provisioningEditorContent ( ) ) ; provisioningThinEditor.addContentWidgetStyleName ( style.provisioningRadioContent ( ) ) ; provisioningCloneEditor.addContentWidgetStyleName ( style.provisioningRadioContent ( ) ) ; cdAttachedEditor.addContentWidgetStyleName ( style.cdAttachedLabelWidth ( ) ) ; }
Source:
public static org.ovirt.engine.core.bll.adbroker.UsersDomainsCacheManager getInstance ( ) { return org.ovirt.engine.core.utils.ejb.EjbUtils.< org.ovirt.engine.core.bll.adbroker.UsersDomainsCacheManager > findBean ( BeanType.USERS_DOMAINS_CACHE , BeanProxyType.LOCAL ) ; }

Target:
public static org.ovirt.engine.core.bll.adbroker.UsersDomainsCacheManagerService getInstance ( ) { if ( ( org.ovirt.engine.core.bll.adbroker.UsersDomainsCacheManagerService.instance ) == null ) { synchronized ( org.ovirt.engine.core.bll.adbroker.UsersDomainsCacheManagerService.class ) { if ( ( org.ovirt.engine.core.bll.adbroker.UsersDomainsCacheManagerService.instance ) == null ) { org.ovirt.engine.core.bll.adbroker.UsersDomainsCacheManagerService.instance = new org.ovirt.engine.core.bll.adbroker.UsersDomainsCacheManagerService ( ) ; } } } return org.ovirt.engine.core.bll.adbroker.UsersDomainsCacheManagerService.instance ; }
Source:
public void setKeepTitleOnSetEnabled ( boolean keepTitleOnSetEnabled ) { this . keepTitleOnSetEnabled = keepTitleOnSetEnabled ; }

Target:
private void addStateUpdateHandler ( ) { ( ( com.google.gwt.user.client.ui.Widget ) ( this . getContentWidget ( ) ) ) . addHandler ( new org.ovirt.engine.ui.common.widget.editor.EditorStateUpdateEvent.EditorStateUpdateHandler ( ) { @ java.lang.Override public void onEditorStateUpdate ( org.ovirt.engine.ui.common.widget.editor.EditorStateUpdateEvent event ) { if ( event.isValid ( ) ) { editorStateValid = true ; markAsValid ( ) ; } else { handleInvalidState ( ) ; } } } , org.ovirt.engine.ui.common.widget.editor.EditorStateUpdateEvent.getType ( ) ) ; }
Source:
public void onPowerringUp ( ) { org.ovirt.engine.core.common.businessentities.VmStatic vmStatic = org.ovirt.engine.core.bll.RunVmCommandBase.getVmStaticDAO ( ) . get ( org.ovirt.engine.core.bll.RunVmCommandBase.getVmId ( ) ) ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVms ( getCurrentVdsId ( ) , vmStatic.getNumOfCpus ( ) , vmStatic.getMinAllocatedMem ( ) , vmStatic.getName ( ) ) ; }

Target:
private void decreasePendingVm ( ) { decreasePendingVm ( org.ovirt.engine.core.bll.RunVmCommandBase.getVm ( ) . getStaticData ( ) ) ; }
Source:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource createStatisticsParametersMapper ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics stats ) { return getCustomMapSqlParameterSource ( ) . addValue ( "id" , stats.getId ( ) ) . addValue ( "rx_drop" , stats.getReceiveDropRate ( ) ) . addValue ( "rx_rate" , stats.getReceiveRate ( ) ) . addValue ( "tx_drop" , stats.getTransmitDropRate ( ) ) . addValue ( "tx_rate" , stats.getTransmitRate ( ) ) . addValue ( "iface_status" , stats.getStatus ( ) ) . addValue ( "vds_id" , stats.getVdsId ( ) ) ; }

Target:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource createStatisticsParametersMapper ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics stats ) { org.ovirt.engine.core.dao.network.NetworkStatisticsDaoDbFacadeImpl.NetworkStatisticsParametersMapper < org.ovirt.engine.core.common.businessentities.network.VdsNetworkStatistics > mapper = new org.ovirt.engine.core.dao.network.NetworkStatisticsDaoDbFacadeImpl.NetworkStatisticsParametersMapper ( ) ; return getCustomMapSqlParameterSource ( ) . addValues ( mapper.createParametersMap ( stats ) ) . addValue ( "vds_id" , stats.getVdsId ( ) ) ; }
Source:
protected void setUpEntityQueryExpectations ( int times , boolean isDisplay ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.VdsGroupQueryParamenters.class , new java.lang.String [ ] { "VdsGroupId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , getEntityList ( isDisplay ) ) ; } }

Target:
protected void verifyUpdate ( org.ovirt.engine.api.model.Network model , int index ) { assertTrue ( model.isSetDisplay ( ) ) ; assertEquals ( model.isDisplay ( ) , true ) ; assertTrue ( model.isSetUsages ( ) ) ; assertNotNull ( model.getUsages ( ) . getUsages ( ) ) ; assertTrue ( model.getUsages ( ) . getUsages ( ) . contains ( NetworkUsage.DISPLAY.name ( ) ) ) ; assertTrue ( model.isSetRequired ( ) ) ; assertEquals ( model.isRequired ( ) , true ) ; }
Source:
protected void syncSearch ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getEntity ( ) ; if ( diskImage == null ) { return ; } org.ovirt.engine.core.common.queries.IdQueryParameters getStorageDomainsByImageIdParameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( diskImage.getImageId ( ) ) ; getStorageDomainsByImageIdParameters.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByImageId , getStorageDomainsByImageIdParameters , new org.ovirt.engine.ui.uicommonweb.models.disks.SetItemsAsyncQuery ( ) ) ; setIsQueryFirstTime ( false ) ; }

Target:
protected void syncSearch ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = getEntity ( ) ; if ( diskImage == null ) { return ; } org.ovirt.engine.core.common.queries.IdQueryParameters getStorageDomainsByImageIdParameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( diskImage.getImageId ( ) ) ; getStorageDomainsByImageIdParameters.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( QueryType.GetStorageDomainsByImageId , getStorageDomainsByImageIdParameters , new org.ovirt.engine.ui.uicommonweb.models.disks.SetItemsAsyncQuery ( ) ) ; setIsQueryFirstTime ( false ) ; }
Source:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunAction: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null , state ) ; callback.Executed ( f ) ; }

Target:
public void onFailure ( java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunAction: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult ( actionType , parameters , null , state ) ; callback.executed ( f ) ; }
Source:
protected boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.isInternalExecution ( ) ) ? 0 : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.getVds ( ) . getName ( ) , AuditLogType.USER_VDS_RESTART.name ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addCanDoActionMessage ( VdcBllMessages.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.pm.RestartVdsCommand.addCanDoActionMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }

Target:
protected boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.isInternalExecution ( ) ) ? 0 : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.getVds ( ) . getName ( ) , AuditLogType.USER_VDS_RESTART.name ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addCanDoActionMessage ( EngineMessage.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.pm.RestartVdsCommand.addCanDoActionMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.Integer numOfActiveVms = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; if ( numOfActiveVms != 0 ) { confirmModel.setMessage ( constants.thereAreActiveVMsRequiringRestart ( ) ) ; } checkForNonResponsiveHosts ( confirmModel ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.Integer numOfActiveVms = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; if ( numOfActiveVms != 0 ) { confirmModel.setMessage ( messages.thereAreActiveVMsRequiringRestart ( numOfActiveVms ) ) ; } checkForNonResponsiveHosts ( confirmModel ) ; }
Source:
public void copyFrom ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick ) { setId ( brick.getId ( ) ) ; setVolumeId ( brick.getVolumeId ( ) ) ; setServerId ( brick.getServerId ( ) ) ; setServerName ( brick.getServerName ( ) ) ; setBrickDirectory ( brick.getBrickDirectory ( ) ) ; setStatus ( brick.getStatus ( ) ) ; }

Target:
public void copyFrom ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick ) { setId ( brick.getId ( ) ) ; setVolumeId ( brick.getVolumeId ( ) ) ; setServerId ( brick.getServerId ( ) ) ; setServerName ( brick.getServerName ( ) ) ; setBrickDirectory ( brick.getBrickDirectory ( ) ) ; setBrickOrder ( brick.getBrickOrder ( ) ) ; setStatus ( brick.getStatus ( ) ) ; }
Source:
public void testRemoveNonExistant ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , null ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 0 , null ) ; 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 ( ) ) ; } }
Source:
public static void getVmNicList ( 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 != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpUriExpectations ( null ) ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpQueryExpectations ( "" ) ; java.util.List < org.ovirt.engine.api.model.NIC > nics = getCollection ( ) ; assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpUriExpectations ( null ) ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 3 ) ; setUpQueryExpectations ( "" ) ; java.util.List < org.ovirt.engine.api.model.NIC > nics = getCollection ( ) ; assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }
Source:
public static void setVmDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmId ( vmBase.getId ( ) ) ; vmBase.setUnmanagedDeviceList ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getUnmanagedDevicesByVmId ( vmBase.getId ( ) ) ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VmDevice > vmManagedDeviceMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( device.getIsManaged ( ) ) { vmManagedDeviceMap.put ( device.getDeviceId ( ) , device ) ; } } vmBase.setManagedDeviceMap ( vmManagedDeviceMap ) ; }

Target:
public static void setVmDevices ( org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = org.ovirt.engine.core.bll.utils.VmDeviceUtils.vmDeviceDao.getVmDeviceByVmId ( vmBase.getId ( ) ) ; vmBase.setUnmanagedDeviceList ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.vmDeviceDao.getUnmanagedDevicesByVmId ( vmBase.getId ( ) ) ) ; java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.VmDevice > vmManagedDeviceMap = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { if ( device.getIsManaged ( ) ) { vmManagedDeviceMap.put ( device.getDeviceId ( ) , device ) ; } } vmBase.setManagedDeviceMap ( vmManagedDeviceMap ) ; }
Source:
protected boolean isDomainAttached ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain ) { if ( ( storageDomain.getstorage_pool_id ( ) ) == null ) { return false ; } org.ovirt.engine.core.compat.Guid storageDomainId = storageDomain.getId ( ) ; org.ovirt.engine.core.compat.Guid storagePoolId = storageDomain.getstorage_pool_id ( ) . getValue ( ) ; return ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getDbFacade ( ) . getStoragePoolIsoMapDAO ( ) . get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( storageDomainId , storagePoolId ) ) ) != null ; }

Target:
protected boolean isDomainAttached ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain ) { if ( ( storageDomain.getstorage_pool_id ( ) ) == null ) { return false ; } org.ovirt.engine.core.compat.Guid storageDomainId = storageDomain.getId ( ) ; org.ovirt.engine.core.compat.Guid storagePoolId = storageDomain.getstorage_pool_id ( ) . getValue ( ) ; return ( org.ovirt.engine.core.bll.storage.RemoveStorageDomainCommand.getDbFacade ( ) . getStoragePoolIsoMapDao ( ) . get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( storageDomainId , storagePoolId ) ) ) != null ; }
Source:
public void testParseIngoreValues ( ) { java.util.List < org.ovirt.engine.api.model.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1,two=2,three=3" , "one=bool,two=int,three=bool" , true ) ; org.junit.Assert.assertNotNull ( ret ) ; org.junit.Assert.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.Agent > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1,two=2,three=3" , "one=bool,two=int,three=bool" , true ) ; org.junit.jupiter.api.Assertions.assertNotNull ( ret ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , null , "two" , "int" , null , "three" , "bool" , null ) ; }
Source:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addBonds ( bond ) ) . build ( ) ; doTestValidateModifiedBondSlaves ( org.mockito.Mockito.spy ( validator ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
protected void addExternallyManagedVm ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( ActionType.AddVmFromScratch , new org.ovirt.engine.core.common.action.AddVmParameters ( vmStatic ) , createAddExternalVmContext ( vmStatic ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { log.debug ( "Failed adding Externally managed VM '{}'" , vmStatic.getName ( ) ) ; return ; } resourceManager.getVmManager ( vmStatic.getId ( ) ) . update ( vmStatic ) ; }

Target:
protected void addExternallyManagedVm ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = runInternalAction ( ActionType.AddVmFromScratch , new org.ovirt.engine.core.common.action.AddVmParameters ( vmStatic ) , createAddExternalVmContext ( vmStatic ) ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { log.debug ( "Failed adding Externally managed VM '{}'" , vmStatic.getName ( ) ) ; return ; } resourceManager.getVmManager ( vmStatic.getId ( ) ) . update ( vmStatic ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; if ( ( pools != null ) && ( ! ( pools.isEmpty ( ) ) ) ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { diskHotpluggableInterfacesMap = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; }
Source:
protected void OnExecute ( ) { super . OnExecute ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = getParameters ( ) ; if ( parameters.isEmpty ( ) ) { cancel ( ) ; return ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( getActionType ( ) , parameters , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.templates.CopyDiskModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.CopyDiskModel ) ( result.getState ( ) ) ) ; localModel.cancel ( ) ; } } , this ) ; }

Target:
protected void onExecute ( ) { super . onExecute ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = getParameters ( ) ; if ( parameters.isEmpty ( ) ) { cancel ( ) ; return ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( getActionType ( ) , parameters , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.templates.CopyDiskModel localModel = ( ( org.ovirt.engine.ui.uicommonweb.models.templates.CopyDiskModel ) ( result.getState ( ) ) ) ; localModel.cancel ( ) ; } } , this ) ; }
Source:
private org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > createVmFromSnapshotCommand ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.compat.Guid sourceSnapshotId ) { org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters param = new org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters ( ) ; param.setVm ( vm ) ; param.setSourceSnapshotId ( sourceSnapshotId ) ; param.setStorageDomainId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > concrete = new org.ovirt.engine.core.bll.AddVmFromSnapshotCommand < org.ovirt.engine.core.common.action.AddVmFromSnapshotParameters > ( param ) ; return org.powermock.api.mockito.PowerMockito.spy ( concrete ) ; }

Target:
protected void initStoragePoolId ( ) { }
Source:
public void testUpdate ( ) { existingAsyncTask.setstatus ( AsyncTaskStatusEnum.aborting ) ; existingAsyncTask.setresult ( AsyncTaskResultEnum.failure ) ; existingAsyncTask.setActionType ( VdcActionType.AddDisk ) ; dao.update ( existingAsyncTask ) ; org.ovirt.engine.core.common.businessentities.AsyncTask result = dao.get ( existingAsyncTask.getTaskId ( ) ) ; org.junit.Assert.assertEquals ( existingAsyncTask , result ) ; }

Target:
public void testUpdate ( ) { existingAsyncTask.setstatus ( AsyncTaskStatusEnum.aborting ) ; existingAsyncTask.setresult ( AsyncTaskResultEnum.failure ) ; existingAsyncTask.setActionType ( ActionType.AddDisk ) ; dao.update ( existingAsyncTask ) ; org.ovirt.engine.core.common.businessentities.AsyncTask result = dao.get ( existingAsyncTask.getTaskId ( ) ) ; org.junit.Assert.assertEquals ( existingAsyncTask , result ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.NetworkInterface > VdsNetworkInterfaceListToBase ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.NetworkInterface > networkInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.NetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface item : items ) { networkInterfaces.add ( item ) ; } return networkInterfaces ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > VdsNetworkInterfaceListToBase ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > networkInterfaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface item : items ) { networkInterfaces.add ( item ) ; } return networkInterfaces ; }
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.GetAllDisksByVmIdParameters ( vmId ) , aQuery ) ; }

Target:
public static void getDiskList ( 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.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.IpConfiguration createIpConfiguration ( ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; address.setAddress ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.IP_ADDRESS ) ; address.setNetmask ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.NETMASK ) ; address.setGateway ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.GATEWAY ) ; address.setBootProtocol ( NetworkBootProtocol.STATIC_IP ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration result = new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ; result.setIPv4Addresses ( java.util.Collections.singletonList ( address ) ) ; return result ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.IPv4Address createIpv4Address ( ) { org.ovirt.engine.core.common.businessentities.network.IPv4Address address = new org.ovirt.engine.core.common.businessentities.network.IPv4Address ( ) ; address.setAddress ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.IPV4_ADDRESS ) ; address.setNetmask ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.IPV4_NETMASK ) ; address.setGateway ( org.ovirt.engine.core.vdsbroker.vdsbroker.HostNetworkAttachmentsPersisterTest.IPV4_GATEWAY ) ; address.setBootProtocol ( NetworkBootProtocol.STATIC_IP ) ; return address ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName , org.ovirt.engine.core.compat.Guid networkId , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNicId ( nicId ) ; networkAttachment.setNicName ( nicName ) ; networkAttachment.setNetworkId ( networkId ) ; networkAttachment.setNetworkName ( networkName ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = org.ovirt.engine.core.utils.NetworkUtils.createDefaultIpConfiguration ( ) ; networkAttachment.setIpConfiguration ( ipConfiguration ) ; return networkAttachment ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.NetworkAttachment createNetworkAttachment ( org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName , org.ovirt.engine.core.compat.Guid networkId , java.lang.String networkName ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNicId ( nicId ) ; networkAttachment.setNicName ( nicName ) ; networkAttachment.setNetworkId ( networkId ) ; networkAttachment.setNetworkName ( networkName ) ; org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = org.ovirt.engine.core.common.utils.NetworkCommonUtils.createDefaultIpConfiguration ( ) ; networkAttachment.setIpConfiguration ( ipConfiguration ) ; return networkAttachment ; }
Source:
private void verifyCertificate ( org.ovirt.engine.api.model.VM model ) { assertNotNull ( model.getDisplay ( ) ) ; assertNotNull ( model.getDisplay ( ) . getCertificate ( ) ) ; assertEquals ( model.getDisplay ( ) . getCertificate ( ) . getSubject ( ) , org.ovirt.engine.api.restapi.resource.BackendVmResourceTest.CERTIFICATE ) ; }

Target:
private void setUpGetBallooningExpectations ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.IsBalloonEnabled , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true ) ; }
Source:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap widgetConfiguration = super . createWidgetConfiguration ( ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . update ( templateVersionNameEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; updateOrAddToWidgetConfiguration ( widgetConfiguration , detachableWidgets ( ) , UpdateToDetachable.INSTANCE ) ; updateOrAddToWidgetConfiguration ( widgetConfiguration , adminOnlyWidgets ( ) , UpdateToAdminOnly.INSTANCE ) ; return widgetConfiguration ; }

Target:
protected org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap createWidgetConfiguration ( ) { org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfigMap widgetConfiguration = super . createWidgetConfiguration ( ) . putAll ( poolSpecificFields ( ) , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) . putOne ( baseTemplateEditor , org.ovirt.engine.ui.common.widget.uicommon.popup.vm.PopupWidgetConfig.hiddenField ( ) ) ; updateOrAddToWidgetConfiguration ( widgetConfiguration , detachableWidgets ( ) , UpdateToDetachable.INSTANCE ) ; updateOrAddToWidgetConfiguration ( widgetConfiguration , adminOnlyWidgets ( ) , UpdateToAdminOnly.INSTANCE ) ; return widgetConfiguration ; }
Source:
public void validateIsoPrefixWhenNoActiveIso ( ) throws java.lang.Exception { setIsoPrefixVDSMethod ( org.ovirt.engine.core.bll.RunVmCommandTest.INACTIVE_ISO_PREFIX ) ; java.lang.String initrd = "initrd" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ) + initrd ) , null ) ; org.junit.Assert.assertEquals ( vm.getinitrd_url ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.INACTIVE_ISO_PREFIX ) + "/" ) + initrd ) ) ; }

Target:
public void validateIsoPrefixWhenNoActiveIso ( ) throws java.lang.Exception { setIsoPrefixVDSMethod ( org.ovirt.engine.core.bll.RunVmCommandTest.INACTIVE_ISO_PREFIX ) ; java.lang.String initrd = "initrd" ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ) + initrd ) , null ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , ( ( ( org.ovirt.engine.core.bll.RunVmCommandTest.INACTIVE_ISO_PREFIX ) + "/" ) + initrd ) ) ; }
Source:
public void setSelectedItems ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > items ) { getModel ( ) . setSelectedItem ( ( ( items.size ( ) ) > 0 ? items.get ( 0 ) : null ) ) ; }

Target:
public void setSelectedItems ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemModel > items ) { getModel ( ) . setSelectedItem ( ( ( items.size ( ) ) > 0 ? items.get ( 0 ) : null ) ) ; if ( ( items.size ( ) ) > 0 ) { org.ovirt.engine.ui.webadmin.uicommon.model.SystemTreeSelectionChangeEvent.fire ( this , items.get ( 0 ) ) ; } }