auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public javax.net.ssl.TrustManager [ ] getTustManagers ( ) { try ( java.io.InputStream stream = new java.io.FileInputStream ( org.ovirt.vdsm.jsonrpc.client.TestManagerProvider.TRUST_STORE_FILE ) ) { java.security.KeyStore keyStore = java.security.KeyStore.getInstance ( "PKCS12" ) ; keyStore.load ( stream , org.ovirt.vdsm.jsonrpc.client.TestManagerProvider.PASSWORD.toCharArray ( ) ) ; javax.net.ssl.TrustManagerFactory tmf = javax.net.ssl.TrustManagerFactory.getInstance ( "SunX509" ) ; tmf.init ( keyStore ) ; return tmf.getTrustManagers ( ) ; } catch ( java.security.NoSuchAlgorithmException | java.io.IOException | java.security.KeyStoreException | java.security.cert.CertificateException ex ) { throw new java.lang.RuntimeException ( ex ) ; } }

Target:
public javax.net.ssl.TrustManager [ ] getTustManagers ( ) { try { java.security.KeyStore keyStore = java.security.KeyStore.getInstance ( "JKS" ) ; keyStore.load ( this . trustStream , this . pass.toCharArray ( ) ) ; javax.net.ssl.TrustManagerFactory tmf = javax.net.ssl.TrustManagerFactory.getInstance ( javax.net.ssl.TrustManagerFactory.getDefaultAlgorithm ( ) ) ; tmf.init ( keyStore ) ; return tmf.getTrustManagers ( ) ; } catch ( java.security.NoSuchAlgorithmException | java.io.IOException | java.security.KeyStoreException | java.security.cert.CertificateException ex ) { throw new java.lang.RuntimeException ( ex ) ; } }
Source:
public void perform ( ) { if ( manager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = ( getRefreshStatistics ( ) ) ? new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( manager ) : new org.ovirt.engine.core.vdsbroker.VmsListFetcher ( manager ) ; long fetchTime = java.lang.System.nanoTime ( ) ; fetcher.fetch ( ) ; new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( manager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , auditLogDirector , fetchTime ) . perform ( ) ; } updateIteration ( ) ; }

Target:
private org.ovirt.engine.core.vdsbroker.VmsMonitoring getVmsMonitoring ( org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher , long fetchTime ) { return new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( manager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , auditLogDirector , fetchTime , getRefreshStatistics ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > getNetworkBusinessEntityMap ( ) { if ( ( networkBusinessEntityMap ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getNetworkDao ( ) . getAllForCluster ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getVdsGroupId ( ) ) ; networkBusinessEntityMap = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networks ) ; } return networkBusinessEntityMap ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > getClusterNetworks ( ) { if ( ( clusterNetworks ) == null ) { clusterNetworks = org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getNetworkDao ( ) . getAllForCluster ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksCommand.getVdsGroupId ( ) ) ; } return clusterNetworks ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateHostIsReadyToRun ( final org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { sb.append ( " VDS " ) . append ( vds.getvds_name ( ) ) . append ( " " ) . append ( vds.getId ( ) ) . append ( " " ) ; for ( org.ovirt.engine.core.bll.VdsSelector.HostValidator validator : this . hostValidators ) { org.ovirt.engine.core.dal.VdcBllMessages result = validator.validate ( vds , sb , isMigrate ) ; if ( result != null ) { return new org.ovirt.engine.core.bll.ValidationResult ( result ) ; } } return ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateHostIsReadyToRun ( final org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { sb.append ( " VDS " ) . append ( vds.getVdsName ( ) ) . append ( " " ) . append ( vds.getId ( ) ) . append ( " " ) ; for ( org.ovirt.engine.core.bll.VdsSelector.HostValidator validator : this . hostValidators ) { org.ovirt.engine.core.dal.VdcBllMessages result = validator.validate ( vds , sb , isMigrate ) ; if ( result != null ) { return new org.ovirt.engine.core.bll.ValidationResult ( result ) ; } } return ValidationResult.VALID ; }
Source:
protected void setStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { if ( ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getStatus ( ) ) != status ) { runVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getId ( ) , status ) ) ; } }

Target:
protected void setStatus ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { if ( ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getStatus ( ) ) != status ) { org.ovirt.engine.core.bll.FenceVdsBaseCommand.getBackend ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.SetVdsStatus , new org.ovirt.engine.core.common.vdscommands.SetVdsStatusVDSCommandParameters ( org.ovirt.engine.core.bll.FenceVdsBaseCommand.getVds ( ) . getId ( ) , status ) ) ; } }
Source:
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 ; }

