auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean verifySourceDomains ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > poolDomainsMap = org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getPoolDomains ( ) ) ; java.util.EnumSet < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > validDomainStatuses = java.util.EnumSet.of ( StorageDomainStatus.Active ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > templateDiskImages = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( getImagesToCheckDestinationStorageDomains ( ) , true , false , false ) ; validDisksDomains = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.findDomainsInApplicableStatusForDisks ( templateDiskImages , poolDomainsMap , validDomainStatuses ) ; return validate ( new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( templateDiskImages ) . diskImagesOnAnyApplicableDomains ( validDisksDomains , poolDomainsMap , EngineMessage.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , validDomainStatuses ) ) ; }

Target:
protected boolean verifySourceDomains ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > poolDomainsMap = org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getPoolDomains ( ) ) ; java.util.EnumSet < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > validDomainStatuses = java.util.EnumSet.of ( StorageDomainStatus.Active ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > templateDiskImages = org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.filterImageDisks ( getImagesToCheckDestinationStorageDomains ( ) , org.ovirt.engine.core.bll.storage.disk.image.DisksFilter.ONLY_NOT_SHAREABLE ) ; validDisksDomains = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.findDomainsInApplicableStatusForDisks ( templateDiskImages , poolDomainsMap , validDomainStatuses ) ; return validate ( new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( templateDiskImages ) . diskImagesOnAnyApplicableDomains ( validDisksDomains , poolDomainsMap , EngineMessage.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , validDomainStatuses ) ) ; }
Source:
public java.lang.String getAdUserName ( ) { if ( ( adUserName ) == null ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDbUserDao ( ) . get ( getAdUserId ( ) ) ; if ( user != null ) { adUserName = user.getLoginName ( ) ; } } return adUserName ; }

Target:
public java.lang.String getAdUserName ( ) { if ( ( adUserName ) == null ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser user = dbUserDao.get ( getAdUserId ( ) ) ; if ( user != null ) { adUserName = user.getLoginName ( ) ; } } return adUserName ; }
Source:
public static java.lang.String resolveJobMessage ( org.ovirt.engine.core.common.action.VdcActionType actionType , java.util.Map < java.lang.String , java.lang.String > values ) { java.lang.String jobMessage = org.ovirt.engine.core.dal.job.ExecutionMessageDirector.getInstance ( ) . getJobMessage ( actionType ) ; if ( jobMessage != null ) { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.MessageResolver.resolveMessage ( jobMessage , values ) ; } else { return actionType.name ( ) ; } }

Target:
public static java.lang.String resolveJobMessage ( org.ovirt.engine.core.common.action.ActionType actionType , java.util.Map < java.lang.String , java.lang.String > values ) { java.lang.String jobMessage = org.ovirt.engine.core.dal.job.ExecutionMessageDirector.getInstance ( ) . getJobMessage ( actionType ) ; if ( jobMessage != null ) { return org.ovirt.engine.core.dal.dbbroker.auditloghandling.MessageResolver.resolveMessage ( jobMessage , values ) ; } else { return actionType.name ( ) ; } }
Source:
private void setupMock ( ) { vdsStaticDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsStaticDAO.class ) ; org.mockito.Mockito.doReturn ( vdsStaticDaoMock ) . when ( getQuery ( ) ) . getVdsStaticDao ( ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDaoMock ) . getAllForHost ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.NEW_SERVER ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDaoMock ) . getAllWithIpAddress ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.NEW_SERVER ) ; clientMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.utils.ssh.SSHClient.class ) ; org.mockito.Mockito.doReturn ( clientMock ) . when ( getQuery ( ) ) . createSSHClient ( ) ; }

