auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean isImagesExists ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : getDisksList ( ) ) { if ( ( diskImage.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { return true ; } } return false ; }

Target:
public org.ovirt.engine.core.compat.Guid getStorageDomainIdForVmMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > memoryDisksList ) { if ( ( cachedStorageDomainId.equals ( Guid.Empty ) ) && ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain = org.ovirt.engine.core.bll.memory.MemoryStorageHandler.getInstance ( ) . findStorageDomainForMemory ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . getStoragePoolId ( ) , memoryDisksList , getDisksList ( ) ) ; if ( storageDomain != null ) { cachedStorageDomainId = storageDomain.getId ( ) ; } } return cachedStorageDomainId ; }
Source:
public void testCanDoActionVmUpHostNotCapable ( ) { prepareForVmValidatorTests ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HOST_CANNOT_LIVE_MERGE ) ) . when ( vmValidator ) . vmHostCanLiveMerge ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_HOST_CANNOT_LIVE_MERGE ) ; }

Target:
public void testValidateVmUpHostNotCapable ( ) { prepareForVmValidatorTests ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HOST_CANNOT_LIVE_MERGE ) ) . when ( vmValidator ) . vmHostCanLiveMerge ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.Up ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_HOST_CANNOT_LIVE_MERGE ) ; }
Source:
private void updateSnapshotDisks ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = org.ovirt.engine.ui.uicommonweb.Linq.toList ( org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.storage.DiskImage > filterNonSnapableDisks ( disks ) ) ; java.util.Collections.sort ( diskImages , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; getSnapshotDisks ( ) . setItems ( diskImages ) ; }

Target:
private void updateSnapshotDisks ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > diskImages = org.ovirt.engine.ui.uicommonweb.Linq.cast ( org.ovirt.engine.ui.uicommonweb.Linq.filterNonSnapableDisks ( disks ) ) ; java.util.Collections.sort ( diskImages , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; getSnapshotDisks ( ) . setItems ( diskImages ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > filterLUNsThatBelongToExistingStorageDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > existingStorageDomains = getStorageDomainDAO ( ) . getAll ( ) ; final java.util.List < org.ovirt.engine.core.compat.Guid > existingStorageDomainIDs = org.ovirt.engine.core.common.businessentities.Entities.getIds ( existingStorageDomains ) ; return org.ovirt.engine.core.utils.linq.LinqUtils.filter ( luns , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun ) { return ! ( existingStorageDomainIDs.contains ( lun.getStorageDomainId ( ) ) ) ; } } ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > filterLUNsThatBelongToExistingStorageDomains ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > existingStorageDomains = getStorageDomainDao ( ) . getAll ( ) ; final java.util.List < org.ovirt.engine.core.compat.Guid > existingStorageDomainIDs = org.ovirt.engine.core.common.businessentities.Entities.getIds ( existingStorageDomains ) ; return org.ovirt.engine.core.utils.linq.LinqUtils.filter ( luns , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.storage.LUNs lun ) { return ! ( existingStorageDomainIDs.contains ( lun.getStorageDomainId ( ) ) ) ; } } ) ; }
Source:
public void testGetEntityNameByIdAndTypeForUser ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser dbUser = dbFacade.getDbUserDao ( ) . get ( org.ovirt.engine.core.dao.DbFacadeDaoTest.USER_ID ) ; org.junit.Assert.assertNotNull ( dbUser ) ; java.lang.String name = dbUser.getLoginName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dao.DbFacadeDaoTest.USER_ID , VdcObjectType.User ) ) ) ; }