Target:
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.storage_pool > ( ) ; } final java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > storagePoolList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( source ) ) ; java.util.Collections.sort ( storagePoolList , new org.ovirt.engine.ui.uicommonweb.Linq.StoragePoolByNameComparer ( ) ) ; return source ; }
Source:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue mergeSnapshots ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.vdscommands.MergeSnapshotsVDSCommandParameters params = new org.ovirt.engine.core.common.vdscommands.MergeSnapshotsVDSCommandParameters ( storagePoolId , storageDomainId , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getVmId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . getId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDestinationDiskImage ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . isWipeAfterDelete ( ) ) ; return runVdsCommand ( VDSCommandType.MergeSnapshots , params ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue mergeSnapshots ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.vdscommands.MergeSnapshotsVDSCommandParameters params = new org.ovirt.engine.core.common.vdscommands.MergeSnapshotsVDSCommandParameters ( storagePoolId , storageDomainId , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getVmId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . getId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDestinationDiskImage ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveSnapshotSingleDiskCommand.getDiskImage ( ) . isWipeAfterDelete ( ) ) ; return runVdsCommand ( VDSCommandType.MergeSnapshots , org.ovirt.engine.core.bll.storage.PostZeroHandler.fixParametersWithPostZero ( params ) ) ; }
Source:
public void put ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.compat.Guid rootCommandId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.core.compat.CommandStatus status ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = buildCommandEntity ( commandId , rootCommandId , actionType , params , status ) ; commandMap.put ( commandId , cmdEntity ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; }

Target:
public void put ( org.ovirt.engine.core.compat.Guid commandId , org.ovirt.engine.core.compat.Guid rootCommandId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.core.compat.CommandStatus status , boolean enableCallBack ) { org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity = buildCommandEntity ( commandId , rootCommandId , actionType , params , status , enableCallBack ) ; commandMap.put ( commandId , cmdEntity ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getCommandEntityDao ( ) . saveOrUpdate ( cmdEntity ) ; }
Source:
public void updateIdForNonExistingSnapshot ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.Empty ; org.ovirt.engine.core.compat.Guid newSnapshotId = org.ovirt.engine.core.compat.Guid.Empty ; org.junit.Assert.assertNull ( dao.get ( snapshotId ) ) ; dao.updateId ( snapshotId , newSnapshotId ) ; org.junit.Assert.assertNull ( dao.get ( snapshotId ) ) ; org.junit.Assert.assertNull ( dao.get ( newSnapshotId ) ) ; }

