auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void searchClose ( org.ovirt.engineextensions.aaa.ldap.Framework.SearchInstance instance ) { try { if ( ( instance.resumeCookie ) != null ) { org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "Closing unfinished search" ) ; instance.searchRequest.setControls ( new org.ovirt.engineextensions.aaa.ldap.SimplePagedResultsControl ( 0 , instance.resumeCookie ) ) ; instance.connection.search ( instance.searchRequest ) ; } } catch ( org.ovirt.engineextensions.aaa.ldap.LDAPException e ) { org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "Ignoring exception" , e ) ; } finally { instance.connectionPool.releaseConnection ( instance.connection ) ; } }

Target:
public void searchClose ( org.ovirt.engineextensions.aaa.ldap.Framework.SearchInstance instance ) { org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "searchClose Entry" ) ; try { if ( ( instance.resumeCookie ) != null ) { org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "Closing unfinished search" ) ; instance.searchRequest.setControls ( new org.ovirt.engineextensions.aaa.ldap.SimplePagedResultsControl ( 0 , instance.resumeCookie ) ) ; instance.connection.search ( instance.searchRequest ) ; } } catch ( org.ovirt.engineextensions.aaa.ldap.LDAPException e ) { org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "Ignoring exception" , e ) ; } finally { instance.connectionPool.releaseConnection ( instance.connection ) ; } org.ovirt.engineextensions.aaa.ldap.Framework.log.debug ( "searchClose Return" ) ; }
Source:
public void taskEndSuccessfully ( ) { super . endSuccessfully ( ) ; }

Target:
private void attachDiskToTemplate ( org.ovirt.engine.core.compat.Guid templateId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage templateDiskImage = org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getDiskImage ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( templateDiskImage.getId ( ) , templateId ) ; dve.setDiskInterface ( DiskInterface.VirtIO ) ; org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getDiskVmElementDao ( ) . save ( dve ) ; org.ovirt.engine.core.bll.utils.VmDeviceUtils.addDiskDevice ( templateId , templateDiskImage.getId ( ) ) ; }
Source:
public void refuseBalloonOnPPC ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddPpcTest ( ) ; cmd.getParameters ( ) . setBalloonEnabled ( true ) ; org.mockito.Mockito.when ( osRepository.isBalloonEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getCluster ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; }

Target:
public void refuseBalloonOnPPC ( ) { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > cmd = setupCanAddPpcTest ( ) ; cmd.getParameters ( ) . setBalloonEnabled ( true ) ; org.mockito.Mockito.when ( osRepository.isBalloonEnabled ( cmd.getParameters ( ) . getVm ( ) . getVmOsId ( ) , cmd.getCluster ( ) . getCompatibilityVersion ( ) ) ) . thenReturn ( false ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.BALLOON_REQUESTED_ON_NOT_SUPPORTED_ARCH ) ; }
Source:
private java.util.ArrayList < java.lang.Object > InitAsyncOperationParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > allRunningVdsInPool ) { java.util.ArrayList < java.lang.Object > parameters = new java.util.ArrayList < java.lang.Object > ( ) ; parameters.add ( allRunningVdsInPool ) ; parameters.add ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStorageDomain ( ) ) ; parameters.add ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ) ; return parameters ; }

