auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public void getStorageDevices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterStorageDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , aQuery ) ; }
Source:
public void testUpdateStoragePoolIsoMap ( ) { existingStoragePoolIsoMap.setstatus ( StorageDomainStatus.Active ) ; dao.update ( existingStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , new org.ovirt.engine.core.compat.Guid ( existingStoragePoolIsoMap.getstorage_pool_id ( ) . toString ( ) ) ) ) ; assertNotNull ( result ) ; assertEquals ( existingStoragePoolIsoMap , result ) ; }

Target:
public void testUpdateStoragePoolIsoMap ( ) { existingStoragePoolIsoMap.setstatus ( StorageDomainStatus.Active ) ; dao.update ( existingStoragePoolIsoMap ) ; org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap result = dao.get ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( existingStoragePoolIsoMap.getstorage_id ( ) , new org.ovirt.engine.core.compat.Guid ( existingStoragePoolIsoMap.getstorage_pool_id ( ) . toString ( ) ) ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingStoragePoolIsoMap , result ) ; }
Source:
public boolean handle ( java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > queryResults ) { boolean result = true ; for ( org.ovirt.engine.api.extensions.ExtMap queryResult : queryResults ) { if ( ( principalRecords.size ( ) ) < ( org.ovirt.engine.core.aaa.AuthzUtils.QUERIES_RESULTS_LIMIT ) ) { principalRecords.add ( queryResult ) ; } else { result = false ; break ; } } return result ; }

Target:
public boolean handle ( java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > queryResults ) { boolean result = true ; for ( org.ovirt.engine.api.extensions.ExtMap queryResult : queryResults ) { if ( ( records.size ( ) ) < ( org.ovirt.engine.core.aaa.AuthzUtils.QUERIES_RESULTS_LIMIT ) ) { records.add ( queryResult ) ; } else { result = false ; break ; } } return result ; }
Source:
public void testGuidListValues ( ) { java.lang.String listValues = "e61f7070-cd52-46ca-88c2-686e1c70fe44,1eaa381a-fbf9-4ef5-bec2-6e4337f85d66" ; java.util.List < org.ovirt.engine.core.compat.Guid > stringList = org.ovirt.engine.core.compat.Guid.createGuidListFromString ( listValues ) ; java.util.List < org.ovirt.engine.core.compat.Guid > expectedList = new java.util.ArrayList < > ( ) ; expectedList.add ( new org.ovirt.engine.core.compat.Guid ( "e61f7070-cd52-46ca-88c2-686e1c70fe44" ) ) ; expectedList.add ( new org.ovirt.engine.core.compat.Guid ( "1eaa381a-fbf9-4ef5-bec2-6e4337f85d66" ) ) ; org.junit.Assert.assertEquals ( expectedList , stringList ) ; }