Target:
public void updateIdForNonExistingSnapshot ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.Empty ; org.ovirt.engine.core.compat.Guid newSnapshotId = org.ovirt.engine.core.compat.Guid.Empty ; org.junit.jupiter.api.Assertions.assertNull ( dao.get ( snapshotId ) ) ; dao.updateId ( snapshotId , newSnapshotId ) ; org.junit.jupiter.api.Assertions.assertNull ( dao.get ( snapshotId ) ) ; org.junit.jupiter.api.Assertions.assertNull ( dao.get ( newSnapshotId ) ) ; }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; log.error ( "Failed deleting disk from Cinder. ID: {}" , getDiskId ( ) ) ; if ( getCommand ( ) . getParameters ( ) . getShouldBeLogged ( ) ) { new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( getCommand ( ) , AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ) ; } org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( getDiskId ( ) , ImageStatus.ILLEGAL ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.CinderDisk getDisk ( ) { return getCommand ( ) . getParameters ( ) . getRemovedVolume ( ) ; }
Source:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase attemptRollback ( org.ovirt.engine.core.common.action.VdcActionType commandType , org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { if ( canPerformRollbackUsingCommand ( commandType , params ) ) { params.setExecutionReason ( CommandExecutionReason.ROLLBACK_FLOW ) ; params.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; return getBackend ( ) . runInternalAction ( commandType , params , context.clone ( ) ) ; } return new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; }

Target:
protected org.ovirt.engine.core.common.action.VdcReturnValueBase attemptRollback ( org.ovirt.engine.core.common.action.VdcActionType commandType , org.ovirt.engine.core.common.action.VdcActionParametersBase params , org.ovirt.engine.core.bll.context.CommandContext context ) { if ( canPerformRollbackUsingCommand ( commandType , params ) ) { params.setExecutionReason ( CommandExecutionReason.ROLLBACK_FLOW ) ; params.setTransactionScopeOption ( TransactionScopeOption.RequiresNew ) ; return getBackend ( ) . runInternalAction ( commandType , params , context ) ; } return new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; }
Source:
private void writeServiceMethod ( org.ovirt.api.metamodel.concepts.Method method ) { writer.writeStartElement ( "method" ) ; writeCommon ( method ) ; method.parameters ( ) . forEach ( this :: writeParameter ) ; writer.writeEndElement ( ) ; }

Target:
private void writeService ( org.ovirt.api.metamodel.concepts.Service service ) { writer.writeStartElement ( "service" ) ; writeCommon ( service ) ; service.methods ( ) . forEach ( this :: writeServiceMethod ) ; service.locators ( ) . forEach ( this :: writeServiceLocator ) ; writer.writeEndElement ( ) ; }
Source:
boolean detectOverflowUsingClientHeight ( com.google.gwt.dom.client.Element parent ) { int clientHeightBefore = parent.getClientHeight ( ) ; java.lang.String whiteSpaceValue = parent.getStyle ( ) . getProperty ( "whiteSpace" ) ; parent.getStyle ( ) . setProperty ( "whiteSpace" , "normal" ) ; int clientHeightAfter = parent.getClientHeight ( ) ; parent.getStyle ( ) . setProperty ( "whiteSpace" , whiteSpaceValue ) ; return clientHeightAfter > clientHeightBefore ; }

Target:
boolean detectOverflowUsingClientHeight ( com.google.gwt.dom.client.Element parent ) { int clientHeightBefore = parent.getClientHeight ( ) ; java.lang.String whiteSpaceValue = parent.getStyle ( ) . getProperty ( "whiteSpace" ) ; parent.getStyle ( ) . setProperty ( "whiteSpace" , "normal" ) ; int scrollHeightAfter = parent.getScrollHeight ( ) ; int clientHeightAfter = parent.getClientHeight ( ) ; parent.getStyle ( ) . setProperty ( "whiteSpace" , whiteSpaceValue ) ; return ( clientHeightAfter > clientHeightBefore ) || ( clientHeightAfter < scrollHeightAfter ) ; }
Source:
public boolean getAllCleared ( ) { synchronized ( _listTasks ) { for ( org.ovirt.engine.core.bll.tasks.CommandAsyncTask task : _listTasks.values ( ) ) { if ( ! ( taskWasCleared ( task ) ) ) { org.ovirt.engine.core.bll.CommandMultiAsyncTasks.log.infoFormat ( "[within thread]: Some of the tasks related to command id {0} were not cleared yet (Task id {1} is in state {2})." , getCommandId ( ) , task.getVdsmTaskId ( ) , task.getState ( ) ) ; return false ; } } } return true ; }

Target:
public boolean getAllCleared ( ) { synchronized ( _listTasks ) { for ( org.ovirt.engine.core.bll.tasks.CommandAsyncTask task : _listTasks.values ( ) ) { if ( ! ( taskWasCleared ( task ) ) ) { org.ovirt.engine.core.bll.CommandMultiAsyncTasks.log.info ( ( "[within thread]: Some of the tasks related to command id '{}' were not cleared yet" + " (Task id '{}' is in state '{}')." ) , getCommandId ( ) , task.getVdsmTaskId ( ) , task.getState ( ) ) ; return false ; } } } return true ; }
Source:
protected void executeCommand ( ) { try { addVmToDb ( ) ; processImages ( ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.isImagesAlreadyOnTarget ( ) ) ) ) ; if ( getReturnValue ( ) . getVdsmTaskIdList ( ) . isEmpty ( ) ) { endVmRelatedOps ( ) ; } org.ovirt.engine.core.bll.VmHandler.addVmInitToDB ( getVm ( ) . getStaticData ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . freeMacs ( macsAdded ) ; throw e ; } org.ovirt.engine.core.bll.ImportVmCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { try { addVmToDb ( ) ; processImages ( ( ! ( org.ovirt.engine.core.bll.ImportVmCommand.isImagesAlreadyOnTarget ( ) ) ) ) ; if ( getReturnValue ( ) . getVdsmTaskIdList ( ) . isEmpty ( ) ) { endVmRelatedOps ( ) ; } org.ovirt.engine.core.bll.VmHandler.addVmInitToDB ( getVm ( ) . getStaticData ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.ImportVmCommand.getMacPool ( ) . freeMacs ( macsAdded ) ; throw e ; } org.ovirt.engine.core.bll.ImportVmCommand.setSucceeded ( true ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel object ) { org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.StoragePopupView.Driver.driver.edit ( object ) ; final org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel = object ; storageModel.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { revealStorageView ( storageModel ) ; } } ) ; }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel object ) { org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.StoragePopupView.Driver.driver.edit ( object ) ; final org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel = object ; storageModel.getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { revealStorageView ( storageModel ) ; } } ) ; }
Source:
public static void getRpmVersion ( 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.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void getGlusterVolumeProfilingStatistics ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid volumeId , boolean nfs ) { aQuery.setHandleFailure ( true ) ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeProfileParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeProfileParameters ( clusterId , volumeId , nfs ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeProfileInfo , parameters , aQuery ) ; }
Source:
private void initListeners ( final org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.ISpice spice = model.getVmConsoles ( ) . getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel.class ) . getspice ( ) ; if ( spice == null ) { return ; } viewUpdatingListener = new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getView ( ) . edit ( model ) ; } } ; }