Target:
private java.util.ArrayList < java.lang.Object > initAsyncOperationParameters ( java.util.List < org.ovirt.engine.core.common.businessentities.VDS > allRunningVdsInPool ) { java.util.ArrayList < java.lang.Object > parameters = new java.util.ArrayList < java.lang.Object > ( ) ; parameters.add ( allRunningVdsInPool ) ; parameters.add ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStorageDomain ( ) ) ; parameters.add ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ) ; return parameters ; }
Source:
public static 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.RunQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public static void GetGlusterHosts ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress , java.lang.String rootPassword , java.lang.String fingerprint ) { 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.core.common.queries.gluster.GlusterServersQueryParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterServersQueryParameters ( hostAddress , rootPassword ) ; parameters.setFingerprint ( fingerprint ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterServers , parameters , aQuery ) ; }
Source:
public void persistCommand ( org.ovirt.engine.core.common.action.VdcActionType parentCommand , org.ovirt.engine.core.bll.context.CommandContext cmdContext , boolean enableCallBack ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; javax.transaction.Transaction transaction = org.ovirt.engine.core.utils.transaction.TransactionSupport.suspend ( ) ; try { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.persistCommand ( org.ovirt.engine.core.common.businessentities.CommandEntity.buildCommandEntity ( getCommandId ( ) , parentParameters.getCommandId ( ) , getActionType ( ) , getParameters ( ) , commandStatus , enableCallBack , getReturnValue ( ) ) , cmdContext ) ; } finally { org.ovirt.engine.core.utils.transaction.TransactionSupport.resume ( transaction ) ; } }

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 void testRemoveNotExisting ( ) { setUpGetNotExistingEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendStorageServerConnectionResource.HOST , GUIDS [ 1 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNotExisting ( ) { setUpGetNotExistingEntityExpectations ( ) ; javax.ws.rs.core.UriInfo uriInfo = setUpBasicUriExpectations ( ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendStorageServerConnectionResource.HOST , GUIDS [ 1 ] . toString ( ) ) ; setUriInfo ( uriInfo ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.jupiter.api.Assertions.assertNotNull ( wae.getResponse ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
protected java.lang.String getName ( ) { return this . name ; }

Target:
public java.lang.String evaluate ( ) { java.lang.String text = template ; for ( java.util.Map.Entry < java.lang.String , java.lang.Object > variable : variables.entrySet ( ) ) { java.lang.String key = ( ( KEY_WRAP ) + ( variable.getKey ( ) ) ) + ( KEY_WRAP ) ; java.lang.Object value = variable.getValue ( ) ; if ( value != null ) { text = text.replace ( key , value.toString ( ) ) ; } } return text ; }
Source:
public void networkNameNotTakenByVdsmName ( ) { org.mockito.Mockito.when ( network.getName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_NETWORK_NAME ) ; org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.ovirt.engine.core.common.businessentities.network.Network network2 = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network2.setVdsmName ( "vdsm-name" ) ; network2.setId ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.OTHER_GUID ) ; org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Arrays.asList ( network , network2 ) ) ; org.junit.Assert.assertThat ( validator.networkNameNotUsedAsVdsmName ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void networkNameNotTakenByVdsmName ( ) { org.mockito.Mockito.when ( network.getName ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_NETWORK_NAME ) ; org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.ovirt.engine.core.common.businessentities.network.Network network2 = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; network2.setVdsmName ( "vdsm-name" ) ; network2.setId ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.OTHER_GUID ) ; org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Arrays.asList ( network , network2 ) ) ; org.hamcrest.MatcherAssert.assertThat ( validator.networkNameNotUsedAsVdsmName ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void init ( ) { org.ovirt.engine.core.bll.TagsDirector.log.info ( ( "Start initializing " + ( getClass ( ) . getSimpleName ( ) ) ) ) ; tagsMapByID.clear ( ) ; tagsMapByName.clear ( ) ; org.ovirt.engine.core.common.businessentities.Tags root = new org.ovirt.engine.core.common.businessentities.Tags ( "root" , null , true , org.ovirt.engine.core.bll.TagsDirector.ROOT_TAG_ID , "root" ) ; addTagToHash ( root ) ; addChildren ( root ) ; org.ovirt.engine.core.bll.TagsDirector.log.info ( "Finished initializing {}" , getClass ( ) . getSimpleName ( ) ) ; }

Target:
protected void init ( ) { org.ovirt.engine.core.bll.TagsDirector.log.info ( "Start initializing {}" , getClass ( ) . getSimpleName ( ) ) ; tagsMapByID.clear ( ) ; tagsMapByName.clear ( ) ; org.ovirt.engine.core.common.businessentities.Tags root = new org.ovirt.engine.core.common.businessentities.Tags ( "root" , null , true , org.ovirt.engine.core.bll.TagsDirector.ROOT_TAG_ID , "root" ) ; addTagToHash ( root ) ; addChildren ( root ) ; org.ovirt.engine.core.bll.TagsDirector.log.info ( "Finished initializing {}" , getClass ( ) . getSimpleName ( ) ) ; }
Source:
public void networkNotLabeled ( ) throws java.lang.Exception { org.junit.Assert.assertThat ( validator.notLabeled ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNotManagementNetworkNegative ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ) . thenReturn ( false ) ; org.hamcrest.MatcherAssert.assertThat ( validator.notManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , getPrincipalName ( sessionId ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.AUTH_RECORD_PARAMETER_NAME , false ) ) ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.PRINCIPAL_RECORD_PARAMETER_NAME , false ) ) ) , message , msgArgs ) ; getDbFacade ( ) . getEngineSessionDao ( ) . remove ( getEngineSessionSeqId ( sessionId ) ) ; sessionInfoMap.remove ( sessionId ) ; }

Target:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { java.lang.String authzName = null ; if ( ( getProfile ( sessionId ) ) != null ) { authzName = getProfile ( sessionId ) . getAuthz ( ) . getContext ( ) . < java.lang.String > get ( Base.ContextKeys.INSTANCE_NAME ) ; } org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , authzName , getPrincipalName ( sessionId ) , message , msgArgs ) ; engineSessionDao.remove ( getEngineSessionSeqId ( sessionId ) ) ; sessionInfoMap.remove ( sessionId ) ; }
Source:
public static void GetLocalFSPath ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RhevhLocalFSPath , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetHighUtilizationForEvenDistribution ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.HighUtilizationForEvenlyDistribute , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }
Source:
public void testEnoughSpaceToMergeSnapshotsWithMultipleDisk ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; org.mockito.Mockito.doReturn ( imagesDisks ) . when ( cmd ) . getSourceImages ( ) ; mockStorageDomainDAOGetForStoragePool ( 22 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertTrue ( "Validation should succeed. Free space minus threshold should be bigger then summarize all disks size" , cmd.isEnoughSpaceToMergeSnapshots ( ) ) ; }

