auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskSnapshotByImageId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskSnapshotResourceTest.IMAGE_ID } , getEntity ( 1 ) ) ; org.ovirt.engine.api.model.DiskSnapshot diskSnapshot = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskSnapshotResourceTest.verifyModelSpecific ( diskSnapshot , 1 ) ; }

Target:
public void testGet ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetDiskSnapshotByImageId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskSnapshotResourceTest.IMAGE_ID } , getEntity ( 1 ) ) ; org.ovirt.engine.api.model.DiskSnapshot diskSnapshot = resource.get ( ) ; org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskSnapshotResourceTest.verifyModelSpecific ( diskSnapshot , 1 ) ; }
Source:
public void testCreatingBusinessEntityMapWithDuplicatesAmongName ( ) { org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem first = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "name" ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem second = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "name" ) ; new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( java.util.Arrays.asList ( first , second ) ) ; }

Target:
public void testCreatingBusinessEntityMapWithDuplicatesAmongName ( ) { org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem first = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "name" ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem second = new org.ovirt.engine.core.common.businessentities.BusinessEntityMapTest.TestItem ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , "name" ) ; org.junit.jupiter.api.Assertions.assertThrows ( java.lang.IllegalArgumentException.class , ( ) -> new org.ovirt.engine.core.common.businessentities.BusinessEntityMap < > ( java.util.Arrays.asList ( first , second ) ) ) ; }
Source:
private boolean isLiveSnapshotEnabled ( ) { return org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.LiveSnapshotEnabled , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getStoragePool ( ) . getcompatibility_version ( ) . getValue ( ) ) ; }

Target:
protected boolean validateVM ( org.ovirt.engine.core.bll.validator.VmValidator vmValidator ) { org.ovirt.engine.core.bll.validator.LiveSnapshotValidator validator = new org.ovirt.engine.core.bll.validator.LiveSnapshotValidator ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getStoragePool ( ) . getcompatibility_version ( ) , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVds ( ) ) ; return ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVm ( ) . isDown ( ) ) || ( validate ( validator.canDoSnapshot ( ) ) ) ) && ( validate ( vmValidator.vmNotSavingRestoring ( ) ) ) ; }
Source:
public static void GetRpmVersionViaPublic ( 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.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) , aQuery ) ; }

Target:
public static void GetSANWipeAfterDelete ( 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.Boolean ) ( source ) ) . booleanValue ( ) : false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SANWipeAfterDelete ) , aQuery ) ; }
Source:
public void testInterfaceInHostWhenInDifferentHost ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NIC_NOT_EXISTS_ON_HOST , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( HostInterfaceValidator.VAR_NIC_NOT_EXISTS_ON_HOST_ENTITY , hostId.toString ( ) ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceInHost ( hostId ) , matcher ) ; }

Target:
public void testInterfaceInHostWhenInDifferentHost ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.compat.Guid hostId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; final org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NIC_NOT_EXISTS_ON_HOST ; org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher = org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , hostId.toString ( ) ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceInHost ( hostId ) , matcher ) ; }
Source:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }

Target:
public static void getMaxSpmPriority ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; aQuery.asyncCallback.onSuccess ( aQuery.getModel ( ) , 10 ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.core.common.businessentities.Disk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; setTitle ( ( disk.isBoot ( ) ? constants.bootableDisk ( ) : null ) ) ; return disk.isBoot ( ) ? resources.bootableDiskIcon ( ) : null ; }

