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

Target:
public void getAllTemplatesFromExportDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.HashMap < org.ovirt.engine.core.common.businessentities.VmTemplate , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters getAllFromExportDomainQueryParamenters = new org.ovirt.engine.core.common.queries.GetAllFromExportDomainQueryParameters ( storagePoolId , storageDomainId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetTemplatesFromExportDomain , getAllFromExportDomainQueryParamenters , aQuery ) ; }
Source:
public void init ( org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos ) { if ( qos == null ) { qos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; } getOutAverageLinkshare ( ) . setEntity ( qos.getOutAverageLinkshare ( ) ) ; getOutAverageUpperlimit ( ) . setEntity ( qos.getOutAverageUpperlimit ( ) ) ; getOutAverageRealtime ( ) . setEntity ( qos.getOutAverageRealtime ( ) ) ; }

Target:
public void init ( org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos ) { if ( qos == null ) { qos = new org.ovirt.engine.core.common.businessentities.network.HostNetworkQos ( ) ; } getOutAverageLinkshare ( ) . setEntity ( org.ovirt.engine.ui.uicompat.external.StringUtils.render ( qos.getOutAverageLinkshare ( ) ) ) ; getOutAverageUpperlimit ( ) . setEntity ( org.ovirt.engine.ui.uicompat.external.StringUtils.render ( qos.getOutAverageUpperlimit ( ) ) ) ; getOutAverageRealtime ( ) . setEntity ( org.ovirt.engine.ui.uicompat.external.StringUtils.render ( qos.getOutAverageRealtime ( ) ) ) ; }
Source:
public void testGetAllForVMs ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > > vmDisksMap = dao.getAllForVms ( java.util.Arrays.asList ( FixturesTool.VM_RHEL5_POOL_57 ) ) ; org.junit.Assert.assertTrue ( vmDisksMap.containsKey ( FixturesTool.VM_RHEL5_POOL_57 ) ) ; org.ovirt.engine.core.dao.DiskDaoTest.assertFullGetAllForVMResult ( vmDisksMap.get ( FixturesTool.VM_RHEL5_POOL_57 ) ) ; }

Target:
public void testGetAllForVMs ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.Disk > > vmDisksMap = dao.getAllForVms ( java.util.Collections.singletonList ( FixturesTool.VM_RHEL5_POOL_57 ) ) ; org.junit.Assert.assertTrue ( vmDisksMap.containsKey ( FixturesTool.VM_RHEL5_POOL_57 ) ) ; org.ovirt.engine.core.dao.DiskDaoTest.assertFullGetAllForVMResult ( vmDisksMap.get ( FixturesTool.VM_RHEL5_POOL_57 ) ) ; }
Source:
private void showCheckBoxes ( ) { for ( java.util.Map.Entry < T , com.google.gwt.user.client.ui.CheckBox > currentEntry : checkBoxes.entrySet ( ) ) { wrapperPanel.add ( currentEntry.getValue ( ) ) ; } }

Target:
private void showCheckBoxes ( java.util.List < T > seletedItems ) { for ( java.util.Map.Entry < T , com.google.gwt.user.client.ui.CheckBox > currentEntry : checkBoxes.entrySet ( ) ) { wrapperPanel.add ( currentEntry.getValue ( ) ) ; if ( seletedItems.contains ( currentEntry.getKey ( ) ) ) { currentEntry.getValue ( ) . setValue ( true ) ; } } }
Source:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.STATUS.equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.ImageStatus.class ) ; } else if ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.DISK_TYPE.equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType.class ) ; } else if ( ( ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.BOOTABLE.equals ( fieldName ) ) || ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.SHAREABLE.equals ( fieldName ) ) ) || ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.WIPE_AFTER_DELETE.equals ( fieldName ) ) ) { return new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } return null ; }