Target:
public void testEnoughSpaceToMergeSnapshotsWithMultipleDisk ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesDisks = org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.mockMultipleSourceImagesForDomain ( 4 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.IMAGE_ACTUAL_SIZE_GB ) ; org.mockito.Mockito.doReturn ( imagesDisks ) . when ( cmd ) . getSourceImages ( ) ; mockStorageDomainDAOGetForStoragePool ( 22 , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_DOMAIN_ID ) ; org.junit.Assert.assertTrue ( "Validation should succeed. Free space minus threshold should be bigger then summarize all disks size" , cmd.validateStorageDomains ( ) ) ; }
Source:
public static java.util.List < org.ovirt.engine.api.extensions.ExtMap > findGroupRecordsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.List < java.lang.String > ids , final boolean groupsResolving , final boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.api.extensions.ExtMap > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryPrincipalRecords ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.GROUP ) , groupsResolving , groupsResolvingRecursive ) ) ; } return results ; }

Target:
public static java.util.List < org.ovirt.engine.api.extensions.ExtMap > findGroupRecordsByIds ( final org.ovirt.engine.core.extensions.mgr.ExtensionProxy extension , final java.lang.String namespace , final java.util.List < java.lang.String > ids , final boolean groupsResolving , final boolean groupsResolvingRecursive ) { java.util.List < org.ovirt.engine.api.extensions.ExtMap > results = new java.util.ArrayList < > ( ) ; for ( java.util.List < java.lang.String > batch : org.ovirt.engine.core.aaa.SearchQueryParsingUtils.getIdsBatches ( extension.getContext ( ) , ids ) ) { results.addAll ( org.ovirt.engine.core.aaa.AuthzUtils.queryGroupRecords ( extension , namespace , org.ovirt.engine.core.aaa.SearchQueryParsingUtils.generateQueryMap ( batch , Authz.QueryEntity.GROUP ) , groupsResolving , groupsResolvingRecursive ) ) ; } return results ; }
Source:
public static void getClusterListByName ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public static void getDataCenterListByName ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
public void rescheduleAJob ( java.lang.String oldTriggerName , java.lang.String oldTriggerGroup , org.quartz.Trigger newTrigger ) { try { if ( ! ( sched.isShutdown ( ) ) ) { sched.rescheduleJob ( org.quartz.TriggerKey.triggerKey ( oldTriggerName , oldTriggerGroup ) , newTrigger ) ; } } catch ( org.quartz.SchedulerException se ) { log.error ( "failed to reschedule the job" , se ) ; } }

Target:
public void rescheduleAJob ( java.lang.String oldTriggerName , java.lang.String oldTriggerGroup , org.quartz.Trigger newTrigger ) { try { if ( ! ( sched.isShutdown ( ) ) ) { sched.rescheduleJob ( org.quartz.TriggerKey.triggerKey ( oldTriggerName , oldTriggerGroup ) , newTrigger ) ; } } catch ( org.quartz.SchedulerException se ) { log.error ( "failed to reschedule the job: {}" , se.getMessage ( ) ) ; log.debug ( "Exception" , se ) ; } }
Source:
protected void executeCommand ( ) { if ( ( ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) != null ) && ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.canRemoveVmPoolWithoutReasons ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) ) ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmPoolDao ( ) . remove ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) ; org.ovirt.engine.core.bll.RemoveVmPoolCommand.setSucceeded ( true ) ; } }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VM > getCachedVmsInPool ( ) { if ( ( ( cachedVmsInPool ) == null ) && ( ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) != null ) ) { cachedVmsInPool = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . getAllForVmPool ( org.ovirt.engine.core.bll.RemoveVmPoolCommand.getVmPoolId ( ) ) ; } return cachedVmsInPool ; }
Source:
public void mapModel ( ) { for ( org.ovirt.engine.api.model.WatchdogModel model : org.ovirt.engine.api.model.WatchdogModel.values ( ) ) { org.ovirt.engine.core.common.businessentities.VmWatchdogType backendModel = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model ) ; org.junit.Assert.assertNotNull ( backendModel ) ; org.junit.Assert.assertEquals ( backendModel.name ( ) . toLowerCase ( ) , model.name ( ) . toLowerCase ( ) ) ; } }