Target:
private void setupMock ( ) { vdsStaticDaoMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VdsStaticDAO.class ) ; org.mockito.Mockito.doReturn ( vdsStaticDaoMock ) . when ( getQuery ( ) ) . getVdsStaticDao ( ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) . get ( 0 ) ) . when ( vdsStaticDaoMock ) . getByHostName ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.NEW_SERVER ) ; org.mockito.Mockito.doReturn ( getVdsStatic ( ) ) . when ( vdsStaticDaoMock ) . getAllWithIpAddress ( org.ovirt.engine.core.bll.gluster.GetGlusterServersForImportQueryTest.NEW_SERVER ) ; clientMock = org.mockito.Mockito.mock ( org.ovirt.engine.core.utils.ssh.SSHClient.class ) ; org.mockito.Mockito.doReturn ( clientMock ) . when ( getQuery ( ) ) . createSSHClient ( ) ; }
Source:
private void HandleEndAction ( ) { try { if ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getParameters ( ) . isRemoveTemplateFromDb ( ) ) { removeTemplateFromDb ( ) ; } else { org.ovirt.engine.core.bll.VmTemplateHandler.UnLockVmTemplate ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmTemplateCommand.setSucceeded ( true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; log.error ( "Encountered a problem removing template from DB, setting the action not to retry." ) ; } }

Target:
private void HandleEndAction ( ) { try { if ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getParameters ( ) . isRemoveTemplateFromDb ( ) ) { removeTemplateFromDb ( ) ; } else { org.ovirt.engine.core.bll.VmTemplateHandler.unlockVmTemplate ( org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getVmTemplateId ( ) ) ; } org.ovirt.engine.core.bll.RemoveVmTemplateCommand.setSucceeded ( true ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.RemoveVmTemplateCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; log.error ( "Encountered a problem removing template from DB, setting the action not to retry." ) ; } }
Source:
public void vdsNotResponding ( final org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.bll.job.ExecutionHandler.updateSpecificActionJobCompleted ( vds.getId ( ) , VdcActionType.MaintananceVds , false ) ; org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { org.ovirt.engine.core.bll.VdsEventListener.log.infoFormat ( "ResourceManager::vdsNotResponding entered for Host {0}, {1}" , vds.getId ( ) , vds.gethost_name ( ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.VdsNotRespondingTreatment , new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.FenceActionType.Restart ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; } } ) ; }

Target:
public void vdsNotResponding ( final org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.bll.job.ExecutionHandler.updateSpecificActionJobCompleted ( vds.getId ( ) , VdcActionType.MaintenanceVds , false ) ; org.ovirt.engine.core.utils.threadpool.ThreadPoolUtil.execute ( new java.lang.Runnable ( ) { @ java.lang.Override public void run ( ) { org.ovirt.engine.core.bll.VdsEventListener.log.infoFormat ( "ResourceManager::vdsNotResponding entered for Host {0}, {1}" , vds.getId ( ) , vds.getHostName ( ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.VdsNotRespondingTreatment , new org.ovirt.engine.core.common.action.FenceVdsActionParameters ( vds.getId ( ) , org.ovirt.engine.core.common.businessentities.FenceActionType.Restart ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; } } ) ; }
Source:
protected boolean setAndValidateDiskProfiles ( ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . setDiskProfileId ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getDiskProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getStoragePool ( ) . getcompatibility_version ( ) ) ) ; }

Target:
protected boolean setAndValidateDiskProfiles ( ) { org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) . setDiskProfileId ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getDiskProfileId ( ) ) ; return validate ( org.ovirt.engine.core.bll.profiles.DiskProfileHelper.setAndValidateDiskProfiles ( java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) , org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getStoragePool ( ) . getCompatibilityVersion ( ) ) ) ; }
Source:
private void removeVmSnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Set < java.lang.String > memoriesOfRemovedSnapshots = snapshotsManager.removeSnapshots ( vm.getId ( ) ) ; new org.ovirt.engine.core.bll.memory.MemoryImageRemover ( vm , this ) . removeMemoryVolumes ( memoriesOfRemovedSnapshots ) ; }