Target:
public org.ovirt.engine.core.searchbackend.IConditionValueAutoCompleter getFieldValueAutoCompleter ( java.lang.String fieldName ) { if ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.STATUS.equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.storage.ImageStatus.class ) ; } else if ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.DISK_TYPE.equals ( fieldName ) ) { return new org.ovirt.engine.core.searchbackend.EnumValueAutoCompleter ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.class ) ; } else if ( ( ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.BOOTABLE.equals ( fieldName ) ) || ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.SHAREABLE.equals ( fieldName ) ) ) || ( org.ovirt.engine.core.searchbackend.DiskConditionFieldAutoCompleter.WIPE_AFTER_DELETE.equals ( fieldName ) ) ) { return new org.ovirt.engine.core.searchbackend.BitValueAutoCompleter ( ) ; } return null ; }
Source:
protected org.ovirt.engine.api.model.VM setUpStatisticalExpectations ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmStatistics stats = control.createMock ( org.ovirt.engine.core.common.businessentities.VmStatistics.class ) ; org.ovirt.engine.api.model.VM entity = control.createMock ( org.ovirt.engine.api.model.VM.class ) ; org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.setUpStatisticalEntityExpectations ( entity , stats ) ; setUpGetEntityExpectations ( 1 , false , entity ) ; control.replay ( ) ; return entity ; }

Target:
protected org.ovirt.engine.api.model.VM getEntity ( int index ) { org.ovirt.engine.api.model.VM vm = new org.ovirt.engine.api.model.VM ( ) ; return org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.setUpEntityExpectations ( vm , vm.getStatisticsData ( ) , index ) ; }
Source:
public static void refreshReloadableConfigsInVdcOptionCache ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdcOption > list = org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.getVdcOptionDAO ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VdcOption option : list ) { try { if ( org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.isReloadable ( option.getoption_name ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.updateOption ( option ) ; } } catch ( java.lang.NoSuchFieldException e ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.log.errorFormat ( "Not refreshing field {0}: does not exist in class {1}." , option.getoption_name ( ) , org.ovirt.engine.core.common.config.ConfigValues.class . getSimpleName ( ) ) ; } } }

Target:
public static void refreshReloadableConfigsInVdcOptionCache ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdcOption > list = org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.getVdcOptionDAO ( ) . getAll ( ) ; for ( org.ovirt.engine.core.common.businessentities.VdcOption option : list ) { try { if ( org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.isReloadable ( option.getoption_name ( ) ) ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.updateOption ( option ) ; } } catch ( java.lang.NoSuchFieldException e ) { org.ovirt.engine.core.dal.dbbroker.generic.DBConfigUtils.log.error ( "Not refreshing field '{}': does not exist in class {}." , option.getoption_name ( ) , org.ovirt.engine.core.common.config.ConfigValues.class . getSimpleName ( ) ) ; } } }
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } super . syncSearch ( ) ; org.ovirt.engine.core.common.queries.GetQuotasByAdElementIdQueryParameters parameters = new org.ovirt.engine.core.common.queries.GetQuotasByAdElementIdQueryParameters ( ) ; parameters.setAdElementId ( getEntity ( ) . getId ( ) ) ; parameters.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetQuotasByAdElementId , parameters , new org.ovirt.engine.ui.uicommonweb.models.users.SetItemsAsyncQuery ( ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } super . syncSearch ( ) ; org.ovirt.engine.core.common.queries.GetQuotasByAdElementIdQueryParameters parameters = new org.ovirt.engine.core.common.queries.GetQuotasByAdElementIdQueryParameters ( ) ; parameters.setAdElementId ( getEntity ( ) . getId ( ) ) ; parameters.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( QueryType.GetQuotasByAdElementId , parameters , new org.ovirt.engine.ui.uicommonweb.models.users.SetItemsAsyncQuery ( ) ) ; }
Source:
private boolean isStorageFormatSupportedByStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StorageFormatType storageFormat = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageFormat ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool targetStoragePool = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStoragePool ( ) ; if ( targetStoragePool == null ) { targetStoragePool = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStoragePoolDAO ( ) . get ( org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getVds ( ) . getStoragePoolId ( ) ) ; if ( targetStoragePool == null ) { return false ; } } java.util.Set < org.ovirt.engine.core.common.businessentities.StorageFormatType > supportedStorageFormats = getSupportedStorageFormatSet ( targetStoragePool.getcompatibility_version ( ) ) ; return supportedStorageFormats.contains ( storageFormat ) ; }

