auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getIrsImageList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getIrsImageList ( aQuery , storagePoolId , false ) ; }

Target:
public void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForRoleNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( isRoleNetwork ( ) ) && ( ( ( ipConfiguration == null ) || ( ! ( ipConfiguration.hasIpv4PrimaryAddressSet ( ) ) ) ) || ( ( ipConfiguration.getIpv4PrimaryAddress ( ) . getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , getNetwork ( ) . getName ( ) ) ) . when ( failWhen ) ; }

Target:
private boolean hasIpv6BootProtocol ( org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration ) { return ( ipConfiguration.hasIpv6PrimaryAddressSet ( ) ) && ( ( ipConfiguration.getIpv6PrimaryAddress ( ) . getBootProtocol ( ) ) != ( org.ovirt.engine.core.common.businessentities.network.Ipv6BootProtocol.NONE ) ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { cachedMaxPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; updatePriority ( ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ; param.setConsoleEnabled ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }
Source:
private final < T extends org.ovirt.engine.core.common.businessentities.IVdcQueryable > java.util.List < T > genericSearch ( final org.ovirt.engine.core.dao.SearchDAO < T > dao , final boolean useCache , final org.ovirt.engine.core.common.utils.ListUtils.Filter < T > filter ) { final org.ovirt.engine.core.bll.QueryData2 data = InitQueryData ( useCache ) ; if ( data == null ) { return new java.util.ArrayList < T > ( ) ; } return org.ovirt.engine.core.common.utils.ListUtils.filter ( dao.getAllWithQuery ( data.getQuery ( ) ) , filter ) ; }

Target:
private final < T extends org.ovirt.engine.core.common.businessentities.IVdcQueryable > java.util.List < T > genericSearch ( final org.ovirt.engine.core.dao.SearchDAO < T > dao , final boolean useCache , final org.ovirt.engine.core.common.utils.ListUtils.Filter < T > filter ) { final org.ovirt.engine.core.bll.QueryData2 data = initQueryData ( useCache ) ; if ( data == null ) { return new java.util.ArrayList < T > ( ) ; } return org.ovirt.engine.core.common.utils.ListUtils.filter ( dao.getAllWithQuery ( data.getQuery ( ) ) , filter ) ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult hasSpaceForSnapshots ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > sdIds = org.ovirt.engine.core.bll.ImagesHandler.getAllStorageIdsForImageIds ( getVmImageDisks ( ) ) ; org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator msdValidator = getStorageDomainsValidator ( sdIds ) ; org.ovirt.engine.core.bll.ValidationResult retVal = msdValidator.allDomainsWithinThresholds ( ) ; if ( retVal == ( org.ovirt.engine.core.bll.ValidationResult.VALID ) ) { return msdValidator.allDomainsHaveSpaceForNewDisks ( getVmImageDisks ( ) ) ; } return retVal ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult hasSpaceForSnapshots ( ) { java.util.Set < org.ovirt.engine.core.compat.Guid > sdIds = org.ovirt.engine.core.bll.ImagesHandler.getAllStorageIdsForImageIds ( getVmImageDisks ( ) ) ; org.ovirt.engine.core.bll.validator.storage.MultipleStorageDomainsValidator msdValidator = getStorageDomainsValidator ( sdIds ) ; org.ovirt.engine.core.bll.ValidationResult retVal = msdValidator.allDomainsWithinThresholds ( ) ; if ( retVal == ( org.ovirt.engine.core.bll.ValidationResult.VALID ) ) { return msdValidator.allDomainsHaveSpaceForNewDisks ( getVmImageDisks ( ) ) ; } return retVal ; }
Source:
public void testListFailure ( ) throws java.lang.Exception { }

Target:
public void testListCrash ( ) throws java.lang.Exception { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpQueryExpectations ( org.ovirt.engine.api.restapi.resource.BackendGroupsResourceTest.QUERY , t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_SERVER_LOCALE , t ) ; } }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.FenceAgent > createConcurrentAgentsList ( int count , int order ) { java.util.List < org.ovirt.engine.core.common.businessentities.FenceAgent > fenceAgents = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { fenceAgents.add ( createFenceAgent ( order ) ) ; } return fenceAgents ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.pm.FenceAgent > createConcurrentAgentsList ( int count , int order ) { java.util.List < org.ovirt.engine.core.common.businessentities.pm.FenceAgent > fenceAgents = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < count ; i ++ ) { fenceAgents.add ( createFenceAgent ( order ) ) ; } return fenceAgents ; }
Source:
public void onBrowserEvent ( com.google.gwt.cell.client.Cell.Context context , final com.google.gwt.dom.client.Element elem , T object , com.google.gwt.dom.client.NativeEvent event ) { super . onBrowserEvent ( context , elem , object , event ) ; if ( BrowserEvents.MOUSEOVER.equals ( event.getType ( ) ) ) { com.google.gwt.safehtml.shared.SafeHtml tooltipHtml = getTooltip ( object ) ; if ( ( tooltipHtml != null ) && ( ! ( tooltipHtml.asString ( ) . isEmpty ( ) ) ) ) { tooltipPanel.setText ( getTooltip ( object ) ) ; } } tooltipPanel.handleNativeBrowserEvent ( elem , event ) ; }

Target:
public com.google.gwt.dom.client.Element getElement ( ) { return ( ( com.google.gwt.dom.client.Element ) ( elem ) ) ; }
Source:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > getMissingStorages ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > storageDomains , org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel vmdisk ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > missingStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel templateDisk = getTemplateDiskByVmDisk ( vmdisk ) ; if ( templateDisk != null ) { for ( org.ovirt.engine.core.common.businessentities.storage_domains storageDomain : storageDomains ) { if ( ! ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( templateDisk.getDisk ( ) ) ) . getstorage_ids ( ) . contains ( storageDomain.getId ( ) ) ) ) { missingStorageDomains.add ( storageDomain ) ; } } } return missingStorageDomains ; }

