auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void postInitTemplate ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > baseTemplates = filterNotBaseTemplates ( templates ) ; org.ovirt.engine.core.common.businessentities.VmTemplate currentTemplate = org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( vm.getVmtGuid ( ) ) ) ; getModel ( ) . getBaseTemplate ( ) . setItems ( baseTemplates ) ; getModel ( ) . getBaseTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( baseTemplates , new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( currentTemplate.getBaseTemplateId ( ) ) ) ) ; }

Target:
private void postInitTemplate ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > baseTemplates = keepBaseTemplates ( templates ) ; org.ovirt.engine.core.common.businessentities.VmTemplate currentTemplate = org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( vm.getVmtGuid ( ) ) ) ; getModel ( ) . getBaseTemplate ( ) . setItems ( baseTemplates ) ; getModel ( ) . getBaseTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( baseTemplates , new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( currentTemplate.getBaseTemplateId ( ) ) ) ) ; }
Source:
public void testValidateStoragePoolStoragePoolNotUp ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; command.setStoragePoolId ( storagePool.getId ( ) ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "" , command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; }

Target:
public void testValidateStoragePoolStoragePoolNotUp ( ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; storagePool.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.mockito.Mockito.when ( storagePoolDao.get ( storagePool.getId ( ) ) ) . thenReturn ( storagePool ) ; command.setStoragePoolId ( storagePool.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( command.validate ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.assertValidationMessages ( "" , command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL ) ; }
Source:
public void testUpdateSetAndUploadIconFailure ( ) throws java.lang.Exception { final org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 0 ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; try { verifyModel ( resource.update ( model ) , 0 ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }

Target:
public void testUpdateSetAndUploadIconFailure ( ) throws java.lang.Exception { final org.ovirt.engine.api.model.Vm model = org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.getModel ( 0 ) ; model.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; model.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; try { verifyModel ( resource.update ( model ) , 0 ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }
Source:
public void testAttachFailDomainAlreadyInPool ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap > isoMap = new java.util.ArrayList < > ( ) ; isoMap.add ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ) ; org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( isoMap ) ; org.ovirt.engine.core.bll.ValidationResult attachedDomainInsertionResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertThat ( attachedDomainInsertionResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ) ; }

Target:
public void testAttachFailDomainAlreadyInPool ( ) { org.mockito.Mockito.when ( storagePoolIsoMapDao.getAllForStorage ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ) ) ; org.ovirt.engine.core.bll.ValidationResult attachedDomainInsertionResult = validator.validateDomainCanBeAttachedToPool ( ) ; org.junit.Assert.assertThat ( attachedDomainInsertionResult , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ) ; }
Source:
public java.util.List < java.net.URI > getLdapServers ( ) { java.util.List < org.ovirt.engine.core.bll.adbroker.ScorableLDAPServer > ldapServersCopy = new java.util.ArrayList < org.ovirt.engine.core.bll.adbroker.ScorableLDAPServer > ( ldapServers.values ( ) ) ; java.util.Collections.sort ( ldapServersCopy ) ; java.util.List < java.net.URI > servers = new java.util.ArrayList < java.net.URI > ( ) ; for ( org.ovirt.engine.core.bll.adbroker.ScorableLDAPServer server : ldapServersCopy ) { servers.add ( server.getURI ( ) ) ; } return servers ; }

Target:
public java.util.List < java.net.URI > getLdapServers ( ) { lock.readLock ( ) . lock ( ) ; try { return new java.util.ArrayList < java.net.URI > ( ldapServers ) ; } finally { lock.readLock ( ) . unlock ( ) ; } }
Source:
public void testValues ( ) { org.ovirt.engine.core.searchbackend.IAutoCompleter comp = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.searchbackend.Jedi.class ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "L" ) ) ; java.lang.System.out.println ( comps ) ; assertTrue ( "luke" , comps.contains ( "luke" ) ) ; assertTrue ( "leia" , comps.contains ( "leia" ) ) ; }

Target:
public void testValues ( ) { org.ovirt.engine.core.searchbackend.IAutoCompleter comp = new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.searchbackend.Jedi.class ) ; java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( "L" ) ) ; java.lang.System.out.println ( comps ) ; org.junit.Assert.assertTrue ( "luke" , comps.contains ( "luke" ) ) ; org.junit.Assert.assertTrue ( "leia" , comps.contains ( "leia" ) ) ; }
Source:
private static void updateInterfacesWithUserConfiguration ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsForUpdate , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsByName ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nicForUpdate : nicsForUpdate ) { if ( nicsByName.containsKey ( nicForUpdate.getName ( ) ) ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = nicsByName.get ( nicForUpdate.getName ( ) ) ; nicForUpdate.setLabels ( nic.getLabels ( ) ) ; } } }