Target:
public void testGetEntityNameByIdAndTypeForUser ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser dbUser = dbFacade.getDbUserDao ( ) . get ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.USER_ID ) ; org.junit.Assert.assertNotNull ( dbUser ) ; java.lang.String name = dbUser.getLoginName ( ) ; org.junit.Assert.assertTrue ( name.equals ( dbFacade.getEntityNameByIdAndType ( org.ovirt.engine.core.dal.dbbroker.DbFacadeDaoTest.USER_ID , VdcObjectType.User ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult networkNameNotUsed ( ) { for ( org.ovirt.engine.core.common.businessentities.network.Network otherNetwork : getNetworks ( ) ) { if ( ( otherNetwork.getName ( ) . equals ( network.getName ( ) ) ) && ( ! ( otherNetwork.getId ( ) . equals ( network.getId ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_NAME_IN_USE ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkNameNotUsed ( ) { for ( org.ovirt.engine.core.common.businessentities.network.Network otherNetwork : getNetworks ( ) ) { if ( ( otherNetwork.getName ( ) . equals ( network.getName ( ) ) ) && ( ! ( otherNetwork.getId ( ) . equals ( network.getId ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_NAME_IN_USE , getNetworkNameReplacement ( ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }

Target:
public void getMaxSpmPriority ( 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 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
public javax.ws.rs.core.Response maintenance ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "maintenanceEnabled" ) ; org.ovirt.engine.core.common.businessentities.VM entity = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , id ) ; if ( ! ( entity.isHostedEngine ( ) ) ) { throw new javax.ws.rs.WebApplicationException ( javax.ws.rs.core.Response.status ( Response.Status.BAD_REQUEST ) . entity ( "Moving to maintenance mode is currently only available for the VM containing the hosted engine." ) . build ( ) ) ; } return doAction ( VdcActionType.SetHaMaintenance , new org.ovirt.engine.core.common.action.SetHaMaintenanceParameters ( entity.getRunOnVds ( ) , org.ovirt.engine.core.common.businessentities.HaMaintenanceMode.GLOBAL , action.isMaintenanceEnabled ( ) ) , action ) ; }

Target:
public javax.ws.rs.core.Response maintenance ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "maintenanceEnabled" ) ; org.ovirt.engine.core.common.businessentities.VM entity = getEntity ( org.ovirt.engine.core.common.businessentities.VM.class , VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( guid ) , id ) ; if ( ! ( entity.isHostedEngine ( ) ) ) { throw new javax.ws.rs.WebApplicationException ( javax.ws.rs.core.Response.status ( Response.Status.BAD_REQUEST ) . entity ( "Moving to maintenance mode is currently only available for the VM containing the hosted engine." ) . build ( ) ) ; } return doAction ( ActionType.SetHaMaintenance , new org.ovirt.engine.core.common.action.SetHaMaintenanceParameters ( entity.getRunOnVds ( ) , org.ovirt.engine.core.common.businessentities.HaMaintenanceMode.GLOBAL , action.isMaintenanceEnabled ( ) ) , action ) ; }
Source:
public static void GetVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters params = new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public static void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }
Source:
protected void disposePassFile ( java.io.File file ) { if ( file != null ) { if ( file.exists ( ) ) { file.delete ( ) ; } } }

Target:
protected void disposePassFile ( java.io.File file ) { if ( file != null ) { if ( file.exists ( ) ) { if ( ! ( file.delete ( ) ) ) { org.ovirt.engine.core.domains.ConfigurationProvider.log.info ( ( ( "Failed deleting file " + ( file.getAbsolutePath ( ) ) ) + ". Continuing anyway." ) ) ; } } } }
Source:
public void onDragOver ( com.google.gwt.event.dom.client.DragOverEvent event ) { doDrag ( event , false ) ; }

Target:
public void onDragOver ( com.google.gwt.event.dom.client.DragOverEvent event ) { com.google.gwt.dom.client.NativeEvent ne = event.getNativeEvent ( ) ; eventBus.fireEvent ( new org.ovirt.engine.ui.webadmin.section.main.view.popup.host.AutoScrollOverEvent ( this , ne.getScreenX ( ) , ne.getScreenY ( ) , ne.getClientX ( ) , ne.getClientY ( ) ) ) ; doDrag ( event , false ) ; }
Source:
public void getPlaceHolderListTest2 ( ) { java.lang.String testMessage = "This is a test if {0} can actually work out {1}, {0}, {1}, {1}" ; java.util.List < java.lang.Integer > result = testMessages.getPlaceHolderList ( testMessage ) ; org.junit.Assert.assertEquals ( "Result should have 2 items" , 2 , result.size ( ) ) ; org.junit.Assert.assertEquals ( "index 0 should be 0" , ( ( java.lang.Integer ) ( 0 ) ) , result.get ( 0 ) ) ; org.junit.Assert.assertEquals ( "index 1 should be 1" , ( ( java.lang.Integer ) ( 1 ) ) , result.get ( 1 ) ) ; }

Target:
public void getPlaceHolderListTest2 ( ) { java.lang.String testMessage = "This is a test if {0} can actually work out {1}, {0}, {1}, {1}" ; java.util.List < java.lang.Integer > result = testMessages.getPlaceHolderList ( testMessage ) ; org.ovirt.engine.ui.common.utils.BaseDynamicMessagesTest.assertIndexes ( result , 2 ) ; }
Source:
public final java.lang.Object getData ( java.lang.String sessionId , java.lang.String key , boolean refresh ) { if ( sessionId == null ) { return null ; } org.ovirt.engine.core.bll.session.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; java.lang.Object value = null ; if ( sessionInfo != null ) { if ( refresh ) { refresh ( sessionInfo ) ; } value = sessionInfo.contentOfSession.get ( key ) ; } return value ; }

Target:
public final java.lang.Object getData ( java.lang.String sessionId , java.lang.String key , boolean refresh ) { if ( sessionId == null ) { return null ; } org.ovirt.engine.core.bll.aaa.SessionDataContainer.SessionInfo sessionInfo = getSessionInfo ( sessionId ) ; java.lang.Object value = null ; if ( sessionInfo != null ) { if ( refresh ) { refresh ( sessionInfo ) ; } value = sessionInfo.contentOfSession.get ( key ) ; } return value ; }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.equals ( HostGeneralModel.RequestEditEventDefinition ) ) { getEditWithPMemphasisCommand ( ) . Execute ( ) ; } if ( ev.equals ( HostGeneralModel.RequestGOToEventsTabEventDefinition ) ) { GoToEventsTab ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ev.equals ( HostGeneralModel.RequestEditEventDefinition ) ) { getEditWithPMemphasisCommand ( ) . Execute ( ) ; } if ( ev.equals ( HostGeneralModel.RequestGOToEventsTabEventDefinition ) ) { GoToEventsTab ( ) ; } }
Source:
public void initOvfDataUpdater ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtil scheduler = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) ; scheduler.scheduleAFixedDelayJob ( this , "ovfUpdateTimer" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.OvfUpdateIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.OvfUpdateIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.storage.ovfstore.OvfDataUpdater.log.info ( "Initialization of OvfDataUpdater completed successfully." ) ; }

Target:
public void initOvfDataUpdater ( ) { org.ovirt.engine.core.utils.timer.SchedulerUtil scheduler = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) ; updateTimerJobId = scheduler.scheduleAFixedDelayJob ( this , "ovfUpdateTimer" , new java.lang.Class [ ] { } , new java.lang.Object [ ] { } , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.OvfUpdateIntervalInMinutes ) , org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.OvfUpdateIntervalInMinutes ) , java.util.concurrent.TimeUnit.MINUTES ) ; org.ovirt.engine.core.bll.storage.ovfstore.OvfDataUpdater.log.info ( "Initialization of OvfDataUpdater completed successfully." ) ; }
Source:
public void canDoActionSucceedsWhenHasPeersThrowsException ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterUtil.hasPeers ( org.mockito.Matchers.any ( org.ovirt.engine.core.utils.ssh.SSHClient.class ) ) ) . thenThrow ( new java.lang.RuntimeException ( ) ) ; org.junit.Assert.assertTrue ( commandMock.canDoAction ( ) ) ; }

Target:
public void canDoActionSucceedsWhenHasPeersThrowsException ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterUtil.getPeers ( org.mockito.Matchers.any ( org.ovirt.engine.core.utils.ssh.SSHClient.class ) ) ) . thenThrow ( new java.lang.RuntimeException ( ) ) ; org.junit.Assert.assertTrue ( commandMock.canDoAction ( ) ) ; }
Source:
private static < R extends org.ovirt.engine.api.model.BaseResource > void setActions ( javax.ws.rs.core.UriInfo uriInfo , R model , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { org.ovirt.engine.api.utils.LinkHelper.Collection collection = org.ovirt.engine.api.utils.LinkHelper.getCollection ( model ) ; javax.ws.rs.core.UriBuilder uriBuilder = org.ovirt.engine.api.utils.LinkHelper.getUriBuilder ( uriInfo , model , suggestedParentType ) ; if ( uriBuilder != null ) { org.ovirt.engine.api.model.ActionsBuilder actionsBuilder = new org.ovirt.engine.api.model.ActionsBuilder ( uriBuilder , collection.getResourceType ( ) ) ; model.setActions ( actionsBuilder.build ( ) ) ; } }

Target:
private static < R extends org.ovirt.engine.api.model.BaseResource > void setActions ( javax.ws.rs.core.UriInfo uriInfo , R model , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { org.ovirt.engine.api.restapi.util.LinkHelper.Collection collection = org.ovirt.engine.api.restapi.util.LinkHelper.getCollection ( model ) ; javax.ws.rs.core.UriBuilder uriBuilder = org.ovirt.engine.api.restapi.util.LinkHelper.getUriBuilder ( uriInfo , model , suggestedParentType ) ; if ( uriBuilder != null ) { org.ovirt.engine.api.restapi.util.ActionsBuilder actionsBuilder = new org.ovirt.engine.api.restapi.util.ActionsBuilder ( uriBuilder , collection.getResourceType ( ) ) ; model.setActions ( actionsBuilder.build ( ) ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > getHostDevices ( ) { if ( ( hostDevices ) == null ) { hostDevices = new java.util.ArrayList < > ( ) ; for ( java.lang.String deviceName : org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getParameters ( ) . getDeviceNames ( ) ) { org.ovirt.engine.core.common.businessentities.HostDevice hostDevice = fetchHostDevice ( deviceName ) ; if ( hostDevice == null ) { return null ; } hostDevices.add ( hostDevice ) ; } } return hostDevices ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.HostDevice > getHostDevices ( ) { if ( ( hostDevices ) == null ) { hostDevices = org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getParameters ( ) . getDeviceNames ( ) . stream ( ) . map ( this :: fetchHostDevice ) . filter ( java.util.Objects :: nonNull ) . collect ( java.util.stream.Collectors.toList ( ) ) ; if ( ( hostDevices.size ( ) ) != ( org.ovirt.engine.core.bll.hostdev.AbstractVmHostDevicesCommand.getParameters ( ) . getDeviceNames ( ) . size ( ) ) ) { hostDevices = null ; } } return hostDevices ; }
Source:
protected org.ovirt.engine.extensions.aaa.builtin.kerberosldap.GroupsDNQueryGenerator createGroupsGeneratorForUser ( org.ovirt.engine.core.common.businessentities.aaa.LdapUser user ) { java.util.List < java.lang.String > dnsList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.aaa.LdapGroup adGroup : user.getGroups ( ) . values ( ) ) { dnsList.add ( adGroup.getDistinguishedName ( ) ) ; } org.ovirt.engine.extensions.aaa.builtin.kerberosldap.GroupsDNQueryGenerator generator = new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.GroupsDNQueryGenerator ( new java.util.HashSet < java.lang.String > ( dnsList ) ) ; return generator ; }

Target:
protected org.ovirt.engine.extensions.aaa.builtin.kerberosldap.GroupsDNQueryGenerator createGroupsGeneratorForUser ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapUser user ) { java.util.List < java.lang.String > dnsList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapGroup adGroup : user.getGroups ( ) . values ( ) ) { dnsList.add ( adGroup.getDistinguishedName ( ) ) ; } org.ovirt.engine.extensions.aaa.builtin.kerberosldap.GroupsDNQueryGenerator generator = new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.GroupsDNQueryGenerator ( new java.util.HashSet < java.lang.String > ( dnsList ) ) ; return generator ; }
Source:
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 ) ; }

Target:
public static void GetExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }
Source:
protected org.ovirt.engine.api.model.Role getEntity ( int index ) { org.ovirt.engine.api.model.Role role = new org.ovirt.engine.api.model.Role ( ) ; role.setId ( GUIDS [ index ] ) ; role.setname ( NAMES [ index ] ) ; role.setdescription ( DESCRIPTIONS [ index ] ) ; role.setis_readonly ( false ) ; role.setType ( RoleType.ADMIN ) ; return role ; }