Target:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > getMissingStorages ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains , org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel vmdisk ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > missingStorageDomains = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel templateDisk = getTemplateDiskByVmDisk ( vmdisk ) ; if ( templateDisk != null ) { for ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain : storageDomains ) { if ( ! ( ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( templateDisk.getDisk ( ) ) ) . getStorageIds ( ) . contains ( storageDomain.getId ( ) ) ) ) { missingStorageDomains.add ( storageDomain ) ; } } } return missingStorageDomains ; }
Source:
public void networNotExist ( ) { simulateNicExists ( ) ; org.junit.Assert.assertThat ( validator.networkExists ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_NOT_EXIST , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.NETWORK_ID_REPLACEMENT , org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) ) ) ; }

Target:
public void networNotExist ( ) { simulateNicExists ( ) ; org.hamcrest.MatcherAssert.assertThat ( validator.networkExists ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_NOT_EXIST , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.NETWORK_ID_REPLACEMENT , org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) ) ) ; }
Source:
public org.ovirt.engine.core.bll.tasks.SPMAsyncTask concreteCreateTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.bll.CommandBase command , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters p = new org.ovirt.engine.core.common.asynctasks.AsyncTaskParameters ( asyncTaskCreationInfo , getAsyncTask ( taskId , command , asyncTaskCreationInfo , parentCommand ) ) ; p.setEntityInfo ( command.getParameters ( ) . getEntityInfo ( ) ) ; return createTask ( internalGetTaskType ( command ) , p ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.AsyncTasks getAsyncTask ( org.ovirt.engine.core.compat.Guid taskId , org.ovirt.engine.core.bll.CommandBase command , org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { return coCoAsyncTaskHelper.getAsyncTask ( taskId , command , asyncTaskCreationInfo , parentCommand ) ; }
Source:
public void AutoLogin ( org.ovirt.engine.core.common.users.VdcUser user ) { loggingInAutomatically = true ; getUserName ( ) . setEntity ( user.getUserName ( ) ) ; getDomain ( ) . setSelectedItem ( user.getDomainControler ( ) ) ; disableLoginScreen ( ) ; setLoggedUser ( user ) ; getLoggedInEvent ( ) . raise ( this , EventArgs.Empty ) ; }

Target:
public void AutoLogin ( org.ovirt.engine.core.common.users.VdcUser user ) { loggingInAutomatically = true ; getUserName ( ) . setEntity ( user.getUserName ( ) ) ; getDomain ( ) . setSelectedItem ( user.getDomainControler ( ) ) ; disableLoginScreen ( ) ; setLoggedUser ( user ) ; raiseLoggedInEvent ( ) ; }
Source:
public void canDoActionEnoughSpace ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommandTest.mockStorageDomainValidatorWithSpace ( ) ) . when ( command ) . createStorageDomainValidator ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void canDoActionVmInPreview ( ) { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initSnapshotValidator ( ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }
Source:
private void DataCenter_SelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.DataCenter_SelectedItemChanged ( ) ; org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenter ( ) . getSelectedItem ( ) ) ) ; if ( dataCenter != null ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenter.getQuotaEnforcementType ( ) ) ; } }

