auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.lang.String render ( T size ) { if ( isUnavailable ( size ) ) { return org.ovirt.engine.ui.common.widget.renderer.DiskSizeRenderer.CONSTANTS.unAvailablePropertyLabel ( ) ; } long sizeInGB = - 1 ; switch ( unit ) { case BYTE : sizeInGB = ( ( long ) ( ( size.longValue ( ) ) / ( java.lang.Math.pow ( 1024 , 3 ) ) ) ) ; break ; case GIGABYTE : sizeInGB = size.longValue ( ) ; break ; } return sizeInGB >= 1 ? sizeInGB + " GB" : "< 1 GB" ; }

Target:
public java.lang.String render ( T size ) { if ( isUnavailable ( size ) ) { return org.ovirt.engine.ui.common.widget.renderer.DiskSizeRenderer.CONSTANTS.unAvailablePropertyLabel ( ) ; } long sizeInGB = org.ovirt.engine.ui.uicommonweb.models.SizeConverter.convert ( size.longValue ( ) , unit , SizeConverter.SizeUnit.GB ) . longValue ( ) ; return sizeInGB >= 1 ? sizeInGB + " GB" : "< 1 GB" ; }
Source:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.DataCenter model = new org.ovirt.engine.api.model.DataCenter ( ) ; model.setName ( NAMES [ 0 ] ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "DataCenter" , "add" , "storageType" ) ; } }

Target:
public void testAddIncompleteParameters ( ) throws java.lang.Exception { org.ovirt.engine.api.model.DataCenter model = new org.ovirt.engine.api.model.DataCenter ( ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; control.replay ( ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException on incomplete parameters" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "DataCenter" , "add" , "name" ) ; } }
Source:
protected java.lang.String getIsoPrefixFilePath ( java.lang.String url ) { java.lang.String isoPrefixName = "iso://" ; java.lang.String fullPathFileName = url ; int prefixLength = isoPrefixName.length ( ) ; if ( ( ( url.length ( ) ) >= prefixLength ) && ( url.substring ( 0 , prefixLength ) . equalsIgnoreCase ( isoPrefixName ) ) ) { fullPathFileName = cdPathWindowsToLinux ( url.substring ( prefixLength , url.length ( ) ) ) ; } return fullPathFileName ; }

Target:
protected java.lang.String getIsoPrefixFilePath ( java.lang.String url ) { java.lang.String fullPathFileName = url ; int prefixLength = org.ovirt.engine.core.bll.RunVmCommand.ISO_PREFIX.length ( ) ; if ( ( ( url.length ( ) ) >= prefixLength ) && ( url.substring ( 0 , prefixLength ) . equalsIgnoreCase ( org.ovirt.engine.core.bll.RunVmCommand.ISO_PREFIX ) ) ) { fullPathFileName = cdPathWindowsToLinux ( url.substring ( prefixLength ) ) ; } return fullPathFileName ; }
Source:
public void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return java.util.Collections.< org.ovirt.engine.core.common.businessentities.CertificateInfo > emptyList ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
public void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return java.util.Collections.< org.ovirt.engine.core.common.businessentities.CertificateInfo > emptyList ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
protected void fillImagesMapBasedOnTemplate ( ) { org.ovirt.engine.core.bll.ImagesHandler.fillImagesMapBasedOnTemplate ( org.ovirt.engine.core.bll.AddVmCommand.getVmTemplate ( ) , org.ovirt.engine.core.bll.AddVmCommand.getStorageDomainDAO ( ) . getAllForStoragePool ( org.ovirt.engine.core.bll.AddVmCommand.getVmTemplate ( ) . getStoragePoolId ( ) ) , diskInfoDestinationMap , destStorages , false ) ; }

Target:
private void copyDiskDevicesFromTemplate ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > disks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( vmDisksSource.getId ( ) , VmDeviceGeneralType.DISK ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.copyVmDevices ( vmDisksSource.getId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVmId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVm ( ) . getStaticData ( ) , true , disks , getSrcDeviceIdToTargetDeviceIdMapping ( ) , false , false , false , false , false ) ; }
Source:
private boolean shouldResizeDiskImage ( ) { return ( ( getNewDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) && ( ( getNewDisk ( ) . getSize ( ) ) != ( getOldDisk ( ) . getSize ( ) ) ) ; }

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 static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getEntitySpecific ( int index ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setName ( NAMES [ index ] ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setSpeed ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_SPEED ) ; entity = org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , GUIDS [ index ] ) ; entity.getStatistics ( ) . setStatus ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_STATUS ) ; entity.setIpv4BootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.BOOT_PROTOCOL ) ; return entity ; }

Target:
public static org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getEntitySpecific ( int index ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity = new org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface ( ) ; entity.setId ( GUIDS [ index ] ) ; entity.setName ( NAMES [ index ] ) ; entity.setNetworkName ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NETWORK_NAME ) ; entity.setSpeed ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_SPEED ) ; entity = org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.setUpStatistics ( entity , GUIDS [ index ] ) ; entity.getStatistics ( ) . setStatus ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.NIC_STATUS ) ; entity.setIpv4BootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.IPV4_BOOT_PROTOCOL ) ; entity.setIpv6BootProtocol ( org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.IPV6_BOOT_PROTOCOL ) ; return entity ; }
Source:
public void thpDefaultFalseTest ( ) { org.ovirt.engine.api.model.Cluster cluster = new org.ovirt.engine.api.model.Cluster ( ) ; cluster.setVersion ( new org.ovirt.engine.api.restapi.types.Version ( ) { { setMajor ( 2 ) ; setMinor ( 0 ) ; } } ) ; org.ovirt.engine.core.common.businessentities.VDSGroup transform = getMapper ( ) . map ( cluster , null ) ; assertEquals ( transform.getTransparentHugepages ( ) , false ) ; }