Target:
public void testGuidListValues ( ) { java.lang.String listValues = "e61f7070-cd52-46ca-88c2-686e1c70fe44,1eaa381a-fbf9-4ef5-bec2-6e4337f85d66" ; java.util.List < org.ovirt.engine.core.compat.Guid > stringList = org.ovirt.engine.core.compat.Guid.createGuidListFromString ( listValues ) ; java.util.List < org.ovirt.engine.core.compat.Guid > expectedList = new java.util.ArrayList < > ( ) ; expectedList.add ( new org.ovirt.engine.core.compat.Guid ( "e61f7070-cd52-46ca-88c2-686e1c70fe44" ) ) ; expectedList.add ( new org.ovirt.engine.core.compat.Guid ( "1eaa381a-fbf9-4ef5-bec2-6e4337f85d66" ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( expectedList , stringList ) ; }
Source:
private void mockVMPoolDao ( ) { org.mockito.Mockito.doReturn ( vmPoolDao ) . when ( command ) . getVmPoolDao ( ) ; }

Target:
public void validateSufficientSpaceOnDestinationDomains ( ) { setupForStorageTests ( ) ; command.ensureDestinationImageMap ( ) ; org.junit.Assert.assertTrue ( command.checkDestDomains ( ) ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsWithinThresholds ( ) ; org.mockito.Mockito.verify ( multipleSdValidator ) . allDomainsHaveSpaceForNewDisks ( org.mockito.Matchers.anyListOf ( org.ovirt.engine.core.common.businessentities.storage.DiskImage.class ) ) ; }
Source:
private org.ovirt.engine.ui.webadmin.ApplicationResources getResources ( ) { return org.ovirt.engine.ui.webadmin.gin.ClientGinjectorProvider.getApplicationResources ( ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( IVdcQueryable quota ) { boolean quotaExceeded = false ; if ( quota instanceof org.ovirt.engine.core.common.businessentities.QuotaStorage ) { quotaExceeded = getQuotaExceeded ( ( ( org.ovirt.engine.core.common.businessentities.QuotaStorage ) ( quota ) ) ) ; } else if ( quota instanceof org.ovirt.engine.core.common.businessentities.QuotaVdsGroup ) { quotaExceeded = getQuotaExceeded ( ( ( org.ovirt.engine.core.common.businessentities.QuotaVdsGroup ) ( quota ) ) ) ; } if ( quotaExceeded ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.webadmin.widget.table.column.QuotaUtilizationStatusColumn.constants.quotaExceeded ( ) ) ; } return null ; }
Source:
public void testGetPagPhrase ( ) { mcr.mockConfigValue ( ConfigValues.DBPagingType , "wrongPageType" ) ; mcr.mockConfigValue ( ConfigValues.DBPagingSyntax , "wrongPageSyntax" ) ; org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = new org.ovirt.engine.core.searchbackend.SyntaxContainer ( "" ) ; res.setMaxCount ( 0 ) ; org.junit.Assert.assertEquals ( "" , chkr.getPagePhrase ( res , "1" ) ) ; mcr.mockConfigValue ( ConfigValues.DBPagingType , "Range" ) ; mcr.mockConfigValue ( ConfigValues.DBPagingSyntax , " WHERE RowNum BETWEEN %1$s AND %2$s" ) ; org.junit.Assert.assertNotEquals ( "" , chkr.getPagePhrase ( res , "1" ) ) ; }

Target:
public void testGetPagPhraseWrong ( ) { mcr.mockConfigValue ( ConfigValues.DBPagingType , "wrongPageType" ) ; mcr.mockConfigValue ( ConfigValues.DBPagingSyntax , "wrongPageSyntax" ) ; org.ovirt.engine.core.searchbackend.SyntaxChecker chkr = new org.ovirt.engine.core.searchbackend.SyntaxChecker ( ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer res = new org.ovirt.engine.core.searchbackend.SyntaxContainer ( "" ) ; res.setMaxCount ( 0 ) ; org.junit.Assert.assertEquals ( "" , chkr.getPagePhrase ( res , "1" ) ) ; }
Source:
public void testValidUpdateOfEditableFieldOnTemplateVm ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; boolean updateIsValid = org.ovirt.engine.core.bll.VmTemplateHandler.isUpdateValid ( src , dest ) ; org.junit.Assert.assertTrue ( "Update should be valid for different cluster IDs" , updateIsValid ) ; }

Target:
public void testValidUpdateOfEditableFieldOnTemplateVm ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate src = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; src.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate dest = new org.ovirt.engine.core.common.businessentities.VmTemplate ( ) ; dest.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; boolean updateIsValid = vmTemplateHandler.isUpdateValid ( src , dest ) ; org.junit.Assert.assertTrue ( "Update should be valid for different cluster IDs" , updateIsValid ) ; }
Source:
public static void getDefaultSpmPriority ( 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 ( ) , 5 ) ; }

Target:
public static void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }
Source:
private void generateWriter ( org.ovirt.api.metamodel.concepts.StructType type ) { javaBuffer = new org.ovirt.api.metamodel.tool.JavaClassBuffer ( ) ; org.ovirt.api.metamodel.tool.JavaClassName writerName = javaTypes.getJsonWriterName ( type ) ; javaBuffer.setClassName ( writerName ) ; generateWriterSource ( type ) ; try { javaBuffer.write ( outDir ) ; } catch ( java.io.IOException exception ) { throw new java.lang.RuntimeException ( ( ( "Can\'t write file for JSON writer \"" + writerName ) + "\"" ) , exception ) ; } }

Target:
private void generateStructWriter ( org.ovirt.api.metamodel.concepts.StructType type ) { javaBuffer = new org.ovirt.api.metamodel.tool.JavaClassBuffer ( ) ; org.ovirt.api.metamodel.tool.JavaClassName writerName = javaTypes.getJsonWriterName ( type ) ; javaBuffer.setClassName ( writerName ) ; generateStructWriterSource ( type ) ; try { javaBuffer.write ( outDir ) ; } catch ( java.io.IOException exception ) { throw new java.lang.RuntimeException ( ( ( "Can\'t write file for JSON writer \"" + writerName ) + "\"" ) , exception ) ; } }
Source:
public void testValidateClusterSupportForVirtioScsi ( ) { org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > cmd = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.Matchers.any ( java.util.Map.class ) ) ; cmd.getParameters ( ) . getVm ( ) . getDiskMap ( ) . values ( ) . iterator ( ) . next ( ) . setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; cmd.getVdsGroup ( ) . setCompatibilityVersion ( Version.v3_2 ) ; cmd.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( cmd , EngineMessage.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; }

Target:
public void testValidateClusterSupportForVirtioScsi ( ) { org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > cmd = setupDiskSpaceTest ( createParameters ( ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . validateImages ( org.mockito.Matchers.any ( java.util.Map.class ) ) ; cmd.getParameters ( ) . getVm ( ) . getDiskMap ( ) . values ( ) . iterator ( ) . next ( ) . setDiskInterface ( DiskInterface.VirtIO_SCSI ) ; cmd.getVdsGroup ( ) . setCompatibilityVersion ( Version.v3_2 ) ; cmd.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; }
Source:
public void canDoActionWrongDiskImageTypeTemplate ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initTemplateDiskImage ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK.toString ( ) ) ) ; }