Target:
private void removeVmSnapshots ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.Set < java.lang.String > memoryStates = snapshotsManager.removeSnapshots ( vm.getId ( ) ) ; if ( ! ( memoryStates.isEmpty ( ) ) ) { new org.ovirt.engine.core.bll.memory.MemoryImageRemoverOnDataDomain ( vm , this ) . remove ( memoryStates ) ; } }
Source:
private java.lang.String wrapItalic ( java.lang.String text ) { if ( ( ( text == null ) || ( text.isEmpty ( ) ) ) || ( text.contains ( "<i>" ) ) ) { return text ; } return text = ( "<i>" + text ) + "</i>" ; }

Target:
private com.google.gwt.safehtml.shared.SafeHtml wrapItalic ( com.google.gwt.safehtml.shared.SafeHtml text ) { if ( text.asString ( ) . startsWith ( "<i>" ) ) { return text ; } return new com.google.gwt.safehtml.shared.SafeHtmlBuilder ( ) . appendHtmlConstant ( "<i>" ) . append ( text ) . appendHtmlConstant ( "</i>" ) . toSafeHtml ( ) ; }
Source:
public void testChangeCdNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( null ) ; try { resource.update ( getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testChangeCdNotFound ( ) { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( null ) ; try { resource.update ( getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.B_ISO ) ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void canDoActionPreallocatedSpaceCheckFailsSize ( ) { final int availableSize = 8 ; final int usedSize = 7 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; org.ovirt.engine.core.common.businessentities.storage_domains domains = mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; mockStorageDomainSpaceCheckerRequest ( domains , false ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW.toString ( ) ) ) ; }

Target:
public void canDoActionPreallocatedSpaceCheckFailsSize ( ) { final int availableSize = 3 ; final int usedSize = 7 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; org.ovirt.engine.core.common.businessentities.storage_domains domains = mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }
Source:
public java.lang.Integer getMemSharedPercent ( ) { java.lang.Long shared = mVdsStatistics.getmem_shared ( ) ; java.lang.Integer physical = mVdsDynamic.getphysical_mem_mb ( ) ; if ( ( ( shared == null ) || ( physical == null ) ) || ( physical == 0 ) ) { return 0 ; } return ( ( int ) ( shared * 100 ) ) / physical ; }

Target:
public java.lang.Integer getMemSharedPercent ( ) { java.lang.Long shared = mVdsStatistics.getMemShared ( ) ; java.lang.Integer physical = mVdsDynamic.getphysical_mem_mb ( ) ; if ( ( ( shared == null ) || ( physical == null ) ) || ( physical == 0 ) ) { return 0 ; } return ( ( int ) ( ( shared * 100 ) / physical ) ) ; }
Source:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { 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.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
protected boolean ValidateAdd ( java.util.List < org.ovirt.engine.core.common.businessentities.EventNotificationMethod > eventNotificationMethods , org.ovirt.engine.core.common.businessentities.event_subscriber event_subscriber , org.ovirt.engine.core.common.businessentities.DbUser user ) { java.lang.String tagName = event_subscriber.gettag_name ( ) ; boolean retValue = ValidateNotificationMethod ( eventNotificationMethods , event_subscriber , user ) ; if ( retValue && ( org.apache.commons.lang.StringUtils.isNotEmpty ( tagName ) ) ) { retValue = ValidateTag ( tagName ) ; } return retValue ; }

Target:
protected boolean ValidateAdd ( org.ovirt.engine.core.common.EventNotificationMethods eventNotificationMethods , org.ovirt.engine.core.common.businessentities.event_subscriber event_subscriber , org.ovirt.engine.core.common.businessentities.DbUser user ) { java.lang.String tagName = event_subscriber.gettag_name ( ) ; boolean retValue = ValidateNotificationMethod ( eventNotificationMethods , event_subscriber , user ) ; if ( retValue && ( org.apache.commons.lang.StringUtils.isNotEmpty ( tagName ) ) ) { retValue = ValidateTag ( tagName ) ; } return retValue ; }
Source:
public void labelBeingAttachedToValidBondAttachedBondBecomingNotValid ( ) { org.ovirt.engine.core.common.businessentities.network.Bond existingBond = new org.ovirt.engine.core.common.businessentities.network.Bond ( "bond" ) ; existingBond.setSlaves ( java.util.Arrays.asList ( "slave1" , "slave2" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = createHostSetupNetworksParams ( ) ; org.ovirt.engine.core.common.businessentities.network.Bond updatedBond = new org.ovirt.engine.core.common.businessentities.network.Bond ( existingBond.getName ( ) ) ; updatedBond.setSlaves ( new java.util.ArrayList < java.lang.String > ( ) ) ; params.getBonds ( ) . add ( updatedBond ) ; assertLabelBeingAttachedToValidBondFailed ( params , existingBond ) ; }

Target:
public void labelBeingAttachedToValidBondAttachedBondBecomingNotValid ( ) { org.ovirt.engine.core.common.businessentities.network.Bond existingBond = new org.ovirt.engine.core.common.businessentities.network.Bond ( "bond" ) ; existingBond.setSlaves ( java.util.Arrays.asList ( "slave1" , "slave2" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = createHostSetupNetworksParams ( ) ; org.ovirt.engine.core.common.action.CreateOrUpdateBond updatedBond = new org.ovirt.engine.core.common.action.CreateOrUpdateBond ( ) ; updatedBond.setName ( existingBond.getName ( ) ) ; updatedBond.setSlaves ( new java.util.HashSet < > ( ) ) ; params.getCreateOrUpdateBonds ( ) . add ( updatedBond ) ; assertLabelBeingAttachedToValidBondFailed ( params , existingBond ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.UserProfile mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.UserProfile entity = new org.ovirt.engine.core.common.businessentities.UserProfile ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "profile_id" ) ) ; entity.setUserId ( getGuidDefaultEmpty ( rs , "user_id" ) ) ; entity.setSshPublicKey ( rs.getString ( "ssh_public_key" ) ) ; entity.setLoginName ( rs.getString ( "login_name" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.UserProfile mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.UserProfile entity = new org.ovirt.engine.core.common.businessentities.UserProfile ( ) ; entity.setId ( getGuidDefaultEmpty ( rs , "profile_id" ) ) ; entity.setUserId ( getGuidDefaultEmpty ( rs , "user_id" ) ) ; entity.setSshPublicKey ( rs.getString ( "ssh_public_key" ) ) ; entity.setLoginName ( rs.getString ( "login_name" ) ) ; entity.setUserPortalVmLoginAutomatically ( rs.getBoolean ( "user_portal_vm_auto_login" ) ) ; return entity ; }
Source:
protected void handleSpecificCommandActions ( ) { if ( ( mVmList.size ( ) ) > 0 ) { org.ovirt.engine.core.bll.StopVdsCommand.restartVdsVms ( ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) . getId ( ) ) ) ; } }

Target:
protected void handleSpecificCommandActions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > mVmList = org.ovirt.engine.core.bll.StopVdsCommand.getVmList ( ) ; if ( ( mVmList.size ( ) ) > 0 ) { org.ovirt.engine.core.bll.RestartVdsVmsOperation restartVmsOper = new org.ovirt.engine.core.bll.RestartVdsVmsOperation ( org.ovirt.engine.core.bll.StopVdsCommand.getContext ( ) , org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) ) ; restartVmsOper.restartVms ( mVmList ) ; runVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.StopVdsCommand.getVds ( ) . getId ( ) ) ) ; } }
Source:
protected void endExecutionMonitoring ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isRunAndPause ( ) ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVmDynamicDao ( ) . get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) { final org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; executionHandler.endJob ( executionContext , true ) ; } else { super . endExecutionMonitoring ( ) ; } }

Target:
protected void endExecutionMonitoring ( ) { if ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isRunAndPause ( ) ) && ( ( vmDynamicDao.get ( org.ovirt.engine.core.bll.RunVmCommand.getVmId ( ) ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Paused ) ) ) { final org.ovirt.engine.core.bll.job.ExecutionContext executionContext = org.ovirt.engine.core.bll.RunVmCommand.getExecutionContext ( ) ; executionContext.setShouldEndJob ( true ) ; executionHandler.endJob ( executionContext , true ) ; } else { super . endExecutionMonitoring ( ) ; } }
Source:
protected void SelectedItemsChanged ( ) { super . SelectedItemsChanged ( ) ; UpdateActionAvailability ( ) ; }