Target:
private void dataCenterWithClusterSelectedItemChanged ( java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { behavior.dataCenterWithClusterSelectedItemChanged ( ) ; org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster dataCenterWithCluster = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.DataCenterWithCluster ) ( getDataCenterWithClustersList ( ) . getSelectedItem ( ) ) ) ; if ( ( dataCenterWithCluster != null ) && ( ( dataCenterWithCluster.getDataCenter ( ) ) != null ) ) { getDisksAllocationModel ( ) . setQuotaEnforcementType ( dataCenterWithCluster.getDataCenter ( ) . getQuotaEnforcementType ( ) ) ; } updateMaximalVmMemSize ( ) ; }
Source:
public void canDoActionPreallocatedSpaceCheckSucceeds ( ) { final int availableSize = 12 ; final int usedSize = 8 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertTrue ( command.canDoAction ( ) ) ; }

Target:
public void testCanDoFailOnAddFloatingDiskWithPlugSet ( ) { org.ovirt.engine.core.common.businessentities.DiskImage disk = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createDiskImage ( 1 ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; parameters.setVmId ( Guid.Empty ) ; parameters.setPlugDiskToVm ( true ) ; initializeCommand ( null , parameters ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.CANNOT_ADD_FLOATING_DISK_WITH_PLUG_VM_SET ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > setUpStorageDomains ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_domains > entities = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } return entities ; }

Target:
protected java.util.List < org.ovirt.engine.api.model.StorageDomain > setUpStorageDomains ( ) { java.util.List < org.ovirt.engine.api.model.StorageDomain > entities = new java.util.ArrayList < org.ovirt.engine.api.model.StorageDomain > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } return entities ; }
Source:
public void starting ( org.junit.runner.Description description ) { origConfUtils = org.ovirt.engine.core.common.config.Config.getConfigUtils ( ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( mockConfigUtils ) ; for ( org.ovirt.engine.core.utils.MockConfigRule.MockConfigDescriptor < ? > config : configs ) { org.ovirt.engine.core.utils.MockConfigRule.mockConfigValue ( config.getValue ( ) , config.getVersion ( ) , config.getReturnValue ( ) ) ; } }

Target:
public void starting ( org.junit.runner.Description description ) { origConfUtils = org.ovirt.engine.core.common.config.Config.getConfigUtils ( ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( mockConfigUtils ) ; for ( org.ovirt.engine.core.utils.MockConfigDescriptor < ? > config : configs ) { mockConfigValue ( config.getValue ( ) , config.getVersion ( ) , config.getReturnValue ( ) ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface.NetworkImplementationDetails getNetworkImplementationDetails ( ) { if ( ! ( isAttached ( ) ) ) { return null ; } org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = ( hasVlan ( ) ) ? getVlanNicModel ( ) . getIface ( ) : getAttachedToNic ( ) . getIface ( ) ; return nic.getNetworkImplementationDetails ( ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkAttachment getNetworkAttachment ( ) { return getSetupModel ( ) . getNetworkAttachmentForNetwork ( getNetwork ( ) . getId ( ) ) ; }
Source:
public void getAncestorImagesByImagesIds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.util.List < org.ovirt.engine.core.compat.Guid > imagesIds ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) { @ java.lang.Override public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.IdsQueryParameters params = new org.ovirt.engine.core.common.queries.IdsQueryParameters ( imagesIds ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAncestorImagesByImagesIds , params , aQuery ) ; }

Target:
public void getAncestorImagesByImagesIds ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.util.List < org.ovirt.engine.core.compat.Guid > imagesIds ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) { @ java.lang.Override public java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.IdsQueryParameters params = new org.ovirt.engine.core.common.queries.IdsQueryParameters ( imagesIds ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAncestorImagesByImagesIds , params , aQuery ) ; }
Source:
private static java.lang.String getTimeZone ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String timeZone ; if ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) { vm.setTimeZone ( TimeZoneInfo.Local.getId ( ) ) ; } switch ( vm.getStaticData ( ) . getOs ( ) ) { case WindowsXP : case Windows2003 : case Windows2003x64 : timeZone = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneIndexByKey ( vm.getTimeZone ( ) ) ; break ; case Windows2008 : default : timeZone = vm.getTimeZone ( ) ; break ; } return timeZone ; }

Target:
private static java.lang.String getTimeZone ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.lang.String timeZone ; if ( org.apache.commons.lang.StringUtils.isEmpty ( vm.getTimeZone ( ) ) ) { vm.setTimeZone ( org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.DefaultWindowsTimeZone ) ) ; } if ( OsRepositoryImpl.INSTANCE.isTimezoneValueInteger ( vm.getStaticData ( ) . getOsId ( ) , null ) ) { timeZone = org.ovirt.engine.core.vdsbroker.vdsbroker.SysprepHandler.getTimezoneIndexByKey ( vm.getTimeZone ( ) ) ; } else { timeZone = vm.getTimeZone ( ) ; } return timeZone ; }
Source:
protected boolean validateCreateImage ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.validate ( ActionType.AddDisk , getAddDiskParameters ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getContext ( ) . clone ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return returnValue.isValid ( ) ; }

Target:
protected boolean validateCreateImage ( ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.validate ( ActionType.AddDisk , getAddDiskParameters ( ) , org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getContext ( ) . clone ( ) ) ; org.ovirt.engine.core.bll.storage.disk.image.TransferDiskImageCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return returnValue.isValid ( ) ; }
Source:
public void validateVmRunningStateless ( ) { createParameters ( ) ; initDiskImage ( diskImageGroupId , diskImageId ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS ) ) . when ( vmValidator ) . vmNotRunningStateless ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_VM_RUNNING_STATELESS.name ( ) ) ) ; }