Target:
protected org.ovirt.engine.api.model.Role getEntity ( int index ) { org.ovirt.engine.api.model.Role role = new org.ovirt.engine.api.model.Role ( ) ; role.setId ( GUIDS [ index ] ) ; role.setName ( NAMES [ index ] ) ; role.setDescription ( DESCRIPTIONS [ index ] ) ; role.setReadonly ( false ) ; role.setType ( RoleType.ADMIN ) ; return role ; }
Source:
public final void reportCompleted ( ) { try { org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) ; if ( ( ( executionContext != null ) && ( executionContext.isMonitored ( ) ) ) && ( ! ( executionContext.isCompleted ( ) ) ) ) { endExecutionMonitoring ( ) ; } } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }

Target:
public final void reportCompleted ( ) { try { decreasePendingVms ( ) ; org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommandBase.getExecutionContext ( ) ; if ( ( ( executionContext != null ) && ( executionContext.isMonitored ( ) ) ) && ( ! ( executionContext.isCompleted ( ) ) ) ) { endExecutionMonitoring ( ) ; } } finally { org.ovirt.engine.core.bll.RunVmCommandBase.freeLock ( ) ; } }
Source:
public void testAddLunDiskMissingId ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setId ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; try { collection.add ( model ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "LogicalUnit" , "testAddLunDiskMissingId" , "id" ) ; } }