Target:
private static void updateInterfacesWithUserConfiguration ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsForUpdate , java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nicsByName ) { for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nicForUpdate : nicsForUpdate ) { if ( nicsByName.containsKey ( nicForUpdate.getName ( ) ) ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = nicsByName.get ( nicForUpdate.getName ( ) ) ; nicForUpdate.setLabels ( nic.getLabels ( ) ) ; nicForUpdate.setQosOverridden ( nic.isQosOverridden ( ) ) ; } } }
Source:
public void initTable ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < java.lang.String > appNameColumn = new org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String appName ) { return appName ; } } ; getTable ( ) . addColumn ( appNameColumn , constants.installedApp ( ) ) ; }

Target:
public void initTable ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < java.lang.String > appNameColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < java.lang.String > ( ) { @ java.lang.Override public java.lang.String getValue ( java.lang.String appName ) { return appName ; } } ; getTable ( ) . addColumn ( appNameColumn , constants.installedApp ( ) ) ; }
Source:
protected void alertIfPowerManagementNotConfigured ( org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic ) { if ( ( ( org.ovirt.engine.core.bll.VdsCommand.getVdsGroup ( ) ) != null ) && ( ! ( org.ovirt.engine.core.bll.VdsCommand.getVdsGroup ( ) . supportsVirtService ( ) ) ) ) { return ; } if ( ! ( vdsStatic.isPmEnabled ( ) ) ) { Alert ( AuditLogType.VDS_ALERT_FENCE_IS_NOT_CONFIGURED ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.removeVdsAlert ( vdsStatic.getId ( ) , AuditLogType.VDS_ALERT_FENCE_TEST_FAILED ) ; } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.removeVdsAlert ( vdsStatic.getId ( ) , AuditLogType.VDS_ALERT_FENCE_IS_NOT_CONFIGURED ) ; } }

Target:
protected void alertIfPowerManagementNotConfigured ( org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic ) { if ( ( ( org.ovirt.engine.core.bll.VdsCommand.getVdsGroup ( ) ) != null ) && ( ! ( org.ovirt.engine.core.bll.VdsCommand.getVdsGroup ( ) . supportsVirtService ( ) ) ) ) { return ; } if ( ! ( vdsStatic.isPmEnabled ( ) ) ) { alert ( AuditLogType.VDS_ALERT_FENCE_IS_NOT_CONFIGURED ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.removeVdsAlert ( vdsStatic.getId ( ) , AuditLogType.VDS_ALERT_FENCE_TEST_FAILED ) ; } else { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.removeVdsAlert ( vdsStatic.getId ( ) , AuditLogType.VDS_ALERT_FENCE_IS_NOT_CONFIGURED ) ; } }
Source:
private void fillVolumeInformation ( org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.common.businessentities.DiskImage ancestor = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImageDao ( ) . getAncestor ( org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) . getImageId ( ) ) ; if ( ancestor == null ) { log.warnFormat ( "Can't find ancestor of Disk with ID {0}, using original disk for volume info." , org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) . getImageId ( ) ) ; ancestor = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) ; } disk.setvolume_format ( ancestor.getvolume_format ( ) ) ; disk.setvolume_type ( ancestor.getvolume_type ( ) ) ; }

