auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void buildVmGraphicsDevicesFromDb ( boolean usesGraphicsAsDevice ) { if ( usesGraphicsAsDevice ) { buildVmDevicesFromDb ( VmDeviceGeneralType.GRAPHICS , false ) ; } java.lang.String legacyDisplay = deriveDisplayTypeLegacy ( ) ; if ( legacyDisplay != null ) { createInfo.put ( VdsProperties.display , legacyDisplay ) ; } }

Target:
private void buildVmGraphicsDevicesFromDb ( boolean usesGraphicsAsDevice , java.util.Map < java.lang.String , java.lang.Object > extraSpecParams ) { if ( usesGraphicsAsDevice ) { buildVmDevicesFromDb ( VmDeviceGeneralType.GRAPHICS , false , extraSpecParams ) ; } java.lang.String legacyDisplay = deriveDisplayTypeLegacy ( ) ; if ( legacyDisplay != null ) { createInfo.put ( VdsProperties.display , legacyDisplay ) ; } }
Source:
private java.util.Map getUserInfoObject ( org.ovirt.engine.core.common.businessentities.aaa.DbUser loggedInUser , java.lang.String ssoToken ) { java.util.Map < java.lang.String , java.lang.String > obj = new java.util.HashMap < > ( ) ; obj.put ( "userName" , loggedInUser.getLoginName ( ) ) ; obj.put ( "domain" , loggedInUser.getDomain ( ) ) ; obj.put ( "isAdmin" , java.lang.Boolean.toString ( loggedInUser.isAdmin ( ) ) ) ; obj.put ( "ssoToken" , ssoToken ) ; return obj ; }

Target:
private java.util.Map getUserInfoObject ( org.ovirt.engine.core.common.businessentities.aaa.DbUser loggedInUser , java.lang.String ssoToken ) { java.util.Map < java.lang.String , java.lang.String > obj = new java.util.HashMap < > ( ) ; obj.put ( "userName" , loggedInUser.getLoginName ( ) ) ; obj.put ( "domain" , loggedInUser.getDomain ( ) ) ; obj.put ( "isAdmin" , java.lang.Boolean.toString ( loggedInUser.isAdmin ( ) ) ) ; obj.put ( "ssoToken" , ssoToken ) ; obj.put ( "userId" , loggedInUser.getId ( ) . toString ( ) ) ; return obj ; }
Source:
private static void setNewIdInImportedCollections ( org.ovirt.engine.core.common.businessentities.VmBase entity ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice managedDevice : entity.getManagedVmDeviceMap ( ) . values ( ) ) { if ( ! ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.isDiskOrInterface ( managedDevice ) ) ) { managedDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , entity.getId ( ) ) ) ; } } for ( org.ovirt.engine.core.common.businessentities.VmDevice unMnagedDevice : entity.getUnmanagedDeviceList ( ) ) { unMnagedDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , entity.getId ( ) ) ) ; } }

Target:
private static void setNewIdInImportedCollections ( org.ovirt.engine.core.common.businessentities.VmBase entity ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice managedDevice : entity.getManagedDeviceMap ( ) . values ( ) ) { if ( ! ( org.ovirt.engine.core.bll.utils.VmDeviceUtils.isDiskOrInterface ( managedDevice ) ) ) { managedDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , entity.getId ( ) ) ) ; } } for ( org.ovirt.engine.core.common.businessentities.VmDevice unMnagedDevice : entity.getUnmanagedDeviceList ( ) ) { unMnagedDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , entity.getId ( ) ) ) ; } }
Source:
protected org.ovirt.engine.core.common.businessentities.network.NetworkAttachment addParents ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment model ) { model.setHostNic ( new org.ovirt.engine.api.model.HostNIC ( ) ) ; model.getHostNic ( ) . setId ( nicId.toString ( ) ) ; model.getHostNic ( ) . setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; model.getHostNic ( ) . getHost ( ) . setId ( getHostId ( ) . toString ( ) ) ; return model ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.NetworkAttachment addParents ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment model ) { model.setHostNic ( new org.ovirt.engine.api.model.HostNic ( ) ) ; model.getHostNic ( ) . setId ( nicId.toString ( ) ) ; model.getHostNic ( ) . setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; model.getHostNic ( ) . getHost ( ) . setId ( getHostId ( ) . toString ( ) ) ; return model ; }
Source:
public static org.ovirt.engine.api.model.CdRom map ( org.ovirt.engine.core.common.businessentities.VM entity , org.ovirt.engine.api.model.CdRom template ) { org.ovirt.engine.api.model.CdRom model = ( template != null ) ? template : new org.ovirt.engine.api.model.CdRom ( ) ; model.setId ( org.ovirt.engine.api.restapi.types.CdRomMapper.CDROM_ID.toString ( ) ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( entity.getStaticData ( ) . getIsoPath ( ) ) ) ) { model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; model.getFile ( ) . setId ( entity.getStaticData ( ) . getIsoPath ( ) ) ; } return model ; }