Target:
protected org.ovirt.engine.core.common.businessentities.DiskInterface getRawValue ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.core.common.businessentities.Disk ) ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ) ) ; return disk.getDiskInterface ( ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.update ( getRestModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; try { resource.update ( getRestModel ( 0 ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected static org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain currDomain : domainsInPool ) { org.ovirt.engine.core.bll.VmHandler.updateDisksStorageType ( currDomain.getStorageType ( ) , disksList.get ( 0 ) ) ; if ( ( ( currDomain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( ( currDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) && ( org.ovirt.engine.core.bll.VmHandler.validateSpaceRequirements ( currDomain , disksList ) ) ) { return currDomain ; } } return null ; }

Target:
protected static org.ovirt.engine.core.common.businessentities.StorageDomain findStorageDomainForMemory ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domainsInPool , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain currDomain : domainsInPool ) { org.ovirt.engine.core.bll.VmHandler.updateDisksStorage ( currDomain , disksList ) ; if ( ( ( currDomain.getStorageDomainType ( ) . isDataDomain ( ) ) && ( ( currDomain.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.Active ) ) ) && ( org.ovirt.engine.core.bll.VmHandler.validateSpaceRequirements ( currDomain , disksList ) ) ) { return currDomain ; } } return null ; }
Source:
public void testDeactivateNic ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmNicResource backendVmNicResource = resource ; setAllContentHeaderExpectation ( ) ; setUpGetEntityExpectations ( 3 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } ) ) ; verifyActionResponse ( backendVmNicResource.deactivate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testDeactivateNic ( ) throws java.lang.Exception { org.ovirt.engine.api.restapi.resource.BackendVmNicResource backendVmNicResource = resource ; setAllContentHeaderExpectation ( ) ; setUpGetEntityExpectations ( 3 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } ) ) ; verifyActionResponse ( backendVmNicResource.deactivate ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
public boolean match ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView vnicProfile ) { return java.util.Objects.equals ( getEntity ( ) . getVnicProfileId ( ) , vnicProfile.getId ( ) ) ; }

Target:
public boolean match ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView vnicProfile ) { return ( java.util.Objects.equals ( getEntity ( ) . getExternalNetworkName ( ) , vnicProfile.getNetworkName ( ) ) ) && ( java.util.Objects.equals ( getEntity ( ) . getExternalNetworkName ( ) , vnicProfile.getName ( ) ) ) ; }
Source:
protected boolean validateQuota ( ) { getParameters ( ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.Disk dit : getVm ( ) . getDiskMap ( ) . values ( ) ) { ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( dit ) ) . setQuotaId ( org.ovirt.engine.core.bll.QuotaHelper.getInstance ( ) . getQuotaIdToConsume ( getVm ( ) . getStaticData ( ) . getQuotaId ( ) , getStoragePool ( ) ) ) ; } return true ; }

Target:
public org.ovirt.engine.core.common.businessentities.VM getVm ( ) { if ( getParameters ( ) . isImportAsNewEntity ( ) ) { return getParameters ( ) . getVm ( ) ; } else { return super . getVm ( ) ; } }
Source:
private boolean validateReplacementContains ( java.util.Collection < java.lang.String > replacements , java.lang.String property ) { java.util.Iterator < java.lang.String > iterator = replacements.iterator ( ) ; while ( iterator.hasNext ( ) ) { java.lang.String replacement = iterator.next ( ) ; if ( replacement.contains ( property ) ) { return true ; } } return false ; }

Target:
private boolean validateReplacementContains ( java.util.Collection < java.lang.String > replacements , java.lang.String property ) { return replacements.stream ( ) . anyMatch ( ( r ) -> r.contains ( property ) ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.Snapshot addSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId , java.lang.String description , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotStatus snapshotStatus , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType , org.ovirt.engine.core.common.businessentities.VM vm , boolean saveVmConfiguration , java.lang.String memoryVolume , final org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { final org.ovirt.engine.core.common.businessentities.Snapshot snapshot = new org.ovirt.engine.core.common.businessentities.Snapshot ( snapshotId , snapshotStatus , vm.getId ( ) , ( saveVmConfiguration ? generateVmConfiguration ( vm ) : null ) , snapshotType , description , new java.util.Date ( ) , vm.getAppList ( ) , memoryVolume ) ; getSnapshotDao ( ) . save ( snapshot ) ; compensationContext.snapshotNewEntity ( snapshot ) ; return snapshot ; }

Target:
public org.ovirt.engine.core.common.businessentities.Snapshot addSnapshot ( org.ovirt.engine.core.compat.Guid snapshotId , java.lang.String description , org.ovirt.engine.core.common.businessentities.Snapshot.SnapshotType snapshotType , org.ovirt.engine.core.common.businessentities.VM vm , java.lang.String memoryVolume , final org.ovirt.engine.core.bll.context.CompensationContext compensationContext ) { return addSnapshot ( snapshotId , description , SnapshotStatus.LOCKED , snapshotType , vm , true , memoryVolume , null , compensationContext ) ; }
Source:
public void testCleanExpiredUsersSessionsWithUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNull ( "Get should return null since the session was removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; org.mockito.Mockito.verify ( dbUserDAOMcok ) . removeUserSessions ( org.mockito.Matchers.anyMap ( ) ) ; }

Target:
public void testCleanNotExpiredUsersSessionsWithUsers ( ) { initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER ) ; container.cleanExpiredUsersSessions ( ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.GetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , org.ovirt.engine.core.bll.session.SessionDataContainerTest.USER , false ) ) ; org.junit.Assert.assertNotNull ( "Get should return the value since the session was not removed" , container.getUser ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , false ) ) ; }
Source:
private void init ( javax.xml.transform.Result result ) { try { javax.xml.stream.XMLOutputFactory factory = javax.xml.stream.XMLOutputFactory.newFactory ( ) ; writer = factory.createXMLStreamWriter ( result ) ; com.sun.xml.txw2.output.IndentingXMLStreamWriter indenter = new com.sun.xml.txw2.output.IndentingXMLStreamWriter ( writer ) ; indenter.setIndentStep ( " " ) ; writer = indenter ; } catch ( javax.xml.stream.XMLStreamException exception ) { throw new org.ovirt.api.metamodel.tool.XmlWriterException ( "Can't create XML writer" , exception ) ; } }

Target:
public void flush ( ) { try { writer.flush ( ) ; } catch ( javax.xml.stream.XMLStreamException exception ) { throw new org.ovirt.api.metamodel.runtime.xml.XmlException ( "Can't flush" , exception ) ; } }
Source:
private void validateParameters ( org.ovirt.engine.api.model.VM incoming ) { if ( ( incoming.isSetDomain ( ) ) && ( ! ( incoming.getDomain ( ) . isSetName ( ) ) ) ) { throw new org.ovirt.engine.api.restapi.resource.WebFaultException ( null , localize ( Messages.INCOMPLETE_PARAMS_REASON ) , localize ( Messages.INCOMPLETE_PARAMS_CONDITIONAL , "Domain" , "Domain name" ) , Response.Status.BAD_REQUEST ) ; } if ( ! ( org.ovirt.engine.api.restapi.util.IconHelper.validateIconParameters ( incoming ) ) ) { throw new org.ovirt.engine.api.restapi.resource.BaseBackendResource.WebFaultException ( null , localize ( Messages.INVALID_ICON_PARAMETERS ) , Response.Status.BAD_REQUEST ) ; } }

Target:
private void validateParameters ( org.ovirt.engine.api.model.Vm incoming ) { if ( ( incoming.isSetDomain ( ) ) && ( ! ( incoming.getDomain ( ) . isSetName ( ) ) ) ) { throw new org.ovirt.engine.api.restapi.resource.WebFaultException ( null , localize ( Messages.INCOMPLETE_PARAMS_REASON ) , localize ( Messages.INCOMPLETE_PARAMS_CONDITIONAL , "Domain" , "Domain name" ) , Response.Status.BAD_REQUEST ) ; } if ( ! ( org.ovirt.engine.api.restapi.util.IconHelper.validateIconParameters ( incoming ) ) ) { throw new org.ovirt.engine.api.restapi.resource.BaseBackendResource.WebFaultException ( null , localize ( Messages.INVALID_ICON_PARAMETERS ) , Response.Status.BAD_REQUEST ) ; } }
Source:
public void testNoStorageQuotaAssigned ( ) { org.mockito.Mockito.when ( storageQosDao.getQosByDiskProfileId ( diskImage.getDiskProfileId ( ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.handleIoTune ( vmDevice , org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.loadStorageQos ( diskImage ) ) ; org.junit.Assert.assertNull ( vmDevice.getSpecParams ( ) ) ; }

Target:
public void testNoStorageQuotaAssigned ( ) { org.mockito.Mockito.when ( storageQosDao.getQosByDiskProfileId ( diskImage.getDiskProfileId ( ) ) ) . thenReturn ( null ) ; underTest.handleIoTune ( vmDevice , underTest.loadStorageQos ( diskImage ) ) ; org.junit.Assert.assertNull ( vmDevice.getSpecParams ( ) ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createIdParameterMapper ( org.ovirt.engine.core.compat.Guid id ) { return getCustomMapSqlParameterSource ( ) . addValue ( "disk_id" , id ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.Disk get ( org.ovirt.engine.core.compat.Guid id , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { return getCallsHandler ( ) . executeRead ( "GetDiskByDiskId" , org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.DiskRowMapper.instance , getCustomMapSqlParameterSource ( ) . addValue ( "disk_id" , id ) . addValue ( "user_id" , userID ) . addValue ( "is_filtered" , isFiltered ) ) ; }
Source:
public void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }

Target:
public void getAllErrata ( 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Erratum > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetErrataForSystem , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS createServer ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String hostname ) { org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic = new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; vdsStatic.setId ( serverId ) ; vdsStatic.setHostName ( hostname ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = new org.ovirt.engine.core.common.businessentities.VdsDynamic ( ) ; vdsDynamic.setstatus ( VDSStatus.Up ) ; return new org.ovirt.engine.core.common.businessentities.VDS ( vdsStatic , vdsDynamic , new org.ovirt.engine.core.common.businessentities.VdsStatistics ( ) ) ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS createServer ( org.ovirt.engine.core.compat.Guid serverId , java.lang.String hostname ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( serverId ) ; vds.setHostName ( hostname ) ; vds.setStatus ( VDSStatus.Up ) ; return vds ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.Integer > result = connect ( org.ovirt.engine.core.bll.storage.ConnectStorageToVdsCommand.getVds ( ) . getId ( ) ) ; setSucceeded ( result.getFirst ( ) ) ; if ( ! ( result.getFirst ( ) ) ) { setErrorMessageAtReturn ( result ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.Integer > result = connectHostToStorage ( ) ; setSucceeded ( result.getFirst ( ) ) ; if ( ! ( result.getFirst ( ) ) ) { setErrorMessageAtReturn ( result ) ; } }
Source:
public void testCanEditARunningVM ( ) { prepareVmToPassCanDoAction ( ) ; vm.setStatus ( VMStatus.Up ) ; mockDiskDaoGetAllForVm ( java.util.Collections.< org.ovirt.engine.core.common.businessentities.storage.Disk > emptyList ( ) , true ) ; mockVmValidator ( ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . areUpdatedFieldsLegal ( ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void testChangeClusterForbidden ( ) { prepareVmToPassValidate ( ) ; org.ovirt.engine.core.common.businessentities.Cluster newGroup = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; newGroup.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newGroup.setCompatibilityVersion ( Version.v3_6 ) ; vmStatic.setClusterId ( newGroup.getId ( ) ) ; org.mockito.Mockito.doReturn ( clusterDao ) . when ( command ) . getClusterDao ( ) ; org.junit.Assert.assertFalse ( "validate should have failed with can't change cluster." , command.validate ( ) ) ; assertValidateMessage ( EngineMessage.VM_CANNOT_UPDATE_CLUSTER ) ; }
Source:
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.RunQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( id ) , aQuery ) ; }

Target:
public static void getStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void testIsNetworkInSyncWhenBootProtocolDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { ifaceQos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; networkQos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; iface = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; iface.setBridged ( true ) ; iface.setQos ( ifaceQos ) ; iface.setReportedSwitchType ( SwitchType.LEGACY ) ; network = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; testedNetworkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; testedNetworkAttachment.setIpConfiguration ( new org.ovirt.engine.core.common.businessentities.network.IpConfiguration ( ) ) ; cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setRequiredSwitchTypeForCluster ( SwitchType.LEGACY ) ; }
Source:
public void testGetAllVMSearch ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "VM" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.VM ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.Assert.assertEquals ( vmResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }

Target:
public void testGetAllVMSearch ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchPattern ( ) ) . thenReturn ( ( "VM" + ( org.ovirt.engine.core.common.utils.CommonConstants.QUERY_RETURN_TYPE_SEPARATOR ) ) ) ; org.mockito.Mockito.when ( getQueryParameters ( ) . getSearchTypeValue ( ) ) . thenReturn ( SearchType.VM ) ; getQuery ( ) . executeQueryCommand ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( vmResultList , getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ; }
Source:
public static void getStorageDomainList ( 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 ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getRoleList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Role > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRoles , new org.ovirt.engine.core.common.queries.MultilevelAdministrationsQueriesParameters ( ) , aQuery ) ; }
Source:
void initComboBox ( ) { sysPrepDomainNameListBoxEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( ) ; sysPrepDomainNameTextBoxEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelTextBoxEditor ( ) ; sysPrepDomainNameComboBox = new org.ovirt.engine.ui.common.widget.ComboBox ( sysPrepDomainNameListBoxEditor , sysPrepDomainNameTextBoxEditor ) ; }

Target:
void initComboBox ( ) { sysPrepDomainNameListBoxEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( ) ; sysPrepDomainNameTextBoxEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelTextBoxEditor ( ) ; sysPrepDomainNameComboBox = new org.ovirt.engine.ui.common.widget.ComboBox ( sysPrepDomainNameListBoxEditor , sysPrepDomainNameTextBoxEditor ) ; defaultHostEditor = new org.ovirt.engine.ui.common.widget.editor.ListModelListBoxEditor < java.lang.Object > ( new org.ovirt.engine.ui.common.widget.renderer.NullSafeRenderer < java.lang.Object > ( ) { @ java.lang.Override public java.lang.String renderNullSafe ( java.lang.Object object ) { return ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( object ) ) . getvds_name ( ) ; } } ) ; }
Source:
public void OnForceRemove ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ! ( model.Validate ( ) ) ) { return ; } org.ovirt.engine.core.common.action.VdcActionParametersBase parametersBase = new org.ovirt.engine.core.common.action.VdcActionParametersBase ( ) ; org.ovirt.engine.core.common.action.StoragePoolParametersBase tempVar = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getSelectedItem ( ) ) ) . getId ( ) ) ; tempVar.setForceDelete ( true ) ; parametersBase = tempVar ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveStoragePool , parametersBase ) ; Cancel ( ) ; }

Target:
public void onForceRemove ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; if ( ! ( model.validate ( ) ) ) { return ; } org.ovirt.engine.core.common.action.VdcActionParametersBase parametersBase = new org.ovirt.engine.core.common.action.VdcActionParametersBase ( ) ; org.ovirt.engine.core.common.action.StoragePoolParametersBase tempVar = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getSelectedItem ( ) ) ) . getId ( ) ) ; tempVar.setForceDelete ( true ) ; parametersBase = tempVar ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveStoragePool , parametersBase ) ; cancel ( ) ; }
Source:
protected void logExceptionAndCompensate ( java.lang.Exception e ) { log.errorFormat ( "Exception while wrapping-up compensation in endAction: {0}." , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) , e ) ; compensate ( ) ; }

Target:
private void internalEndSuccessfully ( ) { log.info ( "Ending command '{}' successfully." , getClass ( ) . getName ( ) ) ; if ( hasTaskHandlers ( ) ) { getCurrentTaskHandler ( ) . endSuccessfully ( ) ; getParameters ( ) . incrementExecutionIndex ( ) ; if ( ( getExecutionIndex ( ) ) < ( getTaskHandlers ( ) . size ( ) ) ) { _actionState = CommandActionState.EXECUTE ; execute ( ) ; } } else { endSuccessfully ( ) ; } }
Source:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }

Target:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
private org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync getService ( ) { return service ; }

Target:
private void getService ( final org.ovirt.engine.ui.frontend.communication.GWTRPCCommunicationProvider.ServiceCallback callback ) { if ( ( xsrfRequestBuilder.getXsrfToken ( ) ) != null ) { callback.serviceFound ( service ) ; } else { xsrfService.getNewXsrfToken ( new com.google.gwt.user.client.rpc.AsyncCallback < com.google.gwt.user.client.rpc.XsrfToken > ( ) { @ java.lang.Override public void onSuccess ( com.google.gwt.user.client.rpc.XsrfToken token ) { xsrfRequestBuilder.setXsrfToken ( token ) ; callback.serviceFound ( service ) ; } @ java.lang.Override public void onFailure ( java.lang.Throwable caught ) { callback.onFailure ( caught ) ; } } ) ; } }
Source:
public void run ( ) { org.ovirt.engine.core.bll.VdsEventListener.log.info ( "ResourceManager::vdsNotResponding entered for Host '{}', '{}'" , vds.getId ( ) , vds.getHostName ( ) ) ; org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.FenceActionType.Restart ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.VdsNotRespondingTreatment , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; moveBricksToUnknown ( vds ) ; }

Target:
public void run ( ) { org.ovirt.engine.core.bll.VdsEventListener.log.info ( "ResourceManager::vdsNotResponding entered for Host '{}', '{}'" , vds.getId ( ) , vds.getHostName ( ) ) ; org.ovirt.engine.core.common.action.FenceVdsActionParameters params = new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.pm.FenceActionType.RESTART ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.VdsNotRespondingTreatment , params , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; moveBricksToUnknown ( vds ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.network.Network mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.Network entity = super . mapRow ( rs , rowNum ) ; entity.setCluster ( new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ) ; entity.getCluster ( ) . setis_display ( ( ( java.lang.Boolean ) ( rs.getObject ( "is_display" ) ) ) ) ; entity.getCluster ( ) . setRequired ( rs.getBoolean ( "required" ) ) ; entity.getCluster ( ) . setstatus ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.forValue ( rs.getInt ( "status" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.Network mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.network.Network entity = super . mapRow ( rs , rowNum ) ; entity.setCluster ( new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ) ; entity.getCluster ( ) . setDisplay ( ( ( java.lang.Boolean ) ( rs.getObject ( "is_display" ) ) ) ) ; entity.getCluster ( ) . setRequired ( rs.getBoolean ( "required" ) ) ; entity.getCluster ( ) . setStatus ( org.ovirt.engine.core.common.businessentities.network.NetworkStatus.forValue ( rs.getInt ( "status" ) ) ) ; return entity ; }
Source:
private boolean isDiskNotShareable ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageByImageId ( imageId ) ; if ( diskImage.isShareable ( ) ) { addCanDoActionMessage ( java.lang.String.format ( "$%1$s %2$s" , "diskAliases" , diskImage.getDiskAlias ( ) ) ) ; return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED ) ; } return true ; }

Target:
private boolean isDiskNotShareable ( org.ovirt.engine.core.compat.Guid imageId ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = getDiskImageByImageId ( imageId ) ; if ( diskImage.isShareable ( ) ) { addCanDoActionMessageVariable ( "diskAliases" , diskImage.getDiskAlias ( ) ) ; return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED ) ; } return true ; }
Source:
public void search ( ) { if ( ( getEntity ( ) ) != null ) { super . search ( ) ; } }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterSwiftServices ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ) ( returnValue ) ) ) ; updateActionAvailability ( ) ; } } ) , getEntity ( ) . getId ( ) ) ; }
Source:
public static com.google.gwt.safehtml.shared.SafeHtml getTooltip ( java.util.Map < com.google.gwt.safehtml.shared.SafeHtml , java.lang.String > imagesToText ) { java.lang.String tooltip = "" ; for ( java.util.Map.Entry < com.google.gwt.safehtml.shared.SafeHtml , java.lang.String > imageToText : imagesToText.entrySet ( ) ) { if ( ! ( tooltip.isEmpty ( ) ) ) { tooltip = tooltip.concat ( "<BR>" ) ; } tooltip = tooltip.concat ( org.ovirt.engine.ui.webadmin.widget.table.column.NetworkRoleColumnHelper.templates.imageTextSetupNetwork ( imageToText.getKey ( ) , imageToText.getValue ( ) ) . asString ( ) ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( tooltip ) ; }

Target:
public static com.google.gwt.safehtml.shared.SafeHtml getTooltip ( java.util.Map < com.google.gwt.safehtml.shared.SafeHtml , java.lang.String > imagesToText ) { java.lang.String tooltip = "" ; for ( java.util.Map.Entry < com.google.gwt.safehtml.shared.SafeHtml , java.lang.String > imageToText : imagesToText.entrySet ( ) ) { if ( ! ( tooltip.isEmpty ( ) ) ) { tooltip = tooltip.concat ( org.ovirt.engine.ui.webadmin.widget.table.column.MultiImageColumnHelper.constants.lineBreak ( ) ) ; } tooltip = tooltip.concat ( org.ovirt.engine.ui.webadmin.widget.table.column.MultiImageColumnHelper.templates.imageTextSetupNetwork ( imageToText.getKey ( ) , imageToText.getValue ( ) ) . asString ( ) ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( tooltip ) ; }
Source:
public org.ovirt.engine.api.resource.ActionResource getActionResource ( java.lang.String action , java.lang.String oid ) { return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface lookupNic ( org.ovirt.engine.core.compat.Guid nicId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = getBackendCollection ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface.class , VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : nics ) { if ( java.util.Objects.equals ( nic.getId ( ) , nicId ) ) { return nic ; } } return null ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getVmsDiskPluggedTo ( ) { if ( ( vmsDiskPluggedTo ) == null ) { vmsDiskPluggedTo = org.ovirt.engine.core.bll.UpdateVmDiskCommand.getVmDAO ( ) . getForDisk ( getOldDisk ( ) . getId ( ) ) . get ( java.lang.Boolean.TRUE ) ; if ( ( vmsDiskPluggedTo ) == null ) { vmsDiskPluggedTo = java.util.Collections.emptyList ( ) ; } } return vmsDiskPluggedTo ; }

Target:
private boolean shouldResizeDiskImage ( ) { return ( ( ( getNewDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) && ( ( vmDeviceForVm.getSnapshotId ( ) ) == null ) ) && ( ( getNewDisk ( ) . getSize ( ) ) != ( getOldDisk ( ) . getSize ( ) ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , null , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void testGetAllWithPermissionsPrivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VdsGroupDaoTest.NUMBER_OF_GROUPS_FOR_PRIVELEGED_USER , result.size ( ) ) ; org.junit.Assert.assertEquals ( result.iterator ( ) . next ( ) , existingVdsGroup ) ; }

Target:
public void testGetAllWithPermissionsPrivilegedUser ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > result = dao.getAll ( org.ovirt.engine.core.dao.PRIVILEGED_USER_ID , true ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.ClusterDaoTest.NUMBER_OF_GROUPS_FOR_PRIVELEGED_USER , result.size ( ) ) ; org.junit.Assert.assertEquals ( result.iterator ( ) . next ( ) , existingCluster ) ; }
Source:
public void networkInUseByTemplates ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmTemplate template = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VmTemplate.class ) ; org.mockito.Mockito.when ( template.getName ( ) ) . thenReturn ( NAMEABLE_NAME ) ; networkNotUsedByTemplatesTest ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_IN_USE ) , java.util.Collections.singletonList ( template ) ) ; }

Target:
public void networkInUseByTemplates ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmTemplate template = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VmTemplate.class ) ; org.mockito.Mockito.when ( template.getName ( ) ) . thenReturn ( NAMEABLE_NAME ) ; networkNotUsedByTemplatesTest ( failsWithNetworkInUse ( ) , java.util.Collections.singletonList ( template ) ) ; }