Target:
public void validateWrongDiskImageTypeTemplate ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initTemplateDiskImage ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISK_IS_NOT_VM_DISK.toString ( ) ) ) ; }
Source:
protected void executeNetworkCommand ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics , java.lang.Object ... params ) { assert op1 instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkToDetach = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( op1 ) ) ; assert networkToDetach.isAttached ( ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.detachNetwork ( allNics , networkToDetach ) ; }

Target:
protected void executeNetworkCommand ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op1 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkItemModel < ? > op2 , org.ovirt.engine.ui.uicommonweb.models.hosts.network.DataFromHostSetupNetworksModel dataFromHostSetupNetworksModel , java.lang.Object ... params ) { assert op1 instanceof org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel networkToDetach = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( op1 ) ) ; assert networkToDetach.isAttached ( ) ; org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperation.detachNetworkAndUpdateHostSetupNetworksParameters ( dataFromHostSetupNetworksModel , networkToDetach ) ; }
Source:
protected boolean checkImageConfiguration ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { return org.ovirt.engine.core.bll.ImagesHandler.checkImageConfiguration ( destStorages.get ( diskInfoDestinationMap.get ( diskImage.getId ( ) ) . getStorageIds ( ) . get ( 0 ) ) . getStorageStaticData ( ) , diskImage , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean checkImageConfiguration ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { return org.ovirt.engine.core.bll.ImagesHandler.checkImageConfiguration ( destStorages.get ( diskInfoDestinationMap.get ( diskImage.getId ( ) ) . getStorageIds ( ) . get ( 0 ) ) . getStorageStaticData ( ) , diskImage , org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
private void logNoProxyAvailable ( org.ovirt.engine.core.compat.Guid dataCenterId ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; java.lang.String dcName = org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getDbFacade ( ) . getStoragePoolDao ( ) . get ( dataCenterId ) . getName ( ) ; logable.addCustomValue ( "StoragePoolName" , dcName ) ; auditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_NO_PROXY_HOST_AVAILABLE_IN_DC ) ; }

Target:
private void logNoProxyAvailable ( org.ovirt.engine.core.compat.Guid dataCenterId ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ) ; java.lang.String dcName = org.ovirt.engine.core.bll.GetVmsFromExternalProviderQuery.getDbFacade ( ) . getStoragePoolDao ( ) . get ( dataCenterId ) . getName ( ) ; logable.addCustomValue ( "StoragePoolName" , dcName ) ; auditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_NO_PROXY_HOST_AVAILABLE_IN_DC ) ; }
Source:
protected void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsGroupById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetClusterById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : getEntity ( 0 ) ) ) ; } }
Source:
public static void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
public void getExternalProviderDiscoveredHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.Cluster getCluster ( ) { return cluster ; }