Target:
private void fillVolumeInformation ( org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.common.businessentities.DiskImage ancestor = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImageDao ( ) . getAncestor ( org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) . getImageId ( ) ) ; if ( ancestor == null ) { log.warnFormat ( "Can't find ancestor of Disk with ID {0}, using original disk for volume info." , org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) . getImageId ( ) ) ; ancestor = org.ovirt.engine.core.bll.CreateImageTemplateCommand.getDiskImage ( ) ; } disk.setvolumeFormat ( ancestor.getVolumeFormat ( ) ) ; disk.setVolumeType ( ancestor.getVolumeType ( ) ) ; }
Source:
public static < V > java.util.concurrent.ExecutorCompletionService < V > createCompletionService ( java.lang.Iterable < java.util.concurrent.Callable < V > > tasks ) { java.util.concurrent.ExecutorCompletionService < V > ecs = org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.createCompletionService ( ) ; if ( tasks != null ) { for ( java.util.concurrent.Callable < V > callable : tasks ) { ecs.submit ( callable ) ; } } return ecs ; }

Target:
public static < V > java.util.List < java.util.concurrent.Future < V > > submitTasks ( java.util.concurrent.ExecutorCompletionService < V > ecs , java.lang.Iterable < java.util.concurrent.Callable < V > > tasks ) { java.util.List < java.util.concurrent.Future < V > > futures = new java.util.LinkedList < java.util.concurrent.Future < V > > ( ) ; if ( tasks != null ) { for ( java.util.concurrent.Callable < V > callable : tasks ) { futures.add ( ecs.submit ( callable ) ) ; } } return futures ; }
Source:
public static java.util.Date getFutureDate ( long delay , java.util.concurrent.TimeUnit timeUnit ) { if ( delay > 0 ) { return new java.util.Date ( ( ( new java.util.Date ( ) . getTime ( ) ) + ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( delay , timeUnit ) ) ) ) ; } else { return new java.util.Date ( ) ; } }

Target:
public static java.util.Date getFutureDate ( long delay , java.util.concurrent.TimeUnit timeUnit ) { return new java.util.Date ( ( ( java.lang.System.currentTimeMillis ( ) ) + ( java.util.concurrent.TimeUnit.MILLISECONDS.convert ( delay , timeUnit ) ) ) ) ; }
Source:
public void endWithFailure ( ) { endRemoveSnapshotSingleDisk ( false ) ; org.ovirt.engine.core.common.businessentities.Disk disk = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . get ( imageGroupId ) ; if ( ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( disk ) ) . getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageStatus.LOCKED ) ) { updateImagesStatus ( ImageStatus.OK ) ; } enclosingCommand.preventRollback ( ) ; enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
public void endWithFailure ( ) { endRemoveSnapshotSingleDisk ( false ) ; org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . get ( imageGroupId ) ; if ( ( ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) . getImageStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.LOCKED ) ) { updateImagesStatus ( ImageStatus.OK ) ; } enclosingCommand.preventRollback ( ) ; enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.remove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { collection.deprecatedRemove ( GUIDS [ 0 ] . toString ( ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected static org.ovirt.engine.core.compat.Guid getNonPrestartedVmToAttach ( org.ovirt.engine.core.compat.NGuid vmPoolId ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmPoolMap > vmPoolMaps = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . getVmMapsInVmPoolByVmPoolIdAndStatus ( vmPoolId , VMStatus.Down ) ; if ( vmPoolMaps != null ) { for ( org.ovirt.engine.core.common.businessentities.VmPoolMap map : vmPoolMaps ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachNonPrestartedVmToUser ( map.getvm_guid ( ) ) ) { return map.getvm_guid ( ) ; } } } return org.ovirt.engine.core.compat.Guid.Empty ; }

Target:
private static boolean failVmFree ( java.util.List < java.lang.String > messages , java.util.List < java.lang.String > messagesToAdd ) { messages.addAll ( messagesToAdd ) ; messages.add ( VdcBllMessages.VAR__TYPE__DESKTOP_POOL.toString ( ) ) ; messages.add ( VdcBllMessages.VAR__ACTION__ATTACH_DESKTOP_TO.toString ( ) ) ; return false ; }
Source:
private void setCustomDefinedProperties ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticDataFromParams ) { org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.VMCustomProperties properties = org.ovirt.engine.core.utils.vmproperties.VmPropertiesUtils.getInstance ( ) . parseProperties ( org.ovirt.engine.core.bll.UpdateVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) , vmStaticDataFromParams.getCustomProperties ( ) ) ; vmStaticDataFromParams.setPredefinedProperties ( properties.getPredefinedProperties ( ) ) ; vmStaticDataFromParams.setUserDefinedProperties ( properties.getUseDefinedProperties ( ) ) ; }