Target:
private void initListeners ( final org.ovirt.engine.ui.uicommonweb.models.ConsolePopupModel model ) { org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleClient spice = model.getVmConsoles ( ) . getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.SpiceConsoleModel.class ) . getSpiceImpl ( ) ; if ( spice == null ) { return ; } viewUpdatingListener = new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { getView ( ) . edit ( model ) ; } } ; }
Source:
protected void verifyEntityModification ( org.ovirt.engine.core.common.businessentities.VdsStatistics result ) { org.junit.Assert.assertEquals ( true , result.getHighlyAvailableIsActive ( ) ) ; }

Target:
public void testSave ( ) { staticDao.save ( newStaticVds ) ; newStatistics.setId ( newStaticVds.getId ( ) ) ; dao.save ( newStatistics ) ; org.ovirt.engine.core.common.businessentities.VdsStatic staticResult = staticDao.get ( newStaticVds.getId ( ) ) ; org.ovirt.engine.core.common.businessentities.VdsStatistics statisticsResult = dao.get ( newStatistics.getId ( ) ) ; org.junit.Assert.assertNotNull ( staticResult ) ; org.junit.Assert.assertEquals ( newStaticVds , staticResult ) ; org.junit.Assert.assertNotNull ( statisticsResult ) ; org.junit.Assert.assertEquals ( newStatistics , statisticsResult ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; if ( disk.isShareable ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( constants.shareable ( ) ) ; } return null ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.ui.uicommonweb.models.EntityModel object ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel ) ( object.getEntity ( ) ) ) . getDisk ( ) ; if ( disk.isShareable ( ) ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( constants.shareable ( ) ) ; } return null ; }
Source:
public void backupCheck ( ) { if ( lock.tryLock ( ) ) { try { org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Backup check started." ) ; doBackupCheck ( ) ; org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Backup check completed." ) ; } finally { lock.unlock ( ) ; } } }