Target:
private void saveSanStorage ( ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel storageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel sanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModel ) ( storageModel.getSelectedItem ( ) ) ) ; java.util.ArrayList < java.lang.String > usedLunsMessages = sanStorageModel.getUsedLunsMessages ( ) ; if ( usedLunsMessages.isEmpty ( ) ) { OnSaveSanStorage ( ) ; } else { forceCreationWarning ( usedLunsMessages ) ; } }
Source:
public static void GetClusterServerMemoryOverCommit ( 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.MaxVdsMemOverCommitForServers , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , 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 void testSetStatusForRequiredNetworkPresentOnHost ( ) { networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; testSetStatusForRequiredNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . updateStatus ( org.mockito.Matchers.same ( networkCluster ) ) ; org.junit.Assert.assertThat ( networkCluster.getStatus ( ) , org.hamcrest.Matchers.is ( NetworkStatus.OPERATIONAL ) ) ; }

Target:
public void testSetStatusForRequiredNetworkAbsentOnHost ( ) { networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; testSetStatusForRequiredNetwork ( createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID1 , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME1 ) , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME2 ) ; org.mockito.Mockito.verify ( networkClusterDao ) . updateStatus ( org.mockito.Matchers.same ( networkCluster ) ) ; org.junit.Assert.assertThat ( networkCluster.getStatus ( ) , org.hamcrest.Matchers.is ( NetworkStatus.NON_OPERATIONAL ) ) ; }
Source:
public void nameNotChanged ( ) { java.lang.String name = generateRandomName ( ) ; org.mockito.Mockito.when ( oldHost.getName ( ) ) . thenReturn ( name ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( name ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void nameNotChanged ( ) { java.lang.String name = generateRandomName ( ) ; org.mockito.Mockito.when ( oldHost.getName ( ) ) . thenReturn ( name ) ; org.mockito.Mockito.when ( host.getName ( ) ) . thenReturn ( name ) ; org.hamcrest.MatcherAssert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void testAlreadyExistStorageDomain ( ) { org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getStorageDomain ( ) ) ; org.junit.Assert.assertFalse ( "Storage Domain already exists" , command.canAddDomain ( ) ) ; org.junit.Assert.assertTrue ( "Import block Storage Domain should have failed due to already existing Storage Domain" , command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST.toString ( ) ) ) ; }

Target:
public void testAlreadyExistStorageDomain ( ) { org.mockito.Mockito.when ( command.getStorageDomainStaticDao ( ) . get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.storage.AddExistingBlockStorageDomainCommandTest.getStorageDomain ( ) ) ; org.junit.Assert.assertFalse ( "Storage Domain already exists" , command.canAddDomain ( ) ) ; org.junit.Assert.assertTrue ( "Import block Storage Domain should have failed due to already existing Storage Domain" , command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST.toString ( ) ) ) ; }
Source:
protected void handleMemoryAdjustments ( ) { }

Target:
private org.ovirt.engine.core.bll.context.CommandContext createContextForStatelessSnapshotCreation ( ) { java.util.Map < java.lang.String , java.lang.String > values = getVmValuesForMsgResolving ( ) ; org.ovirt.engine.core.common.job.Step createSnapshotsStep = addSubStep ( StepEnum.EXECUTING , StepEnum.CREATING_SNAPSHOTS , values ) ; org.ovirt.engine.core.bll.job.ExecutionContext createSnapshotsCtx = new org.ovirt.engine.core.bll.job.ExecutionContext ( ) ; createSnapshotsCtx.setMonitored ( true ) ; createSnapshotsCtx.setStep ( createSnapshotsStep ) ; return new org.ovirt.engine.core.bll.context.CommandContext ( createSnapshotsCtx , org.ovirt.engine.core.bll.RunVmCommand.getCompensationContext ( ) , org.ovirt.engine.core.bll.RunVmCommand.getLock ( ) ) ; }
Source:
public javax.ws.rs.core.Response end ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "status" ) ; org.ovirt.engine.api.model.JobStatus status = org.ovirt.engine.api.model.JobStatus.fromValue ( action.getStatus ( ) ) ; return doAction ( VdcActionType.EndExternalJob , new org.ovirt.engine.core.common.action.EndExternalJobParameters ( guid , org.ovirt.engine.api.restapi.types.JobMapper.mapJobStatus ( status ) , ( action.isSetForce ( ) ? action.isForce ( ) : false ) ) , action ) ; }

Target:
public javax.ws.rs.core.Response end ( org.ovirt.engine.api.model.Action action ) { org.ovirt.engine.core.common.action.EndExternalJobParameters parameters = new org.ovirt.engine.core.common.action.EndExternalJobParameters ( guid , ( action.isSetSucceeded ( ) ? action.isSucceeded ( ) : true ) , ( action.isSetForce ( ) ? action.isForce ( ) : false ) ) ; return doAction ( VdcActionType.EndExternalJob , parameters , action ) ; }
Source:
public void canAddCloneVmFromSnapshotNoConfiguration ( ) { initializeMock ( ) ; cmd.getVm ( ) . setName ( "vm1" ) ; mockUninterestingMethods ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommandTest.SOURCE_SNAPSHOT_ID ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_HAS_NO_CONFIGURATION ) ; }

Target:
public void canAddCloneVmFromSnapshotNoConfiguration ( ) { cmd.getVm ( ) . setName ( "vm1" ) ; org.mockito.Mockito.doReturn ( null ) . when ( cmd ) . getVmFromConfiguration ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotsValidator ) . vmNotDuringSnapshot ( org.mockito.ArgumentMatchers.any ( ) ) ; org.mockito.Mockito.when ( snapshotDao.get ( org.ovirt.engine.core.bll.AddVmFromSnapshotCommandTest.SOURCE_SNAPSHOT_ID ) ) . thenReturn ( new org.ovirt.engine.core.common.businessentities.Snapshot ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_HAS_NO_CONFIGURATION ) ; }
Source:
public void appendCustomValueDoesntHandleNullKeys ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = null ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String sep = "_" ; b.appendCustomValue ( key , value , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( value , s ) ; }