Target:
private void setCustomDefinedProperties ( org.ovirt.engine.core.common.businessentities.VmStatic vmStaticDataFromParams ) { org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.VMCustomProperties properties = org.ovirt.engine.core.utils.customprop.VmPropertiesUtils.getInstance ( ) . parseProperties ( org.ovirt.engine.core.bll.UpdateVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) , vmStaticDataFromParams.getCustomProperties ( ) ) ; vmStaticDataFromParams.setPredefinedProperties ( properties.getPredefinedProperties ( ) ) ; vmStaticDataFromParams.setUserDefinedProperties ( properties.getUseDefinedProperties ( ) ) ; }
Source:
public void initUserAndGroupData ( ) { if ( ( dbUser ) == null ) { dbUser = org.ovirt.engine.core.bll.PermissionsCommandBase.getDbUserDAO ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getad_element_id ( ) ) ; } if ( ( dbGroup ) == null ) { dbGroup = org.ovirt.engine.core.bll.PermissionsCommandBase.getAdGroupDAO ( ) . get ( org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) . getad_element_id ( ) ) ; } }

Target:
public java.lang.String getNamespace ( ) { initUserAndGroupData ( ) ; return ( dbUser ) == null ? ( dbGroup ) == null ? "" : dbGroup.getNamespace ( ) : dbUser.getNamespace ( ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult storageDomainNotChanged ( ) { if ( org.apache.commons.lang.ObjectUtils.equals ( diskProfile.getStorageDomainId ( ) , getOldDiskProfile ( ) . getStorageDomainId ( ) ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_CANNOT_CHANGE_PROFILE ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult diskProfileNameNotUsed ( ) { for ( org.ovirt.engine.core.common.businessentities.profiles.DiskProfile profile : getDiskProfiles ( ) ) { if ( ( profile.getName ( ) . equals ( getDiskProfile ( ) . getName ( ) ) ) && ( ! ( profile.getId ( ) . equals ( getDiskProfile ( ) . getId ( ) ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_PROFILE_NAME_IN_USE ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void testBeanValidations ( ) { org.junit.Assert.assertTrue ( createCommand ( initializeMock ( 1 , 1 ) ) . validateInputs ( ) ) ; }

Target:
public void testPatternBasedNameFails ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = createCommand ( initializeMock ( 1 ) ) ; cmd.getParameters ( ) . getVm ( ) . setName ( "aa-??bb" ) ; org.junit.Assert.assertFalse ( "Pattern-based name should not be supported for VM" , cmd.validateInputs ( ) ) ; }
Source:
protected org.ovirt.engine.core.compat.Guid lookupClusterId ( org.ovirt.engine.api.model.Vm vm ) { return vm.getCluster ( ) . isSetId ( ) ? asGuid ( vm.getCluster ( ) . getId ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.VDSGroup.class , VdcQueryType.GetVdsGroupByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( vm.getCluster ( ) . getName ( ) ) , ( "Cluster: name=" + ( vm.getCluster ( ) . getName ( ) ) ) ) . getId ( ) ; }

Target:
protected org.ovirt.engine.core.compat.Guid lookupClusterId ( org.ovirt.engine.api.model.Vm vm ) { return vm.getCluster ( ) . isSetId ( ) ? asGuid ( vm.getCluster ( ) . getId ( ) ) : getEntity ( org.ovirt.engine.core.common.businessentities.Cluster.class , VdcQueryType.GetClusterByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( vm.getCluster ( ) . getName ( ) ) , ( "Cluster: name=" + ( vm.getCluster ( ) . getName ( ) ) ) ) . getId ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getExternalVmList ( java.lang.String uri , java.lang.String username , java.lang.String password ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMs ( uri , username , password ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.QemuImageInfoReturnForXmlRpc getQemuImageInfo ( java.lang.String sdUUID , java.lang.String spUUID , java.lang.String imgUUID , java.lang.String volUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmpRpcReturnValue = vdsServer.getQemuImageInfo ( sdUUID , spUUID , imgUUID , volUUID ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.QemuImageInfoReturnForXmlRpc ( xmpRpcReturnValue ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected boolean doesStorageDomainhaveSpaceForRequest ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain , long spaceForRequest ) { return validate ( new org.ovirt.engine.core.bll.validator.StorageDomainValidator ( storageDomain ) . isDomainHasSpaceForRequest ( spaceForRequest ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { if ( ( ( diskInfoDestinationMap ) != null ) && ( ! ( diskInfoDestinationMap.isEmpty ( ) ) ) ) { java.util.Map < org.ovirt.engine.core.common.businessentities.DiskImage , org.ovirt.engine.core.compat.Guid > map = new java.util.HashMap < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskInfoDestinationMap.values ( ) ) { map.put ( diskImage , diskImage.getStorageIds ( ) . get ( 0 ) ) ; } return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( map , org.ovirt.engine.core.bll.AddVmTemplateCommand.getStoragePool ( ) . getcompatibility_version ( ) ) ) ; } return true ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase call ( ) throws java.lang.Exception { return getBackend ( ) . runInternalAction ( VdcActionType.SetupGlusterGeoRepMountBrokerInternal , new org.ovirt.engine.core.common.action.gluster.SetUpMountBrokerParameters ( currentSlaveServerId , getParameters ( ) . getSlaveVolumeName ( ) , getParameters ( ) . getUserName ( ) , getParameters ( ) . getUserGroup ( ) , true ) ) ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { return getSucceeded ( ) ? org.ovirt.engine.core.common.AuditLogType.CREATE_GLUSTER_VOLUME_GEOREP_SESSION : org.ovirt.engine.core.common.AuditLogType.GLUSTER_GEOREP_SESSION_CREATE_FAILED ; }
Source:
public void invokeClient ( ) { org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker invoker = new org.ovirt.engine.ui.common.uicommon.WebClientConsoleInvoker ( org.ovirt.engine.ui.common.uicommon.NoVncImpl.CLIENT_PAGE , config , getVncHost ( ) , getVncPort ( ) , getTicket ( ) , false ) ; invoker.invokeClient ( ) ; }

Target:
protected org.ovirt.engine.ui.common.uicommon.WebsocketProxyConfig getConfig ( ) { if ( ( config ) != null ) { config = new org.ovirt.engine.ui.common.uicommon.WebsocketProxyConfig ( ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.WebSocketProxy ) ) ) , getOptions ( ) . getHost ( ) ) ; } return config ; }
Source:
protected void updateModelDataCenterFromVds ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters , org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( dataCenters != null ) { getDataCenter ( ) . setItems ( dataCenters ) ; getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCenters , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterPredicate ( vds.getStoragePoolId ( ) ) ) ) ; if ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) { getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( dataCenters ) ) ; } } }

Target:
protected void updateModelDataCenterFromVds ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters , org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( dataCenters != null ) { getDataCenter ( ) . setItems ( dataCenters ) ; getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters , new org.ovirt.engine.ui.uicommonweb.Linq.DataCenterPredicate ( vds.getStoragePoolId ( ) ) ) ) ; if ( ( getDataCenter ( ) . getSelectedItem ( ) ) == null ) { getDataCenter ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrNull ( dataCenters ) ) ; } } }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetRoleActionGroupsByRoleId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , org.ovirt.engine.api.restapi.resource.BackendPermitsResourceTest.setUpActionGroups ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.jupiter.api.Assertions.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetRoleActionGroupsByRoleId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , org.ovirt.engine.api.restapi.resource.BackendPermitsResourceTest.setUpActionGroups ( ) , failure ) ; }
Source:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry = new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , FixturesTool.DEFAULT_QUOTA_GENERAL , FixturesTool.DISK_PROFILE_1 ) ; dao.save ( entry ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY ) ; org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertEquals ( 1 , entries.size ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entryFromDb = entries.get ( 0 ) ; org.junit.Assert.assertEquals ( entry , entryFromDb ) ; }

Target:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry = new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , FixturesTool.DEFAULT_QUOTA_GENERAL , FixturesTool.DISK_PROFILE_1 ) ; dao.save ( entry ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY ) ; org.junit.jupiter.api.Assertions.assertNotNull ( entries ) ; org.junit.jupiter.api.Assertions.assertEquals ( 1 , entries.size ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entryFromDb = entries.get ( 0 ) ; org.junit.jupiter.api.Assertions.assertEquals ( entry , entryFromDb ) ; }
Source:
protected boolean checkStorageDomainStatus ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus ... statuses ) { boolean valid = false ; org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = getStorageDomainStatus ( ) ; if ( status != null ) { valid = java.util.Arrays.asList ( statuses ) . contains ( status ) ; } if ( ! valid ) { if ( status == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Locked ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ; } addStorageDomainStatusIllegalMessage ( ) ; } return valid ; }

Target:
protected boolean checkStorageDomainStatus ( final org.ovirt.engine.core.common.businessentities.StorageDomainStatus ... statuses ) { boolean valid = false ; org.ovirt.engine.core.common.businessentities.StorageDomainStatus status = getStorageDomainStatus ( ) ; if ( status != null ) { valid = java.util.Arrays.asList ( statuses ) . contains ( status ) ; } if ( ! valid ) { if ( status.isStorageDomainInProcess ( ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ; } addStorageDomainStatusIllegalMessage ( ) ; } return valid ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > getUserRequestForStorageDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageType , boolean forceRefresh ) { if ( ! ( isStorageDomainValid ( storageDomainId , imageType , forceRefresh ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.GetIsoListError ) ; } return getCachedIsoListByDomainId ( storageDomainId , imageType ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > getUserRequestForStorageDomainRepoFileList ( org.ovirt.engine.core.compat.Guid storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageFileType imageType , boolean forceRefresh ) { if ( ! ( isStorageDomainIdValid ( storageDomainId ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.GetIsoListError ) ; } if ( forceRefresh && ( ! ( refreshRepos ( storageDomainId , imageType ) ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.IMAGES_NOT_SUPPORTED_ERROR ) ; } return getCachedIsoListByDomainId ( storageDomainId , imageType ) ; }
Source:
public static com.google.gwt.safehtml.shared.SafeHtml getValue ( java.util.List < com.google.gwt.safehtml.shared.SafeHtml > imagesHtml ) { java.lang.String images = "" ; for ( com.google.gwt.safehtml.shared.SafeHtml imageHtml : imagesHtml ) { images = images.concat ( imageHtml.asString ( ) ) ; } return org.ovirt.engine.ui.webadmin.widget.table.column.NetworkRoleColumnHelper.templates.image ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( images ) ) ; }

Target:
public static com.google.gwt.safehtml.shared.SafeHtml getValue ( java.util.List < com.google.gwt.safehtml.shared.SafeHtml > imagesHtml ) { java.lang.String images = "" ; for ( com.google.gwt.safehtml.shared.SafeHtml imageHtml : imagesHtml ) { images = images.concat ( imageHtml.asString ( ) ) ; } return org.ovirt.engine.ui.webadmin.widget.table.column.MultiImageColumnHelper.templates.image ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( images ) ) ; }
Source:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }

Target:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
static org.ovirt.engine.core.common.businessentities.VDSGroup setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.VDSGroup entity , int index ) { org.easymock.classextension.EasyMock.expect ( entity.getId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.classextension.EasyMock.expect ( entity.getname ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; org.easymock.classextension.EasyMock.expect ( entity.getdescription ( ) ) . andReturn ( DESCRIPTIONS [ index ] ) . anyTimes ( ) ; return entity ; }

Target:
static org.ovirt.engine.core.common.businessentities.VDSGroup setUpEntityExpectations ( org.ovirt.engine.core.common.businessentities.VDSGroup entity , int index ) { org.easymock.EasyMock.expect ( entity.getId ( ) ) . andReturn ( GUIDS [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getname ( ) ) . andReturn ( NAMES [ index ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( entity.getdescription ( ) ) . andReturn ( DESCRIPTIONS [ index ] ) . anyTimes ( ) ; return entity ; }
Source:
public org.ovirt.engine.core.compat.Version getCompatibilityVersion ( ) { org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.compat.Version > customCompatibilityVersion = getCustomCompatibilityVersion ( ) ; if ( ( customCompatibilityVersion != null ) && ( ( customCompatibilityVersion.getSelectedItem ( ) ) != null ) ) { return customCompatibilityVersion.getSelectedItem ( ) ; } org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = getSelectedCluster ( ) ; if ( vdsGroup != null ) { return vdsGroup.getCompatibilityVersion ( ) ; } return null ; }

Target:
public org.ovirt.engine.core.compat.Version getCompatibilityVersion ( ) { org.ovirt.engine.ui.uicommonweb.models.ListModel < org.ovirt.engine.core.compat.Version > customCompatibilityVersion = getCustomCompatibilityVersion ( ) ; if ( ( customCompatibilityVersion != null ) && ( ( customCompatibilityVersion.getSelectedItem ( ) ) != null ) ) { return customCompatibilityVersion.getSelectedItem ( ) ; } org.ovirt.engine.core.common.businessentities.Cluster cluster = getSelectedCluster ( ) ; if ( cluster != null ) { return cluster.getCompatibilityVersion ( ) ; } return null ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.host.provider.HostProviderProxy proxy = systemProviderFinder.findSystemProvider ( ) ; if ( proxy == null ) { setReturnValue ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.Erratum > emptyList ( ) ) ; } else { setReturnValue ( proxy.getErrataForHost ( systemProviderFinder.getSystemHostName ( ) ) ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.bll.host.provider.HostProviderProxy proxy = systemProviderFinder.findSystemProvider ( ) ; if ( proxy == null ) { org.ovirt.engine.core.bll.GetErrataForSystemQuery.getQueryReturnValue ( ) . setSucceeded ( false ) ; org.ovirt.engine.core.bll.GetErrataForSystemQuery.getQueryReturnValue ( ) . setExceptionString ( VdcBllMessages.NO_HOST_PROVIDER_FOR_SYSTEM.name ( ) ) ; } else { setReturnValue ( proxy.getErrataForHost ( systemProviderFinder.getSystemHostName ( ) ) ) ; } }
Source:
public void onSuccess ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Frontend: sucessfully executed runAction, determining result!" ) ; handleActionResult ( actionType , parameters , result , ( callback != null ? callback : org.ovirt.engine.ui.frontend.Frontend.NULLABLE_ASYNC_CALLBACK ) , state , showErrorDialog ) ; org.ovirt.engine.ui.frontend.communication.RefreshActiveModelEvent.fire ( this , true ) ; }

Target:
public void onSuccess ( final org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > operation , final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Frontend: sucessfully executed runAction, determining result!" ) ; handleActionResult ( actionType , parameters , result , ( callback != null ? callback : org.ovirt.engine.ui.frontend.Frontend.NULLABLE_ASYNC_CALLBACK ) , state , showErrorDialog ) ; fireAsyncOperationCompleteEvent ( state ) ; org.ovirt.engine.ui.frontend.communication.RefreshActiveModelEvent.fire ( this , true ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command == ( getManageCommand ( ) ) ) { Manage ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnManage" ) ) { OnManage ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { Cancel ( ) ; } }

Target:
private void setManageCommand ( org.ovirt.engine.ui.uicommonweb.UICommand value ) { manageCommand = value ; }
Source:
public boolean isMemBalloonEnabled ( org.ovirt.engine.core.compat.Guid vmId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , vmId ) ; java.util.Map < java.lang.String , java.lang.Object > dbResults = new org.springframework.jdbc.core.simple.SimpleJdbcCall ( jdbcTemplate ) . withFunctionName ( "isMemBalloonEnabled" ) . execute ( parameterSource ) ; java.lang.String resultKey = dialect.getFunctionReturnKey ( ) ; return ( dbResults.get ( resultKey ) ) != null ? ( ( java.lang.Boolean ) ( dbResults.get ( resultKey ) ) ) . booleanValue ( ) : false ; }

Target:
public boolean isMemBalloonEnabled ( org.ovirt.engine.core.compat.Guid vmId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_id" , vmId ) ; java.util.Map < java.lang.String , java.lang.Object > dbResults = new org.springframework.jdbc.core.simple.SimpleJdbcCall ( getJdbcTemplate ( ) ) . withFunctionName ( "isMemBalloonEnabled" ) . execute ( parameterSource ) ; java.lang.String resultKey = getDialect ( ) . getFunctionReturnKey ( ) ; return ( dbResults.get ( resultKey ) ) != null ? ( ( java.lang.Boolean ) ( dbResults.get ( resultKey ) ) ) . booleanValue ( ) : false ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > listPermissionSubjects = new java.util.ArrayList < > ( ) ; listPermissionSubjects.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; return listPermissionSubjects ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > listPermissionSubjects = new java.util.ArrayList < > ( ) ; if ( org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.isImageProvided ( ) ) { listPermissionSubjects.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.EDIT_DISK_PROPERTIES ) ) ; } else { listPermissionSubjects.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getParameters ( ) . getStorageDomainId ( ) , org.ovirt.engine.core.common.VdcObjectType.Storage , org.ovirt.engine.core.common.businessentities.ActionGroup.CREATE_DISK ) ) ; } return listPermissionSubjects ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { java.lang.Object [ ] args = invocation.getArguments ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage arg = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( args [ 0 ] ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > list = createDiskSnapshot ( arg.getId ( ) , 3 ) ; return list ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > answer ( org.mockito.invocation.InvocationOnMock invocation ) throws java.lang.Throwable { java.lang.Object [ ] args = invocation.getArguments ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage arg = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( args [ 0 ] ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > list = createDiskSnapshot ( arg.getId ( ) , 3 ) ; return list ; }
Source:
public boolean awaitVdsmResponse ( ) { final int checks = ( org.ovirt.engine.core.bll.network.NetworkConfigurator.VDSM_RESPONSIVENESS_PERIOD_IN_SECONDS ) / ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.SetupNetworksPollingTimeout ) ) ; for ( int i = 0 ; i < checks ; i ++ ) { if ( pollVds ( ) ) { org.ovirt.engine.core.bll.network.NetworkConfigurator.log.info ( "Engine managed to communicate with VDSM agent on host '{}' ('{}')" , host.getName ( ) , host.getId ( ) ) ; return true ; } else { delayPolling ( ) ; } } return false ; }

Target:
public boolean awaitVdsmResponse ( ) { final int checks = ( org.ovirt.engine.core.bll.network.NetworkConfigurator.VDSM_RESPONSIVENESS_PERIOD_IN_SECONDS ) / ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.SetupNetworksPollingTimeout ) ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller poller = new org.ovirt.engine.core.bll.network.host.HostSetupNetworkPoller ( ) ; for ( int i = 0 ; i < checks ; i ++ ) { if ( poller.poll ( host.getId ( ) ) ) { org.ovirt.engine.core.bll.network.NetworkConfigurator.log.info ( "Engine managed to communicate with VDSM agent on host '{}' ('{}')" , host.getName ( ) , host.getId ( ) ) ; return true ; } } return false ; }
Source:
public void storageTypeUnsupported ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = mockGetExistingDomain ( true ) ; sd.setStorageType ( StorageType.CINDER ) ; sd.setId ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommandTest.HE_SD_ID ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 1 ) ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( VdcQueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }

Target:
public void storageTypeUnsupported ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = mockGetExistingDomain ( true ) ; sd.setStorageType ( StorageType.CINDER ) ; sd.setId ( org.ovirt.engine.core.bll.storage.domain.ImportHostedEngineStorageDomainCommandTest.HE_SD_ID ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_TYPE_UNSUPPORTED ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 1 ) ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }
Source:
public static void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) , aQuery ) ; }

Target:
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 ) ; }