Target:
private boolean isStorageFormatSupportedByStoragePool ( ) { org.ovirt.engine.core.common.businessentities.StorageFormatType storageFormat = org.ovirt.engine.core.bll.storage.AddStorageDomainCommand.getStorageDomain ( ) . getStorageFormat ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool targetStoragePool = getTargetStoragePool ( ) ; if ( targetStoragePool == null ) { return false ; } java.util.Set < org.ovirt.engine.core.common.businessentities.StorageFormatType > supportedStorageFormats = getSupportedStorageFormatSet ( targetStoragePool.getcompatibility_version ( ) ) ; return supportedStorageFormats.contains ( storageFormat ) ; }
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 getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
public void close ( ) throws java.lang.Exception { if ( fallbackTriggered ) { setFallbackProtocol ( VdsProtocol.STOMP ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic host = vdsDynamicDao.get ( vds.getId ( ) ) ; if ( ( isJsonProtocolSupported ( host ) ) && ( vds.getVdsGroupCompatibilityVersion ( ) . greaterOrEquals ( Version.v3_6 ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase event = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; event.setVds ( vds ) ; auditLogDirector.log ( event , AuditLogType.HOST_PROTOCOL_INCOMPATIBLE_WITH_CLUSTER ) ; } } }

Target:
public void close ( ) throws java.lang.Exception { if ( fallbackTriggered ) { setFallbackProtocol ( VdsProtocol.STOMP ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic host = vdsDynamicDao.get ( vds.getId ( ) ) ; if ( ( isJsonProtocolSupported ( host ) ) && ( vds.getClusterCompatibilityVersion ( ) . greaterOrEquals ( Version.v3_6 ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase event = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; event.setVds ( vds ) ; auditLogDirector.log ( event , AuditLogType.HOST_PROTOCOL_INCOMPATIBLE_WITH_CLUSTER ) ; } } }
Source:
public java.util.List < java.lang.String > allocateMacAddresses ( int numberOfAddresses ) { java.util.List < java.lang.String > macAddresses = new java.util.ArrayList < java.lang.String > ( numberOfAddresses ) ; for ( int i = 0 ; i < numberOfAddresses ; ++ i ) { macAddresses.add ( org.ovirt.engine.core.bll.network.MacPoolManager.getInstance ( ) . allocateNewMac ( ) ) ; } java.util.Collections.sort ( macAddresses ) ; return macAddresses ; }

Target:
public java.util.List < java.lang.String > allocateMacAddresses ( int numberOfAddresses ) { return macPoolManagerStrategy.allocateMacAddresses ( numberOfAddresses ) ; }
Source:
private java.util.List < org.ovirt.engine.api.model.Network > getEntities ( boolean isDisplay , boolean isRequired ) { java.util.List < org.ovirt.engine.api.model.Network > entities = new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { if ( isDisplay ) { entities.add ( getEntity ( i , isDisplay , isRequired ) ) ; } else { entities.add ( getEntity ( i ) ) ; } } return entities ; }

Target:
private java.util.List < org.ovirt.engine.api.model.Network > getEntities ( boolean isDisplay , boolean isMigration , boolean isRequired ) { java.util.List < org.ovirt.engine.api.model.Network > entities = new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { if ( isDisplay ) { entities.add ( getEntity ( i , isDisplay , isMigration , isRequired ) ) ; } else { entities.add ( getEntity ( i ) ) ; } } return entities ; }
Source:
public void onFailure ( final java.lang.Throwable caught ) { try { if ( org.ovirt.engine.ui.frontend.Frontend.ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute RunPublicQuery: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; org.ovirt.engine.ui.frontend.Frontend.failureEventHandler ( caught ) ; callback.executed ( f ) ; } finally { org.ovirt.engine.ui.frontend.Frontend.raiseQueryCompleteEvent ( queryTypeList , context ) ; } }

Target:
public void onFailure ( final java.util.List < org.ovirt.engine.ui.frontend.communication.VdcOperation < org.ovirt.engine.core.common.queries.VdcQueryType , org.ovirt.engine.core.common.queries.VdcQueryParametersBase > > operationList , final java.lang.Throwable caught ) { try { if ( ignoreFailure ( caught ) ) { return ; } org.ovirt.engine.ui.frontend.Frontend.logger.log ( java.util.logging.Level.SEVERE , ( "Failed to execute runMultipleQueries: " + caught ) , caught ) ; org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult f = new org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult ( queryTypeList , queryParamsList , null ) ; failureEventHandler ( caught ) ; callback.executed ( f ) ; } finally { raiseQueryCompleteEvent ( queryTypeList , context ) ; } }
Source:
protected boolean canDoAction ( ) { boolean retValue = true ; if ( ( disk ) == null ) { retValue = false ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } if ( retValue ) { buildSharedLockMap ( ) ; retValue = org.ovirt.engine.core.bll.RemoveDiskCommand.acquireLockInternal ( ) ; } retValue = retValue && ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? canRemoveDiskBasedOnImageStorageCheck ( ) : canRemoveLunDisk ( ) ) ; return retValue ; }

Target:
protected boolean canDoAction ( ) { if ( ( getDisk ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IMAGE_DOES_NOT_EXIST ) ; } buildSharedLockMap ( ) ; if ( ! ( org.ovirt.engine.core.bll.RemoveDiskCommand.acquireLockInternal ( ) ) ) { return false ; } return ( getDisk ( ) . getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ? canRemoveDiskBasedOnImageStorageCheck ( ) : canRemoveLunDisk ( ) ; }
Source:
public void testBootFromNetworkNoNetwork ( ) { org.ovirt.engine.core.dao.network.VmNicDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.network.VmNicDao.class ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNic > ( ) ) . when ( dao ) . getAllForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( dao ) . when ( runVmValidator ) . getVmNicDao ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.N , new java.util.ArrayList < > ( ) , null ) , false , EngineMessage.VM_CANNOT_RUN_FROM_NETWORK_WITHOUT_NETWORK ) ; }

Target:
public void testBootFromNetworkNoNetwork ( ) { org.ovirt.engine.core.dao.network.VmNicDao dao = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.network.VmNicDao.class ) ; org.mockito.Mockito.doReturn ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNic > ( ) ) . when ( dao ) . getAllForVm ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.doReturn ( dao ) . when ( runVmValidator ) . getVmNicDao ( ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.validateBootSequence ( new org.ovirt.engine.core.common.businessentities.VM ( ) , BootSequence.N , new java.util.ArrayList < > ( ) , null ) , false , EngineMessage.VM_CANNOT_RUN_FROM_NETWORK_WITHOUT_NETWORK ) ; }
Source:
protected void executeVmCommand ( ) { try { vmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.exportimport.ExtractOvaCommand.getVm ( ) ) ; java.util.List < java.lang.String > diskPaths = prepareImages ( ) ; boolean succeeded = runAnsibleImportOvaPlaybook ( diskPaths ) ; teardownImages ( ) ; if ( ! succeeded ) { log.error ( "Failed to extract OVA file" ) ; removeVm ( ) ; } org.ovirt.engine.core.bll.exportimport.ExtractOvaCommand.setSucceeded ( succeeded ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { log.error ( "Failed to extract OVA file" ) ; removeVm ( ) ; throw e ; } }

Target:
protected void executeVmCommand ( ) { try { vmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.exportimport.ExtractOvaCommand.getVm ( ) ) ; java.util.List < java.lang.String > diskPaths = prepareImages ( ) ; boolean succeeded = runAnsibleImportOvaPlaybook ( diskPaths ) ; teardownImages ( ) ; if ( ! succeeded ) { log.error ( "Failed to extract OVA file" ) ; setCommandStatus ( CommandStatus.FAILED ) ; } else { org.ovirt.engine.core.bll.exportimport.ExtractOvaCommand.setSucceeded ( true ) ; } } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { log.error ( "Failed to extract OVA file" ) ; setCommandStatus ( CommandStatus.FAILED ) ; } }
Source:
public void serviceFound ( org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync foundService ) { foundService.logOff ( ( ( org.ovirt.engine.core.common.businessentities.DbUser ) ( userObject ) ) , new com.google.gwt.user.client.rpc.AsyncCallback < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) { @ java.lang.Override public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { xsrfRequestBuilder.setXsrfToken ( null ) ; callback.onSuccess ( result ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { xsrfRequestBuilder.setXsrfToken ( null ) ; callback.onFailure ( caught ) ; } } ) ; }

Target:
public void serviceFound ( org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync foundService ) { foundService.logOff ( ( ( org.ovirt.engine.core.common.businessentities.aaa.DbUser ) ( userObject ) ) , new com.google.gwt.user.client.rpc.AsyncCallback < org.ovirt.engine.core.common.action.VdcReturnValueBase > ( ) { @ java.lang.Override public void onSuccess ( final org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { xsrfRequestBuilder.setXsrfToken ( null ) ; callback.onSuccess ( result ) ; } @ java.lang.Override public void onFailure ( final java.lang.Throwable caught ) { xsrfRequestBuilder.setXsrfToken ( null ) ; callback.onFailure ( caught ) ; } } ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity insertTestSnapshot ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity ( ) ; snapshot.setSnapshotId ( snapshotId ) ; snapshot.setClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.CLUSTER_ID ) ; snapshot.setSnapshotName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.NEW_SNAPSHOT_NAME ) ; snapshot.setVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; snapshot.setDescription ( "test-description" ) ; snapshot.setStatus ( GlusterSnapshotStatus.STARTED ) ; dao.save ( snapshot ) ; return snapshot ; }

Target:
private org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity insertTestSnapshot ( ) { org.ovirt.engine.core.compat.Guid snapshotId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity snapshot = new org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotEntity ( ) ; snapshot.setSnapshotId ( snapshotId ) ; snapshot.setClusterId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.CLUSTER_ID ) ; snapshot.setSnapshotName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.NEW_SNAPSHOT_NAME ) ; snapshot.setVolumeId ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotDaoTest.VOLUME_ID ) ; snapshot.setDescription ( "test-description" ) ; snapshot.setStatus ( GlusterSnapshotStatus.STARTED ) ; snapshot.setCreatedAt ( new java.util.Date ( ) ) ; dao.save ( snapshot ) ; return snapshot ; }
Source:
public static void GetVmList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String poolName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > Cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: pool=" + poolName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , 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.GetAllDisksByVmIdParameters ( vmId ) , aQuery ) ; }
Source:
public void testIsNetworkInSyncWhenBootProtocolDifferent ( ) throws java.lang.Exception { initIpConfigurationBootProtocol ( false ) ; iface.setIpv4BootProtocol ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.forValue ( ( ( ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.BOOT_PROTOCOL.getValue ( ) ) + 1 ) % ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.values ( ) . length ) ) ) ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( false ) ) ; }