Target:
private void backupCheck ( ) { try { if ( lock.tryLock ( ) ) { try { org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Backup check started." ) ; doBackupCheck ( ) ; org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.info ( "Backup check completed." ) ; } finally { lock.unlock ( ) ; } } } catch ( java.lang.Throwable t ) { org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.error ( "Exception in backupCheck: {}" , org.apache.commons.lang.exception.ExceptionUtils.getRootCauseMessage ( t ) ) ; org.ovirt.engine.core.bll.EngineBackupAwarenessManager.log.debug ( "Exception" , t ) ; } }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.v3.types.V3Cluster v3Cluster ) { org.ovirt.engine.api.model.Cluster v4Cluster = org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( v3Cluster ) ; org.ovirt.engine.api.v3.helpers.V3ClusterHelper.assignCompatiblePolicy ( v3Cluster , v4Cluster ) ; try { return adaptResponse ( delegate.add ( v4Cluster ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.v3.types.V3Cluster v3Cluster ) { org.ovirt.engine.api.model.Cluster v4Cluster = org.ovirt.engine.api.v3.adapters.V3InAdapters.adaptIn ( v3Cluster ) ; org.ovirt.engine.api.v3.helpers.V3ClusterHelper.assignCompatiblePolicy ( v3Cluster , v4Cluster ) ; try { return adaptResponse ( getDelegate ( ) . add ( v4Cluster ) ) ; } catch ( javax.ws.rs.WebApplicationException exception ) { throw adaptException ( exception ) ; } }
Source:
private org.ovirt.engine.core.compat.Version clusterVersionOrNull ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = model.getSelectedCluster ( ) ; if ( ( vdsGroup == null ) || ( ( vdsGroup.getcompatibility_version ( ) ) == null ) ) { return null ; } return vdsGroup.getcompatibility_version ( ) ; }

Target:
private org.ovirt.engine.core.compat.Version clusterVersionOrNull ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model ) { org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = model.getSelectedCluster ( ) ; if ( ( vdsGroup == null ) || ( ( vdsGroup.getCompatibilityVersion ( ) ) == null ) ) { return null ; } return vdsGroup.getCompatibilityVersion ( ) ; }
Source:
public static void IsSupportBridgesReportByVDSM ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { 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 ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
private static 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.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dataCenters.getSelectedItem ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenter.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , createGetStorageDomainsByStoragePoolIdCallback ( dataCenter ) ) ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { loadProviders ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = dataCenters.getSelectedItem ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenter.getId ( ) ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , createGetStorageDomainsByStoragePoolIdCallback ( dataCenter ) ) ) ; }
Source:
protected boolean validateRemoveProvider ( ) { if ( ( getProviderProxy ( ) ) != null ) { org.ovirt.engine.core.bll.provider.ProviderValidator providerValidator = getProviderProxy ( ) . getProviderValidator ( ) ; return validate ( providerValidator.validateRemoveProvider ( ) ) ; } return true ; }