Target:
public void passDiscardNotSupportedOnDestSd ( ) { org.ovirt.engine.core.compat.Guid dstSd = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.when ( diskVmElementValidator.isPassDiscardSupported ( dstSd ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_PASS_DISCARD_NOT_SUPPORTED_BY_DISK_INTERFACE ) ) ; org.junit.Assert.assertFalse ( command.validatePassDiscardSupportedOnDestinationStorageDomain ( new org.ovirt.engine.core.common.action.LiveMigrateDiskParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , dstSd , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { boolean doesNotReferenceExistingNetworkAttachment = networkAttachmentId == null ; if ( doesNotReferenceExistingNetworkAttachment ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult modifiedAttachmentExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { if ( isNewAttachment ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator.VAR_NETWORK_ATTACHMENT_NOT_EXISTS_ENTITY , networkAttachmentId.toString ( ) ) ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.tags createTag ( java.lang.String name , java.lang.String description ) { org.ovirt.engine.core.compat.Guid tagId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.tags tag = new org.ovirt.engine.core.common.businessentities.tags ( ) ; tag.setdescription ( description ) ; tag.settag_id ( tagId ) ; tag.settag_name ( name ) ; tag.settype ( TagsType.GeneralTag ) ; tag.setparent_id ( tagsDirector.GetRootTag ( ) . gettag_id ( ) ) ; return tag ; }

Target:
protected org.ovirt.engine.core.common.businessentities.tags createTag ( java.lang.String name , java.lang.String description ) { org.ovirt.engine.core.compat.Guid tagId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.tags tag = new org.ovirt.engine.core.common.businessentities.tags ( ) ; tag.setdescription ( description ) ; tag.settag_id ( tagId ) ; tag.settag_name ( name ) ; tag.settype ( TagsType.GeneralTag ) ; tag.setparent_id ( tagsDirector.GetRootTag ( ) . gettag_id ( ) ) ; return tag ; }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.hosts.VfsConfigModel model ) { driver.edit ( model ) ; labelsWidget.edit ( model.getLabelsModel ( ) ) ; networks.asEditor ( ) . edit ( model.getNetworks ( ) ) ; initNetworksTable ( ) ; updateAllowedNetworksPanelVisibility ( model ) ; model.getAllNetworksAllowed ( ) . getSelectedItemChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateAllowedNetworksPanelVisibility ( model ) ; } } ) ; }

Target:
public void onValueChange ( com.google.gwt.event.logical.shared.ValueChangeEvent < java.util.Set < java.lang.String > > event ) { refreshNetworksTable ( ) ; }
Source:
protected void updateNumOfSockets ( ) { org.ovirt.engine.core.compat.Version version = getCompatibilityVersion ( ) ; if ( version == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfVmSockets ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase behavior = org.ovirt.engine.ui.uicommonweb.models.vms.VmModelBehaviorBase.this ; behavior.maxNumOfSockets = ( ( java.lang.Integer ) ( returnValue ) ) ; behavior.updataMaxVmsInPool ( ) ; } } ) , version.toString ( ) ) ; }

Target:
protected void updateNumOfSockets ( ) { org.ovirt.engine.core.compat.Version version = getCompatibilityVersion ( ) ; if ( version == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getMaxNumOfVmSockets ( asyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.lang.Integer > ( ) { @ java.lang.Override public void onSuccess ( java.lang.Integer returnValue ) { maxNumOfSockets = returnValue ; updataMaxVmsInPool ( ) ; } } ) , version.toString ( ) ) ; }
Source:
public void engineIsRunningNotification ( ) { try { heartBeatVar.setDateTime ( new java.util.Date ( ) ) ; dwhHistoryTimekeepingDao.save ( heartBeatVar ) ; } catch ( java.lang.Exception ex ) { org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.error ( "Error updating DWH Heart Beat: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.debug ( "Exception" , ex ) ; } }

Target:
public void engineIsRunningNotification ( ) { try { org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.debug ( "DWH Heart Beat - Start" ) ; heartBeatVar.setDateTime ( new java.util.Date ( ) ) ; dwhHistoryTimekeepingDao.save ( heartBeatVar ) ; org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.debug ( "DWH Heart Beat - End" ) ; } catch ( java.lang.Exception ex ) { org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.error ( "Error updating DWH Heart Beat: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.dwh.DwhHeartBeat.log.debug ( "Exception" , ex ) ; } }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue executeVerb ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage ) { try { return runVdsCommand ( VDSCommandType.GetVmsInfo , buildGetVmsInfoParameters ( storage ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = org.ovirt.engine.core.di.Injector.injectMembers ( new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ) ; logable.addCustomValue ( "StorageDomainName" , storage.getStorageName ( ) ) ; auditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_GET_VMS_INFO_FAILED ) ; throw e ; } }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue executeVerb ( org.ovirt.engine.core.common.businessentities.StorageDomainStatic storage ) { try { return runVdsCommand ( VDSCommandType.GetVmsInfo , buildGetVmsInfoParameters ( storage ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogable logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableImpl ( ) ; logable.addCustomValue ( "StorageDomainName" , storage.getStorageName ( ) ) ; auditLogDirector.log ( logable , AuditLogType.IMPORTEXPORT_GET_VMS_INFO_FAILED ) ; throw e ; } }
Source:
public static org.ovirt.engine.core.bll.tasks.CommandCoordinatorImpl getInstance ( ) { return org.ovirt.engine.core.bll.tasks.CommandCoordinatorImpl.instance ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase endAction ( org.ovirt.engine.core.compat.Guid stepId , org.ovirt.engine.core.common.action.VdcActionType actionType , org.ovirt.engine.core.common.businessentities.AsyncTasks dbAsyncTask , org.ovirt.engine.core.bll.job.ExecutionContext context ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = dbAsyncTask.getActionParameters ( ) ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters ) ; command.setContext ( new org.ovirt.engine.core.bll.context.CommandContext ( context ) ) ; return command.endAction ( ) ; }
Source:
public static void RunMultipleQueries ( final java.util.List < org.ovirt.engine.core.common.queries.VdcQueryType > queryTypeList , final java.util.List < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > queryParamsList , final org.ovirt.engine.ui.uicompat.IFrontendMultipleQueryAsyncCallback callback , final java.lang.String context ) { org.ovirt.engine.ui.frontend.gwtservices.GenericApiGWTServiceAsync service = GenericApiGWTServiceAsync.Util.getInstance ( ) ; org.ovirt.engine.ui.frontend.Frontend.RunMultipleQueries ( queryTypeList , queryParamsList , callback , context , service ) ; }

Target:
public static void RunMultipleQueries ( final java.util.List < org.ovirt.engine.core.common.queries.VdcQueryType > queryTypeList , final java.util.List < org.ovirt.engine.core.common.queries.VdcQueryParametersBase > queryParamsList , final org.ovirt.engine.ui.uicompat.IFrontendMultipleQueryAsyncCallback callback , final java.lang.String context ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleQueries ( queryTypeList , queryParamsList , callback , context ) ; }
Source:
private void addDefaultClusterToPool ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup defaultCluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; defaultCluster.setcompatibility_version ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.VERSION_1_1 ) ; defaultCluster.setId ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.DEFAULT_VDS_GROUP_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; clusters.add ( defaultCluster ) ; org.mockito.Mockito.when ( vdsDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( clusters ) ; }

Target:
private void addDefaultClusterToPool ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup defaultCluster = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; defaultCluster.setcompatibility_version ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.VERSION_1_1 ) ; defaultCluster.setId ( org.ovirt.engine.core.bll.storage.UpdateStoragePoolCommandTest.DEFAULT_VDS_GROUP_ID ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; clusters.add ( defaultCluster ) ; org.mockito.Mockito.when ( vdsGroupDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( clusters ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel storageListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageListModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; storageListModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
public void getHostNumaTopologyByHostId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.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.VdsNumaNode > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsNumaNodesByVdsId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) , asyncQuery ) ; }

Target:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmsWithNumaByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.Network getGlusterNetwork ( ) { if ( ( glusterNetwork ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allNetworksInCluster = getNetworkDao ( ) . getAllForCluster ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getVdsGroupId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allNetworksInCluster ) { if ( network.getCluster ( ) . isGluster ( ) ) { glusterNetwork = network ; return glusterNetwork ; } } } return glusterNetwork ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.Network getGlusterNetwork ( ) { if ( ( glusterNetwork ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > allNetworksInCluster = getNetworkDao ( ) . getAllForCluster ( org.ovirt.engine.core.bll.gluster.GlusterCommandBase.getClusterId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : allNetworksInCluster ) { if ( network.getCluster ( ) . isGluster ( ) ) { glusterNetwork = network ; return glusterNetwork ; } } } return glusterNetwork ; }
Source:
public static boolean isAdminUser ( org.ovirt.engine.core.common.businessentities.DbUser user ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > userRoles = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getRoleDAO ( ) . getAllForUserAndGroups ( user.getId ( ) , org.apache.commons.lang.StringUtils.join ( user.getGroupIds ( ) , "," ) ) ; for ( org.ovirt.engine.core.common.businessentities.Role r : userRoles ) { if ( ( r.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) { if ( org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.debugFormat ( "LoginAdminUser: User logged to admin using role {0}" , r.getname ( ) ) ; } return true ; } } return false ; }

Target:
public static boolean isAdminUser ( org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > userRoles = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getRoleDAO ( ) . getAllForUserAndGroups ( user.getId ( ) , org.apache.commons.lang.StringUtils.join ( user.getGroupIds ( ) , "," ) ) ; for ( org.ovirt.engine.core.common.businessentities.Role r : userRoles ) { if ( ( r.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) { if ( org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.debugFormat ( "LoginAdminUser: User logged to admin using role {0}" , r.getname ( ) ) ; } return true ; } } return false ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeRemoveBricksStop ( java.lang.String volumeName , java.lang.String [ ] brickList , int replicaCount ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.removeBrickStop" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "brickList" , new java.util.ArrayList < java.lang.String > ( java.util.Arrays.asList ( brickList ) ) ) . withParameter ( "replicaCount" , replicaCount ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc updateVmPolicy ( java.util.Map params ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.updateVmPolicy" ) . withParameter ( "params" , params ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }
Source:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateTag , org.ovirt.engine.core.common.action.TagsOperationParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendTagsResourceTest.getModel ( 0 , false ) ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public static byte [ ] toByteArray ( java.util.UUID uuid ) { java.lang.String guidStr = uuid.toString ( ) ; java.lang.String [ ] guidParts = org.ovirt.engine.core.utils.GuidUtils.GUID_PART_PATTERN.split ( guidStr ) ; if ( ( guidParts == null ) || ( ( guidParts.length ) == 0 ) ) { return null ; } java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream ( ) ; for ( java.lang.String guidPart : guidParts ) { org.ovirt.engine.core.utils.GuidUtils.writeGUIDPartToStream ( guidPart , baos ) ; } return baos.toByteArray ( ) ; }

Target:
public static byte [ ] toByteArray ( java.util.UUID uuid ) { java.lang.String guidStr = uuid.toString ( ) ; java.lang.String [ ] guidParts = guidStr.split ( "-" ) ; if ( ( guidParts == null ) || ( ( guidParts.length ) == 0 ) ) { return null ; } java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream ( ) ; for ( java.lang.String guidPart : guidParts ) { org.ovirt.engine.core.utils.GuidUtils.writeGUIDPartToStream ( guidPart , baos ) ; } return baos.toByteArray ( ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { getVmTemplate ( ) . setVdsGroupId ( getVdsGroupId ( ) ) ; getVmTemplate ( ) . setCpuProfileId ( getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( cpuProfileHelper.setAndValidateCpuProfile ( getVmTemplate ( ) , getVdsGroup ( ) . getCompatibilityVersion ( ) , getUserId ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { getVmTemplate ( ) . setVdsGroupId ( getVdsGroupId ( ) ) ; getVmTemplate ( ) . setCpuProfileId ( getParameters ( ) . getCpuProfileId ( ) ) ; return validate ( cpuProfileHelper.setAndValidateCpuProfile ( getVmTemplate ( ) , getVdsGroup ( ) . getCompatibilityVersion ( ) , getUserIdIfExternal ( ) ) ) ; }
Source:
public void RequestSearch ( ) { searchRequested = true ; model.setItems ( new java.util.ArrayList ( ) ) ; model.getSelectedItemChangedEvent ( ) . raise ( this , new org.ovirt.engine.ui.uicompat.EventArgs ( ) ) ; model.getSelectedItemsChangedEvent ( ) . raise ( this , new org.ovirt.engine.ui.uicompat.EventArgs ( ) ) ; }

Target:
public void requestSearch ( ) { searchRequested = true ; model.setItems ( new java.util.ArrayList < T > ( ) ) ; model.getSelectedItemChangedEvent ( ) . raise ( this , new org.ovirt.engine.ui.uicompat.EventArgs ( ) ) ; model.getSelectedItemsChangedEvent ( ) . raise ( this , new org.ovirt.engine.ui.uicompat.EventArgs ( ) ) ; }
Source:
protected boolean canRunActionOnNonManagedVm ( ) { org.ovirt.engine.core.bll.ValidationResult nonManagedVmValidationResult = org.ovirt.engine.core.bll.VmHandler.canRunActionOnNonManagedVm ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) , this . getActionType ( ) ) ; if ( ! ( nonManagedVmValidationResult.isValid ( ) ) ) { return failCanDoAction ( nonManagedVmValidationResult.getMessage ( ) ) ; } return true ; }

Target:
protected boolean canRunActionOnNonManagedVm ( ) { org.ovirt.engine.core.bll.ValidationResult nonManagedVmValidationResult = org.ovirt.engine.core.bll.VmHandler.canRunActionOnNonManagedVm ( org.ovirt.engine.core.bll.VmCommand.getVm ( ) , this . getActionType ( ) ) ; if ( ! ( nonManagedVmValidationResult.isValid ( ) ) ) { return failValidation ( nonManagedVmValidationResult.getMessage ( ) ) ; } return true ; }
Source:
private org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.Integer > > parseDropString ( java.lang.String dropString ) { org.ovirt.engine.core.common.utils.Pair < java.lang.Boolean , java.lang.Integer > pinnedIndexPair = new org.ovirt.engine.core.common.utils.Pair ( ) ; java.lang.String [ ] splitString = dropString.split ( "_" ) ; pinnedIndexPair.setFirst ( java.lang.Boolean.valueOf ( splitString [ 1 ] ) ) ; pinnedIndexPair.setSecond ( java.lang.Integer.valueOf ( splitString [ 2 ] ) ) ; return new org.ovirt.engine.core.common.utils.Pair ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( splitString [ 0 ] ) , pinnedIndexPair ) ; }

Target:
private java.lang.String getValue ( java.lang.String key , java.lang.String vmGidString ) { java.lang.String [ ] keyValue = vmGidString.split ( "=" ) ; if ( ( ( keyValue.length ) == 2 ) && ( keyValue [ 0 ] . equals ( key ) ) ) { return keyValue [ 1 ] ; } return "" ; }