Target:
public void appendCustomValueAppend ( ) { final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String newVal = "bar" ; final java.lang.String sep = "_" ; b.addCustomValue ( key , value ) ; b.appendCustomValue ( key , newVal , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( ( ( value + sep ) + newVal ) , s ) ; }
Source:
private void setBondOptions ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity , org.ovirt.engine.ui.uicommonweb.models.hosts.SetupNetworksBondModel bondDialogModel ) { org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > BondPair = ( ( org.ovirt.engine.core.compat.KeyValuePairCompat < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel > ) ( bondDialogModel.getBondingOptions ( ) . getSelectedItem ( ) ) ) ; java.lang.String key = BondPair.getKey ( ) ; entity.setBondOptions ( ( ( java.lang.String ) ( "custom" . equals ( key ) ? BondPair.getValue ( ) . getEntity ( ) : key ) ) ) ; }

Target:
private void setBondOptions ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface entity , org.ovirt.engine.ui.uicommonweb.models.hosts.SetupNetworksBondModel bondDialogModel ) { java.util.Map.Entry < java.lang.String , org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > > BondPair = bondDialogModel.getBondingOptions ( ) . getSelectedItem ( ) ; java.lang.String key = BondPair.getKey ( ) ; entity.setBondOptions ( ( "custom" . equals ( key ) ? BondPair.getValue ( ) . getEntity ( ) : key ) ) ; }
Source:
public static void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getStorageDomainListByTemplate ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.asynctasks.AsyncTaskType internalGetTaskType ( ) { if ( hasTaskHandlers ( ) ) { if ( ( getParameters ( ) . getExecutionReason ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionParametersBase.CommandExecutionReason.REGULAR_FLOW ) ) { return getCurrentTaskHandler ( ) . getTaskType ( ) ; } return getCurrentTaskHandler ( ) . getRevertTaskType ( ) ; } return getTaskType ( ) ; }

Target:
protected void freeLock ( ) { if ( ( context.getLock ( ) ) != null ) { getLockManager ( ) . releaseLock ( context.getLock ( ) ) ; log.infoFormat ( "Lock freed to object {0}" , context.getLock ( ) ) ; context.withLock ( null ) ; } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > networkQoSes = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkQoS none = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; none.setName ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getConstants ( ) . unlimitedQoSTitle ( ) ) ; none.setId ( Guid.Empty ) ; networkQoSes.add ( 0 , none ) ; getNetworkQoS ( ) . setItems ( networkQoSes ) ; setSelectedNetworkQoSId ( defaultQosId ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > networkQoSes = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; networkQoSes.add ( 0 , org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.getEmptyQos ( ) ) ; getNetworkQoS ( ) . setItems ( networkQoSes ) ; setSelectedNetworkQoSId ( defaultQosId ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( id.tagId ) == null ? 0 : id.tagId.hashCode ( ) ) ; result = ( prime * result ) + ( ( id.vmId ) == null ? 0 : id.vmId.hashCode ( ) ) ; result = ( prime * result ) + ( ( defaultDisplayType ) == null ? 0 : defaultDisplayType.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( id.tagId , id.vmId , defaultDisplayType ) ; }
Source:
public static void GetExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , org.ovirt.engine.core.common.businessentities.StorageType.NFS , domainType , path ) , aQuery ) ; }