Target:
public void testIsNetworkInSyncWhenIpv4StaticBootProtocolAddressEqual ( ) throws java.lang.Exception { initIpv4ConfigurationBootProtocolAddress ( org.ovirt.engine.core.utils.NetworkInSyncWithVdsNetworkInterfaceTest.IPV4_BOOT_PROTOCOL , true ) ; org.junit.Assert.assertThat ( createTestedInstance ( ) . isNetworkInSync ( ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }
Source:
public static java.net.URI buildSsoRevokeUrl ( java.lang.String url , java.lang.String ssoToken ) { try { org.apache.http.client.utils.URIBuilder uriBuilder = new org.apache.http.client.utils.URIBuilder ( java.lang.String.format ( "%1$s/services/sso-logout" , url.substring ( 0 , url.lastIndexOf ( "/" ) ) ) ) ; uriBuilder.addParameter ( "scope" , org.ovirt.engine.sdk4.internal.SsoUtils.SCOPE ) ; uriBuilder.addParameter ( "token" , ssoToken ) ; return uriBuilder.build ( ) ; } catch ( java.net.URISyntaxException ex ) { throw new java.lang.RuntimeException ( ex ) ; } }

Target:
public static java.net.URI buildSsoRevokeUrl ( java.lang.String url , java.lang.String ssoToken ) { try { org.apache.http.client.utils.URIBuilder uriBuilder = new org.apache.http.client.utils.URIBuilder ( java.lang.String.format ( "%1$s/services/sso-logout" , url.substring ( 0 , url.lastIndexOf ( "/" ) ) ) ) ; uriBuilder.addParameter ( "scope" , org.ovirt.engine.sdk4.internal.SsoUtils.SCOPE ) ; uriBuilder.addParameter ( "token" , ssoToken ) ; return uriBuilder.build ( ) ; } catch ( java.net.URISyntaxException ex ) { throw new java.lang.Error ( "Failed to build SSO revoke URL" , ex ) ; } }
Source:
public static void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }

Target:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
private static void setGatewayIfNecessary ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String gateway ) { if ( ( ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( host.getVdsGroupCompatibilityVersion ( ) ) ) || ( org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) . equals ( iface.getNetworkName ( ) ) ) ) || ( iface.getName ( ) . equals ( host.getActiveNic ( ) ) ) ) { iface.setGateway ( gateway ) ; } }

Target:
public static void setGatewayIfNecessary ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String gateway ) { final org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil managementNetworkUtil = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.getManagementNetworkUtil ( ) ; if ( ( ( org.ovirt.engine.core.common.FeatureSupported.multipleGatewaysSupported ( host.getVdsGroupCompatibilityVersion ( ) ) ) || ( managementNetworkUtil.isManagementNetwork ( iface.getNetworkName ( ) , host.getVdsGroupId ( ) ) ) ) || ( iface.getName ( ) . equals ( host.getActiveNic ( ) ) ) ) { iface.setGateway ( gateway ) ; } }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { getAsyncTaskManager ( ) . cancelTasks ( getReturnValue ( ) . getVdsmTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }

Target:
public void setCommandStatus ( org.ovirt.engine.core.compat.CommandStatus status , boolean updateDB ) { this . commandStatus = status ; if ( updateDB ) { javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.updateCommandStatus ( getCommandId ( ) , commandStatus ) ; } finally { if ( transaction != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } } } }
Source:
public static void isAnyHostUpInCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( ( source != null ) && ( ( ( ( java.util.List ) ( source ) ) . size ( ) ) > 0 ) ) { return true ; } return false ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , 1 ) ; }

Target:
public void getGlusterVolumeGeoRepStatusForMasterVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeGeoRepSessions , new org.ovirt.engine.core.common.queries.IdQueryParameters ( masterVolumeId ) , aQuery ) ; }
Source:
private void canDoActionUpdateWipeAfterDelete ( org.ovirt.engine.core.common.businessentities.VMStatus status ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = createDiskImage ( ) ; disk.setReadOnly ( false ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.getDiskInfo ( ) . setReadOnly ( false ) ; parameters.getDiskInfo ( ) . setWipeAfterDelete ( true ) ; initializeCommand ( parameters , java.util.Arrays.asList ( createVm ( status ) ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
private void canDoActionUpdateWipeAfterDelete ( org.ovirt.engine.core.common.businessentities.VMStatus status ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = createDiskImage ( ) ; disk.setReadOnly ( false ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( disk ) ; org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.getDiskInfo ( ) . setReadOnly ( false ) ; parameters.getDiskInfo ( ) . setWipeAfterDelete ( true ) ; initializeCommand ( parameters , java.util.Collections.singletonList ( createVm ( status ) ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }
Source:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpUriExpectations ( null ) ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpQueryExpectations ( "" ) ; java.util.List < org.ovirt.engine.api.model.HostNIC > nics = getCollection ( ) ; assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionsUriExpectations ( ) ; setGetVdsQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setUpQueryExpectations ( "" ) ; collection.setUriInfo ( uriInfo ) ; java.util.List < org.ovirt.engine.api.model.HostNIC > nics = getCollection ( ) ; assertTrue ( nics.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( nics ) ; } finally { accepts.clear ( ) ; } }
Source:
private void processHeartbeat ( ) { if ( ( ( this . lastHeartbeat ) + ( this . policy.getHeartbeat ( ) ) ) < ( java.lang.System.currentTimeMillis ( ) ) ) { org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.log.debug ( "Heartbeat exeeded. Closing channel" ) ; this . closeChannel ( ) ; } }

Target:
private void processHeartbeat ( ) { if ( ( ! ( this . isInInit ( ) ) ) && ( ( ( this . lastHeartbeat ) + ( this . policy.getHeartbeat ( ) ) ) < ( java.lang.System.currentTimeMillis ( ) ) ) ) { org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.log.debug ( "Heartbeat exeeded. Closing channel" ) ; this . closeChannel ( ) ; } }
Source:
public static void GetDataCenterList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static boolean IsLinuxOsType ( org.ovirt.engine.core.common.businessentities.VmOsType osType ) { if ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetLinuxOsTypes ( ) . contains ( osType ) ) { return true ; } return false ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { org.ovirt.engine.core.common.AuditLogType result = null ; if ( org.ovirt.engine.core.bll.InstallVdsCommand.getSucceeded ( ) ) { result = org.ovirt.engine.core.common.AuditLogType.VDS_INSTALL ; } else { org.ovirt.engine.core.bll.InstallVdsCommand.AddCustomValue ( "FailedInstallMessage" , getErrorMessage ( _failureMessage ) ) ; result = org.ovirt.engine.core.common.AuditLogType.VDS_INSTALL_FAILED ; } return result ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { org.ovirt.engine.core.common.AuditLogType result = null ; if ( org.ovirt.engine.core.bll.InstallVdsCommand.getSucceeded ( ) ) { result = org.ovirt.engine.core.common.AuditLogType.VDS_INSTALL ; } else { org.ovirt.engine.core.bll.InstallVdsCommand.addCustomValue ( "FailedInstallMessage" , getErrorMessage ( _failureMessage ) ) ; result = org.ovirt.engine.core.common.AuditLogType.VDS_INSTALL_FAILED ; } return result ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isReadOnlyPropertyCompatibleWithInterface ( ) { if ( java.lang.Boolean.TRUE.equals ( disk.getReadOnly ( ) ) ) { org.ovirt.engine.core.common.businessentities.DiskInterface diskInterface = disk.getDiskInterface ( ) ; if ( diskInterface == ( org.ovirt.engine.core.common.businessentities.DiskInterface.IDE ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR , java.lang.String.format ( "$interface %1$s" , diskInterface ) ) ; } if ( disk.isScsiPassthrough ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.SCSI_PASSTHROUGH_IS_NOT_SUPPORTED_FOR_READ_ONLY_DISK ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isReadOnlyPropertyCompatibleWithInterface ( ) { if ( java.lang.Boolean.TRUE.equals ( disk.getReadOnly ( ) ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface = disk.getDiskInterface ( ) ; if ( diskInterface == ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface.IDE ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_INTERFACE_DOES_NOT_SUPPORT_READ_ONLY_ATTR , java.lang.String.format ( "$interface %1$s" , diskInterface ) ) ; } if ( disk.isScsiPassthrough ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.SCSI_PASSTHROUGH_IS_NOT_SUPPORTED_FOR_READ_ONLY_DISK ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public org.ovirt.engine.sdk.decorators.Host add ( org.ovirt.engine.sdk.decorators.Host host ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; return getProxy ( ) . add ( url , host , org.ovirt.engine.sdk.entities.Host.class , org.ovirt.engine.sdk.decorators.Host.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.Host add ( org.ovirt.engine.sdk.decorators.Host host ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( SLASH ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , host , org.ovirt.engine.sdk.entities.Host.class , org.ovirt.engine.sdk.decorators.Host.class , headers ) ; }
Source:
public static void getVmTemplatesWithPermittedAction ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesWithPermittedAction , getEntitiesWithPermittedActionParameters , aQuery ) ; }

Target:
public static void getDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public static java.lang.String toJson ( final java.util.List < org.ovirt.engine.core.bll.validator.InClusterUpgradeValidator.UPGRADE_ERROR > vm ) { final org.codehaus.jackson.map.ObjectMapper mapper = new org.codehaus.jackson.map.ObjectMapper ( ) ; mapper.setSerializationInclusion ( JsonSerialize.Inclusion.NON_NULL ) ; try { return mapper.writerWithDefaultPrettyPrinter ( ) . writeValueAsString ( new org.ovirt.engine.core.bll.validator.InClusterUpgradeValidator.VmValidation ( vm ) ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } }

Target:
private java.util.List < java.lang.String > toHostEngineMessage ( final org.ovirt.engine.core.common.businessentities.VDS host , final org.ovirt.engine.core.common.errors.EngineMessage error ) { return java.util.Arrays.asList ( error.name ( ) , java.lang.String.format ( "$%1$s %2$s" , "hostName" , host.getName ( ) ) , java.lang.String.format ( "$%1$s %2$s" , "hostId" , host.getId ( ) ) ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.compat.Guid > getDedicatedHostList ( ) { java.util.List < org.ovirt.engine.core.compat.Guid > dedicatedHost = org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getParameters ( ) . getDedicatedHostList ( ) ; if ( ! ( dedicatedHost.isEmpty ( ) ) ) { return dedicatedHost ; } return org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) . getDedicatedVmForVdsList ( ) ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.VdsNumaNode > getVdsNumaNodes ( ) { if ( ! ( org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) . getDedicatedVmForVdsList ( ) . isEmpty ( ) ) ) { org.ovirt.engine.core.compat.Guid vdsId = org.ovirt.engine.core.bll.numa.vm.AbstractVmNumaNodeCommand.getVm ( ) . getDedicatedVmForVdsList ( ) . get ( 0 ) ; if ( vdsId != null ) { return getVdsNumaNodeDao ( ) . getAllVdsNumaNodeByVdsId ( vdsId ) ; } } return java.util.Arrays.asList ( ) ; }
Source:
public static void GetPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }

Target:
public static void getPermittedStorageDomainsByStoragePoolId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters params = new org.ovirt.engine.core.common.queries.GetPermittedStorageDomainsByStoragePoolIdParameters ( ) ; params.setStoragePoolId ( dataCenterId ) ; params.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetPermittedStorageDomainsByStoragePoolId , params , aQuery ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setEnumTitle ( object.getVmEntityType ( ) ) ; return ( object.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.VM ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.vmsImage ( ) : ( object.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.TEMPLATE ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.templatesImage ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setTitle ( ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ? getDefaultTitle ( ) : null ) ) ; return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.externalDiskIcon ( ) : null ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.network.host.LabelNicCommand.getBackend ( ) . runInternalAction ( VdcActionType.PersistentSetupNetworks , new AddNetworksByLabelParametersBuilder ( ) . buildParameters ( getNic ( ) , getLabel ( ) ) ) ; if ( result.getSucceeded ( ) ) { org.ovirt.engine.core.bll.network.host.LabelNicCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; } else { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.network.host.LabelNicCommand.getBackend ( ) . runInternalAction ( VdcActionType.PersistentSetupNetworks , new AddNetworksByLabelParametersBuilder ( ) . buildParameters ( getNic ( ) , getLabel ( ) , getClusterNetworksByLabel ( ) ) ) ; if ( result.getSucceeded ( ) ) { org.ovirt.engine.core.bll.network.host.LabelNicCommand.getReturnValue ( ) . setActionReturnValue ( getLabel ( ) ) ; } else { propagateFailure ( result ) ; } setSucceeded ( result.getSucceeded ( ) ) ; }