Target:
protected boolean validateRemoveProvider ( ) { if ( ( ( getProviderProxy ( ) ) != null ) && ( ! ( org.ovirt.engine.core.bll.provider.RemoveProviderCommand.getParameters ( ) . isForce ( ) ) ) ) { org.ovirt.engine.core.bll.provider.ProviderValidator providerValidator = getProviderProxy ( ) . getProviderValidator ( ) ; return validate ( providerValidator.validateRemoveProvider ( ) ) ; } return true ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { boolean doesNotReferenceExistingNetworkAttachment = networkAttachmentId == null ; if ( doesNotReferenceExistingNetworkAttachment ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_ATTACHMENT_NOT_EXISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.VAR_NETWORK_ATTACHMENT_NOT_EXISTS_ENTITY , networkAttachmentId.toString ( ) ) ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { boolean doesNotReferenceExistingNetworkAttachment = networkAttachmentId == null ; if ( doesNotReferenceExistingNetworkAttachment ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS ) ; }
Source:
public void poll ( ) { if ( ( this . manager.isMonitoringNeeded ( ) ) && ( getRefreshStatistics ( ) ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = new org.ovirt.engine.core.vdsbroker.VmsStatisticsFetcher ( this . manager ) ; long fetchTime = java.lang.System.nanoTime ( ) ; fetcher.fetch ( ) ; new org.ovirt.engine.core.vdsbroker.VmsMonitoring ( this . manager , fetcher.getChangedVms ( ) , fetcher.getVmsWithChangedDevices ( ) , this . auditLogDirector , fetchTime ) . perform ( ) ; } updateIteration ( ) ; }

Target:
public void stopMonitoring ( ) { pollVMStatsRefresher.stopMonitoring ( ) ; this . subscription.cancel ( ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionCreate ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remotVolumeName , java.lang.String remoteUserName , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionCreate" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , remoteHost ) . withParameter ( "remoteVolumeName" , remotVolumeName ) . withParameter ( "force" , force ) . withOptionalParameter ( "remoteUserName" , remoteUserName ) . 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 glusterVolumeGeoRepSessionCreate ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remotVolumeName , java.lang.String userName , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionCreate" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , remoteHost ) . withParameter ( "remoteVolumeName" , remotVolumeName ) . withParameter ( "force" , force ) . withOptionalParameter ( "remoteUserName" , userName ) . 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 void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }

Target:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
public void filter ( ) throws org.apache.xmlrpc.XmlRpcException { java.lang.Object [ ] sentObject = new java.lang.Object [ 4 ] ; sentObject [ 0 ] = new java.lang.Object [ ] { org.ovirt.schedulerproxy.SchedulerProxy.FILE_NAME } ; sentObject [ 1 ] = org.ovirt.schedulerproxy.SchedulerProxy.HOSTS_EXAMPLE ; sentObject [ 2 ] = org.ovirt.schedulerproxy.SchedulerProxy.VM_EXAMPLE ; sentObject [ 3 ] = "" ; java.lang.Object execute = client.execute ( "runFilters" , sentObject ) ; java.lang.System.out.println ( parseFilterResult ( execute ) ) ; }

Target:
public java.lang.String balance ( java.lang.String balanceName , java.lang.String [ ] HostID , java.lang.String args ) throws org.apache.xmlrpc.XmlRpcException { java.lang.Object [ ] sentObject = new java.lang.Object [ 3 ] ; sentObject [ 0 ] = balanceName ; sentObject [ 1 ] = HostID ; sentObject [ 2 ] = args ; java.lang.Object execute = client.execute ( "runLoadBalancing" , sentObject ) ; return parseBalanceResults ( execute ) ; }
Source:
private final < T extends org.ovirt.engine.core.common.businessentities.IVdcQueryable > java.util.List < T > genericSearch ( final org.ovirt.engine.core.dao.SearchDAO < T > dao , final boolean useCache , final org.ovirt.engine.core.common.utils.ListUtils.Filter < T > filter ) { final org.ovirt.engine.core.bll.QueryData2 data = InitQueryData ( useCache ) ; if ( data == null ) { return new java.util.ArrayList < T > ( ) ; } return org.ovirt.engine.core.common.utils.ListUtils.filter ( dao.getAllWithQuery ( data.getQuery ( ) ) , filter ) ; }

Target:
private final < T extends org.ovirt.engine.core.common.businessentities.IVdcQueryable > java.util.List < T > genericSearch ( final org.ovirt.engine.core.dao.SearchDAO < T > dao , final boolean useCache , final org.ovirt.engine.core.common.utils.ListUtils.Filter < T > filter ) { final org.ovirt.engine.core.bll.QueryData data = initQueryData ( useCache ) ; if ( data == null ) { return new java.util.ArrayList < T > ( ) ; } return org.ovirt.engine.core.common.utils.ListUtils.filter ( dao.getAllWithQuery ( data.getQuery ( ) ) , filter ) ; }
Source:
protected void setUserDomainCredentials ( java.lang.String domain ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.Domain domainObject = org.ovirt.engine.extensions.aaa.builtin.kerberosldap.UsersDomainsCacheManagerService.getInstance ( ) . getDomain ( domain ) ; if ( domainObject != null ) { setLoginName ( domainObject.getUserName ( ) ) ; setPassword ( domainObject.getPassword ( ) ) ; if ( getLoginName ( ) . contains ( "@" ) ) { java.lang.String userDomain = getLoginName ( ) . split ( "@" ) [ 1 ] . toLowerCase ( ) ; setAuthenticationDomain ( userDomain ) ; } else { setAuthenticationDomain ( domain ) ; } } }

Target:
protected void setUserDomainCredentials ( java.lang.String domain ) { setLoginName ( configuration.getProperty ( "config.AdUserName" ) ) ; try { setPassword ( org.ovirt.engine.core.utils.crypt.EngineEncryptionUtils.decrypt ( configuration.getProperty ( "config.AdUserPassword" ) ) ) ; } catch ( java.security.GeneralSecurityException e ) { org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapBrokerCommandBase.log.error ( java.lang.String.format ( "Error decrypting password. Message is: %1$s" , e.getMessage ( ) ) ) ; throw new java.lang.RuntimeException ( e ) ; } if ( getLoginName ( ) . contains ( "@" ) ) { java.lang.String userDomain = getLoginName ( ) . split ( "@" ) [ 1 ] . toLowerCase ( ) ; setAuthenticationDomain ( userDomain ) ; } else { setAuthenticationDomain ( domain ) ; } }
Source:
public static void getRpmVersion ( 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.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.sdk.decorators.Template > list ( java.lang.String query ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( ( ( SLASH ) + ( getName ( ) ) ) ) ; if ( query != null ) { urlBuilder.add ( "search" , query , UrlParameterType.QUERY ) ; } java.lang.String url = urlBuilder.build ( ) ; return list ( url , org.ovirt.engine.sdk.entities.Templates.class , org.ovirt.engine.sdk.decorators.Template.class , headers ) ; }

Target:
public java.util.List < org.ovirt.engine.sdk.decorators.Template > list ( java.lang.String allContent ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; if ( allContent != null ) { headersBuilder.add ( "All-Content" , allContent ) ; } java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( ( ( SLASH ) + ( getName ( ) ) ) ) ; java.lang.String url = urlBuilder.build ( ) ; return list ( url , org.ovirt.engine.sdk.entities.Templates.class , org.ovirt.engine.sdk.decorators.Template.class , headers ) ; }
Source:
public 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void canRunVmFailVmRunning ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; org.mockito.Mockito.doReturn ( false ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }

Target:
public void canRunVmFailVmRunning ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setStatus ( VMStatus.Up ) ; org.mockito.Mockito.doReturn ( false ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }
Source:
public int getAvailableMacsCount ( ) { lockObj.readLock ( ) . lock ( ) ; try { checkIfInitialized ( ) ; int availableMacsSize = macsStorage.getAvailableMacsCount ( ) ; org.ovirt.engine.core.bll.network.MacPoolManagerRanges.log.debugFormat ( "Number of available Mac addresses = {1}" , availableMacsSize ) ; return availableMacsSize ; } finally { lockObj.readLock ( ) . unlock ( ) ; } }

Target:
public int getAvailableMacsCount ( ) { try ( org.ovirt.engine.core.utils.lock.AutoCloseableLock l = new org.ovirt.engine.core.utils.lock.AutoCloseableLock ( lockObj.readLock ( ) ) ) { checkIfInitialized ( ) ; int availableMacsSize = macsStorage.getAvailableMacsCount ( ) ; org.ovirt.engine.core.bll.network.MacPoolManagerRanges.log.debugFormat ( "Number of available Mac addresses = {1}" , availableMacsSize ) ; return availableMacsSize ; } }
Source:
protected java.lang.String findBestMatchForEmulatedMachine ( java.lang.String originalEmulatedMachine , java.util.List < java.lang.String > candidateEmulatedMachines ) { return candidateEmulatedMachines.stream ( ) . max ( java.util.Comparator.comparingInt ( ( s ) -> org.apache.commons.lang.StringUtils.indexOfDifference ( originalEmulatedMachine , s ) ) ) . orElse ( originalEmulatedMachine ) ; }

Target:
protected java.lang.String findBestMatchForEmulatedMachine ( java.lang.String currentEmulatedMachine , java.util.List < java.lang.String > candidateEmulatedMachines ) { if ( candidateEmulatedMachines.contains ( currentEmulatedMachine ) ) { return currentEmulatedMachine ; } return candidateEmulatedMachines.stream ( ) . max ( java.util.Comparator.comparingInt ( ( s ) -> org.apache.commons.lang.StringUtils.indexOfDifference ( currentEmulatedMachine , s ) ) ) . orElse ( currentEmulatedMachine ) ; }
Source:
protected void postConstruct ( ) { T parameters = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) ; if ( ( parameters.isImportAsNewEntity ( ) ) && ( parameters.getVmId ( ) . equals ( parameters.getVm ( ) . getId ( ) ) ) ) { parameters.getVm ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } setStoragePoolId ( parameters.getStoragePoolId ( ) ) ; imageToDestinationDomainMap = parameters.getImageToDestinationDomainMap ( ) ; }

Target:
protected void init ( ) { T parameters = org.ovirt.engine.core.bll.ImportVmCommandBase.getParameters ( ) ; if ( ( parameters.isImportAsNewEntity ( ) ) && ( parameters.getVmId ( ) . equals ( parameters.getVm ( ) . getId ( ) ) ) ) { parameters.getVm ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } setVdsGroupId ( parameters.getVdsGroupId ( ) ) ; setVm ( parameters.getVm ( ) ) ; }
Source:
public void getStorageDomainByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String storageDomainName ) { 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.GetStorageDomainByName , new org.ovirt.engine.core.common.queries.NameQueryParameters ( storageDomainName ) , aQuery ) ; }

Target:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }