auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getSession ( java.lang.String masterVolumeName , java.util.Map < java.lang.String , java.lang.Object > innerMap ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession geoRepSession = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession ( ) ; java.lang.String sessionKey = ( ( java.lang.String ) ( innerMap.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc.SESSION_KEY ) ) ) ; java.lang.String [ ] sessSplit = sessionKey.split ( "([://]+)" ) ; java.lang.String slaveNode = sessSplit [ ( ( sessSplit.length ) - 2 ) ] ; java.lang.String slaveVolume = ( ( java.lang.String ) ( innerMap.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc.REMOTE_VOL_NAME ) ) ) ; geoRepSession.setSlaveHostName ( slaveNode ) ; geoRepSession.setSlaveVolumeName ( slaveVolume ) ; geoRepSession.setSessionKey ( sessionKey ) ; geoRepSession.setMasterVolumeName ( masterVolumeName ) ; return geoRepSession ; }

Target:
protected org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession getSession ( java.lang.String masterVolumeName , java.util.Map < java.lang.String , java.lang.Object > innerMap ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession geoRepSession = new org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession ( ) ; java.lang.String sessionKey = ( ( java.lang.String ) ( innerMap.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc.SESSION_KEY ) ) ) ; java.lang.String [ ] sessSplit = sessionKey.split ( "([://]+)" ) ; java.lang.String slaveNode = sessSplit [ ( ( sessSplit.length ) - 2 ) ] ; if ( slaveNode.contains ( "@" ) ) { java.lang.String [ ] hostComponents = slaveNode.split ( "@" ) ; slaveNode = hostComponents [ ( ( hostComponents.length ) - 1 ) ] ; } java.lang.String slaveVolume = ( ( java.lang.String ) ( innerMap.get ( org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc.REMOTE_VOL_NAME ) ) ) ; geoRepSession.setSlaveHostName ( slaveNode ) ; geoRepSession.setSlaveVolumeName ( slaveVolume ) ; geoRepSession.setSessionKey ( sessionKey ) ; geoRepSession.setMasterVolumeName ( masterVolumeName ) ; return geoRepSession ; }
Source:
public void prepareFromRequest ( com.gwtplatform.mvp.shared.proxy.PlaceRequest request ) { super . prepareFromRequest ( request ) ; if ( hasMainTabSelection ( ) ) { org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.getProxy ( ) . manualReveal ( this ) ; } else { org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.getProxy ( ) . manualRevealFailed ( ) ; placeManager.revealPlace ( getMainTabRequest ( ) ) ; } }

Target:
public void prepareFromRequest ( com.gwtplatform.mvp.shared.proxy.PlaceRequest request ) { super . prepareFromRequest ( request ) ; if ( selectedMainItems.hasSelection ( ) ) { org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.getProxy ( ) . manualReveal ( this ) ; } else { org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.getProxy ( ) . manualRevealFailed ( ) ; placeManager.revealPlace ( getMainTabRequest ( ) ) ; } }
Source:
private void internalEndWithFailure ( ) { log.errorFormat ( "Ending command with failure: {0}" , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; } else { endWithFailure ( ) ; } }

Target:
private void internalEndWithFailure ( ) { log.errorFormat ( "Ending command with failure: {0}" , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { getCurrentTaskHandler ( ) . endWithFailure ( ) ; revertPreviousHandlers ( ) ; startPollingAsyncTasks ( ) ; } else { endWithFailure ( ) ; } }
Source:
public javax.ws.rs.core.Response migrate ( org.ovirt.engine.api.model.Action action ) { boolean forceMigration = ( action.isSetForce ( ) ) ? action.isForce ( ) : false ; if ( ! ( action.isSetHost ( ) ) ) { return doAction ( VdcActionType.MigrateVm , new org.ovirt.engine.core.common.action.MigrateVmParameters ( forceMigration , guid , getTargetClusterId ( action ) ) , action ) ; } else { return doAction ( VdcActionType.MigrateVmToServer , new org.ovirt.engine.core.common.action.MigrateVmToServerParameters ( forceMigration , guid , getHostId ( action ) , getTargetClusterId ( action ) ) , action ) ; } }

Target:
public javax.ws.rs.core.Response migrate ( org.ovirt.engine.api.model.Action action ) { boolean forceMigration = ( action.isSetForce ( ) ) ? action.isForce ( ) : false ; if ( ! ( action.isSetHost ( ) ) ) { return doAction ( ActionType.MigrateVm , new org.ovirt.engine.core.common.action.MigrateVmParameters ( forceMigration , guid , getTargetClusterId ( action ) ) , action ) ; } else { return doAction ( ActionType.MigrateVmToServer , new org.ovirt.engine.core.common.action.MigrateVmToServerParameters ( forceMigration , guid , getHostId ( action ) , getTargetClusterId ( action ) ) , action ) ; } }
Source:
public void getHostById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getMaxNumOfThreadsPerCpu ( 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.MaxNumOfThreadsPerCpu ) ; tempVar.setVersion ( version ) ; getConfigFromCache ( tempVar , aQuery ) ; }
Source:
protected boolean validateAllDiskImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images = getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getDiskImage ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.validator.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.DiskImagesValidator ( images ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) && ( validate ( diskImagesValidator.diskImagesNotIllegal ( ) ) ) ; }

Target:
protected boolean validateAllDiskImages ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images = getDiskImageDao ( ) . getAllSnapshotsForImageGroup ( org.ovirt.engine.core.bll.RemoveDiskSnapshotsCommand.getDiskImage ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator diskImagesValidator = new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( images ) ; return ( validate ( diskImagesValidator.diskImagesNotLocked ( ) ) ) && ( validate ( diskImagesValidator.diskImagesNotIllegal ( ) ) ) ; }
Source:
public void convertValidPropertiesToMap ( ) { org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils utils = new org.ovirt.engine.core.utils.customprop.CustomPropertiesUtils ( ) ; java.lang.String propStr = "speed=1024;duplex=half;debug=" ; java.util.Map < java.lang.String , java.lang.String > map = utils.convertProperties ( propStr ) ; org.ovirt.engine.core.utils.customprop.PropertiesUtilsTestHelper.validatePropertyMap ( map , 3 ) ; org.ovirt.engine.core.utils.customprop.PropertiesUtilsTestHelper.validatePropertyValue ( map , "speed" , "1024" ) ; org.ovirt.engine.core.utils.customprop.PropertiesUtilsTestHelper.validatePropertyValue ( map , "duplex" , "half" ) ; org.ovirt.engine.core.utils.customprop.PropertiesUtilsTestHelper.validatePropertyValue ( map , "debug" , "" ) ; }

Target:
public void convertValidPropertiesToMap ( ) { org.ovirt.engine.core.common.utils.customprop.CustomPropertiesUtils utils = new org.ovirt.engine.core.common.utils.customprop.CustomPropertiesUtils ( ) ; java.lang.String propStr = "speed=1024;duplex=half;debug=" ; java.util.Map < java.lang.String , java.lang.String > map = utils.convertProperties ( propStr ) ; org.ovirt.engine.core.common.utils.customprop.PropertiesUtilsTestHelper.validatePropertyMap ( map , 3 ) ; org.ovirt.engine.core.common.utils.customprop.PropertiesUtilsTestHelper.validatePropertyValue ( map , "speed" , "1024" ) ; org.ovirt.engine.core.common.utils.customprop.PropertiesUtilsTestHelper.validatePropertyValue ( map , "duplex" , "half" ) ; org.ovirt.engine.core.common.utils.customprop.PropertiesUtilsTestHelper.validatePropertyValue ( map , "debug" , "" ) ; }
Source:
public void networkExists ( ) { org.mockito.Mockito.when ( networkDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( network ) ; org.junit.Assert.assertThat ( validator.networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void networkQosExists ( ) { org.mockito.Mockito.when ( vnicProfile.getNetworkQosId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkQosDao.get ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ) . thenReturn ( networkQos ) ; org.hamcrest.MatcherAssert.assertThat ( validator.networkQosExistsOrNull ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testAddTag ( ) { org.ovirt.engine.core.common.businessentities.tags tag = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.tags tagFromDirector = tagsDirector.GetTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNull ( tagFromDirector ) ; tagsDirector.AddTag ( tag ) ; tagFromDirector = tagsDirector.GetTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNotNull ( tagFromDirector ) ; org.junit.Assert.assertEquals ( tag , tagFromDirector ) ; }

Target:
public void testAddTag ( ) { org.ovirt.engine.core.common.businessentities.Tags tag = createTag ( "tag1" , "desc1" ) ; org.ovirt.engine.core.common.businessentities.Tags tagFromDirector = tagsDirector.GetTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNull ( tagFromDirector ) ; tagsDirector.AddTag ( tag ) ; tagFromDirector = tagsDirector.GetTagById ( tag.gettag_id ( ) ) ; org.junit.Assert.assertNotNull ( tagFromDirector ) ; org.junit.Assert.assertEquals ( tag , tagFromDirector ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > getAllAsyncTasksFromDb ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.AsyncTasks > asyncTasks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAsyncTaskDao ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.AsyncTasks asyncTask : asyncTasks ) { copyFromCommandEntity ( asyncTask , commandsCache.get ( asyncTask.getCommandId ( ) ) ) ; } return asyncTasks ; }

Target:
public void persistCommand ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.compat.Guid rootCommandId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.core.compat.CommandStatus status , boolean enableCallBack ) { commandsCache.put ( commandId , rootCommandId , actionType , params , status , enableCallBack ) ; }
Source:
public static void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmTemlateWithSameNameExistParameters ( name ) , aQuery ) ; }

Target:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
public static void GetDataCenterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > GetLinuxOsTypes ( ) { if ( ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ) != null ) { return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmOsType > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmOsType [ ] { org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL3x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL4x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL5x64 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6 , org.ovirt.engine.core.common.businessentities.VmOsType.RHEL6x64 } ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.linuxOsTypes ; }
Source:
public void setIsAutoSelect ( boolean value ) { if ( ( isAutoSelect ) != value ) { isAutoSelect = value ; getHosts ( ) . setIsChangable ( ( ! ( isAutoSelect ) ) ) ; OnPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsAutoSelect" ) ) ; setIsSameVdsMessageVisible ( ( ! value ) ) ; privateSelectHostAutomatically_IsSelected.setEntity ( value ) ; privateSelectDestinationHost_IsSelected.setEntity ( ( ! value ) ) ; privateHosts.setIsChangable ( ( ! value ) ) ; } }

Target:
public void setIsAutoSelect ( boolean value ) { if ( ( isAutoSelect ) != value ) { isAutoSelect = value ; getHosts ( ) . setIsChangable ( ( ! ( isAutoSelect ) ) ) ; onPropertyChanged ( new org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ( "IsAutoSelect" ) ) ; setIsSameVdsMessageVisible ( ( ! value ) ) ; privateSelectHostAutomatically_IsSelected.setEntity ( value ) ; privateSelectDestinationHost_IsSelected.setEntity ( ( ! value ) ) ; privateHosts.setIsChangable ( ( ! value ) ) ; } }
Source:
public int hashCode ( ) { int result = 17 ; result = ( 31 * result ) + ( ( vdsId ) == null ? 0 : vdsId.hashCode ( ) ) ; result = ( 31 * result ) + ( ( status ) == null ? 0 : status.hashCode ( ) ) ; result = ( 31 * result ) + ( ( address ) == null ? 0 : address.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( vdsId , status , address ) ; }
Source:
public void AttachTask ( org.ovirt.engine.core.bll.EntityAsyncTask asyncTask ) { synchronized ( _listTasks ) { if ( ! ( _listTasks.containsKey ( asyncTask.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks.log.infoFormat ( "EntityMultiAsyncTasks::AttachTask: Attaching task '{0}' to entity '{1}'." , asyncTask.getVdsmTaskId ( ) , getContainerId ( ) ) ; _listTasks.put ( asyncTask.getVdsmTaskId ( ) , asyncTask ) ; } } }

Target:
public void AttachTask ( org.ovirt.engine.core.bll.EntityAsyncTask asyncTask ) { synchronized ( _listTasks ) { if ( ! ( _listTasks.containsKey ( asyncTask.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks.log.infoFormat ( "EntityMultiAsyncTasks::AttachTask: Attaching task '{0}' to command '{1}'." , asyncTask.getVdsmTaskId ( ) , getCommandId ( ) ) ; _listTasks.put ( asyncTask.getVdsmTaskId ( ) , asyncTask ) ; } } }
Source:
public void setdisplay_ip ( java.lang.String value ) { if ( ( host.getConsoleAddress ( ) ) != null ) { super . setdisplay_ip ( host.getConsoleAddress ( ) ) ; } else if ( value.startsWith ( "0" ) ) { super . setdisplay_ip ( host.gethost_name ( ) ) ; } else { super . setdisplay_ip ( value ) ; } }

Target:
public void setdisplay_ip ( java.lang.String value ) { if ( ( host.getConsoleAddress ( ) ) != null ) { super . setdisplay_ip ( host.getConsoleAddress ( ) ) ; } else if ( value.startsWith ( "0" ) ) { super . setdisplay_ip ( host.getHostName ( ) ) ; } else { super . setdisplay_ip ( value ) ; } }
Source:
private java.lang.String getSearchPattern ( ) { java.lang.String constraint = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( getUriInfo ( ) , org.ovirt.engine.core.aaa.DirectoryUser.class , false ) ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( 128 ) ; sb.append ( java.text.MessageFormat.format ( org.ovirt.engine.api.restapi.resource.aaa.BackendDomainUsersResource.SEARCH_TEMPLATE , parent.getDirectory ( ) . getName ( ) ) ) ; sb.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( constraint ) ? "allnames=*" : constraint ) ) ; return sb.toString ( ) ; }

Target:
private java.lang.String getSearchPattern ( ) { java.lang.String constraint = org.ovirt.engine.api.common.util.QueryHelper.getConstraint ( getUriInfo ( ) , org.ovirt.engine.core.aaa.DirectoryUser.class , false ) ; java.lang.StringBuilder sb = new java.lang.StringBuilder ( 128 ) ; sb.append ( java.text.MessageFormat.format ( ResourceConstants.AAA_PRINCIPALS_SEARCH_TEMPLATE , parent.getDirectory ( ) . getName ( ) , "" ) ) ; sb.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( constraint ) ? "allnames=*" : constraint ) ) ; return sb.toString ( ) ; }
Source:
void bindInfrastructure ( ) { bindCommonInfrastructure ( ) ; bind ( com.gwtplatform.mvp.client.proxy.PlaceManager.class ) . to ( org.ovirt.engine.ui.webadmin.place.WebAdminPlaceManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.webadmin.system.ApplicationInit.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.system.InternalConfiguration.class ) . asEagerSingleton ( ) ; }

Target:
void bindInfrastructure ( ) { bindCommonInfrastructure ( ) ; bind ( com.gwtplatform.mvp.client.proxy.PlaceManager.class ) . to ( org.ovirt.engine.ui.webadmin.place.WebAdminPlaceManager.class ) . in ( com.google.inject.Singleton.class ) ; bind ( org.ovirt.engine.ui.webadmin.system.ApplicationInit.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.system.InternalConfiguration.class ) . asEagerSingleton ( ) ; bind ( org.ovirt.engine.ui.webadmin.system.PostMessageDispatcher.class ) . asEagerSingleton ( ) ; }
Source:
private void reportMtuDifferences ( java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > ifaceNetworks ) { java.util.List < java.lang.String > mtuDiffNetworks = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network net : ifaceNetworks ) { mtuDiffNetworks.add ( java.lang.String.format ( "%s(%s)" , net.getName ( ) , ( ( net.getMtu ( ) ) == 0 ? "default" : java.lang.String.valueOf ( net.getMtu ( ) ) ) ) ) ; } addViolation ( VdcBllMessages.NETWORK_MTU_DIFFERENCES , java.lang.String.format ( "[%s]" , org.apache.commons.lang.StringUtils.join ( mtuDiffNetworks , ", " ) ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { return validateCoherentNicIdentification ( attachment.getId ( ) , attachment.getNicId ( ) , attachment.getNicName ( ) , VdcBllMessages.NETWORK_ATTACHMENT_REFERENCES_NICS_INCOHERENTLY ) ; }
Source:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } upServer = getUpServer ( ) ; if ( ( upServer ) == null ) { addValidationMessageVariable ( "clusterName" , org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroup ( ) . getName ( ) ) ; addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND ) ; return false ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } upServer = getUpServer ( ) ; if ( ( upServer ) == null ) { addValidationMessageVariable ( "clusterName" , org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getCluster ( ) . getName ( ) ) ; addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND ) ; return false ; } return true ; }
Source:
protected boolean checkStorageDomainNameLengthValid ( ) { boolean result = true ; if ( ( org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBase.getStorageDomain ( ) . getStorageName ( ) . length ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.StorageDomainNameSizeLimit ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ; result = false ; } return result ; }

Target:
protected boolean checkStorageDomainNameLengthValid ( ) { boolean result = true ; if ( ( org.apache.commons.lang.StringUtils.isNotEmpty ( org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBase.getStorageDomain ( ) . getStorageName ( ) ) ) && ( ( org.ovirt.engine.core.bll.storage.domain.StorageDomainCommandBase.getStorageDomain ( ) . getStorageName ( ) . length ( ) ) > ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.StorageDomainNameSizeLimit ) ) ) ) { addValidationMessage ( EngineMessage.ACTION_TYPE_FAILED_NAME_LENGTH_IS_TOO_LONG ) ; result = false ; } return result ; }
Source:
protected void removeVnicProfiles ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > profiles = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVnicProfileDao ( ) . getAllForNetwork ( getNetwork ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile : profiles ) { org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVnicProfileDao ( ) . remove ( vnicProfile.getId ( ) ) ; } }

Target:
protected void removeVnicProfiles ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > profiles = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVnicProfileDao ( ) . getAllForNetwork ( getNetwork ( ) . getId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile vnicProfile : profiles ) { org.ovirt.engine.core.bll.network.dc.NetworkCommon.getCompensationContext ( ) . snapshotEntity ( vnicProfile ) ; org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVnicProfileDao ( ) . remove ( vnicProfile.getId ( ) ) ; } }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > pmOptions = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; getPmPort ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmPortKey ) ) ; getPmSlot ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSlotKey ) ) ; getPmSecure ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSecureKey ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > pmOptions = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; if ( pmOptions != null ) { getPmSecondaryPort ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmPortKey ) ) ; getPmSecondarySlot ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSlotKey ) ) ; getPmSecondarySecure ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSecureKey ) ) ; } }
Source:
private boolean validateCrossAttachments ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > expectedAttachments = org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getDbFacade ( ) . getNetworkAttachmentDao ( ) . getAllForHost ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getVdsId ( ) ) ; expectedAttachments.add ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getParameters ( ) . getNetworkAttachment ( ) ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator crossAttachmentsValidator = new org.ovirt.engine.core.bll.validator.NetworkAttachmentsValidator ( expectedAttachments , org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getNetworkDAO ( ) . getAllForCluster ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getVdsGroupId ( ) ) ) ) ; return validate ( crossAttachmentsValidator.validateNetworkExclusiveOnNics ( ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > getHostInterfaces ( ) { if ( ( hostNics ) == null ) { hostNics = interfaceDao.getAllInterfacesForVds ( org.ovirt.engine.core.bll.network.host.AddNetworkAttachmentCommand.getVdsId ( ) ) ; } return hostNics ; }
Source:
public void testCronExpressionForDaily ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageSyncSchedule schedule = new org.ovirt.engine.core.common.businessentities.gluster.StorageSyncSchedule ( ) ; schedule.setFrequency ( Frequency.DAILY ) ; schedule.setHour ( 12 ) ; schedule.setMins ( 50 ) ; java.lang.String expectedExpression = "0 50 12 * * ? *" ; org.junit.Assert.assertEquals ( expectedExpression , schedule.toCronExpression ( ) ) ; }

Target:
public void testCronExpressionForDaily ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageSyncSchedule schedule = new org.ovirt.engine.core.common.businessentities.gluster.StorageSyncSchedule ( ) ; schedule.setFrequency ( Frequency.DAILY ) ; schedule.setHour ( 12 ) ; schedule.setMins ( 50 ) ; java.lang.String expectedExpression = "0 50 12 * * ? *" ; org.junit.jupiter.api.Assertions.assertEquals ( expectedExpression , schedule.toCronExpression ( ) ) ; }
Source:
private org.ovirt.engine.core.common.asynctasks.AsyncTaskType internalGetTaskType ( ) { if ( hasTaskHandlers ( ) ) { if ( ( getParameters ( ) . getExecutionReason ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionParametersBase.CommandExecutionReason.REGULAR_FLOW ) ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; } return getCurrentTaskHandler ( ) . getRevertTaskType ( ) ; } return getTaskType ( ) ; }

Target:
public org.ovirt.engine.core.bll.context.CommandContext cloneContextAndDetachFromParent ( ) { return cloneContext ( ) . withoutCompensationContext ( ) . withoutExecutionContext ( ) . withoutLock ( ) ; }
Source:
private void writeService ( org.ovirt.api.metamodel.concepts.Service service ) { writeStartElement ( "service" ) ; writeCommon ( service ) ; service.methods ( ) . forEach ( this :: writeServiceMethod ) ; service.locators ( ) . forEach ( this :: writeServiceLocator ) ; writeEndElement ( ) ; }

Target:
private void writeService ( org.ovirt.api.metamodel.concepts.Service service ) { writer.writeStartElement ( "service" ) ; writeCommon ( service ) ; service.methods ( ) . forEach ( this :: writeServiceMethod ) ; service.locators ( ) . forEach ( this :: writeServiceLocator ) ; writer.writeEndElement ( ) ; }
Source:
public void getVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
private static void helpTestLog ( org.ovirt.engine.core.utils.log.Logged.LogLevel logLevel , org.ovirt.engine.core.utils.log.LoggedUtilsTest.LogSetup logSetup ) { org.ovirt.engine.core.utils.log.Log log = org.mockito.Mockito.mock ( org.ovirt.engine.core.utils.log.Log.class ) ; java.lang.String message = "{0}" ; java.lang.Object args = new java.lang.Object ( ) ; logSetup.setup ( log , message , args ) ; org.ovirt.engine.core.utils.log.LoggedUtils.log ( log , logLevel , message , args ) ; logSetup.verifyCall ( log , message , args ) ; }

Target:
private static void helpTestLog ( org.ovirt.engine.core.utils.log.Logged.LogLevel logLevel , org.ovirt.engine.core.utils.log.LoggedUtilsTest.LogSetup logSetup ) { org.slf4j.Logger log = org.mockito.Mockito.mock ( org.slf4j.Logger.class ) ; java.lang.String message = "{}" ; java.lang.Object s = "arg1" ; logSetup.setup ( log , message , s ) ; org.ovirt.engine.core.utils.log.LoggedUtils.log ( log , logLevel , message , s ) ; logSetup.verifyCall ( log , message , s ) ; }
Source:
public void search ( ) { if ( ( getSearchPageSize ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.UnknownInteger ) ) { asyncCallback.RequestSearch ( ) ; } else { stopRefresh ( ) ; if ( getIsQueryFirstTime ( ) ) { setSelectedItem ( null ) ; setSelectedItems ( null ) ; } if ( ( getIsTimerDisabled ( ) ) == false ) { setIsQueryFirstTime ( true ) ; syncSearch ( ) ; setIsQueryFirstTime ( false ) ; getTimer ( ) . start ( ) ; } else { syncSearch ( ) ; } } }

Target:
public void search ( ) { if ( ( getSearchPageSize ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.UnknownInteger ) ) { asyncCallback.requestSearch ( ) ; } else { stopRefresh ( ) ; if ( getIsQueryFirstTime ( ) ) { setSelectedItem ( null ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.setSelectedItems ( null ) ; } if ( ( getIsTimerDisabled ( ) ) == false ) { setIsQueryFirstTime ( true ) ; syncSearch ( ) ; setIsQueryFirstTime ( false ) ; getTimer ( ) . start ( ) ; } else { syncSearch ( ) ; } } }
Source:
public org.ovirt.engine.core.common.businessentities.RepoFileMetaData mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.RepoFileMetaData entity = new org.ovirt.engine.core.common.businessentities.RepoFileMetaData ( ) ; entity.setRepoDomainId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "storage_domain_id" ) ) ) ; entity.setLastRefreshed ( rs.getLong ( "last_refreshed" ) ) ; entity.setFileType ( org.ovirt.engine.core.common.businessentities.FileTypeExtension.forValue ( rs.getInt ( "file_type" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.RepoFileMetaData mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.RepoFileMetaData entity = new org.ovirt.engine.core.common.businessentities.RepoFileMetaData ( ) ; entity.setRepoDomainId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "storage_domain_id" ) ) ) ; entity.setLastRefreshed ( rs.getLong ( "last_refreshed" ) ) ; entity.setFileType ( org.ovirt.engine.core.common.businessentities.ImageType.forValue ( rs.getInt ( "file_type" ) ) ) ; return entity ; }
Source:
private boolean isVmInterfacesConfigured ( ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface nic : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getInterfaces ( ) ) { if ( ( nic.getNetworkName ( ) ) == null ) { if ( ! ( org.ovirt.engine.core.bll.validator.FeatureSupported.networkLinking ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED ) ; return false ; } else { return true ; } } } return true ; }

Target:
private boolean isVmInterfacesConfigured ( ) { for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface nic : org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getInterfaces ( ) ) { if ( ( nic.getNetworkName ( ) ) == null ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.networkLinking ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_NETWORK_NOT_CONFIGURED ) ; return false ; } else { return true ; } } } return true ; }
Source:
private void fetchCpuProfiles ( org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCpuProfilesByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.profiles.CpuProfile > cpuProfiles = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getCpuProfiles ( ) . setItems ( cpuProfiles ) ; } } ) ) ; }

Target:
private void fetchCpuProfiles ( org.ovirt.engine.core.compat.Guid clusterId ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetCpuProfilesByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , new org.ovirt.engine.ui.uicommonweb.models.vms.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.profiles.CpuProfile > cpuProfiles = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; getCpuProfiles ( ) . setItems ( cpuProfiles ) ; } } ) ) ; }
Source:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public static void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
public void testStaticBarToFooClassMapper ( ) { org.ovirt.engine.api.restapi.types.Mapper < org.ovirt.engine.api.restapi.test.mappers.impl.BarImpl , org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl > mapper = mappingLocator.getMapper ( org.ovirt.engine.api.restapi.test.mappers.impl.BarImpl.class , org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl.class ) ; org.junit.Assert.assertNotNull ( mapper ) ; org.ovirt.engine.api.restapi.test.mappers.api.IFoo foo = mapper.map ( new org.ovirt.engine.api.restapi.test.mappers.impl.BarImpl ( "bar" ) , null ) ; org.junit.Assert.assertEquals ( "bar" , foo.get ( ) ) ; }

Target:
public void testStaticBarToFooClassMapper ( ) { org.ovirt.engine.api.restapi.types.Mapper < org.ovirt.engine.api.restapi.test.mappers.impl.BarImpl , org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl > mapper = mappingLocator.getMapper ( org.ovirt.engine.api.restapi.test.mappers.impl.BarImpl.class , org.ovirt.engine.api.restapi.test.mappers.impl.FooImpl.class ) ; org.junit.jupiter.api.Assertions.assertNotNull ( mapper ) ; org.ovirt.engine.api.restapi.test.mappers.api.IFoo foo = mapper.map ( new org.ovirt.engine.api.restapi.test.mappers.impl.BarImpl ( "bar" ) , null ) ; org.junit.jupiter.api.Assertions.assertEquals ( "bar" , foo.get ( ) ) ; }
Source:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.HostNic > 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" ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.HostNic > nics = getCollection ( ) ; org.junit.Assert.assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( ( ( java.lang.Boolean ) ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ) ) ; param.setConsoleEnabled ( ( ( java.lang.Boolean ) ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallbacks.NetworkUpdateFrontendAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( ( ( java.lang.Boolean ) ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ) ) ; param.setConsoleEnabled ( ( ( java.lang.Boolean ) ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.InstanceType lookupInstanceType ( org.ovirt.engine.core.compat.Guid id ) { return getEntity ( org.ovirt.engine.core.common.businessentities.InstanceType.class , VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( id ) , "GetVmTemplate" ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmTemplate lookupTemplate ( org.ovirt.engine.api.model.Template template , org.ovirt.engine.core.compat.Guid datacenterId ) { if ( template.isSetId ( ) ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( asGuid ( template.getId ( ) ) ) , "GetVmTemplate" ) ; } else if ( template.isSetName ( ) ) { org.ovirt.engine.core.common.queries.GetVmTemplateParameters params = new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( template.getName ( ) ) ; params.setDataCenterId ( datacenterId ) ; return getEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , VdcQueryType.GetVmTemplate , params , "GetVmTemplate" ) ; } return null ; }
Source:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; setupCpu ( ) ; canDoActionFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }

Target:
public void versionDecreaseLowerVersionThanDC ( ) { createCommandWithOlderVersion ( true , false ) ; org.ovirt.engine.core.dao.StoragePoolDao storagePoolDao2 = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDao.class ) ; org.mockito.Mockito.when ( storagePoolDao2.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.createStoragePoolLocalFSOldVersion ( ) ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( cmd ) . getStoragePoolDao ( ) ; org.mockito.Mockito.doReturn ( storagePoolDao2 ) . when ( dbFacadeMock ) . getStoragePoolDao ( ) ; setupCpu ( ) ; canDoActionFailedWithReason ( EngineMessage.ACTION_TYPE_FAILED_CANNOT_DECREASE_COMPATIBILITY_VERSION_UNDER_DC ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { this . model = model ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel defaultConsole = model.getModel ( ) . getDefaultConsoleModel ( ) ; editCheckBoxes ( defaultConsole , ctrlAltDel , enableUsbAutoshare , openInFullScreen , enableSpiceProxy , wanEnabled , disableSmartcard ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel additionalConsole = model.getModel ( ) . getAdditionalConsoleModel ( ) ; editCheckBoxes ( additionalConsole , useLocalDrives ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { this . model = model ; editCheckBoxes ( model.getVmConsoles ( ) . getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel.class ) , ctrlAltDel , enableUsbAutoshare , openInFullScreen , enableSpiceProxy , wanEnabled , disableSmartcard ) ; editCheckBoxes ( model.getVmConsoles ( ) . getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.RdpConsoleModel.class ) , useLocalDrives ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > generateDisksList ( int size ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < size ; ++ i ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; disksList.add ( diskImage ) ; } return disksList ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; diskImage.setSizeInGigabytes ( size ) ; diskImage.setActualSize ( size ) ; diskImage.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; diskImage.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return diskImage ; }
Source:
protected void updateMemoryBalloon ( ) { if ( ( getModel ( ) . getSelectedCluster ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; boolean hasMemoryBalloon = ( cluster.getcompatibility_version ( ) . compareTo ( VmListModel.BALLOON_DEVICE_MIN_VERSION ) ) >= 0 ; getModel ( ) . getMemoryBalloonDeviceEnabled ( ) . setIsAvailable ( hasMemoryBalloon ) ; } }

Target:
protected void baseTemplateSelectedItemChanged ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate baseTemplate = getModel ( ) . getBaseTemplate ( ) . getSelectedItem ( ) ; if ( baseTemplate != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > subVersions = baseTemplateToSubTemplates.get ( baseTemplate.getId ( ) ) ; getModel ( ) . getTemplate ( ) . setItems ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( subVersions ) ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( subVersions.get ( 1 ) ) ; } }