auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void buildVmVirtioSerial ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = vmDeviceDao.getVmDeviceByVmIdTypeAndDevice ( vm.getId ( ) , VmDeviceGeneralType.CONTROLLER , VmDeviceType.VIRTIOSERIAL.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < > ( ) ; struct.put ( VdsProperties.Type , VmDeviceGeneralType.CONTROLLER.getValue ( ) ) ; struct.put ( VdsProperties.Device , VdsProperties.VirtioSerial ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VmInfoBuilder.addAddress ( vmDevice , struct ) ; addDevice ( struct , vmDevice , null ) ; } }

Target:
public void buildVmVirtioSerial ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = vmDeviceDao.getVmDeviceByVmIdTypeAndDevice ( vm.getId ( ) , VmDeviceGeneralType.CONTROLLER , VmDeviceType.VIRTIOSERIAL.getName ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmDevice vmDevice : vmDevices ) { java.util.Map < java.lang.String , java.lang.Object > struct = new java.util.HashMap < > ( ) ; struct.put ( VdsProperties.Type , VmDeviceGeneralType.CONTROLLER.getValue ( ) ) ; struct.put ( VdsProperties.Device , VdsProperties.VirtioSerial ) ; vmInfoBuildUtils.addAddress ( vmDevice , struct ) ; addDevice ( struct , vmDevice , null ) ; } }
Source:
protected void endWithFailure ( ) { org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderVolume = org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getParameters ( ) . getRemovedVolume ( ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.log.error ( "Could not volume id from Cinder which is related to disk {}" , cinderVolume.getDiskAlias ( ) , cinderVolume.getImageId ( ) ) ; if ( org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommand.getParameters ( ) . isFaultTolerant ( ) ) { endRemoveCinderDisk ( cinderVolume ) ; } else { auditLogFailureWithImageDeletion ( cinderVolume.getImageId ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( getDisk ( ) . getId ( ) , ImageStatus.ILLEGAL ) ; } }

Target:
protected void removeDiskFromDbCallBack ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderVolume ) { final org.ovirt.engine.core.common.businessentities.Snapshot updated = getSnapshotWithoutCinderVolume ( cinderVolume ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInScope ( TransactionScopeOption.Required , new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Object > ( ) { @ java.lang.Override public java.lang.Object runInTransaction ( ) { removeDiskFromDb ( cinderVolume , updated ) ; return null ; } } ) ; }
Source:
public void testFingerprint ( ) throws java.lang.Exception { org.junit.Assume.assumeNotNull ( sshd ) ; org.ovirt.engine.core.utils.hostinstall.VdsInstallerSSH vdsi = new org.ovirt.engine.core.utils.hostinstall.VdsInstallerSSH ( ) ; vdsi.setPort ( port ) ; try { assertEquals ( org.ovirt.engine.core.engineencryptutils.OpenSSHUtils.getKeyFingerprintString ( sshd.getKey ( ) ) , vdsi.getServerKeyFingerprint ( org.ovirt.engine.core.utils.hostinstall.VdsInstallerSSHTest.host , 5000 ) ) ; } finally { vdsi.shutdown ( ) ; vdsi = null ; } }

Target:
public void testFingerprint ( ) throws java.lang.Exception { org.junit.Assume.assumeNotNull ( sshd ) ; org.ovirt.engine.core.utils.hostinstall.VdsInstallerSSH vdsi = new org.ovirt.engine.core.utils.hostinstall.VdsInstallerSSH ( ) ; vdsi.setPort ( port ) ; try { org.junit.Assert.assertEquals ( org.ovirt.engine.core.engineencryptutils.OpenSSHUtils.getKeyFingerprintString ( sshd.getKey ( ) ) , vdsi.getServerKeyFingerprint ( org.ovirt.engine.core.utils.hostinstall.VdsInstallerSSHTest.host , 5000 ) ) ; } finally { vdsi.shutdown ( ) ; vdsi = null ; } }
Source:
public void failsInNotImportedAndNotExists ( ) throws java.lang.Exception { mockGetExistingDomain ( false ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 1 ) ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( VdcQueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }

Target:
public void failsInNotImportedAndNotExists ( ) throws java.lang.Exception { mockGetExistingDomain ( false ) ; cmd.init ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( "" , cmd , EngineMessage.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST ) ; org.mockito.Mockito.verify ( backend , org.mockito.Mockito.times ( 1 ) ) . runInternalQuery ( org.mockito.ArgumentMatchers.eq ( QueryType.GetExistingStorageDomainList ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ; org.mockito.Mockito.verify ( cmd , org.mockito.Mockito.times ( 0 ) ) . executeCommand ( ) ; }
Source:
protected org.ovirt.engine.api.model.HostNIC slave ( java.lang.String id ) { org.ovirt.engine.api.model.HostNIC slave = new org.ovirt.engine.api.model.HostNIC ( ) ; slave.setId ( id ) ; slave.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; slave.getHost ( ) . setId ( hostId ) ; slave = org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , slave ) ; slave.setHost ( null ) ; return slave ; }

Target:
protected org.ovirt.engine.api.model.HostNic slave ( java.lang.String id ) { org.ovirt.engine.api.model.HostNic slave = new org.ovirt.engine.api.model.HostNic ( ) ; slave.setId ( id ) ; slave.setHost ( new org.ovirt.engine.api.model.Host ( ) ) ; slave.getHost ( ) . setId ( hostId ) ; slave = org.ovirt.engine.api.utils.LinkHelper.addLinks ( getUriInfo ( ) , slave ) ; slave.setHost ( null ) ; return slave ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel object ) { org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmSnapshotCreatePopupWidget.Driver.driver.edit ( object ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel model ) { org.ovirt.engine.ui.common.widget.uicommon.popup.vm.VmSnapshotCreatePopupWidget.Driver.driver.edit ( model ) ; model.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( "Message" . equals ( propName ) ) { appendMessage ( model.getMessage ( ) ) ; } } } ) ; }
Source:
public void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisksForVmQueryParameters ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllAttachableDisksForVm , params , aQuery ) ; }
Source:
public void canDoActionSucceedsWhenGlusterServerHasPeersThatExistInDB ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterDBUtils.serverExists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( org.ovirt.engine.core.bll.hostdeploy.AddVdsCommandTest.PEER_1 ) ) ) . thenReturn ( true ) ; org.junit.Assert.assertTrue ( commandMock.canDoAction ( ) ) ; }

Target:
public void validateSucceedsWhenGlusterServerHasPeersThatExistInDB ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterDBUtils.serverExists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( org.ovirt.engine.core.bll.hostdeploy.AddVdsCommandTest.PEER_1 ) ) ) . thenReturn ( true ) ; org.junit.Assert.assertTrue ( commandMock.validate ( ) ) ; }
Source:
public void updateSortOptions ( java.lang.String sortBy , boolean sortAscending ) { if ( ! ( supportsServerSideSorting ( ) ) ) { return ; } boolean shouldRefresh = ( ! ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( this . sortBy , sortBy ) ) ) || ( ( this . sortAscending ) != sortAscending ) ; this . sortBy = sortBy ; this . sortAscending = sortAscending ; if ( shouldRefresh ) { refresh ( ) ; } }

Target:
public boolean isSearchValidForServerSideSorting ( ) { java.lang.String search = getSearchString ( ) ; org.ovirt.engine.core.searchbackend.SyntaxContainer syntaxResult = getSyntaxChecker ( ) . analyzeSyntaxState ( search , true ) ; if ( ( syntaxResult.getError ( ) ) != ( org.ovirt.engine.core.searchbackend.SyntaxError.NO_ERROR ) ) { return false ; } for ( org.ovirt.engine.core.searchbackend.SyntaxObject syntaxObject : syntaxResult ) { if ( ( syntaxObject.getType ( ) ) == ( org.ovirt.engine.core.searchbackend.SyntaxObjectType.SORTBY ) ) { return false ; } } return true ; }
Source:
protected void executeCommand ( ) { getMacPoolDao ( ) . update ( getMacPool ( ) ) ; org.ovirt.engine.core.bll.network.macpoolmanager.MacPoolPerDc.getInstance ( ) . modifyPool ( getMacPool ( ) ) ; setSucceeded ( true ) ; getReturnValue ( ) . setActionReturnValue ( getMacPoolId ( ) ) ; }

Target:
protected boolean canDoAction ( ) { if ( ! ( super . canDoAction ( ) ) ) { return false ; } oldMacPool = getMacPoolDao ( ) . get ( getMacPoolId ( ) ) ; return ( ( validate ( new org.ovirt.engine.core.bll.MacPoolValidator ( oldMacPool ) . macPoolExists ( ) ) ) && ( validate ( new org.ovirt.engine.core.bll.MacPoolValidator ( getMacPoolEntity ( ) ) . hasUniqueName ( ) ) ) ) && ( validate ( org.ovirt.engine.core.bll.UpdateMacPoolCommand.validateDefaultFlagIsNotChanged ( oldMacPool , getMacPoolEntity ( ) ) ) ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VdsKdumpStatus other = ( ( org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ) ( obj ) ) ; return ( ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( vdsId , other.getVdsId ( ) ) ) && ( ( status ) == ( other.getStatus ( ) ) ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( address , other.getAddress ( ) ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ) ) { return false ; } org.ovirt.engine.core.common.businessentities.VdsKdumpStatus other = ( ( org.ovirt.engine.core.common.businessentities.VdsKdumpStatus ) ( obj ) ) ; return ( ( java.util.Objects.equals ( vdsId , other.getVdsId ( ) ) ) && ( ( status ) == ( other.getStatus ( ) ) ) ) && ( java.util.Objects.equals ( address , other.getAddress ( ) ) ) ; }
Source:
public java.lang.Object runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( map , map.getstatus ( ) ) ; map.setstatus ( StorageDomainStatus.Maintenance ) ; getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , map.getstatus ( ) ) ; if ( ( getStorageDomain ( ) . getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) { CalcStoragePoolStatusByDomainsStatus ( ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( map , map.getstatus ( ) ) ; map.setstatus ( StorageDomainStatus.Maintenance ) ; getStoragePoolIsoMapDAO ( ) . updateStatus ( map.getId ( ) , map.getstatus ( ) ) ; if ( ( getStorageDomain ( ) . getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.Master ) ) { calcStoragePoolStatusByDomainsStatus ( ) ; } getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public void init ( ) { initState ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getRedirectServletReportsPage ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { setReportBaseUrl ( ( ( java.lang.String ) ( returnValue ) ) ) ; } } ) ) ; parseReportsXML ( ) ; }

Target:
public void init ( ) { initState ( ) ; setReportBaseUrl ( org.ovirt.engine.ui.uicommonweb.ReportInit.buildUrl ( org.ovirt.engine.ui.uicommonweb.ReportInit.REDIRECT_SERVICE ) ) ; parseReportsXML ( ) ; }
Source:
public void validateVmShareableDisk ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.storage.lsm.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED ) ; }

Target:
public void validateVmShareableDisk ( ) { org.ovirt.engine.core.common.businessentities.StorageDomain srcStorageDomain = initStorageDomain ( srcStorageId ) ; srcStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.StorageDomain dstStorageDomain = initStorageDomain ( dstStorageId ) ; dstStorageDomain.setStatus ( StorageDomainStatus.Active ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage = initDiskImage ( diskImageGroupId , diskImageId ) ; diskImage.setShareable ( true ) ; initVm ( VMStatus.Up , org.ovirt.engine.core.compat.Guid.newGuid ( ) , diskImageGroupId ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_SHAREABLE_DISK_NOT_SUPPORTED ) ; }
Source:
public void canDoActionFailsWithInvalidBricks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > paramBricks1 = getInvalidNoOfBricks ( volumeWithRemoveBricksTask ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.StopRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTask , paramBricks1 ) ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > paramBricks2 = getInvalidBricks ( volumeWithRemoveBricksTask ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.StopRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTask , paramBricks2 ) ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.canDoAction ( ) ) ; }

Target:
public void validateFailsWithInvalidBricks ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > paramBricks1 = getInvalidNoOfBricks ( volumeWithRemoveBricksTask ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.StopRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTask , paramBricks1 ) ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > paramBricks2 = getInvalidBricks ( volumeWithRemoveBricksTask ) ; cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.StopRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTask , paramBricks2 ) ) ) ; prepareMocks ( cmd ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
public void testValidName ( ) { prepareVmToPassCanDoAction ( ) ; junit.framework.Assert.assertTrue ( "canDoAction should have passed." , command.canDoAction ( ) ) ; }

Target:
public void testValidName ( ) { prepareVmToPassCanDoAction ( ) ; boolean c = command.canDoAction ( ) ; java.lang.System.out.println ( command.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; java.lang.System.out.println ( command.getParameters ( ) . getVm ( ) . getOs ( ) ) ; junit.framework.Assert.assertTrue ( "canDoAction should have passed." , c ) ; }
Source:
private void mockNullVm ( ) { org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; mockGetForDisk ( null ) ; mockGetVmsListForDisk ( null ) ; org.mockito.Mockito.when ( vmDAO.get ( command.getParameters ( ) . getVmId ( ) ) ) . thenReturn ( null ) ; }

Target:
public void canDoActionMakeDiskBootableOnOtherVmFail ( ) { canDoActionMakeDiskBootableOnOtherVm ( true ) ; }
Source:
public void setup ( ) { executor = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.pm.HostFenceActionExecutor ( fencedHost , new org.ovirt.engine.core.common.businessentities.FencingPolicy ( ) ) ) ; org.mockito.Mockito.doReturn ( agentExecutor1 ) . doReturn ( agentExecutor2 ) . when ( executor ) . createFenceActionExecutor ( org.mockito.ArgumentMatchers.any ( ) ) ; }

Target:
public void setup ( ) { org.mockito.Mockito.when ( dbFacade.getFenceAgentDao ( ) ) . thenReturn ( fenceAgentDao ) ; org.mockito.Mockito.when ( fencedHost.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.pm.HostFenceActionExecutorTest.FENCECD_HOST_ID ) ; executor = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.pm.HostFenceActionExecutor ( fencedHost , new org.ovirt.engine.core.common.businessentities.FencingPolicy ( ) ) ) ; org.mockito.Mockito.doReturn ( dbFacade ) . when ( executor ) . getDbFacade ( ) ; org.mockito.Mockito.doReturn ( agentExecutor1 ) . doReturn ( agentExecutor2 ) . when ( executor ) . createFenceActionExecutor ( org.mockito.ArgumentMatchers.any ( ) ) ; }
Source:
public static java.io.File makeFileFromSanePath ( java.lang.String path , java.io.File base ) { java.io.File file = null ; if ( path == null ) { file = base ; } else if ( ! ( org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( path ) ) ) { org.ovirt.engine.core.utils.servlet.ServletUtils.log.error ( ( ( "The path \"" + path ) + "\" is not sane, will return null." ) ) ; } else { file = new java.io.File ( base , path ) ; } return file ; }

Target:
public static boolean isSane ( java.lang.String path ) { final int length = path.length ( ) ; if ( length > ( org.ovirt.engine.core.utils.servlet.ServletUtils.PATH_MAX ) ) { org.ovirt.engine.core.utils.servlet.ServletUtils.log.error ( "The path '{}' is characters long, which is longer than the maximum allowed {}." , path , length , org.ovirt.engine.core.utils.servlet.ServletUtils.PATH_MAX ) ; return false ; } if ( ( ( path.contains ( ".." ) ) || ( path.contains ( "//" ) ) ) || ( path.contains ( "./" ) ) ) { org.ovirt.engine.core.utils.servlet.ServletUtils.log.error ( "The path contains potentially dangerous directory navigation sequences." ) ; return false ; } return true ; }
Source:
private static < T extends org.ovirt.engine.core.common.action.VmManagementParametersBase > void initCommandMethods ( org.ovirt.engine.core.bll.AddVmCommand < T > cmd ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) . when ( cmd ) . getStoragePoolId ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . canAddVm ( org.mockito.Matchers.anyListOf ( java.lang.String.class ) , org.mockito.Matchers.anyString ( ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anyInt ( ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_POOL_ID ) . when ( cmd ) . getStoragePoolId ( ) ; }

Target:
private static < T extends org.ovirt.engine.core.common.action.VmManagementParametersBase > void initCommandMethods ( org.ovirt.engine.core.bll.AddVmCommand < T > cmd ) { org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStoragePoolId ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( cmd ) . canAddVm ( org.mockito.Matchers.anyListOf ( java.lang.String.class ) , org.mockito.Matchers.anyString ( ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.anyInt ( ) ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_POOL_ID ) . when ( cmd ) . getStoragePoolId ( ) ; }
Source:
public void setUnlimited ( boolean unlimited ) { if ( unlimited ) { percentageBarA.setStyleName ( style.percentageBarUnlimited ( ) ) ; percentageLabelA.setText ( "Unlimited" ) ; percentageLabelA.setTitle ( "Unlimited" ) ; } else { percentageBarA.setStyleName ( style.percentageBarA ( ) ) ; } percentageBarB.setVisible ( ( ! unlimited ) ) ; }

Target:
public void setUnlimited ( ) { percentageBarA.setStyleName ( style.percentageBarUnlimited ( ) ) ; percentageLabelA.setStyleName ( style.percentageLabel ( ) ) ; percentageLabelA.setText ( "Unlimited" ) ; percentageLabelA.setTitle ( "Unlimited" ) ; percentageBarB.setVisible ( false ) ; }
Source:
public void syncWithBackend ( ) { super . syncWithBackend ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getClusterList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { onGetClusterList ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Cluster > ) ( ReturnValue ) ) ) ; } } ) , getSelectedDc ( ) . getId ( ) ) ; }

Target:
public void syncWithBackend ( ) { super . syncWithBackend ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getClusterList ( new org.ovirt.engine.ui.uicommonweb.models.datacenters.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > clusters ) { onGetClusterList ( clusters ) ; } } ) , getSelectedDc ( ) . getId ( ) ) ; }
Source:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.api.model.Disk entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , entity ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.api.model.Disk entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( QueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , entity ) ; } }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { org.ovirt.engine.core.bll.storage.disk.cinder.ExtendCinderDiskCommand command = getCommand ( cmdId ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateImageStatus ( getDiskId ( command ) , ImageStatus.ILLEGAL ) ; log.error ( "Failed extending disk. ID: {}" , getDiskId ( command ) ) ; updateAuditLog ( command , AuditLogType.USER_EXTEND_DISK_SIZE_FAILURE , command.getNewDiskSizeInGB ( ) ) ; super . onFailed ( cmdId , childCmdIds ) ; }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { org.ovirt.engine.core.bll.storage.disk.cinder.ExtendCinderDiskCommand command = getCommand ( cmdId ) ; imagesHandler.updateImageStatus ( getDiskId ( command ) , ImageStatus.ILLEGAL ) ; log.error ( "Failed extending disk. ID: {}" , getDiskId ( command ) ) ; updateAuditLog ( command , AuditLogType.USER_EXTEND_DISK_SIZE_FAILURE , command.getNewDiskSizeInGB ( ) ) ; super . onFailed ( cmdId , childCmdIds ) ; }
Source:
protected boolean checkDomainCanBeAttached ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { return ( ( ( ( checkStorageDomainType ( storageDomain ) ) && ( isStorageDomainFormatCorrectForPool ( storageDomain , org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ) ) ) && ( checkStorageDomainSharedStatusNotLocked ( storageDomain ) ) ) && ( ( ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) || ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) || ( isStorageDomainNotInPool ( storageDomain ) ) ) ) && ( isStorageDomainTypeCorrect ( storageDomain ) ) ; }

Target:
protected boolean isStorageDomainCompatibleWithDC ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { org.ovirt.engine.core.bll.storage.StoragePoolValidator spv = new org.ovirt.engine.core.bll.storage.StoragePoolValidator ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ) ; if ( ( storageDomain.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) { org.ovirt.engine.core.bll.ValidationResult result = spv.isGlusterSupportedInDC ( ) ; return validate ( result ) ; } if ( ( storageDomain.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.POSIXFS ) ) { org.ovirt.engine.core.bll.ValidationResult result = spv.isPosixSupportedInDC ( ) ; return validate ( result ) ; } return true ; }
Source:
public void guestLogoutTimeTreatmentAfterDestroy ( ) { if ( ( ( getguest_last_login_time ( ) ) != null ) && ( ( ( getguest_last_logout_time ( ) ) == null ) || ( ( getguest_last_login_time ( ) . compareTo ( getguest_last_logout_time ( ) ) ) > 0 ) ) ) { setguest_last_logout_time ( new java.util.Date ( ) ) ; } }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > getInterfaces ( ) { return vmStatic.getInterfaces ( ) ; }
Source:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public static void GetAllProviders ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedLabels ( java.lang.String ... removedLabels ) { if ( emptyParameters ( removedLabels ) ) { return this ; } if ( ( parameters.getRemovedLabels ( ) ) == null ) { parameters.setRemovedLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; } parameters.getRemovedLabels ( ) . addAll ( java.util.Arrays.asList ( removedLabels ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addRemovedLabels ( java.lang.String ... removedLabels ) { if ( nullParameters ( removedLabels ) ) { return this ; } if ( ( parameters.getRemovedLabels ( ) ) == null ) { parameters.setRemovedLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; } parameters.getRemovedLabels ( ) . addAll ( java.util.Arrays.asList ( removedLabels ) ) ; return this ; }
Source:
public static java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getGuidListFromString ( java.lang.String str ) { return org.ovirt.engine.core.utils.GuidUtils.getGuidListFromStringArray ( java.util.Arrays.asList ( org.apache.commons.lang.StringUtils.split ( java.util.Objects.toString ( str , StringUtils.EMPTY ) , org.ovirt.engine.core.utils.GuidUtils.SEPARATOR ) ) ) ; }

Target:
public static java.util.ArrayList < org.ovirt.engine.core.compat.Guid > getGuidListFromString ( java.lang.String str ) { return java.util.Arrays.stream ( org.apache.commons.lang.StringUtils.split ( java.util.Objects.toString ( str , StringUtils.EMPTY ) , org.ovirt.engine.core.utils.GuidUtils.SEPARATOR ) ) . map ( Guid :: createGuidFromStringDefaultEmpty ) . collect ( java.util.stream.Collectors.toCollection ( java.util.ArrayList < org.ovirt.engine.core.compat.Guid > :: new ) ) ; }
Source:
public void testExistingDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { setSdDiscardFunctionality ( true , false ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; junit.framework.Assert.assertFalse ( discardHelper.isExistingDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsNotPreservedSdDiscardSupportBreaks ( ) { setSdDiscardSupport ( true , false ) ; createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; junit.framework.Assert.assertFalse ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 0L , true ) , createLunWithDiscardFunctionality ( 2048L , false ) ) , storageDomain ) ) ; }
Source:
protected void performLogin ( T loginModel ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser loggedUser = loginModel.getLoggedUser ( ) ; java.lang.String loginPassword = loginModel.getPassword ( ) . getEntity ( ) ; beforeLogin ( loginModel ) ; frontend.initLoggedInUser ( loggedUser , loginPassword ) ; user.onUserLogin ( loggedUser ) ; loginModel.getPassword ( ) . setEntity ( null ) ; }

Target:
protected void performLogin ( T loginModel ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser loggedUser = loginModel.getLoggedUser ( ) ; beforeLogin ( ) ; frontend.initLoggedInUser ( loggedUser ) ; user.login ( loggedUser ) ; afterLogin ( ) ; performPlaceTransition ( ) ; }
Source:
protected void endWithFailure ( ) { if ( ! ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . isImportEntity ( ) ) ) { org.ovirt.engine.core.bll.CopyImageGroupCommand.unLockImage ( ) ; } if ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getAddImageDomainMapping ( ) ) { org.ovirt.engine.core.bll.CopyImageGroupCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; } revertTasks ( ) ; org.ovirt.engine.core.bll.CopyImageGroupCommand.setSucceeded ( true ) ; }

Target:
protected void endWithFailure ( ) { if ( ! ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . isImportEntity ( ) ) ) { org.ovirt.engine.core.bll.CopyImageGroupCommand.unLockImage ( ) ; } if ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getAddImageDomainMapping ( ) ) { org.ovirt.engine.core.bll.CopyImageGroupCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMapId ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; } revertTasks ( ) ; org.ovirt.engine.core.bll.CopyImageGroupCommand.setSucceeded ( true ) ; }
Source:
private void mockExecutor ( org.ovirt.engine.core.common.businessentities.FenceAgent agent , boolean success ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue ( ) ; returnValue.setSucceeded ( success ) ; returnValue.setFenceAgentUsed ( agent ) ; org.mockito.Mockito.when ( executor.fence ( org.mockito.Matchers.eq ( FenceActionType.Start ) , org.mockito.Matchers.eq ( agent ) ) ) . thenReturn ( returnValue ) ; }

Target:
private void mockExecutor ( org.ovirt.engine.core.common.businessentities.FenceAgent agent , boolean success ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue returnValue = new org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue ( ) ; returnValue.setSucceeded ( success ) ; returnValue.setFenceAgentUsed ( agent ) ; org.mockito.Mockito.when ( executor.fence ( org.mockito.Matchers.eq ( FenceActionType.START ) , org.mockito.Matchers.eq ( agent ) ) ) . thenReturn ( returnValue ) ; }
Source:
public void getGlusterSwiftServerServices ( 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 != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterServerServicesByClusterId , new org.ovirt.engine.core.common.queries.gluster.GlusterServiceQueryParameters ( clusterId , org.ovirt.engine.core.common.businessentities.gluster.ServiceType.GLUSTER_SWIFT ) , aQuery ) ; }

Target:
public void getGlusterHooks ( 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 != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( null ) ; try { org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO ) ; resource.update ( cdrom ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testUpdateNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( null ) ; try { org.ovirt.engine.api.model.Cdrom cdrom = getCdrom ( org.ovirt.engine.api.restapi.resource.BackendVmCdromResourceTest.A_ISO ) ; resource.update ( cdrom ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
protected void ProceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateVMVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case Done : return ; default : org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase outEx = createDefaultConcreteException ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateVMVDSCommand.getReturnStatus ( ) . mMessage ) ; initializeVdsError ( returnStatus ) ; outEx.setVdsError ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateVMVDSCommand.getVDSReturnValue ( ) . getVdsError ( ) ) ; throw outEx ; } }

Target:
protected void proceedProxyReturnValue ( ) { org.ovirt.engine.core.common.errors.VdcBllErrors returnStatus = GetReturnValueFromStatus ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateVMVDSCommand.getReturnStatus ( ) ) ; switch ( returnStatus ) { case Done : return ; default : org.ovirt.engine.core.vdsbroker.vdsbroker.VDSExceptionBase outEx = createDefaultConcreteException ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateVMVDSCommand.getReturnStatus ( ) . mMessage ) ; initializeVdsError ( returnStatus ) ; outEx.setVdsError ( org.ovirt.engine.core.vdsbroker.irsbroker.UpdateVMVDSCommand.getVDSReturnValue ( ) . getVdsError ( ) ) ; throw outEx ; } }
Source:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getVmsFromExternalServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId , org.ovirt.engine.core.compat.Guid vdsId , java.lang.String url , java.lang.String username , java.lang.String password ) { 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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsFromExternalProvider , new org.ovirt.engine.core.common.queries.GetVmsFromExternalProviderQueryParameters ( url , username , password , vdsId , dataCenterId ) , aQuery ) ; }
Source:
public static < T > java.util.ArrayList < T > Union ( java.util.ArrayList < java.util.ArrayList < T > > lists ) { java.util.HashSet < T > set = new java.util.HashSet < T > ( ) ; for ( java.util.ArrayList < T > list : lists ) { set.addAll ( list ) ; } return new java.util.ArrayList < T > ( set ) ; }

Target:
public static < T > java.util.ArrayList < T > union ( java.util.ArrayList < java.util.ArrayList < T > > lists ) { java.util.HashSet < T > set = new java.util.HashSet < T > ( ) ; for ( java.util.ArrayList < T > list : lists ) { set.addAll ( list ) ; } return new java.util.ArrayList < T > ( set ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterGeoRepMountBrokerSetup ( java.lang.String remoteVolumeName , java.lang.String remoteUserName , java.lang.String remoteGroupName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepMountBrokerSetup" ) . withParameter ( "remoteVolumeName" , remoteVolumeName ) . withOptionalParameter ( "remoteUserName" , remoteUserName ) . withOptionalParameter ( "remoteGroupName" , remoteGroupName ) . 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 glusterGeoRepMountBrokerSetup ( java.lang.String remoteVolumeName , java.lang.String userName , java.lang.String remoteGroupName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepMountBrokerSetup" ) . withParameter ( "remoteVolumeName" , remoteVolumeName ) . withOptionalParameter ( "remoteUserName" , userName ) . withOptionalParameter ( "remoteGroupName" , remoteGroupName ) . 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 org.ovirt.engine.core.common.businessentities.VdsNetworkInterface newBond ( java.lang.String name ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = new org.ovirt.engine.core.common.businessentities.VdsNetworkInterface ( ) ; bond.setBonded ( java.lang.Boolean.TRUE ) ; bond.setBondOptions ( "options" ) ; bond.setName ( name ) ; return bond ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > createNics ( java.lang.String bondName , int count ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ifaces = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( count ) ; for ( int i = 0 ; i < count ; i ++ ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface nic = createNic ( ( "eth" + i ) , null ) ; if ( bondName != null ) { nic = enslaveOrReleaseNIC ( nic , bondName ) ; } ifaces.add ( nic ) ; } return ifaces ; }
Source:
public void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { 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.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }

Target:
public void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public java.lang.String render ( T size ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit , java.lang.Double > sizePair = org.ovirt.engine.core.common.utils.SizeConverter.autoConvert ( size.longValue ( ) , SizeUnit.BYTES ) ; return org.ovirt.engine.ui.webadmin.widget.renderer.RebalanceFileSizeRenderer.messages.sizeUnitString ( formatSize ( sizePair.getSecond ( ) ) , sizePair.getFirst ( ) ) ; }

Target:
public java.lang.String render ( T size ) { org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.utils.SizeConverter.SizeUnit , java.lang.Double > sizePair = org.ovirt.engine.core.common.utils.SizeConverter.autoConvert ( size.longValue ( ) , SizeUnit.BYTES ) ; return org.ovirt.engine.ui.webadmin.widget.renderer.RebalanceFileSizeRenderer.messages.sizeUnitString ( formatSize ( sizePair.getSecond ( ) ) , org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . translate ( sizePair.getFirst ( ) ) ) ; }
Source:
protected void validateKeyValuePair ( java.lang.String key , java.lang.String value , org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result ) { super . validateKeyValuePair ( key , value , result ) ; org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation intValidation = new org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation ( ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult intResult = intValidation.validate ( value ) ; if ( ! ( intResult.getSuccess ( ) ) ) { result.getReasons ( ) . addAll ( intResult.getReasons ( ) ) ; result.setSuccess ( false ) ; } }

Target:
protected void validateKeyValuePair ( java.lang.String key , java.lang.String value , org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result ) { super . validateKeyValuePair ( key , value , result ) ; if ( org.ovirt.engine.ui.uicommonweb.models.hosts.FenceAgentModel.PM_PORT_KEY.equals ( key ) ) { org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation intValidation = new org.ovirt.engine.ui.uicommonweb.validation.IntegerValidation ( ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult intResult = intValidation.validate ( value ) ; if ( ! ( intResult.getSuccess ( ) ) ) { result.getReasons ( ) . addAll ( intResult.getReasons ( ) ) ; result.setSuccess ( false ) ; } } }
Source:
public void updateAll ( java.util.Collection < T > entities ) { updateAll ( org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) , entities ) ; for ( T entity : entities ) { org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getCallsHandler ( ) . executeModification ( org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) , org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.createFullParametersMapper ( entity ) ) ; } }

Target:
public void updateAll ( java.lang.String procedureName , java.util.Collection < T > entities ) { for ( T entity : entities ) { update ( entity , ( procedureName == null ? org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) : procedureName ) ) ; } }