Target:
public void testAddLunDiskMissingId ( ) { org.ovirt.engine.api.model.Disk model = createIscsiLunDisk ( ) ; model.getLunStorage ( ) . getLogicalUnits ( ) . getLogicalUnits ( ) . get ( 0 ) . setId ( null ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; verifyIncompleteException ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , ( ) -> org.ovirt.engine.api.restapi.resource.collection.add ( model ) ) , "LogicalUnit" , "lambda$testAddLunDiskMissingId$4" , "id" ) ; }
Source:
public void testCheckGlusterQuorumWithoutRequiredVolumeOptions ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > glusterVolumes = getGlusterVolumes ( GlusterStatus.UP ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume : glusterVolumes ) { volume.setOptions ( "" ) ; } org.mockito.Mockito.doReturn ( glusterVolumes ) . when ( volumeDao ) . getByClusterId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; org.junit.Assert.assertTrue ( hostValidator.checkGlusterQuorum ( cluster , hostIds ) . isEmpty ( ) ) ; }

Target:
public void testCheckGlusterQuorumWithoutRequiredVolumeOptions ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = getCluster ( true ) ; java.lang.Iterable < org.ovirt.engine.core.compat.Guid > hostIds = java.util.Arrays.asList ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_1 , org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.SERVER_ID_2 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > glusterVolumes = getGlusterVolumes ( GlusterStatus.UP ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume : glusterVolumes ) { volume.setOptions ( "" ) ; } org.mockito.Mockito.doReturn ( glusterVolumes ) . when ( volumeDao ) . getByClusterId ( org.ovirt.engine.core.bll.gluster.GlusterHostValidatorTest.CLUSTER_ID ) ; org.junit.jupiter.api.Assertions.assertTrue ( hostValidator.checkGlusterQuorum ( cluster , hostIds ) . isEmpty ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > disks = adjustReturnValue ( returnValue ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = org.ovirt.engine.ui.uicommonweb.Linq.disksToDiskModelList ( disks ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > > entities = org.ovirt.engine.ui.uicommonweb.Linq.toEntityModelList ( org.ovirt.engine.ui.uicommonweb.Linq.filterDisksByType ( diskModels , diskStorageType ) ) ; initAttachableDisks ( entities ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > disks = adjustReturnValue ( returnValue ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels = org.ovirt.engine.ui.uicommonweb.Linq.disksToDiskModelList ( disks ) ; java.util.List < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > > entities = org.ovirt.engine.ui.uicommonweb.Linq.toEntityModelList ( org.ovirt.engine.ui.uicommonweb.Linq.filterDisksByType ( diskModels , diskStorageType ) ) ; initAttachableDisks ( entities ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Network network ) { validateParameters ( network , "name" ) ; org.ovirt.engine.api.model.Network entity = map ( network ) ; org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters parameters = new org.ovirt.engine.core.common.action.AddNetworkStoragePoolParameters ( dataCenterId , entity ) ; if ( network.isSetProfileRequired ( ) ) { parameters.setVnicProfileRequired ( network.isProfileRequired ( ) ) ; } return performCreate ( VdcActionType.AddNetwork , parameters , new org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworksResource.AddedNetworkResolver ( ) ) ; }

Target:
public org.ovirt.engine.api.model.Networks list ( ) { org.ovirt.engine.api.model.Networks networks = mapCollection ( getNetworks ( ) ) ; for ( org.ovirt.engine.api.model.Network network : networks.getNetworks ( ) ) { network.setDisplay ( null ) ; } return networks ; }
Source:
public boolean hasMethod ( org.ovirt.api.metamodel.concepts.Name name ) { for ( org.ovirt.api.metamodel.concepts.Method method : methods ) { if ( java.util.Objects.equals ( method.getName ( ) , name ) ) { return true ; } } if ( ( base ) != null ) { return base.hasMethod ( name ) ; } return false ; }

Target:
public org.ovirt.api.metamodel.concepts.Method getMethod ( org.ovirt.api.metamodel.concepts.Name name ) { java.util.Optional < org.ovirt.api.metamodel.concepts.Method > method = methods.stream ( ) . filter ( named ( name ) ) . findFirst ( ) ; if ( method.isPresent ( ) ) { return method.get ( ) ; } if ( ( base ) != null ) { return base.getMethod ( name ) ; } return null ; }
Source:
protected void executeQueryCommand ( ) { java.util.Map < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > templateMap = org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getDbFacade ( ) . getVmTemplateDAO ( ) . getAllForImage ( org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getParameters ( ) . getImageGuid ( ) ) ; if ( ! ( templateMap.values ( ) . isEmpty ( ) ) ) { updateDisksFromDb ( templateMap.values ( ) . iterator ( ) . next ( ) ) ; } org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getQueryReturnValue ( ) . setReturnValue ( templateMap ) ; }

Target:
protected void executeQueryCommand ( ) { java.util.Map < java.lang.Boolean , org.ovirt.engine.core.common.businessentities.VmTemplate > templateMap = org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getDbFacade ( ) . getVmTemplateDao ( ) . getAllForImage ( org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getParameters ( ) . getImageGuid ( ) ) ; if ( ! ( templateMap.values ( ) . isEmpty ( ) ) ) { updateDisksFromDb ( templateMap.values ( ) . iterator ( ) . next ( ) ) ; } org.ovirt.engine.core.bll.GetVmTemplatesByImageGuidQuery.getQueryReturnValue ( ) . setReturnValue ( templateMap ) ; }
Source:
public void testImportWithStorageDomainName ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ( "Storage: name=" + ( NAMES [ 2 ] ) ) , SearchType.StorageDomain , getStorageDomain ( 2 ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID ) ; org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setName ( NAMES [ 2 ] ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; doTestImport ( storageDomain , cluster ) ; }

Target:
public void testImportCollapseSnapshots ( ) throws java.lang.Exception { org.ovirt.engine.api.model.StorageDomain storageDomain = new org.ovirt.engine.api.model.StorageDomain ( ) ; storageDomain.setId ( GUIDS [ 2 ] . toString ( ) ) ; org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setId ( GUIDS [ 1 ] . toString ( ) ) ; setUpGetDataCenterByStorageDomainExpectations ( org.ovirt.engine.api.restapi.resource.BackendStorageDomainVmResourceTest.STORAGE_DOMAIN_ID ) ; doTestImport ( storageDomain , cluster , true , false ) ; }
Source:
private void updateAvailableOvirtNodeUpgrades ( ) { final org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItem ( ) ; if ( host == null ) { return ; } if ( ! ( host.isOvirtNode ( ) ) ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getoVirtISOsList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { } } ) , host.getId ( ) ) ; }

Target:
private void updateAvailableOvirtNodeUpgrades ( ) { final org.ovirt.engine.core.common.businessentities.VDS host = org.ovirt.engine.ui.uicommonweb.models.hosts.HostListModel.getSelectedItem ( ) ; if ( host == null ) { return ; } if ( ! ( host.isOvirtVintageNode ( ) ) ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getoVirtISOsList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { } } ) , host.getId ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { try { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setReturnValue ( org.ovirt.engine.core.utils.PKIResources.getInstance ( ) . getAsString ( PKIResources.Resource.CACertificate , PKIResources.OutputType.X509_PEM ) ) ; org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setExceptionString ( e.getMessage ( ) ) ; } }

Target:
protected void executeQueryCommand ( ) { try { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setReturnValue ( PKIResources.Resource.CACertificate.toString ( PKIResources.Format.X509_PEM ) ) ; org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setSucceeded ( true ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.bll.GetCACertificateQuery.getQueryReturnValue ( ) . setExceptionString ( e.getMessage ( ) ) ; } }
Source:
com.gwtplatform.mvp.client.proxy.PlaceRequest getSubTabRequest ( ) { java.lang.String subTabName = modelProvider.getModel ( ) . getActiveDetailModel ( ) . getHashName ( ) ; java.lang.String requestToken = ( ( org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.getMainTabRequest ( ) . getNameToken ( ) ) + ( org.ovirt.engine.ui.webadmin.place.ApplicationPlaces.SUB_TAB_PREFIX ) ) + subTabName ; return org.ovirt.engine.ui.common.place.PlaceRequestFactory.get ( requestToken ) ; }

Target:
com.gwtplatform.mvp.client.proxy.PlaceRequest getSubTabRequest ( ) { java.lang.String subTabName = modelProvider.getModel ( ) . getActiveDetailModel ( ) . getHashName ( ) ; java.lang.String requestToken = ( ( org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.getMainTabRequest ( ) . getNameToken ( ) ) + ( org.ovirt.engine.ui.uicommonweb.place.WebAdminApplicationPlaces.SUB_TAB_PREFIX ) ) + subTabName ; return org.ovirt.engine.ui.common.place.PlaceRequestFactory.get ( requestToken ) ; }
Source:
public void testGet ( ) throws java.lang.Exception { resource.getParent ( ) . setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.Device device = resource.get ( ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDeviceResourceTest.DEVICE_ID.toString ( ) , device.getId ( ) ) ; verifyLinks ( device ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { resource.getParent ( ) . setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.ReportedDevice device = resource.get ( ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendVmReportedDeviceResourceTest.DEVICE_ID.toString ( ) , device.getId ( ) ) ; verifyLinks ( device ) ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.frontend.Frontend.getEventsHandler ( ) . runQueryFailed ( null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; if ( callback.isHandleFailure ( ) ) { callback.asyncCallback.onSuccess ( callback.getModel ( ) , null ) ; } }

Target:
protected boolean ignoreFailure ( final java.lang.Throwable caught ) { if ( ( caught instanceof com.google.gwt.user.client.rpc.StatusCodeException ) && ( ( ( ( com.google.gwt.user.client.rpc.StatusCodeException ) ( caught ) ) . getStatusCode ( ) ) == 0 ) ) { return true ; } return false ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderNetworkListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderNetworkListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getDiscoverCommand ( ) ) ) { return discoverNetworkPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnRemove" ) ) { OnRemove ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getRemoveCommand ( ) ) ) { remove ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnRemove" ) ) { OnRemove ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }
Source:
public void calculateNetworkImplementationDetailsNetworkQosOutOfSync ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkQoS qos = createQos ( ) ; qos.setOutboundAverage ( 30 ) ; qos.setOutboundPeak ( 30 ) ; qos.setOutboundBurst ( 30 ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , qos ) ; }

Target:
public void calculateNetworkImplementationDetailsNetworkQosMissing ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNetworkDevice ( ) ; calculateNetworkImplementationDetailsAndAssertSync ( iface , false , iface.isBridged ( ) , iface.getMtu ( ) , iface.getVlanId ( ) , null ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > setUpTemplates ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > ret = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { ret.add ( getEntity ( i ) ) ; } return ret ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > setUpTemplates ( ) { return java.util.stream.IntStream.range ( 0 , NAMES.length ) . mapToObj ( this :: getEntity ) . collect ( java.util.stream.Collectors.toList ( ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.storage_pool_iso_map mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.storage_pool_iso_map entity = new org.ovirt.engine.core.common.businessentities.storage_pool_iso_map ( ) ; entity.setstorage_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "storage_id" ) ) ) ; entity.setstorage_pool_id ( org.ovirt.engine.core.compat.NGuid.createGuidFromString ( rs.getString ( "storage_pool_id" ) ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setowner ( org.ovirt.engine.core.common.businessentities.StorageDomainOwnerType.forValue ( rs.getInt ( "owner" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap entity = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; entity.setstorage_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "storage_id" ) ) ) ; entity.setstorage_pool_id ( org.ovirt.engine.core.compat.NGuid.createGuidFromString ( rs.getString ( "storage_pool_id" ) ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.forValue ( rs.getInt ( "status" ) ) ) ; entity.setowner ( org.ovirt.engine.core.common.businessentities.StorageDomainOwnerType.forValue ( rs.getInt ( "owner" ) ) ) ; return entity ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( java.lang.String userName , java.lang.String password , java.lang.String domain , org.ovirt.engine.core.common.action.VdcActionType loginType ) { org.ovirt.engine.core.common.action.LoginUserParameters params = new org.ovirt.engine.core.common.action.LoginUserParameters ( userName , password , domain , null , null , null ) ; params.setSessionId ( getSessionId ( ) ) ; params.setActionType ( loginType ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = getBackend ( ) . Login ( params ) ; return returnValue ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase Login ( java.lang.String userName , java.lang.String password , java.lang.String domain , org.ovirt.engine.core.common.action.VdcActionType loginType ) { org.ovirt.engine.core.common.action.LoginUserParameters params = new org.ovirt.engine.core.common.action.LoginUserParameters ( userName , password , domain , null , null , null ) ; params.setSessionId ( getSessionId ( ) ) ; params.setActionType ( loginType ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = getBackend ( ) . login ( params ) ; return returnValue ; }
Source:
private void mockVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setStatus ( VMStatus.Down ) ; vm.setStoragePoolId ( org.ovirt.engine.core.bll.snapshots.RemoveSnapshotCommandTest.STORAGE_POOL_ID ) ; vm.setVdsGroupCompatibilityVersion ( Version.v3_5 ) ; org.mockito.Mockito.doReturn ( vm ) . when ( cmd ) . getVm ( ) ; }

Target:
private void mockVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setStatus ( VMStatus.Down ) ; vm.setStoragePoolId ( org.ovirt.engine.core.bll.snapshots.RemoveSnapshotCommandTest.STORAGE_POOL_ID ) ; vm.setClusterCompatibilityVersion ( Version.v3_5 ) ; org.mockito.Mockito.doReturn ( vm ) . when ( cmd ) . getVm ( ) ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > FilterDisksByType ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels , org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType type ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > filteredList = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; if ( diskModels != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel item : diskModels ) { if ( ( item.getDisk ( ) . getDiskStorageType ( ) ) == type ) { filteredList.add ( item ) ; } } } return filteredList ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > filterDisksByType ( java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > diskModels , org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType type ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > filteredList = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; if ( diskModels != null ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel item : diskModels ) { if ( ( item.getDisk ( ) . getDiskStorageType ( ) ) == type ) { filteredList.add ( item ) ; } } } return filteredList ; }