Target:
public void thpDefaultFalseTest ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setVersion ( new org.ovirt.engine.api.restapi.types.Version ( ) { { setMajor ( 2 ) ; setMinor ( 0 ) ; } } ) ; org.ovirt.engine.core.common.businessentities.Cluster transform = getMapper ( ) . map ( cluster , null ) ; assertEquals ( transform.getTransparentHugepages ( ) , false ) ; }
Source:
public static java.lang.String encrypt ( java.lang.String source ) throws java.security.GeneralSecurityException { if ( ( source == null ) || ( ( source.length ( ) ) == 0 ) ) { return source ; } else { javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( "RSA" ) ; rsa.init ( javax.crypto.Cipher.ENCRYPT_MODE , org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.getCertificate ( ) . getPublicKey ( ) ) ; return new org.apache.commons.codec.binary.Base64 ( 0 ) . encodeToString ( rsa.doFinal ( source.getBytes ( java.nio.charset.Charset.forName ( "UTF-8" ) ) ) ) ; } }

Target:
public static java.lang.String encrypt ( java.lang.String source ) throws java.security.GeneralSecurityException { if ( ( source == null ) || ( ( source.length ( ) ) == 0 ) ) { return source ; } else { javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( "RSA" ) ; rsa.init ( javax.crypto.Cipher.ENCRYPT_MODE , org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.getCertificate ( ) . getPublicKey ( ) ) ; return new org.apache.commons.codec.binary.Base64 ( 0 ) . encodeToString ( rsa.doFinal ( source.getBytes ( java.nio.charset.StandardCharsets.UTF_8 ) ) ) ; } }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel.CMD_IMPORT ) ) { onImport ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel.CMD_CANCEL ) ) { cancel ( ) ; } else if ( getCancelImportCommand ( ) . equals ( command ) ) { cancelImport ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel.CMD_IMPORT ) ) { onImport ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.networks.ImportNetworksModel.CMD_CANCEL ) ) { cancel ( ) ; } else if ( getAddImportCommand ( ) . equals ( command ) ) { addImport ( ) ; } else if ( getCancelImportCommand ( ) . equals ( command ) ) { cancelImport ( ) ; } }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.permissions > setUpPermissionsWithAdElementId ( org.ovirt.engine.core.compat.Guid adElementId ) { java.util.List < org.ovirt.engine.core.common.businessentities.permissions > perms = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.permissions > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.permissions entity = getEntity ( i ) ; entity.setad_element_id ( adElementId ) ; perms.add ( entity ) ; } return perms ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > setUpPermissionsWithAdElementId ( org.ovirt.engine.core.compat.Guid adElementId ) { java.util.List < org.ovirt.engine.core.common.businessentities.Permissions > perms = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.Permissions entity = getEntity ( i ) ; entity.setad_element_id ( adElementId ) ; perms.add ( entity ) ; } return perms ; }
Source:
public void testUpdateImageVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; dao.updateImageVmSnapshotId ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_ID , guid ) ; org.ovirt.engine.core.common.businessentities.Image imageFromDb = dao.get ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_ID ) ; org.junit.Assert.assertNotNull ( imageFromDb ) ; org.junit.Assert.assertEquals ( "Image snapshot id wasn't updated properly" , guid , imageFromDb.getSnapshotId ( ) ) ; }