Target:
public static org.ovirt.engine.api.model.CdRom map ( org.ovirt.engine.core.common.businessentities.VM entity , org.ovirt.engine.api.model.CdRom template ) { org.ovirt.engine.api.model.CdRom model = ( template != null ) ? template : new org.ovirt.engine.api.model.CdRom ( ) ; model.setId ( org.ovirt.engine.api.restapi.types.CdRomMapper.CDROM_ID.toString ( ) ) ; if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( entity.getStaticData ( ) . getIsoPath ( ) ) ) ) { model.setFile ( new org.ovirt.engine.api.model.File ( ) ) ; model.getFile ( ) . setId ( entity.getStaticData ( ) . getIsoPath ( ) ) ; } return model ; }
Source:
public static void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { 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.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase ( storageDomainId ) , aQuery ) ; }
Source:
private java.lang.Object getStorageDomains ( ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > sds = new java.util.LinkedList < org.ovirt.engine.api.model.StorageDomain > ( ) ; org.ovirt.engine.api.model.StorageDomain sd = new org.ovirt.engine.api.model.StorageDomain ( ) ; sd.setStorageName ( "Storage_Domain_1" ) ; sd.setId ( GUIDS [ 2 ] ) ; sds.add ( sd ) ; return sds ; }

Target:
private java.util.List getStorageDomains ( ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > sds = new java.util.LinkedList < > ( ) ; sds.add ( getStorageDomain ( GUIDS [ 2 ] ) ) ; return sds ; }
Source:
public void testGetAllMultiVdsSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Hosts" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( vdsResultList , searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testGetAllMultiVdsSearch ( ) throws java.lang.Exception { org.ovirt.engine.core.common.queries.SearchParameters searchParam = new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Hosts" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) , org.ovirt.engine.core.common.interfaces.SearchType.VDS ) ; org.ovirt.engine.core.bll.SearchQuery < org.ovirt.engine.core.common.queries.SearchParameters > searchQuery = spySearchQuery ( searchParam ) ; searchQuery.executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( vdsResultList , searchQuery.getQueryReturnValue ( ) . getReturnValue ( ) ) ; org.junit.Assert.assertEquals ( 1 , vdsResultList.size ( ) ) ; org.junit.Assert.assertEquals ( "cpu" , vdsResultList.get ( 0 ) . getCpuName ( ) . getCpuName ( ) ) ; }
Source:
public void testUpdateIncompleteParameters ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.CdRom update = new org.ovirt.engine.api.model.CdRom ( ) ; update.setFile ( null ) ; control.replay ( ) ; try { resource.update ( update ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "CdRom" , "update" , "file" ) ; } }

Target:
public void testUpdateIncompleteParameters ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; org.ovirt.engine.api.model.Cdrom update = new org.ovirt.engine.api.model.Cdrom ( ) ; update.setFile ( null ) ; control.replay ( ) ; try { resource.update ( update ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Cdrom" , "update" , "file" ) ; } }
Source:
private void writeCleanup ( ) { com.google.gwt.core.ext.typeinfo.JClassType editorType = model.getEditorType ( ) ; logger.log ( Type.DEBUG , ( "Starting to write cleanup impl. for editor " + ( editorType.getQualifiedSourceName ( ) ) ) ) ; sw.println ( ) ; sw.println ( "@Override" ) ; sw.println ( "public void cleanup() {" ) ; sw.indent ( ) ; sw.println ( "if (getObject() != null) {" ) ; sw.indent ( ) ; if ( model.getProxyType ( ) . isAssignableTo ( hasCleanupType ) ) { sw.println ( "getObject().cleanup();" ) ; } for ( com.google.gwt.editor.rebind.model.EditorData editorData : model.getEditorData ( ) ) { if ( editorData.getPropertyOwnerType ( ) . isAssignableTo ( hasCleanupType ) ) { sw.println ( java.lang.String.format ( "getObject()%s.cleanup();" , editorData.getBeanOwnerExpression ( ) ) ) ; } } sw.outdent ( ) ; sw.println ( "}" ) ; for ( com.google.gwt.core.ext.typeinfo.JField field : editorType.getFields ( ) ) { com.google.gwt.core.ext.typeinfo.JClassType fieldClassType = field.getType ( ) . isClassOrInterface ( ) ; if ( ( ( fieldClassType != null ) && ( fieldClassType.isAssignableTo ( hasCleanupType ) ) ) && ( ! ( field.getType ( ) . isClassOrInterface ( ) . isAssignableTo ( baseModelType ) ) ) ) { sw.println ( java.lang.String.format ( "getEditor().%s.cleanup();" , field.getName ( ) ) ) ; } } sw.outdent ( ) ; sw.println ( "}" ) ; }

Target:
private void writeCleanup ( ) { com.google.gwt.core.ext.typeinfo.JClassType editorType = model.getEditorType ( ) ; logger.log ( Type.DEBUG , ( "Starting to write cleanup impl. for editor " + ( editorType.getQualifiedSourceName ( ) ) ) ) ; sw.println ( ) ; sw.println ( "@Override" ) ; sw.println ( "public void cleanup() {" ) ; sw.indent ( ) ; sw.println ( "if (getObject() != null) {" ) ; sw.indent ( ) ; if ( model.getProxyType ( ) . isAssignableTo ( hasCleanupType ) ) { sw.println ( "getObject().cleanup();" ) ; } for ( com.google.gwt.editor.rebind.model.EditorData editorData : model.getEditorData ( ) ) { if ( editorData.getPropertyOwnerType ( ) . isAssignableTo ( hasCleanupType ) ) { sw.println ( java.lang.String.format ( "getObject()%s.cleanup();" , editorData.getBeanOwnerExpression ( ) ) ) ; } } sw.outdent ( ) ; sw.println ( "}" ) ; for ( com.google.gwt.core.ext.typeinfo.JField field : editorType.getFields ( ) ) { com.google.gwt.core.ext.typeinfo.JClassType fieldClassType = field.getType ( ) . isClassOrInterface ( ) ; if ( ( ( fieldClassType != null ) && ( fieldClassType.isAssignableTo ( hasCleanupType ) ) ) && ( ! ( field.getType ( ) . isClassOrInterface ( ) . isAssignableTo ( baseModelType ) ) ) ) { java.lang.String fieldName = field.getName ( ) ; sw.println ( java.lang.String.format ( "if (getEditor().%s != null) {" , fieldName ) ) ; sw.indent ( ) ; sw.println ( java.lang.String.format ( "getEditor().%s.cleanup();" , fieldName ) ) ; sw.outdent ( ) ; sw.println ( "}" ) ; } } sw.outdent ( ) ; sw.println ( "}" ) ; }
Source:
private void verifyPermit ( org.ovirt.engine.api.model.Permit permit , org.ovirt.engine.core.common.businessentities.ActionGroup action ) { assertEquals ( java.lang.Integer.toString ( action.getId ( ) ) , permit.getId ( ) ) ; org.ovirt.engine.api.model.PermitType permitType = org.ovirt.engine.api.restapi.types.PermitMapper.map ( action , ( ( org.ovirt.engine.api.model.PermitType ) ( null ) ) ) ; assertEquals ( permitType.value ( ) , permit.getName ( ) ) ; assertNotNull ( permit.getRole ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendPermitResourceTest.ROLE_ID.toString ( ) , permit.getRole ( ) . getId ( ) ) ; }

Target:
private void verifyPermit ( org.ovirt.engine.api.model.Permit permit , org.ovirt.engine.core.common.businessentities.ActionGroup action ) { assertEquals ( java.lang.Integer.toString ( action.getId ( ) ) , permit.getId ( ) ) ; assertEquals ( action.name ( ) . toLowerCase ( ) , permit.getName ( ) ) ; assertNotNull ( permit.getRole ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendPermitResourceTest.ROLE_ID.toString ( ) , permit.getRole ( ) . getId ( ) ) ; }
Source:
public void testPositiveAffinity ( ) throws java.lang.Exception { hosts = java.util.Arrays.asList ( host_positive_enforcing , host_not_in_affinity_group ) ; java.util.List < org.ovirt.engine.core.common.scheduling.AffinityGroup > affinityGroups = java.util.Arrays.asList ( positive_enforcing_group ) ; org.mockito.Mockito.doReturn ( affinityGroups ) . when ( affinityGroupDao ) . getAllAffinityGroupsByVmId ( org.mockito.Matchers.any ( ) ) ; org.assertj.core.api.Assertions.assertThat ( unit.filter ( cluster , hosts , vm , new java.util.HashMap < > ( ) , new org.ovirt.engine.core.common.scheduling.PerHostMessages ( ) ) ) . contains ( host_positive_enforcing ) . doesNotContain ( host_not_in_affinity_group ) ; }

Target:
public void testPositiveAffinity ( ) throws java.lang.Exception { hosts = java.util.Arrays.asList ( host_positive_enforcing , host_not_in_affinity_group ) ; java.util.List < org.ovirt.engine.core.common.scheduling.AffinityGroup > affinityGroups = java.util.Arrays.asList ( positive_enforcing_group ) ; org.mockito.Mockito.doReturn ( affinityGroups ) . when ( affinityGroupDao ) . getAllAffinityGroupsByVmId ( org.mockito.ArgumentMatchers.any ( ) ) ; org.assertj.core.api.Assertions.assertThat ( unit.filter ( cluster , hosts , vm , new java.util.HashMap < > ( ) , new org.ovirt.engine.core.common.scheduling.PerHostMessages ( ) ) ) . contains ( host_positive_enforcing ) . doesNotContain ( host_not_in_affinity_group ) ; }
Source:
public void oneDiskImagesDoesntExist ( ) { org.mockito.Mockito.doReturn ( false ) . when ( baseDiskDao ) . exists ( disk1 ) ; org.mockito.Mockito.doReturn ( true ) . when ( baseDiskDao ) . exists ( disk2 ) ; org.junit.Assert.assertThat ( diskExistenceValidator.disksNotExist ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST , ( "$diskIds " + ( disk1.toString ( ) ) ) ) ) ; }

Target:
public void oneDiskImagesDoesntExist ( ) { org.mockito.Mockito.doReturn ( false ) . when ( baseDiskDao ) . exists ( disk1 ) ; org.mockito.Mockito.doReturn ( true ) . when ( baseDiskDao ) . exists ( disk2 ) ; org.hamcrest.MatcherAssert.assertThat ( diskExistenceValidator.disksNotExist ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_DISKS_NOT_EXIST , ( "$diskIds " + ( disk1.toString ( ) ) ) ) ) ; }
Source:
public void postUpdateNumOfSockets2 ( ) { java.lang.String version = getClusterCompatibilityVersion ( ) . toString ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfCPUsPerSocket ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase ) ( target ) ) ; behavior.maxCpusPerSocket = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.totalCpuCoresChanged ( ) ; } } , getModel ( ) . getHash ( ) ) , version ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = this ; behavior.maxCpus = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.postUpdateNumOfSockets2 ( ) ; }
Source:
public static java.lang.String getRandomNumWithHighValue ( int min , int high ) { java.lang.String HighValue ; int Low = 1 ; if ( min > 1 ) { Low = min ; } int High = high ; HighValue = java.lang.String.valueOf ( ( ( org.ovirt.vdsmfake.Utils.RND.nextInt ( ( High - Low ) ) ) + Low ) ) ; return HighValue ; }

Target:
public static java.lang.String getRandomInRange ( int high , int min ) { if ( min == 0 ) { min = 1 ; } return java.lang.String.valueOf ( ( ( org.ovirt.vdsmfake.Utils.RND.nextInt ( ( high - min ) ) ) + min ) ) ; }
Source:
public void isSoundcardEnabled ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getHostListByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.VDS > > aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
private void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.LabelNetwork , org.ovirt.engine.core.common.action.LabelNetworkParameters.class , new java.lang.String [ ] { "NetworkId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.NETWORK_ID , org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.LABELS [ 0 ] } , valid , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAdd ( boolean valid , boolean success , java.lang.String detail ) { setUriInfo ( setUpActionExpectations ( ActionType.LabelNetwork , org.ovirt.engine.core.common.action.LabelNetworkParameters.class , new java.lang.String [ ] { "NetworkId" , "Label" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.NETWORK_ID , org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.LABELS [ 0 ] } , valid , success ) ) ; try { collection.add ( getModel ( 0 ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void writeName ( org.ovirt.api.metamodel.concepts.Concept concept ) { org.ovirt.api.metamodel.concepts.Name name = concept.getName ( ) ; if ( name != null ) { writer.write ( "name" , name.toString ( ) ) ; } }

Target:
private void writeAnnotations ( org.ovirt.api.metamodel.concepts.Concept concept ) { java.util.List < org.ovirt.api.metamodel.concepts.Annotation > annotations = concept.getAnnotations ( ) ; if ( ! ( annotations.isEmpty ( ) ) ) { writer.writeStartArray ( "annotations" ) ; annotations.forEach ( this :: writeAnnotation ) ; writer.writeEnd ( ) ; } }
Source:
void localize ( ) { pathEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.PosixStorageView.constants.storagePopupPosixPathLabel ( ) ) ; pathExampleLabel.setText ( org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.PosixStorageView.constants.storagePopupPosixPathExampleLabel ( ) ) ; vfsTypeEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.PosixStorageView.constants.storagePopupVfsTypeLabel ( ) ) ; mountOptionsEditor.setLabel ( org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.PosixStorageView.constants.storagePopupMountOptionsLabel ( ) ) ; nfsPosixAlertIcon.setTitle ( org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.PosixStorageView.constants.storagePopupPosixNfsWarningLabel ( ) ) ; }

Target:
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 ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > posixStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > ) ( sender ) ) ; boolean isNfs = ( ( posixStorageModel.getEntity ( ) ) != null ) ? posixStorageModel.getEntity ( ) . toLowerCase ( ) . equals ( "nfs" ) : false ; nfsPosixAlertIcon.setVisible ( isNfs ) ; }
Source:
public void rollbackQuota ( ) { if ( canPerformQuotaValidation ( ) ) { org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . rollbackQuota ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) , org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . getQuotaListFromParameters ( getOldStorageQuotaListParameters ( ) ) ) ; org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . rollbackQuota ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) , org.ovirt.engine.core.bll.quota.QuotaManager.getInstance ( ) . getQuotaListFromParameters ( getUpdatedStorageQuotaListParameters ( ) ) ) ; } }

Target:
public void rollbackQuota ( ) { if ( canPerformQuotaValidation ( ) ) { org.ovirt.engine.core.bll.UpdateVmDiskCommand.getQuotaManager ( ) . rollbackQuota ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getQuotaManager ( ) . getQuotaListFromParameters ( getOldStorageQuotaListParameters ( ) ) ) ; org.ovirt.engine.core.bll.UpdateVmDiskCommand.getQuotaManager ( ) . rollbackQuota ( org.ovirt.engine.core.bll.UpdateVmDiskCommand.getStoragePool ( ) , org.ovirt.engine.core.bll.UpdateVmDiskCommand.getQuotaManager ( ) . getQuotaListFromParameters ( getUpdatedStorageQuotaListParameters ( ) ) ) ; } }
Source:
public static void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public void authenticate ( java.lang.String user , java.lang.String password ) { java.lang.String adminName = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.AdminUser ) ; java.lang.String adminPassword = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.AdminPassword ) ; if ( ( ! ( org.apache.commons.lang.ObjectUtils.equals ( user , adminName ) ) ) || ( ! ( org.apache.commons.lang.ObjectUtils.equals ( password , adminPassword ) ) ) ) { throw new org.ovirt.engine.api.extensions.AAAExtensionException ( AAAExtensionException.AAAExtensionError.INCORRECT_CREDENTIALS , "" ) ; } }

Target:
public void authenticate ( java.lang.String user , java.lang.String password ) { java.lang.String adminUser = ( ( java.util.Properties ) ( context.get ( ExtensionProperties.CONFIGURATION ) ) ) . getProperty ( "config.authn.user.name" ) ; java.lang.String adminPassword = ( ( java.util.Properties ) ( context.get ( ExtensionProperties.CONFIGURATION ) ) ) . getProperty ( "config.authn.user.password" ) ; if ( ! ( ( user.equals ( adminUser ) ) && ( password.equals ( adminPassword ) ) ) ) { throw new org.ovirt.engine.api.extensions.AAAExtensionException ( AAAExtensionException.AAAExtensionError.INCORRECT_CREDENTIALS , "" ) ; } }
Source:
public static void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }

Target:
public static void getGlusterHookContent ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : "" ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterHookContentQueryParameters ( hookId ) ; parameters.setGlusterServerId ( serverId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHookContent , parameters , aQuery ) ; }
Source:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { this . model = model ; initView ( model ) ; initListeners ( model ) ; java.lang.String vmName = ( ( model.getVmConsoles ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.VmConsolesImpl ) ? model.getVmConsoles ( ) . getVm ( ) . getName ( ) : model.getVmConsoles ( ) . getVm ( ) . getVmPoolName ( ) ; getView ( ) . setVmName ( vmName ) ; getView ( ) . setCtrlAltDeleteRemapHotkey ( consoleUtils.getRemapCtrlAltDelHotkey ( ) ) ; super . init ( model ) ; }

Target:
public void init ( final org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { this . model = model ; initView ( model ) ; initListeners ( model ) ; java.lang.String vmName = ( ( model.getVmConsoles ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.VmConsolesImpl ) ? model.getVmConsoles ( ) . getVm ( ) . getName ( ) : model.getVmConsoles ( ) . getVm ( ) . getVmPoolName ( ) ; getView ( ) . setVmName ( vmName ) ; getView ( ) . setCtrlAltDeleteRemapHotkey ( ConsoleOptions.SECURE_ATTENTION_MAPPING ) ; super . init ( model ) ; }
Source:
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 ) ; }

Target:
public static void getVmById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.event_subscriber mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.event_subscriber entity = new org.ovirt.engine.core.common.businessentities.event_subscriber ( ) ; entity.setevent_up_name ( rs.getString ( "event_up_name" ) ) ; entity.setmethod_id ( rs.getInt ( "method_id" ) ) ; entity.setmethod_address ( rs.getString ( "method_address" ) ) ; entity.setsubscriber_id ( getGuidDefaultEmpty ( rs , "subscriber_id" ) ) ; entity.settag_name ( rs.getString ( "tag_name" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.event_subscriber mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.event_subscriber entity = new org.ovirt.engine.core.common.businessentities.event_subscriber ( ) ; entity.setevent_up_name ( rs.getString ( "event_up_name" ) ) ; entity.setevent_notification_method ( org.ovirt.engine.core.common.EventNotificationMethods.valueOf ( rs.getString ( "notification_method" ) ) ) ; entity.setmethod_address ( rs.getString ( "method_address" ) ) ; entity.setsubscriber_id ( getGuidDefaultEmpty ( rs , "subscriber_id" ) ) ; entity.settag_name ( rs.getString ( "tag_name" ) ) ; return entity ; }
Source:
private void assertAllDisksAreActive ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( disk instanceof org.ovirt.engine.core.common.businessentities.storage.LunDisk ) { continue ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; org.junit.Assert.assertTrue ( "disk should be active" , diskImage.getActive ( ) ) ; } }

Target:
private void assertAllDisksAreActive ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.Disk > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : disks ) { if ( disk instanceof org.ovirt.engine.core.common.businessentities.storage.LunDisk ) { continue ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( diskImage.getActive ( ) , "disk should be active" ) ; } }
Source:
public void testReadBooleanList ( ) { java.util.List < java.lang.Boolean > expected = java.util.Arrays.asList ( true , false ) ; org.ovirt.api.metamodel.runtime.xml.XmlReader reader = openReader ( "<action><value>true</value><value>false</value></action>" ) ; reader.next ( ) ; java.util.List < java.lang.Boolean > booleans = reader.readBooleans ( ) ; org.junit.Assert.assertEquals ( expected , booleans ) ; }

Target:
public void testReadBooleanList ( ) { java.util.List < java.lang.Boolean > expected = java.util.Arrays.asList ( true , false ) ; org.ovirt.api.metamodel.runtime.xml.XmlReader reader = openReader ( "<action><values><value>true</value><value>false</value></values></action>" ) ; reader.next ( ) ; java.util.List < java.lang.Boolean > booleans = reader.readBooleans ( ) ; org.junit.Assert.assertEquals ( expected , booleans ) ; }
Source:
public boolean runForSingleConnectionInHost ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain , org.ovirt.engine.core.compat.Guid storagePoolId , int type ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.storage_pool pool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( storagePoolId ) ; org.ovirt.engine.core.compat.Guid vdsId = ( ( pool.getspm_vds_id ( ) ) != null ) ? pool.getspm_vds_id ( ) . getValue ( ) : org.ovirt.engine.core.compat.Guid.Empty ; if ( ! ( vdsId.equals ( Guid.Empty ) ) ) { returnValue = RunConnectionStorageToDomain ( storageDomain , vdsId , type ) ; } return returnValue ; }

Target:
public boolean runForSingleConnectionInHost ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain , org.ovirt.engine.core.compat.Guid storagePoolId , int type ) { boolean returnValue = false ; org.ovirt.engine.core.common.businessentities.storage_pool pool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . get ( storagePoolId ) ; org.ovirt.engine.core.compat.Guid vdsId = ( ( pool.getspm_vds_id ( ) ) != null ) ? pool.getspm_vds_id ( ) . getValue ( ) : org.ovirt.engine.core.compat.Guid.Empty ; if ( ! ( vdsId.equals ( Guid.Empty ) ) ) { returnValue = runConnectionStorageToDomain ( storageDomain , vdsId , type ) ; } return returnValue ; }
Source:
public void testRemoveNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testRemoveNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testPermissionSubjectOnProvidedImage ( ) { initializeSuppliedImage ( ) ; org.junit.Assert.assertEquals ( getCommand ( ) . getPermissionCheckSubjects ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.utils.PermissionSubject ( getCommand ( ) . getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.EDIT_DISK_PROPERTIES ) ) ; }

Target:
public void testPermissionSubjectOnProvidedImage ( ) { initializeSuppliedImage ( ) ; org.junit.Assert.assertEquals ( transferImageCommand.getPermissionCheckSubjects ( ) . get ( 0 ) , new org.ovirt.engine.core.bll.utils.PermissionSubject ( transferImageCommand.getParameters ( ) . getImageGroupID ( ) , org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.common.businessentities.ActionGroup.EDIT_DISK_PROPERTIES ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addManagedDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , org.ovirt.engine.core.common.utils.VmDeviceType type , org.ovirt.engine.core.common.utils.VmDeviceType device , java.util.Map < java.lang.String , java.lang.Object > specParams , boolean plugged , boolean readOnly , java.lang.String address ) { org.ovirt.engine.core.common.businessentities.VmDevice managedDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , type , device , specParams , plugged , readOnly ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { managedDevice.setAddress ( address ) ; } return managedDevice ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmDevice addManagedDevice ( org.ovirt.engine.core.common.businessentities.VmDeviceId id , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType type , org.ovirt.engine.core.common.utils.VmDeviceType device , java.util.Map < java.lang.String , java.lang.Object > specParams , boolean plugged , boolean readOnly , java.lang.String address ) { org.ovirt.engine.core.common.businessentities.VmDevice managedDevice = org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( id , type , device , specParams , plugged , readOnly ) ; if ( org.apache.commons.lang.StringUtils.isNotBlank ( address ) ) { managedDevice.setAddress ( address ) ; } return managedDevice ; }
Source:
public void getHugePagesMemoryDoesNotFitIntoOne ( ) { org.ovirt.engine.core.common.utils.HugePageUtils utils = new org.ovirt.engine.core.common.utils.HugePageUtils ( ) ; org.ovirt.engine.core.common.businessentities.VmBase base = new org.ovirt.engine.core.common.businessentities.VmBase ( ) ; base.setCustomProperties ( "hugepages=1024" ) ; base.setMemSizeMb ( 1025 ) ; org.hamcrest.MatcherAssert.assertThat ( utils.getHugePages ( base ) . size ( ) , org.hamcrest.core.Is.is ( 1 ) ) ; org.hamcrest.MatcherAssert.assertThat ( utils.getHugePages ( base ) . get ( 1024 ) , org.hamcrest.core.Is.is ( 2 ) ) ; }

Target:
public void getHugePagesMemoryDoesNotFitIntoOne ( ) { org.ovirt.engine.core.common.businessentities.VmBase base = new org.ovirt.engine.core.common.businessentities.VmBase ( ) ; base.setCustomProperties ( "hugepages=1048576" ) ; base.setMemSizeMb ( 1025 ) ; org.hamcrest.MatcherAssert.assertThat ( org.ovirt.engine.core.common.utils.HugePageUtils.getHugePages ( base ) . size ( ) , org.hamcrest.core.Is.is ( 1 ) ) ; org.hamcrest.MatcherAssert.assertThat ( org.ovirt.engine.core.common.utils.HugePageUtils.getHugePages ( base ) . get ( 1048576 ) , org.hamcrest.core.Is.is ( 2 ) ) ; }
Source:
public void testGetLunsToUpdateInDbDiffLunIdSamePvId ( ) { org.ovirt.engine.core.compat.Guid pvID = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.compat.Guid lunFromVgLunId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > newLunsToSaveInDb = getLunsToUpdateInDb ( lunFromVgLunId , org.ovirt.engine.core.compat.Guid.newGuid ( ) , pvID , pvID ) . get ( command.saveLunsHandler ) ; assertLunIdInList ( newLunsToSaveInDb , lunFromVgLunId ) ; }

Target:
public void testGetLunsToUpdateInDbDiffLunIdSamePvId ( ) { org.ovirt.engine.core.compat.Guid pvID = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.compat.Guid lunFromVgLunId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; java.util.Map < org.ovirt.engine.core.bll.storage.domain.SyncLunsInfoForBlockStorageDomainCommand.LunHandler , java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > > lunsToUpdateInDb = getLunsToUpdateInDb ( lunFromVgLunId , org.ovirt.engine.core.compat.Guid.newGuid ( ) , pvID , pvID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.LUNs > newLunsToSaveInDb = lunsToUpdateInDb.get ( command.saveLunsHandler ) ; org.junit.Assert.assertEquals ( java.util.stream.Stream.of ( command.saveLunsHandler , command.removeLunsHandler ) . collect ( java.util.stream.Collectors.toSet ( ) ) , lunsToUpdateInDb.keySet ( ) ) ; assertLunIdInList ( newLunsToSaveInDb , lunFromVgLunId ) ; }
Source:
public void getUserMessageOfTheDayViaPublic ( 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.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getVolumeList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { getVolumeList ( aQuery , clusterName , true ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc deactivateStorageDomain ( java.lang.String sdUUID , java.lang.String spUUID , java.lang.String msdUUID , int masterVersion ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StorageDomain.deactivate" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "masterSdUUID" , msdUUID ) . withParameter ( "masterVersion" , masterVersion ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn deactivateStorageDomain ( java.lang.String sdUUID , java.lang.String spUUID , java.lang.String msdUUID , int masterVersion ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StorageDomain.deactivate" ) . withParameter ( "storagedomainID" , sdUUID ) . withParameter ( "storagepoolID" , spUUID ) . withParameter ( "masterSdUUID" , msdUUID ) . withParameter ( "masterVersion" , masterVersion ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
public void setCollapseSnapshot ( org.ovirt.engine.ui.uicommonweb.models.EntityModel collapseSnapshotsModel ) { this . collapseSnapshots = collapseSnapshotsModel ; collapseSnapshots.getEntityChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { setVolumeType ( VolumeType.Sparse ) ; } } ) ; }

Target:
public void setCollapseSnapshot ( org.ovirt.engine.ui.uicommonweb.models.EntityModel collapseSnapshotsModel ) { this . collapseSnapshots = collapseSnapshotsModel ; collapseSnapshots.getEntityChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setVolumeType ( VolumeType.Sparse ) ; } } ) ; }
Source:
private void updateDiskVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.bll.AttachDiskToVmCommand.getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.AttachDiskToVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) ; if ( disk.getDiskStorageType ( ) . isInternal ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; org.ovirt.engine.core.bll.AttachDiskToVmCommand.getImageDao ( ) . updateImageVmSnapshotId ( diskImage.getImageId ( ) , snapshotId ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.StorageException , "update of snapshot id was initiated for unsupported disk type" ) ; } }

Target:
private void updateDiskVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.bll.AttachDiskToVmCommand.getSnapshotDao ( ) . getId ( org.ovirt.engine.core.bll.AttachDiskToVmCommand.getVmId ( ) , SnapshotType.ACTIVE ) ; if ( disk.getDiskStorageType ( ) . isInternal ( ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( disk ) ) ; org.ovirt.engine.core.bll.AttachDiskToVmCommand.getImageDao ( ) . updateImageVmSnapshotId ( diskImage.getImageId ( ) , snapshotId ) ; } else { throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.StorageException , "update of snapshot id was initiated for unsupported disk type" ) ; } }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : diskInfoDestinationMap.values ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaStorageConsumptionParameter.QuotaAction.CONSUME , disk.getStorageIds ( ) . get ( 0 ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : diskInfoDestinationMap.values ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaStorageConsumptionParameter.QuotaAction.CONSUME , disk.getStorageIds ( ) . get ( 0 ) , ( ( double ) ( disk.getSizeInGigabytes ( ) ) ) ) ) ; } return list ; }