Target:
public static void getExistingStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hostId , org.ovirt.engine.core.common.businessentities.StorageDomainType domainType , org.ovirt.engine.core.common.businessentities.StorageType storageType , java.lang.String path ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetExistingStorageDomainList , new org.ovirt.engine.core.common.queries.GetExistingStorageDomainListParameters ( hostId , storageType , domainType , path ) , aQuery ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > getStorageDomainList ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > l = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; final org.ovirt.engine.core.common.businessentities.storage_domains s = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; s.setstatus ( StorageDomainStatus.InActive ) ; l.add ( s ) ; final org.ovirt.engine.core.common.businessentities.storage_domains s2 = new org.ovirt.engine.core.common.businessentities.storage_domains ( ) ; s2.setstatus ( null ) ; l.add ( s2 ) ; STORAGE_DOMAIN.setstatus ( StorageDomainStatus.Active ) ; l.add ( STORAGE_DOMAIN ) ; return l ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > getStorageDomainList ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > l = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s.setStatus ( StorageDomainStatus.InActive ) ; l.add ( s ) ; final org.ovirt.engine.core.common.businessentities.StorageDomain s2 = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; s2.setStatus ( null ) ; l.add ( s2 ) ; STORAGE_DOMAIN.setStatus ( StorageDomainStatus.Active ) ; l.add ( STORAGE_DOMAIN ) ; return l ; }
Source:
public static void getClusterDesktopMemoryOverCommit ( 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.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.aaa.DirectoryGroup getGroupById ( java.lang.String directoryName , java.lang.String namespace , java.lang.String groupId ) { groupId = org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( groupId ) ; return getEntity ( org.ovirt.engine.core.aaa.DirectoryGroup.class , VdcQueryType.GetDirectoryGroupById , new org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters ( directoryName , namespace , groupId ) , groupId , true ) ; }

Target:
private org.ovirt.engine.core.aaa.DirectoryGroup getGroupById ( java.lang.String directoryName , java.lang.String namespace , java.lang.String groupId ) { try { groupId = org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( groupId ) ; } catch ( java.lang.IllegalArgumentException exception ) { return null ; } return getEntity ( org.ovirt.engine.core.aaa.DirectoryGroup.class , VdcQueryType.GetDirectoryGroupById , new org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters ( directoryName , namespace , groupId ) , groupId , true ) ; }
Source:
public java.lang.String customProperties ( java.lang.String predefinedProperties , java.lang.String userDefinedProperties ) { java.lang.StringBuilder result = new java.lang.StringBuilder ( ) ; result.append ( ( predefinedProperties == null ? "" : predefinedProperties ) ) ; result.append ( ( ( result.length ( ) ) == 0 ? "" : ";" ) ) ; result.append ( ( userDefinedProperties == null ? "" : userDefinedProperties ) ) ; return result.toString ( ) ; }

Target:
public java.lang.String customProperties ( java.lang.String predefinedProperties , java.lang.String userDefinedProperties ) { java.lang.String predefined = ( predefinedProperties == null ) ? "" : predefinedProperties ; java.lang.String userDefined = ( userDefinedProperties == null ) ? "" : userDefinedProperties ; java.lang.StringBuilder result = new java.lang.StringBuilder ( ) ; result.append ( predefined ) ; if ( ( ! ( predefined.isEmpty ( ) ) ) && ( ! ( userDefined.isEmpty ( ) ) ) ) { result.append ( org.ovirt.engine.core.common.utils.customprop.PROPERTIES_DELIMETER ) ; } result.append ( userDefined ) ; return result.toString ( ) ; }
Source:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "rollbackOnFailure" , isRollbackOnFailure ( ) ) . append ( "conectivityTimeout" , getConectivityTimeout ( ) ) . append ( "hostNetworkQosSupported" , getHostNetworkQosSupported ( ) ) . append ( "networks" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getNetworks ( ) , "\t\t" ) ) . append ( "removedNetworks" , getRemovedNetworks ( ) ) . append ( "bonds" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getBonds ( ) , "\t\t" ) ) . append ( "removedBonds" , getBonds ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "rollbackOnFailure" , isRollbackOnFailure ( ) ) . append ( "connectivityTimeout" , getConnectivityTimeout ( ) ) . append ( "hostNetworkQosSupported" , getHostNetworkQosSupported ( ) ) . append ( "networks" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getNetworks ( ) , "\t\t" ) ) . append ( "removedNetworks" , getRemovedNetworks ( ) ) . append ( "bonds" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getCreateOrUpdateBonds ( ) , "\t\t" ) ) . append ( "removedBonds" , getRemovedBonds ( ) ) ; }
Source:
public void testGetAllForRunningForVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDynamic > result = dao.getAllRunningForVds ( org.ovirt.engine.core.dao.VmDynamicDAOTest.VDS_STATIC_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmDynamicDAOTest.DYNAMIC_RUNNING_COUNT , result.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDynamic vmdynamic : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmDynamicDAOTest.VDS_STATIC_ID , vmdynamic.getrun_on_vds ( ) ) ; } }

Target:
public void testGetAllForRunningForVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDynamic > result = dao.getAllRunningForVds ( org.ovirt.engine.core.dao.VmDynamicDAOTest.VDS_STATIC_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmDynamicDAOTest.DYNAMIC_RUNNING_COUNT , result.size ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDynamic vmdynamic : result ) { org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.VmDynamicDAOTest.VDS_STATIC_ID , vmdynamic.getRunOnVds ( ) ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createIscsiConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.StorageType type , java.lang.String iqn , java.lang.String userName , java.lang.String password , java.lang.String portal ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( id , connection , type ) ; connectionDetails.setiqn ( iqn ) ; connectionDetails.setuser_name ( userName ) ; connectionDetails.setpassword ( password ) ; connectionDetails.setportal ( portal ) ; return connectionDetails ; }

Target:
private org.ovirt.engine.core.common.businessentities.StorageServerConnections createIscsiConnection ( java.lang.String connection , org.ovirt.engine.core.common.businessentities.storage.StorageType type , java.lang.String iqn , java.lang.String userName , java.lang.String password , java.lang.String portal ) { org.ovirt.engine.core.compat.Guid id = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connectionDetails = populateBasicConnectionDetails ( id , connection , type ) ; connectionDetails.setiqn ( iqn ) ; connectionDetails.setuser_name ( userName ) ; connectionDetails.setpassword ( password ) ; connectionDetails.setportal ( portal ) ; return connectionDetails ; }