Target:
public void testUpdateImageVmSnapshotId ( ) { org.ovirt.engine.core.compat.Guid guid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; dao.updateImageVmSnapshotId ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_ID , guid ) ; org.ovirt.engine.core.common.businessentities.storage.Image imageFromDb = dao.get ( org.ovirt.engine.core.dao.ImageDaoTest.EXISTING_IMAGE_ID ) ; org.junit.Assert.assertNotNull ( imageFromDb ) ; org.junit.Assert.assertEquals ( "Image snapshot id wasn't updated properly" , guid , imageFromDb.getSnapshotId ( ) ) ; }
Source:
public boolean isNicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > existingInterfacesMap , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Bond > bondsMap , java.lang.String nicName , org.ovirt.engine.core.compat.Guid nicId ) { boolean nicExists = ( existingInterfacesMap.get ( nicId , nicName ) ) != null ; if ( nicExists ) { return true ; } boolean nicIsNewBond = ( nicName != null ) && ( ( bondsMap.get ( nicName ) ) != null ) ; if ( nicIsNewBond ) { return true ; } return false ; }

Target:
public boolean isNicActuallyExistsOrReferencesNewBond ( org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > existingInterfacesMap , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.action.CreateOrUpdateBond > createOrUpdateBondBusinessEntityMap , java.lang.String nicName , org.ovirt.engine.core.compat.Guid nicId ) { boolean nicExists = ( existingInterfacesMap.get ( nicId , nicName ) ) != null ; if ( nicExists ) { return true ; } boolean nicIsNewBond = ( nicName != null ) && ( ( createOrUpdateBondBusinessEntityMap.get ( nicName ) ) != null ) ; if ( nicIsNewBond ) { return true ; } return false ; }
Source:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }

Target:
public static void getNextAvailableDiskAliasNameByVMId ( 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.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
protected void setUpGetEntityExpectations ( int times , boolean notFound , org.ovirt.engine.api.model.StorageDomain entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetStorageDomainById , org.ovirt.engine.core.common.queries.StorageDomainQueryParametersBase.class , new java.lang.String [ ] { "StorageDomainId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : entity ) ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , boolean notFound , org.ovirt.engine.api.model.StorageDomain entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetStorageDomainById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? null : entity ) ) ; } }
Source:
public static org.ovirt.engine.core.bll.scheduling.SchedulingManager getInstance ( ) { if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ) == null ) { synchronized ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.class ) { if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ) == null ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance = new org.ovirt.engine.core.bll.scheduling.SchedulingManager ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.EnableLoadBalancer ( ) ; } } } return org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ; }