Target:
public void mapModel ( ) { for ( org.ovirt.engine.api.model.WatchdogModel model : org.ovirt.engine.api.model.WatchdogModel.values ( ) ) { org.ovirt.engine.core.common.businessentities.VmWatchdogType backendModel = org.ovirt.engine.api.restapi.types.WatchdogMapper.map ( model ) ; org.junit.jupiter.api.Assertions.assertNotNull ( backendModel ) ; org.junit.jupiter.api.Assertions.assertEquals ( backendModel.name ( ) . toLowerCase ( ) , model.name ( ) . toLowerCase ( ) ) ; } }
Source:
private void mockDAOs ( org.ovirt.engine.core.bll.AddVmCommand < ? > cmd ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( cmd , vmDAO ) ; org.mockito.Mockito.doReturn ( sdDAO ) . when ( cmd ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.doReturn ( vmTemplateDAO ) . when ( cmd ) . getVmTemplateDAO ( ) ; }

Target:
private void mockDAOs ( org.ovirt.engine.core.bll.AddVmCommand < ? > cmd ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseMockUtils.mockVmDao ( cmd , vmDAO ) ; org.mockito.Mockito.doReturn ( sdDAO ) . when ( cmd ) . getStorageDomainDAO ( ) ; org.mockito.Mockito.doReturn ( vmTemplateDAO ) . when ( cmd ) . getVmTemplateDAO ( ) ; org.mockito.Mockito.doReturn ( vdsGroupDao ) . when ( cmd ) . getVdsGroupDAO ( ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.PrepareImageVDSCommandParameters getPrepareParameters ( org.ovirt.engine.core.compat.Guid vdsId ) { return new org.ovirt.engine.core.common.vdscommands.PrepareImageVDSCommandParameters ( vdsId , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getImage ( ) . getImage ( ) . getDiskId ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getImage ( ) . getImageId ( ) , true ) ; }

Target:
private org.ovirt.engine.core.common.vdscommands.PrepareImageVDSCommandParameters getPrepareParameters ( org.ovirt.engine.core.compat.Guid vdsId ) { return new org.ovirt.engine.core.common.vdscommands.PrepareImageVDSCommandParameters ( vdsId , org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getStorageDomainId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getImage ( ) . getImage ( ) . getDiskId ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getImage ( ) . getImageId ( ) , true ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.StorageDomain getSelectedStorageDomain ( ) { if ( ( ( selectedStorageDomain ) == null ) && ( ! ( storageDomains.isEmpty ( ) ) ) ) { selectedStorageDomain = java.util.Collections.max ( storageDomains , new java.util.Comparator < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) { @ java.lang.Override public int compare ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain1 , org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain2 ) { return storageDomain1.getAvailableDiskSize ( ) . compareTo ( storageDomain2.getAvailableDiskSize ( ) ) ; } } ) ; } return selectedStorageDomain ; }

Target:
public org.ovirt.engine.core.common.businessentities.StorageDomain getSelectedStorageDomain ( ) { if ( ( ( selectedStorageDomain ) == null ) && ( ! ( storageDomains.isEmpty ( ) ) ) ) { selectedStorageDomain = java.util.Collections.max ( storageDomains , java.util.Comparator.comparing ( StorageDomain :: getAvailableDiskSize ) ) ; } return selectedStorageDomain ; }
Source:
public void managedNetworkAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingIfaces ( nic ) ; nic.setNetworkName ( "net" ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; org.ovirt.engine.core.common.businessentities.network net = mockExistingNetwork ( nic.getNetworkName ( ) ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNetworkModified ( helper , net ) ; assertNoNetworksRemoved ( helper ) ; assertNoBondsRemoved ( helper ) ; }

Target:
public void managedNetworkAddedToNic ( ) { org.ovirt.engine.core.common.businessentities.network net = createNetwork ( "net" ) ; org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( "nic0" , null ) ; mockExistingNetworks ( net ) ; mockExistingIfaces ( nic ) ; nic.setNetworkName ( net.getName ( ) ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic ) ) ; validateAndExpectNoViolations ( helper ) ; assertNoBondsModified ( helper ) ; assertNetworkModified ( helper , net ) ; assertNoNetworksRemoved ( helper ) ; assertNoBondsRemoved ( helper ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc setVmTicket ( java.lang.String vmId , java.lang.String otp64 , java.lang.String sec ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.setVmTicket ( vmId , otp64 , sec ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc prepareImage ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID , boolean allowIllegal ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.prepareImage ( sdID , spID , imageID , volumeID , allowIllegal ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public boolean updateConsoleUserWithOptimisticLocking ( org.ovirt.engine.core.common.businessentities.VmDynamic vm ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_guid" , vm.getId ( ) ) . addValue ( "console_user_id" , vm.getConsoleUserId ( ) ) ; java.util.Map < java.lang.String , java.lang.Object > results = getCallsHandler ( ) . executeModification ( "UpdateConsoleUserWithOptimisticLocking" , parameterSource ) ; return ( ( java.lang.Boolean ) ( results.get ( "updated" ) ) ) ; }

Target:
public boolean updateConsoleUserWithOptimisticLocking ( org.ovirt.engine.core.common.businessentities.VmDynamic vm ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "vm_guid" , vm.getId ( ) ) . addValue ( "console_user_id" , vm.getConsoleUserId ( ) ) . addValue ( "guest_cur_user_name" , vm.getguest_cur_user_name ( ) ) ; java.util.Map < java.lang.String , java.lang.Object > results = getCallsHandler ( ) . executeModification ( "UpdateConsoleUserWithOptimisticLocking" , parameterSource ) ; return ( ( java.lang.Boolean ) ( results.get ( "updated" ) ) ) ; }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getHostListByDataCenter ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid spId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsByStoragePool , new org.ovirt.engine.core.common.queries.IdQueryParameters ( spId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult isSameStorageType ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { org.ovirt.engine.core.common.businessentities.storage.StorageType connectionStorageType = connection.getstorage_type ( ) ; org.ovirt.engine.core.common.businessentities.storage.StorageType storageDomainType = storageDomain.getStorageType ( ) ; if ( ! ( connectionStorageType.equals ( storageDomainType ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_NOT_SAME_STORAGE_TYPE ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult isSameStorageType ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { org.ovirt.engine.core.common.businessentities.storage.StorageType connectionStorageType = connection.getstorage_type ( ) ; org.ovirt.engine.core.common.businessentities.storage.StorageType storageDomainType = storageDomain.getStorageType ( ) ; if ( ! ( connectionStorageType.equals ( storageDomainType ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_UNSUPPORTED_ACTION_NOT_SAME_STORAGE_TYPE ) ; } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.FileStatsReturnForXmlRpc getIsoList ( java.lang.String spUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getIsoList ( spUUID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.FileStatsReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.FileStatsReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc teardownImage ( java.lang.String sdID , java.lang.String spID , java.lang.String imageID , java.lang.String volumeID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.teardownImage ( sdID , spID , imageID , volumeID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testUnknownTypeLunCantBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , parameters ) ; disk.getLun ( ) . setLunType ( StorageType.UNKNOWN ) ; org.junit.Assert.assertFalse ( "checkIfLunDiskCanBeAdded() succeded for LUN with UNKNOWN type" , command.checkIfLunDiskCanBeAdded ( ) ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed but correct can do action hasn't been added to the return response" , verifyCanDoActionMessagesContainMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE ) ) ; }

Target:
public void testUnknownTypeLunCantBeAdded ( ) { org.ovirt.engine.core.common.businessentities.LunDisk disk = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createISCSILunDisk ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; initializeCommand ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , parameters ) ; disk.getLun ( ) . setLunType ( StorageType.UNKNOWN ) ; org.junit.Assert.assertFalse ( "checkIfLunDiskCanBeAdded() succeded for LUN with UNKNOWN type" , command.checkIfLunDiskCanBeAdded ( ) ) ; org.junit.Assert.assertTrue ( "checkIfLunDiskCanBeAdded() failed but correct can do action hasn't been added to the return response" , verifyCanDoActionMessagesContainMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_LUN_HAS_NO_VALID_TYPE ) ) ; }
Source:
public void testGetYesterdayHttpDate ( ) { java.util.Calendar calendar = org.mockito.Mockito.spy ( java.util.Calendar.getInstance ( java.util.TimeZone.getTimeZone ( org.ovirt.engine.core.utils.servlet.CachingFilterTest.GMT ) , java.util.Locale.US ) ) ; calendar.clear ( ) ; calendar.set ( 2000 , 0 , 5 , 15 , 0 ) ; java.lang.String result = testFilter.getYesterdayHttpDate ( calendar ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertTrue ( result.contains ( "04 Jan 2000 15:00:00" ) ) ; org.mockito.Mockito.verify ( calendar ) . add ( java.util.Calendar.DAY_OF_MONTH , ( - 1 ) ) ; }

Target:
public void testGetYesterdayHttpDate ( ) { java.util.Calendar calendar = org.mockito.Mockito.spy ( java.util.Calendar.getInstance ( java.util.TimeZone.getTimeZone ( org.ovirt.engine.core.utils.servlet.CachingFilterTest.GMT ) , java.util.Locale.US ) ) ; calendar.clear ( ) ; calendar.set ( 2000 , 0 , 5 , 15 , 0 ) ; java.lang.String result = testFilter.getYesterdayHttpDate ( calendar ) ; org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertTrue ( result.contains ( "04 Jan 2000 15:00:00" ) ) ; org.mockito.Mockito.verify ( calendar ) . add ( java.util.Calendar.DAY_OF_MONTH , ( - 1 ) ) ; }
Source:
public void testNetworkExistWhenOnlyNetworkNameIsSet ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkName ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidatorTest.NETWORK_NAME ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( networkAttachment ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_HAVING_NAME_NOT_EXISTS ; org.junit.Assert.assertThat ( validator.networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , org.ovirt.engine.core.bll.validator.NetworkAttachmentValidatorTest.NETWORK_NAME ) ) ) ; }

Target:
public void testNetworkExistWhenOnlyNetworkNameIsSet ( ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; networkAttachment.setNetworkName ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidatorTest.NETWORK_NAME ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( networkAttachment ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_HAVING_NAME_NOT_EXISTS ; org.hamcrest.MatcherAssert.assertThat ( validator.networkExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getVariableAssignmentString ( engineMessage , org.ovirt.engine.core.bll.validator.NetworkAttachmentValidatorTest.NETWORK_NAME ) ) ) ; }
Source:
private void initState ( ) { reportsEnabled = false ; xmlInitialized = false ; reportsWebappDeployed = false ; scheduledStatusCheckInProgress = false ; initEventRaised = false ; reportBaseUrl = "" ; isCommunityEdition = false ; resourceMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicompat.ReportParser.Resource > ( ) ; dashboardMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicompat.ReportParser.Dashboard > ( ) ; reportsInitEvent = new org.ovirt.engine.ui.uicompat.Event ( "ReportsInitialize" , org.ovirt.engine.ui.uicommonweb.ReportInit.class ) ; retryCount = 0 ; }

Target:
private void initState ( ) { reportsEnabled = false ; xmlInitialized = false ; reportsWebappDeployed = false ; scheduledStatusCheckInProgress = false ; initEventRaised = false ; reportBaseUrl = "" ; reportRightClickUrl = "" ; isCommunityEdition = false ; resourceMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicompat.ReportParser.Resource > ( ) ; dashboardMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.ui.uicompat.ReportParser.Dashboard > ( ) ; reportsInitEvent = new org.ovirt.engine.ui.uicompat.Event < org.ovirt.engine.ui.uicompat.EventArgs > ( "ReportsInitialize" , org.ovirt.engine.ui.uicommonweb.ReportInit.class ) ; retryCount = 0 ; }
Source:
private static void failureEventHandler ( java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > messages ) { org.ovirt.engine.ui.frontend.Frontend.frontendFailureEvent.raise ( org.ovirt.engine.ui.frontend.Frontend.class , new org.ovirt.engine.ui.frontend.FrontendFailureEventArgs ( messages ) ) ; }

Target:
private static void failureEventHandler ( java.lang.String description , java.util.ArrayList < java.lang.String > errorMessages ) { java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > messages = new java.util.ArrayList < org.ovirt.engine.ui.frontend.Message > ( ) ; for ( java.lang.String errorMessage : errorMessages ) { messages.add ( new org.ovirt.engine.ui.frontend.Message ( description , errorMessage ) ) ; } org.ovirt.engine.ui.frontend.Frontend.frontendFailureEvent.raise ( org.ovirt.engine.ui.frontend.Frontend.class , new org.ovirt.engine.ui.frontend.FrontendFailureEventArgs ( messages ) ) ; }
Source:
public static void getDataCenterListByName ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public 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.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
protected void pollVds ( org.ovirt.engine.core.compat.Guid vdsId ) { int retries = 10 ; while ( ( ( retries > 0 ) && ( ( retVal ) == null ) ) && ( ! ( editNetworkThreadFinish ) ) ) { retries -- ; try { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( vdsId ) ) ; } catch ( java.lang.Exception e ) { } } }

Target:
protected void pollVds ( org.ovirt.engine.core.common.businessentities.VDS vds ) { int retries = 10 ; while ( ( ( retries > 0 ) && ( ( retVal ) == null ) ) && ( ! ( editNetworkThreadFinish ) ) ) { retries -- ; try { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.CollectVdsNetworkDataVDSCommandParameters ( vds ) ) ; } catch ( java.lang.Exception e ) { } } }
Source:
public static < E extends java.lang.Enum < E > > E validateEnum ( java.lang.String reason , java.lang.String detail , java.lang.Class < E > clz , java.lang.String name ) { try { return java.lang.Enum.valueOf ( clz , name ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new javax.ws.rs.WebApplicationException ( org.ovirt.engine.api.common.util.EnumValidator.response ( reason , java.text.MessageFormat.format ( detail , name , clz.getSimpleName ( ) ) ) ) ; } }

Target:
public static < E extends java.lang.Enum < E > > E validateEnum ( java.lang.String reason , java.lang.String detail , java.lang.Class < E > clz , java.lang.String name , boolean toUppercase ) { try { return java.lang.Enum.valueOf ( clz , ( toUppercase ? name.toUpperCase ( ) : name ) ) ; } catch ( java.lang.IllegalArgumentException e ) { throw new javax.ws.rs.WebApplicationException ( org.ovirt.engine.api.common.util.EnumValidator.response ( reason , java.text.MessageFormat.format ( detail , name , clz.getSimpleName ( ) ) ) ) ; } }
Source:
public void getAllowClusterWithVirtGlusterEnabled ( 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 ? source : java.lang.Boolean.TRUE ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.AllowClusterWithVirtGlusterEnabled , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getExternalProviderDiscoveredHostList ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.ExternalDiscoveredHost > > aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDiscoveredHostListFromExternalProvider , params , aQuery ) ; }
Source:
protected org.ovirt.engine.api.model.VM setVmOvfConfiguration ( org.ovirt.engine.api.model.VM model , org.ovirt.engine.api.model.VM entity ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValue = runQuery ( VdcQueryType.GetVmOvfByVmId , new org.ovirt.engine.core.common.queries.GetVmOvfByVmIdParameters ( entity.getId ( ) , entity.getDbGeneration ( ) ) ) ; if ( ( queryReturnValue.getSucceeded ( ) ) && ( ( queryReturnValue.getReturnValue ( ) ) != null ) ) { java.lang.String configuration = queryReturnValue.getReturnValue ( ) ; return org.ovirt.engine.api.restapi.types.VmMapper.map ( configuration , ConfigurationType.OVF , model ) ; } return model ; }

Target:
protected void setConsoleDevice ( org.ovirt.engine.api.model.Vm model ) { if ( ! ( model.isSetConsole ( ) ) ) { model.setConsole ( new org.ovirt.engine.api.model.Console ( ) ) ; } model.getConsole ( ) . setEnabled ( ( ! ( getConsoleDevicesForEntity ( new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) . isEmpty ( ) ) ) ) ; }
Source:
private boolean otherIfaceWithSameMacExists ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface ) { org.ovirt.engine.core.compat.NGuid ifaceId = iface.getId ( ) ; if ( ifaceId != null ) { for ( org.ovirt.engine.core.compat.Guid ifaceFromList : getVmNetworkInterfaceDao ( ) . getVmInterfacesByMac ( iface.getMacAddress ( ) ) ) { if ( ! ( ifaceId.equals ( ifaceFromList ) ) ) { return true ; } } } return false ; }

Target:
private void internalFreeMac ( java.lang.String mac ) { if ( allocatedMacs.containsKey ( mac ) ) { removeMacFromMap ( allocatedMacs , mac ) ; if ( ! ( allocatedMacs.containsKey ( mac ) ) ) { availableMacs.add ( mac ) ; } } else if ( allocatedCustomMacs.containsKey ( mac ) ) { removeMacFromMap ( allocatedCustomMacs , mac ) ; } }