Target:
public void setUp ( ) throws java.io.IOException { org.mockito.Mockito.doReturn ( cluster ) . when ( cmd ) . getCluster ( ) ; org.mockito.Mockito.doReturn ( java.util.Collections.emptyList ( ) ) . when ( cmd ) . getImages ( ) ; org.mockito.Mockito.when ( externalVnicProfileMappingValidator.validateExternalVnicProfileMapping ( new java.util.ArrayList < > ( ) , clusterId ) ) . thenReturn ( ValidationResult.VALID ) ; mockCluster ( ) ; setXmlOvfData ( ) ; }
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 getTemplateNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplateInterfacesByTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.utils.lock.EngineLock acquireGlusterLockWait ( org.ovirt.engine.core.compat.Guid clusterId ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > exclusiveLocks = new java.util.HashMap < > ( ) ; exclusiveLocks.put ( clusterId.toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.GLUSTER , VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_OPERATION_INPROGRESS ) ) ; org.ovirt.engine.core.utils.lock.EngineLock lock = new org.ovirt.engine.core.utils.lock.EngineLock ( exclusiveLocks , null ) ; org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLockWait ( lock ) ; return lock ; }

Target:
public org.ovirt.engine.core.utils.lock.EngineLock acquireGlusterLockWait ( org.ovirt.engine.core.compat.Guid clusterId ) { java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > exclusiveLocks = new java.util.HashMap < > ( ) ; exclusiveLocks.put ( clusterId.toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.GLUSTER , EngineMessage.ACTION_TYPE_FAILED_GLUSTER_OPERATION_INPROGRESS ) ) ; org.ovirt.engine.core.utils.lock.EngineLock lock = new org.ovirt.engine.core.utils.lock.EngineLock ( exclusiveLocks , null ) ; org.ovirt.engine.core.utils.lock.LockManagerFactory.getLockManager ( ) . acquireLockWait ( lock ) ; return lock ; }
Source:
public void syncNetworkQosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; org.ovirt.engine.core.compat.Guid qosId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.when ( qosDao.get ( qosId ) ) . thenReturn ( createQos ( ) ) ; network.setQosId ( qosId ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void syncNetworkQosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; org.ovirt.engine.core.compat.Guid qosId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = createQos ( ) ; org.mockito.Mockito.when ( qosDao.get ( qosId ) ) . thenReturn ( qos ) ; network.setQosId ( qosId ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( iface ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
Source:
public static void GetMaxVmPriority ( 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 ) { if ( source == null ) { return 100 ; } return ( ( java.lang.Integer ) ( source ) ) . intValue ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPriorityMaxValue ) , aQuery ) ; }

Target:
public static void GetMaxVmPriority ( 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 ) { if ( source == null ) { return 100 ; } return ( ( java.lang.Integer ) ( source ) ) . intValue ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPriorityMaxValue , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public void testGetDefaultQuotaToDCWithoutDefaultQuota ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quotaUnlimited = quotaHelper.getUnlimitedQuota ( mockStoragePool ( ) , true ) ; assertQuotaUnlimited ( quotaUnlimited ) ; assertQuotaUnlimitedName ( quotaUnlimited ) ; }

Target:
public void testGetDefaultQuotaToDCWithoutDefaultQuota ( ) throws java.lang.Exception { java.lang.String defaultQuotaName = quotaHelper.getDefaultQuotaName ( storagePool.getname ( ) ) ; org.mockito.Mockito.when ( quotaHelper.generateDefaultQuotaName ( storagePool ) ) . thenReturn ( defaultQuotaName ) ; org.ovirt.engine.core.common.businessentities.Quota quotaUnlimited = quotaHelper.getUnlimitedQuota ( mockStoragePool ( ) , true ) ; assertQuotaUnlimited ( quotaUnlimited ) ; assertQuotaUnlimitedName ( quotaUnlimited ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.DbUser persistAuthenticatedUser ( org.ovirt.engine.core.common.businessentities.AdUser adUser ) { org.ovirt.engine.core.common.businessentities.DbUser dbUser = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . get ( adUser.getUserId ( ) ) ; boolean newUser = dbUser == null ; dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( adUser ) ; if ( newUser ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . save ( dbUser ) ; } else { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . update ( dbUser ) ; } return dbUser ; }

Target:
public static org.ovirt.engine.core.common.businessentities.DbUser persistAuthenticatedUser ( org.ovirt.engine.core.common.businessentities.LdapUser ldapUser ) { org.ovirt.engine.core.common.businessentities.DbUser dbUser = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . get ( ldapUser.getUserId ( ) ) ; boolean newUser = dbUser == null ; dbUser = new org.ovirt.engine.core.common.businessentities.DbUser ( ldapUser ) ; if ( newUser ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . save ( dbUser ) ; } else { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . update ( dbUser ) ; } return dbUser ; }
Source:
public static org.ovirt.engine.core.aaa.DirectoryUser findDirectoryUserById ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.lang.String id , final boolean groupsResolving , final boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryUser > users = org.ovirt.engine.core.aaa.DirectoryUtils.findDirectoryUserByIds ( extension , namespace , java.util.Arrays.asList ( id ) , groupsResolving , groupsResolvingRecursive ) ; if ( users.isEmpty ( ) ) { return null ; } return users.get ( 0 ) ; }

Target:
public static org.ovirt.engine.core.aaa.DirectoryUser findDirectoryUserById ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.lang.String id , final boolean groupsResolving , final boolean groupsResolvingRecursive ) { java.util.Collection < org.ovirt.engine.core.aaa.DirectoryUser > users = org.ovirt.engine.core.aaa.DirectoryUtils.findDirectoryUserByIds ( extension , namespace , java.util.Arrays.asList ( id ) , groupsResolving , groupsResolvingRecursive ) ; if ( ( users.size ( ) ) == 0 ) { return null ; } return new java.util.ArrayList < org.ovirt.engine.core.aaa.DirectoryUser > ( users ) . get ( 0 ) ; }
Source:
public static java.lang.String getConstraint ( javax.ws.rs.core.UriInfo uriInfo , java.lang.String defaultQuery , java.lang.Class < ? > clz , boolean typePrefix ) { java.lang.String prefix = ( typePrefix ) ? org.ovirt.engine.api.common.util.QueryHelper.RETURN_TYPES.get ( clz ) : "" ; java.util.HashMap < java.lang.String , java.lang.String > constraints = org.ovirt.engine.api.common.util.QueryHelper.getQueryConstraints ( uriInfo , org.ovirt.engine.api.common.util.QueryHelper.CONSTRAINT_PARAMETER ) ; return ( constraints != null ) && ( constraints.containsKey ( org.ovirt.engine.api.common.util.QueryHelper.CONSTRAINT_PARAMETER ) ) ? prefix + ( constraints.get ( org.ovirt.engine.api.common.util.QueryHelper.CONSTRAINT_PARAMETER ) ) : defaultQuery != null ? prefix + defaultQuery : null ; }

Target:
public static java.lang.String getConstraint ( javax.ws.rs.core.HttpHeaders headers , javax.ws.rs.core.UriInfo ui , java.lang.String defaultQuery , java.lang.Class < ? > clz , boolean typePrefix ) { java.lang.String prefix = ( typePrefix ) ? org.ovirt.engine.api.common.util.QueryHelper.RETURN_TYPES.get ( clz ) : "" ; java.lang.String search = org.ovirt.engine.api.common.util.ParametersHelper.getParameter ( headers , ui , org.ovirt.engine.api.common.util.QueryHelper.CONSTRAINT_PARAMETER ) ; if ( search != null ) { return prefix + search ; } if ( defaultQuery != null ) { return prefix + defaultQuery ; } return null ; }
Source:
public static void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }
Source:
private void initAutoStartVmsToRestart ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > failedAutoStartVms = getVmDao ( ) . getAllFailedAutoStartVms ( ) ; java.util.ArrayList < org.ovirt.engine.core.bll.AutoStartVmsRunner.AutoStartVmToRestart > initialFailedVms = new java.util.ArrayList ( failedAutoStartVms.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : failedAutoStartVms ) { org.ovirt.engine.core.bll.AutoStartVmsRunner.log.info ( "Found HA VM which is down because of an error, trying to restart it, VM '{}' ({})" , vm.getName ( ) , vm.getId ( ) ) ; initialFailedVms.add ( new org.ovirt.engine.core.bll.AutoStartVmsRunner.AutoStartVmToRestart ( vm.getId ( ) ) ) ; } autoStartVmsToRestart = new java.util.concurrent.CopyOnWriteArraySet < > ( initialFailedVms ) ; }

Target:
protected abstract boolean isVmNeedsToBeAutoStarted ( org.ovirt.engine.core.compat.Guid vmId ) ;
Source:
protected java.lang.String getUserdefinedVMProperties ( org.ovirt.engine.core.compat.Version version ) { return "" ; }

Target:
public void testBootFromNetworkNoNetwork ( ) { org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.network.VmNetworkInterfaceDao.class ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ) . when ( dao ) . getAllForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( dao ) . when ( runVmValidator ) . getVmNetworkInterfaceDao ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.N , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ) , false , VdcBllMessages.VM_CANNOT_RUN_FROM_NETWORK_WITHOUT_NETWORK ) ; }
Source:
public org.ovirt.engine.core.bll.SPMAsyncTask concreteCreateTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , getAsyncTask ( taskId , asyncTaskCreationInfo , parentCommand ) ) ; p.setEntityInfo ( getParameters ( ) . getEntityInfo ( ) ) ; return createTask ( internalGetTaskType ( ) , p ) ; }

Target:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { persistCommand ( parentCommand , false ) ; }
Source:
public static void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.ui.uicommonweb.Linq.VdsGroupByNameComparer ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getClusterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVdsGroupsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
protected void ExecuteVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getBroker ( ) . getStorageDomainStats ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.BuildStorageDynamicFromXmlRpcStruct ( _result.mStorageStats ) ; domain.setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( domain ) ; }

Target:
protected void executeVdsBrokerCommand ( ) { _result = org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getBroker ( ) . getStorageDomainStats ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getParameters ( ) . getStorageDomainId ( ) . toString ( ) ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.proceedProxyReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.StorageDomain domain = org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.BuildStorageDynamicFromXmlRpcStruct ( _result.mStorageStats ) ; domain.setId ( org.ovirt.engine.core.vdsbroker.vdsbroker.GetStorageDomainStatsVDSCommand.getParameters ( ) . getStorageDomainId ( ) ) ; setReturnValue ( domain ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.DiskImage i = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeInBytes ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return i ; }

Target:
private static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImageTemplate ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage i = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; i.setSizeInGigabytes ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.USED_SPACE_GB ) + ( org.ovirt.engine.core.bll.AddVmCommandTest.AVAILABLE_SPACE_GB ) ) ) ; i.setActualSizeInBytes ( ( ( ( ( org.ovirt.engine.core.bll.AddVmCommandTest.REQUIRED_DISK_SIZE_GB ) * 1024L ) * 1024L ) * 1024L ) ) ; i.setImageId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; i.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID_1 ) ) ) ; return i ; }
Source:
private void updateFenceAgents ( ) { if ( ( getParameters ( ) . getFenceAgents ( ) ) != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getFenceAgentDao ( ) . removeByVdsId ( getVdsId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.FenceAgent agent : getParameters ( ) . getFenceAgents ( ) ) { agent.setHostId ( getVdsId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getFenceAgentDao ( ) . save ( agent ) ; } } }

Target:
private void updateFenceAgents ( ) { if ( ( getParameters ( ) . getFenceAgents ( ) ) != null ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getFenceAgentDao ( ) . removeByVdsId ( getVdsId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.pm.FenceAgent agent : getParameters ( ) . getFenceAgents ( ) ) { agent.setHostId ( getVdsId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getFenceAgentDao ( ) . save ( agent ) ; } } }
Source:
protected void performBootstrap ( ) { super . performBootstrap ( ) ; com.google.gwt.user.client.Window.setTitle ( dynamicMessages.applicationTitle ( ) ) ; org.ovirt.engine.ui.webadmin.uimode.UiModeData uiModeData = org.ovirt.engine.ui.webadmin.uimode.UiModeData.instance ( ) ; if ( uiModeData != null ) { handleUiMode ( uiModeData ) ; } placeManager.revealCurrentPlace ( ) ; }

Target:
protected void performBootstrap ( ) { super . performBootstrap ( ) ; com.google.gwt.user.client.Window.setTitle ( dynamicMessages.applicationTitle ( ) ) ; org.ovirt.engine.core.common.mode.ApplicationMode uiMode = org.ovirt.engine.ui.webadmin.uimode.UiModeData.getUiMode ( ) ; if ( uiMode != null ) { org.ovirt.engine.ui.uicommonweb.models.ApplicationModeHelper.setUiMode ( uiMode ) ; } placeManager.revealCurrentPlace ( ) ; }
Source:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel ) ( model ) ) ; java.lang.Boolean migrationNetworkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MigrationNetworkEnabled , clusterNetworkModel.getCluster ( ) . getcompatibility_version ( ) . toString ( ) ) ) ) ; return migrationNetworkEnabled && ( clusterNetworkModel.isAttached ( ) ) ; }

Target:
protected boolean canEdit ( org.ovirt.engine.ui.uicommonweb.models.EntityModel model ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel ) ( model ) ) ; java.lang.Boolean migrationNetworkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MigrationNetworkEnabled , clusterNetworkModel.getCluster ( ) . getcompatibility_version ( ) . toString ( ) ) ) ) ; return ( migrationNetworkEnabled && ( clusterNetworkModel.isAttached ( ) ) ) && ( ! ( clusterNetworkModel.isExternal ( ) ) ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getValue ( T object ) { java.lang.Integer progressValue = getProgressValue ( object ) ; int progress = ( progressValue != null ) ? progressValue : 0 ; java.lang.String text = getProgressText ( object ) ; java.lang.String color = getColorByProgress ( progress ) ; return org.ovirt.engine.ui.webadmin.widget.table.column.AbstractProgressBarColumn.templates.progressBar ( progress , text , color , getStyle ( ) , com.google.gwt.user.client.DOM.createUniqueId ( ) ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getValue ( T object ) { java.lang.Integer progressValue = getProgressValue ( object ) ; int progress = ( progressValue != null ) ? progressValue : 0 ; java.lang.String text = getProgressText ( object ) ; java.lang.String color = getColorByProgress ( progress ) ; return org.ovirt.engine.ui.common.widget.table.column.AbstractProgressBarColumn.templates.progressBar ( progress , text , color , getStyle ( ) , com.google.gwt.user.client.DOM.createUniqueId ( ) ) ; }
Source:
public static void getRedirectServletReportsPage ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getVmNicList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected void initFrontend ( ) { frontend.setEventsHandler ( frontendEventsHandler ) ; frontend.getFrontendFailureEvent ( ) . addListener ( frontendFailureEventListener ) ; frontend.getFrontendNotLoggedInEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { user.logout ( ) ; } } ) ; frontend.setFilterQueries ( filterFrontendQueries ( ) ) ; }

Target:
public void onLogout ( ) { restApiSessionManager.releaseSession ( ) ; }
Source:
public static org.ovirt.engine.core.aaa.DirectoryGroup findGroupById ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String id ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > groups = org.ovirt.engine.core.aaa.AuthzUtils.findGroupsByIds ( extension , java.util.Arrays.asList ( id ) ) ; if ( groups.isEmpty ( ) ) { return null ; } return groups.get ( 0 ) ; }

Target:
public static org.ovirt.engine.core.aaa.DirectoryGroup findGroupById ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , java.lang.String namespace , final java.lang.String id , final boolean resolveGroups , final boolean resolveGroupsRecursive ) { java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > groups = org.ovirt.engine.core.aaa.AuthzUtils.findGroupsByIds ( extension , namespace , java.util.Arrays.asList ( id ) , resolveGroups , resolveGroupsRecursive ) ; if ( groups.isEmpty ( ) ) { return null ; } return groups.get ( 0 ) ; }