Target:
public static org.ovirt.engine.core.bll.scheduling.SchedulingManager getInstance ( ) { if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ) == null ) { synchronized ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.class ) { if ( ( org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ) == null ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance = new org.ovirt.engine.core.bll.scheduling.SchedulingManager ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.enableLoadBalancer ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.enableHaReservationCheck ( ) ; } } } return org.ovirt.engine.core.bll.scheduling.SchedulingManager.instance ; }
Source:
public void testValidateQosOverriddenInterfacesWhenNoAttachmentsPassed ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments = java.util.Collections.emptyList ( ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworkValidator ( networkAttachments ) ; org.junit.Assert.assertThat ( validator.validateQosOverriddenInterfaces ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testValidateQosOverriddenInterfacesWhenAttachmentDoesNotHaveQosOverridden ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addNetworkAttachments ( networkAttachment ) ) . build ( ) ; org.junit.Assert.assertThat ( validator.validateQosOverriddenInterfaces ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void executeCommand ( ) { affinityGroupDao.update ( getParameters ( ) . getAffinityGroup ( ) ) ; setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { java.util.Collection changedVms = org.apache.commons.collections.CollectionUtils.disjunction ( getAffinityGroup ( ) . getVmIds ( ) , getParameters ( ) . getAffinityGroup ( ) . getVmIds ( ) ) ; vmStaticDao.incrementDbGenerationForVms ( new java.util.ArrayList < > ( changedVms ) ) ; affinityGroupDao.update ( getParameters ( ) . getAffinityGroup ( ) ) ; setSucceeded ( true ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isDiskInterfaceSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm != null ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isDiskInterfaceSupportedByOs ( vm.getOs ( ) , vm.getVdsGroupCompatibilityVersion ( ) , disk.getDiskInterface ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED , java.lang.String.format ( "$osName %s" , org.ovirt.engine.core.bll.validator.storage.DiskValidator.getOsRepository ( ) . getOsName ( vm.getOs ( ) ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isDiskInterfaceSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm != null ) { if ( ! ( org.ovirt.engine.core.bll.validator.VmValidationUtils.isDiskInterfaceSupportedByOs ( vm.getOs ( ) , vm.getVdsGroupCompatibilityVersion ( ) , disk.getDiskInterface ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED , java.lang.String.format ( "$osName %s" , org.ovirt.engine.core.bll.validator.storage.DiskValidator.getOsRepository ( ) . getOsName ( vm.getOs ( ) ) ) ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public java.lang.Void call ( ) throws java.lang.Exception { try { final java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > conns = org.ovirt.engine.core.bll.storage.ISCSIStorageHelper.updateIfaces ( connections , host.getId ( ) ) ; runVdsCommand ( VDSCommandType.ConnectStorageServer , new org.ovirt.engine.core.common.vdscommands.StorageServerConnectionManagementVDSParameters ( host.getId ( ) , org.ovirt.engine.core.compat.Guid.Empty , org.ovirt.engine.core.common.businessentities.StorageType.ISCSI , conns ) ) ; } catch ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.errorFormat ( "Could not connect Host {0} - {1} to Iscsi Storage Server. The exception is: {2}" , host.getName ( ) , host.getId ( ) , e ) ; } return null ; }

Target:
public boolean eval ( java.lang.String a ) { return ! ( "0" . equals ( iscsiMap.get ( a ) ) ) ; }
Source:
public synchronized boolean cachingOver ( org.ovirt.engine.core.bll.tasks.SPMAsyncTask task ) { long SubtractMinutesAsMills = java.util.concurrent.TimeUnit.MINUTES.toMillis ( _cacheTimeInMinutes ) ; return ( ( ( task.getState ( ) ) == ( AsyncTaskState.Cleared ) ) || ( ( task.getState ( ) ) == ( AsyncTaskState.ClearFailed ) ) ) && ( ( task.getLastAccessToStatusSinceEnd ( ) ) < ( ( java.lang.System.currentTimeMillis ( ) ) - SubtractMinutesAsMills ) ) ; }

Target:
public synchronized boolean cachingOver ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task ) { long SubtractMinutesAsMills = java.util.concurrent.TimeUnit.MINUTES.toMillis ( _cacheTimeInMinutes ) ; return ( ( ( task.getState ( ) ) == ( AsyncTaskState.Cleared ) ) || ( ( task.getState ( ) ) == ( AsyncTaskState.ClearFailed ) ) ) && ( ( task.getLastAccessToStatusSinceEnd ( ) ) < ( ( java.lang.System.currentTimeMillis ( ) ) - SubtractMinutesAsMills ) ) ; }
Source:
public static void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.GetVmsRunningOnOrMigratingToVdsParameters ( id ) , aQuery ) ; }

Target:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }
Source:
public void setPrefix ( java.lang.String prefix , java.lang.String uri ) { try { writer.setPrefix ( prefix , uri ) ; } catch ( javax.xml.stream.XMLStreamException exception ) { throw new org.ovirt.api.metamodel.tool.XmlWriterException ( ( ( ( ( "Can\'t associate prefix \"" + prefix ) + "\" with URI \"" ) + uri ) + "\"" ) , exception ) ; } }

Target:
public void setPrefix ( java.lang.String prefix , java.lang.String uri ) { try { writer.setPrefix ( prefix , uri ) ; } catch ( javax.xml.stream.XMLStreamException exception ) { throw new org.ovirt.api.metamodel.runtime.xml.XmlException ( ( ( ( ( "Can\'t associate prefix \"" + prefix ) + "\" with URI \"" ) + uri ) + "\"" ) , exception ) ; } }
Source:
private void fillVolumeInformation ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage ancestor = org.ovirt.engine.core.bll.storage.disk.image.CreateImageTemplateCommand.getDiskImageDao ( ) . getAncestor ( org.ovirt.engine.core.bll.storage.disk.image.CreateImageTemplateCommand.getDiskImage ( ) . getImageId ( ) ) ; disk.setVolumeFormat ( ancestor.getVolumeFormat ( ) ) ; disk.setVolumeType ( ancestor.getVolumeType ( ) ) ; }

Target:
private void fillVolumeInformation ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage ancestor = diskImageDao.getAncestor ( org.ovirt.engine.core.bll.storage.disk.image.CreateImageTemplateCommand.getDiskImage ( ) . getImageId ( ) ) ; disk.setVolumeFormat ( ancestor.getVolumeFormat ( ) ) ; disk.setVolumeType ( ancestor.getVolumeType ( ) ) ; }
Source:
public void testBlockUseHostCpuWithPPCArch ( ) { prepareVmToPassValidate ( ) ; command.initEffectiveCompatibilityVersion ( ) ; vm.setClusterArch ( ArchitectureType.ppc64le ) ; group.setArchitecture ( ArchitectureType.ppc ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.UpdateVmCommandTest.osRepository.getArchitectureFromOS ( OsType.Windows.ordinal ( ) ) ) . thenReturn ( ArchitectureType.ppc ) ; vmStatic.setUseHostCpuFlags ( true ) ; vmStatic.setMigrationSupport ( MigrationSupport.PINNED_TO_HOST ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.USE_HOST_CPU_REQUESTED_ON_UNSUPPORTED_ARCH ) ; }

Target:
public void testBlockUseHostCpuWithPPCArch ( ) { prepareVmToPassValidate ( ) ; command.initEffectiveCompatibilityVersion ( ) ; vm.setClusterArch ( ArchitectureType.ppc64le ) ; group.setArchitecture ( ArchitectureType.ppc ) ; org.mockito.Mockito.when ( osRepository.getArchitectureFromOS ( OsType.Windows.ordinal ( ) ) ) . thenReturn ( ArchitectureType.ppc ) ; vmStatic.setUseHostCpuFlags ( true ) ; vmStatic.setMigrationSupport ( MigrationSupport.PINNED_TO_HOST ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.USE_HOST_CPU_REQUESTED_ON_UNSUPPORTED_ARCH ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > buildFromOVFs ( java.util.List < java.lang.String > ovfList ) { org.ovirt.engine.core.bll.OvfHelper ovfHelper = new org.ovirt.engine.core.bll.OvfHelper ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = new java.util.ArrayList < > ( ) ; for ( java.lang.String ovf : ovfList ) { try { if ( ! ( ovfHelper.isOvfTemplate ( ovf ) ) ) { vms.add ( ovfHelper.readVmFromOvf ( ovf ) ) ; } } catch ( org.ovirt.engine.core.utils.ovf.OvfReaderException ex ) { auditLogOvfLoadError ( ex.getName ( ) , ex.getMessage ( ) ) ; } } return vms ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VM > buildFromOVFs ( java.util.List < java.lang.String > ovfList ) { org.ovirt.engine.core.bll.storage.ovfstore.OvfHelper ovfHelper = new org.ovirt.engine.core.bll.storage.ovfstore.OvfHelper ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = new java.util.ArrayList < > ( ) ; for ( java.lang.String ovf : ovfList ) { try { if ( ! ( ovfHelper.isOvfTemplate ( ovf ) ) ) { vms.add ( ovfHelper.readVmFromOvf ( ovf ) ) ; } } catch ( org.ovirt.engine.core.utils.ovf.OvfReaderException ex ) { auditLogOvfLoadError ( ex.getName ( ) , ex.getMessage ( ) ) ; } } return vms ; }
Source:
public com.google.gwt.event.dom.client.HasClickHandlers addShutdownButton ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model , org.ovirt.engine.ui.uicommonweb.UICommand command ) { org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton button = new org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton ( constants.shutdownVm ( ) , resources.stopIcon ( ) , resources.stopDisabledIcon ( ) , style.shutdownButtonAdditionalStyle ( ) ) ; button.setElementId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , "shutdownButton" ) ) ; addButtonToPanel ( button ) ; updateButton ( button , command ) ; return button ; }

Target:
public void updateSuspendButton ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { updateButton ( suspendButton , command ) ; }
Source:
public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from Logoff." ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , result ) ; if ( ( org.ovirt.engine.ui.frontend.Frontend.getLoginHandler ( ) ) != null ) { org.ovirt.engine.ui.frontend.Frontend.getLoginHandler ( ) . onLogout ( ) ; } }

Target:
public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { org.ovirt.engine.ui.frontend.Frontend.logger.finer ( "Succesful returned result from logoff." ) ; callback.getDel ( ) . onSuccess ( callback.getModel ( ) , result ) ; if ( ( org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoginHandler ( ) ) != null ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . getLoginHandler ( ) . onLogout ( ) ; } }
Source:
public void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return java.util.Collections.< org.ovirt.engine.core.common.businessentities.CertificateInfo > emptyList ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }

Target:
public void getProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.CertificateInfo > > aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
private void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public void getExternalProviderComputeResourceList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalComputeResource > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetComputeResourceFromExternalProvider , params , aQuery ) ; }
Source:
public java.lang.Object runInTransaction ( ) { getStoragePool ( ) . setstatus ( StoragePoolStatus.Maintenance ) ; getStoragePool ( ) . setStoragePoolFormatType ( masterStorageDomain.getStorageFormat ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( getStoragePool ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.PoolStatusChanged ( getStoragePool ( ) . getId ( ) , getStoragePool ( ) . getstatus ( ) ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { getStoragePool ( ) . setStatus ( StoragePoolStatus.Maintenance ) ; getStoragePool ( ) . setStoragePoolFormatType ( masterStorageDomain.getStorageFormat ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( getStoragePool ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; org.ovirt.engine.core.bll.storage.StoragePoolStatusHandler.poolStatusChanged ( getStoragePool ( ) . getId ( ) , getStoragePool ( ) . getStatus ( ) ) ; return null ; }
Source:
private void undo ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getPreview ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RestoreAllSnapshots , new org.ovirt.engine.core.common.action.RestoreAllSnapshotsParameters ( vm.getId ( ) , snapshot.getId ( ) ) , null , null ) ; } }

Target:
private void undo ( ) { org.ovirt.engine.core.common.businessentities.VM vm = ( ( org.ovirt.engine.core.common.businessentities.VM ) ( getEntity ( ) ) ) ; if ( vm != null ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getPreview ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.RestoreAllSnapshots , new org.ovirt.engine.core.common.action.RestoreAllSnapshotsParameters ( vm.getId ( ) , snapshot.getId ( ) ) , null , null ) ; } }
Source:
public void testCleanExpiredUsersSessionsNoUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = initDataForClearTest ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_KEY ) ; 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.TEST_KEY ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }

Target:
public void testCleanNotExpiredUsersSessionsWithUsers ( ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = 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 ) ) ; org.mockito.Mockito.verifyZeroInteractions ( dbUserDAOMcok ) ; }
Source:
public void setColumnVisible ( com.google.gwt.user.cellview.client.Column < T , ? > column , boolean visible ) { if ( isColumnPresent ( column ) ) { columnVisibleMapOverride.put ( column , visible ) ; ensureColumnVisible ( column , null , visible , columnWidthMap.get ( column ) , false ) ; } }

Target:
public boolean isColumnVisible ( com.google.gwt.user.cellview.client.Column < T , ? > column ) { if ( ! ( isColumnPresent ( column ) ) ) { return false ; } boolean visible = true ; if ( columnVisibleMap.containsKey ( column ) ) { visible = columnVisibleMap.get ( column ) ; } if ( visible && ( columnVisibleMapOverride.containsKey ( column ) ) ) { visible = columnVisibleMapOverride.get ( column ) ; } visible = visible && ( ( getHiddenPersistedColumnWidth ( column ) ) == null ) ; return visible ; }
Source:
private void showBrickAdvancedDetails ( ) { final org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getEntity ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getClusterById ( 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 ) { onShowBrickAdvancedDetails ( volumeEntity ) ; } } ) , volumeEntity.getClusterId ( ) ) ; }

Target:
private void showBrickAdvancedDetails ( ) { final org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getEntity ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getClusterById ( new org.ovirt.engine.ui.uicommonweb.models.gluster.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.businessentities.Cluster > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.businessentities.Cluster returnValue ) { onShowBrickAdvancedDetails ( volumeEntity ) ; } } ) , volumeEntity.getClusterId ( ) ) ; }
Source:
private static void mockConfigVals ( ) { org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLocalDisksLowFreeSpace ) ) . thenReturn ( 0 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsLocalDisksCriticallyLowFreeSpace ) ) . thenReturn ( 0 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsRefreshRate ) ) . thenReturn ( 3000 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.TimeToReduceFailedRunOnVdsInMinutes ) ) . thenReturn ( 30 ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VdsRecoveryTimeoutInMintues ) ) . thenReturn ( 3 ) ; }

Target:
public void unmockEjbStrategy ( ) { org.ovirt.engine.core.utils.ejb.EjbUtils.setStrategy ( origEjbStrategy ) ; }
Source:
protected java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > setUpExportTemplates ( ) { java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ret = new java.util.LinkedHashMap < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { ret.put ( getEntity ( i ) , new java.util.ArrayList < > ( ) ) ; } return ret ; }

Target:
protected java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > setUpExportTemplates ( ) { return java.util.stream.IntStream.range ( 0 , NAMES.length ) . boxed ( ) . collect ( java.util.stream.Collectors.toMap ( this :: getEntity , ( x ) -> new java.util.ArrayList < > ( ) , ( u , v ) -> null , java.util.LinkedHashMap :: new ) ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > searchVmsFromDb ( ) { org.ovirt.engine.core.aaa.QueryData data = initQueryData ( true ) ; if ( data == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.core.bll.SearchQuery.getDbFacade ( ) . getVmDao ( ) . getAllUsingQuery ( data.getQuery ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmLock ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateOperationProgress ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmStatistics ( vm ) ; } return vms ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > searchVmsFromDb ( ) { org.ovirt.engine.core.aaa.QueryData data = initQueryData ( true ) ; if ( data == null ) { return java.util.Collections.emptyList ( ) ; } java.util.List < org.ovirt.engine.core.common.businessentities.VM > vms = vmDao.getAllUsingQuery ( data.getQuery ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vms ) { org.ovirt.engine.core.bll.VmHandler.updateVmGuestAgentVersion ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmLock ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateOperationProgress ( vm ) ; org.ovirt.engine.core.bll.VmHandler.updateVmStatistics ( vm ) ; } return vms ; }
Source:
private void updateShareableDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isShareableDiskEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.ShareableDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsShareable ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.shareableDiskNotSupported ( ) ) ; getIsShareable ( ) . setIsChangable ( ( isShareableDiskEnabled && ( isEditEnabled ( ) ) ) ) ; }

Target:
private void updateDirectLunDiskEnabled ( org.ovirt.engine.core.common.businessentities.StoragePool datacenter ) { boolean isInternal = getIsInternal ( ) . getEntity ( ) ; if ( isInternal ) { return ; } boolean isDirectLUNDiskkEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.DirectLUNDiskEnabled , datacenter.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getIsDirectLunDiskAvaialable ( ) . setEntity ( isDirectLUNDiskkEnabled ) ; setMessage ( ( ! isDirectLUNDiskkEnabled ? org.ovirt.engine.ui.uicommonweb.models.vms.AbstractDiskModel.CONSTANTS.directLUNDiskNotSupported ( ) : "" ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc heartBeat ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.ping" ) . 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.StatusOnlyReturnForXmlRpc createVolumeContainer ( java.lang.String jobId , java.util.Map < java.lang.String , java.lang.Object > createVolumeInfo ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "SDM.create_volume" ) . withParameter ( "job_id" , jobId ) . withParameter ( "vol_info" , createVolumeInfo ) . 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 ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.StoragePool getStoragePool ( ) { if ( ( ( ( _storagePool ) == null ) && ( ( getStoragePoolId ( ) ) != null ) ) && ( ! ( Guid.Empty.equals ( getStoragePoolId ( ) ) ) ) ) { _storagePool = getStoragePoolDAO ( ) . get ( getStoragePoolId ( ) ) ; } return _storagePool ; }

Target:
public org.ovirt.engine.core.common.businessentities.StoragePool getStoragePool ( ) { if ( ( ( ( _storagePool ) == null ) && ( ( getStoragePoolId ( ) ) != null ) ) && ( ! ( Guid.Empty.equals ( getStoragePoolId ( ) ) ) ) ) { _storagePool = getStoragePoolDao ( ) . get ( getStoragePoolId ( ) ) ; } return _storagePool ; }
Source:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.Disk > extractRootDisks ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Set < org.ovirt.engine.core.common.businessentities.Disk > rootDisks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage candidate : vm.getImages ( ) ) { if ( isRoot ( candidate , vm.getImages ( ) ) ) { rootDisks.add ( candidate ) ; } } return rootDisks ; }

Target:
private java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.Disk > extractRootDisks ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Set < org.ovirt.engine.core.common.businessentities.storage.Disk > rootDisks = new java.util.HashSet < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage candidate : vm.getImages ( ) ) { if ( isRoot ( candidate , vm.getImages ( ) ) ) { rootDisks.add ( candidate ) ; } } return rootDisks ; }
Source:
public static void getHostPublicKey ( 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.RunQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }