auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.compat.Guid removeConfImage ( java.util.List < org.ovirt.engine.core.compat.Guid > guids ) { org.ovirt.engine.core.compat.Guid taskId2 = enclosingCommand.persistAsyncTaskPlaceHolder ( VmCommand.DELETE_SECONDARY_IMAGES_TASK_KEY ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsRetValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.DeleteImageGroup , buildDeleteMemoryConfParams ( guids ) ) ; if ( ! ( vdsRetValue.getSucceeded ( ) ) ) { return null ; } org.ovirt.engine.core.compat.Guid guid2 = enclosingCommand.createTask ( taskId2 , vdsRetValue.getCreationInfo ( ) , enclosingCommand.getActionType ( ) ) ; enclosingCommand.getTaskIdList ( ) . add ( guid2 ) ; return guid2 ; }

Target:
protected org.ovirt.engine.core.compat.Guid removeConfImage ( java.util.List < org.ovirt.engine.core.compat.Guid > guids ) { return removeImage ( VmCommand.DELETE_SECONDARY_IMAGES_TASK_KEY , buildDeleteMemoryConfParams ( guids ) ) ; }
Source:
public void insufficientDiskSpace ( ) { final int lotsOfSpace = 1073741824 ; final org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > c = setupDiskSpaceTest ( lotsOfSpace ) ; org.junit.Assert.assertFalse ( c.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( c.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
public void insufficientDiskSpace ( ) { final int lotsOfSpace = 1073741824 ; final org.ovirt.engine.core.bll.ImportVmCommand < org.ovirt.engine.core.common.action.ImportVmParameters > c = setupDiskSpaceTest ( lotsOfSpace ) ; org.junit.Assert.assertFalse ( c.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( c.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN.toString ( ) ) ) ; }
Source:
public void isConnWithSameDetailsExistSameConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection1 = newNFSConnection ; connections.add ( connection1 ) ; org.mockito.Mockito.when ( storageConnDao.getAllForStorage ( newNFSConnection.getconnection ( ) ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newNFSConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }

Target:
public void isConnWithSameDetailsExistSameConnection ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.StorageServerConnections connection1 = newNFSConnection ; connections.add ( connection1 ) ; org.mockito.Mockito.when ( storageConnDao.getAllForStorage ( newNFSConnection.getConnection ( ) ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newNFSConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > getCommandsWithCallBackEnabled ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > cmdEntities = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ; for ( org.ovirt.engine.core.compat.Guid cmdId : commandsCache.keySet ( ) ) { cmdEntity = commandsCache.get ( cmdId ) ; if ( commandsCache.get ( cmdId ) . isCallBackEnabled ( ) ) { cmdEntities.add ( cmdEntity ) ; } } return cmdEntities ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > getCommandsWithCallBackEnabled ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.CommandEntity > cmdEntities = new java.util.ArrayList < > ( ) ; org.ovirt.engine.core.common.businessentities.CommandEntity cmdEntity ; for ( org.ovirt.engine.core.compat.Guid cmdId : commandsCache.keySet ( ) ) { cmdEntity = commandsCache.get ( cmdId ) ; if ( commandsCache.get ( cmdId ) . isCallbackEnabled ( ) ) { cmdEntities.add ( cmdEntity ) ; } } return cmdEntities ; }
Source:
private void movePoolToProblematicInDB ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolStatusChange ( storagePool.getId ( ) , StoragePoolStatus.NonResponsive , AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC , VdcBllErrors.ENGINE ) ; storagePool.setSpmVdsId ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; }

Target:
private void movePoolToProblematicInDB ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { updateStoragePoolStatus ( storagePool.getId ( ) , StoragePoolStatus.NonResponsive , AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC , VdcBllErrors.ENGINE ) ; storagePool.setSpmVdsId ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; }
Source:
private void buildSharedLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsDiskPluggedTo ) { sharedLockMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsDiskPluggedTo ) { sharedLockMap.put ( vm.getId ( ) . toString ( ) , LockMessagesMatchUtil.VM ) ; } }

Target:
private void buildSharedLockMap ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsDiskPluggedTo ) { sharedLockMap = new java.util.HashMap < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsDiskPluggedTo ) { sharedLockMap.put ( vm.getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } }
Source:
private void removePoolIfNeeded ( ) { if ( ! ( isPoolRemovalEnabled ( ) ) ) { return ; } org.ovirt.engine.core.compat.Guid poolId = getPoolId ( ) ; if ( poolId == null ) { return ; } boolean allVmsRemoved = ( vmPoolDao.getVmPoolsMapByVmPoolId ( poolId ) . size ( ) ) == 0 ; if ( ! allVmsRemoved ) { return ; } org.ovirt.engine.core.common.action.VmPoolParametersBase removePoolParam = new org.ovirt.engine.core.common.action.VmPoolParametersBase ( poolId ) ; removePoolParam.setSessionId ( getSessionId ( ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.RemoveVmPool , removePoolParam , commandContext ) ; }

Target:
private void removePoolIfNeeded ( ) { if ( ! ( isPoolRemovalEnabled ( ) ) ) { return ; } org.ovirt.engine.core.compat.Guid poolId = getPoolId ( ) ; if ( poolId == null ) { return ; } boolean allVmsRemoved = ( vmPoolDao.getVmPoolsMapByVmPoolId ( poolId ) . size ( ) ) == 0 ; if ( ! allVmsRemoved ) { return ; } org.ovirt.engine.core.common.action.VmPoolParametersBase removePoolParam = new org.ovirt.engine.core.common.action.VmPoolParametersBase ( poolId ) ; removePoolParam.setSessionId ( getSessionId ( ) ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( ActionType.RemoveVmPool , removePoolParam , commandContext ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface object ) { java.util.ArrayList < java.lang.String > networkList = new java.util.ArrayList < java.lang.String > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.Network network : importModel.getNetworks ( ) ) { networkList.add ( network.getName ( ) ) ; } ( ( org.ovirt.engine.ui.webadmin.widget.table.cell.CustomSelectionCell ) ( getCell ( ) ) ) . setOptions ( networkList ) ; return networkList.isEmpty ( ) ? "" : networkList.get ( 0 ) ; }

Target:
public void update ( int index , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface , java.lang.String value ) { importModel.getNetworkImportData ( iface ) . setSelectedNetworkName ( value ) ; nicTable.asEditor ( ) . edit ( importModel.getImportNetworkInterfaceListModel ( ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vds.setVdsName ( "gfs1" ) ; vds.setVdsGroupId ( CLUSTER_ID ) ; vds.setStatus ( status ) ; return vds ; }

Target:
private org.ovirt.engine.core.common.businessentities.VDS getVds ( org.ovirt.engine.core.common.businessentities.VDSStatus status ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vds.setVdsName ( "gfs1" ) ; vds.setClusterId ( CLUSTER_ID ) ; vds.setStatus ( status ) ; return vds ; }
Source:
private static void addIpsByVersion ( org.ovirt.engine.api.model.IPs ips , java.util.List < java.lang.String > entityIps , org.ovirt.engine.api.restapi.types.IpVersion ipVersion ) { if ( entityIps != null ) { for ( java.lang.String entityIp : entityIps ) { org.ovirt.engine.api.model.IP ip = new org.ovirt.engine.api.model.IP ( ) ; ip.setAddress ( entityIp ) ; ip.setVersion ( ipVersion.value ( ) ) ; ips.getIPs ( ) . add ( ip ) ; } } }

Target:
private static void addIpsByVersion ( org.ovirt.engine.api.model.Ips ips , java.util.List < java.lang.String > entityIps , org.ovirt.engine.api.restapi.types.IpVersion ipVersion ) { if ( entityIps != null ) { for ( java.lang.String entityIp : entityIps ) { org.ovirt.engine.api.model.Ip ip = new org.ovirt.engine.api.model.Ip ( ) ; ip.setAddress ( entityIp ) ; ip.setVersion ( ipVersion.value ( ) ) ; ips.getIps ( ) . add ( ip ) ; } } }
Source:
public void canDoActionChecksIfHotPlugDiskSnapshotIsSupported ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeVirtIODisk ( ) ; initStorageDomain ( ) ; command.getParameters ( ) . setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command.canDoAction ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.times ( 1 ) ) . isHotPlugDiskSnapshotSupported ( ) ; }

Target:
public void validateChecksIfHotPlugDiskSnapshotIsSupported ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeVirtIODisk ( ) ; initStorageDomain ( ) ; command.getParameters ( ) . setSnapshotId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command.validate ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.times ( 1 ) ) . isHotPlugDiskSnapshotSupported ( ) ; }
Source:
private void assertGetLunsThatBreakDiscardFunctionalityContainsExpectedLuns ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.LUNs > expectedLunsThatBreakDiscardFunctionality ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsThatBreakDiscardFunctionality = discardHelper.getLunsThatBreakDiscardFunctionality ( luns , storageDomain.getId ( ) ) ; junit.framework.Assert.assertTrue ( org.apache.commons.collections.CollectionUtils.isEqualCollection ( lunsThatBreakDiscardFunctionality , expectedLunsThatBreakDiscardFunctionality ) ) ; }

Target:
private void assertGetLunsThatBreakPassDiscardFunctionalityContainsExpectedLuns ( java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.LUNs > luns , java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.LUNs > expectedLunsThatBreakPassDiscardFunctionality ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.storage.LUNs > lunsThatBreakPassDiscardFunctionality = discardHelper.getLunsThatBreakPassDiscardSupport ( luns , storageDomain.getId ( ) ) ; junit.framework.Assert.assertTrue ( org.apache.commons.collections.CollectionUtils.isEqualCollection ( lunsThatBreakPassDiscardFunctionality , expectedLunsThatBreakPassDiscardFunctionality ) ) ; }
Source:
public void canDoActionSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( getStorageDevice ( "sda" , null ) ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; }

Target:
public void validateSucceeds ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CreateBrickCommand ( new org.ovirt.engine.core.common.action.gluster.CreateBrickParameters ( HOST_ID , "brick1" , "/gluster-bricks/brick1" , org.ovirt.engine.core.common.businessentities.RaidType.RAID0 , null , null , java.util.Arrays.asList ( getStorageDevice ( "sda" , null ) ) ) ) ) ; prepareMocks ( cmd , VDSStatus.Up ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; }
Source:
public void virtIoRngNotSupported ( ) { org.mockito.Mockito.when ( cluster.getRequiredRngSources ( ) ) . thenReturn ( java.util.Collections.singleton ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source.class ) ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . virtIoRngSupportedInCluster ( ) ; org.junit.Assert.assertThat ( validator.virtIoRngSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_RNG_SOURCE_NOT_SUPPORTED ) ) ; }

Target:
public void virtIoRngNotSupported ( ) { org.mockito.Mockito.when ( cluster.getRequiredRngSources ( ) ) . thenReturn ( java.util.Collections.singleton ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.VmRngDevice.Source.class ) ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . virtIoRngSupportedInCluster ( ) ; org.junit.Assert.assertThat ( validator.virtIoRngSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_RNG_SOURCE_NOT_SUPPORTED ) ) ; }
Source:
private org.ovirt.engine.core.dao.DbUserDAO initDataForClearTest ( java.lang.String key ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.DbUserDAO.class ) ; org.mockito.Mockito.doReturn ( dbUserDAOMcok ) . when ( container ) . getDbUserDAO ( ) ; container.SetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , key , org.mockito.Mockito.mock ( org.ovirt.engine.core.common.users.VdcUser.class ) ) ; return dbUserDAOMcok ; }

Target:
private org.ovirt.engine.core.dao.DbUserDAO initDataForClearTest ( java.lang.String key ) { org.ovirt.engine.core.dao.DbUserDAO dbUserDAOMcok = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.DbUserDAO.class ) ; org.mockito.Mockito.doReturn ( dbUserDAOMcok ) . when ( container ) . getDbUserDAO ( ) ; container.SetData ( org.ovirt.engine.core.bll.session.SessionDataContainerTest.TEST_SESSION_ID , key , org.mockito.Mockito.mock ( org.ovirt.engine.core.common.interfaces.IVdcUser.class ) ) ; return dbUserDAOMcok ; }
Source:
public java.lang.Void runInTransaction ( ) { addVmStatic ( ) ; addVmDynamic ( ) ; addVmNetwork ( ) ; addVmStatistics ( ) ; addActiveSnapshot ( ) ; addVmPermission ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { addVmStatic ( ) ; addVmDynamic ( ) ; addVmNetwork ( ) ; addVmNumaNodes ( ) ; addVmStatistics ( ) ; addActiveSnapshot ( ) ; addVmPermission ( ) ; addVmInit ( ) ; addVmRngDevice ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
protected void initCommand ( ) { org.mockito.Mockito.doNothing ( ) . when ( transferImageCommand ) . createImage ( ) ; org.mockito.Mockito.doNothing ( ) . when ( transferImageCommand ) . persistCommand ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.mockito.Mockito.doNothing ( ) . when ( transferImageCommand ) . lockImage ( ) ; org.mockito.Mockito.doNothing ( ) . when ( transferImageCommand ) . startImageTransferSession ( ) ; }

Target:
public void setUp ( ) { org.mockito.Mockito.doNothing ( ) . when ( transferImageCommand ) . createImage ( ) ; org.mockito.Mockito.doNothing ( ) . when ( transferImageCommand ) . persistCommand ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.anyBoolean ( ) ) ; org.mockito.Mockito.doNothing ( ) . when ( transferImageCommand ) . lockImage ( ) ; org.mockito.Mockito.doNothing ( ) . when ( transferImageCommand ) . startImageTransferSession ( ) ; }
Source:
public void testGetLunsThatBreakDiscardFunctionalityPassDiscardBreaks ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lunThatBreaksDiscardSupport = createLunWithDiscardFunctionality ( 0L , false ) ; assertGetLunsThatBreakDiscardFunctionalityContainsExpectedLuns ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , false ) , lunThatBreaksDiscardSupport ) , java.util.Collections.singletonList ( lunThatBreaksDiscardSupport ) ) ; }

Target:
public void testGetLunsThatBreakPassDiscardFunctionalityPassDiscardBreaks ( ) { createVmDiskOnSd ( false , false ) ; createVmDiskOnSd ( false , true ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lunThatBreaksDiscardSupport = createLunWithDiscardFunctionality ( 0L , false ) ; assertGetLunsThatBreakPassDiscardFunctionalityContainsExpectedLuns ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , false ) , lunThatBreaksDiscardSupport ) , java.util.Collections.singletonList ( lunThatBreaksDiscardSupport ) ) ; }
Source:
private void removeOtherImageAndParents ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid lastParent ) { org.ovirt.engine.core.common.businessentities.DiskImage image = org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( imageId ) ; org.ovirt.engine.core.compat.Guid currentParent = image.getParentId ( ) ; removeSnapshot ( image ) ; while ( ! ( lastParent.equals ( currentParent ) ) ) { image = org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( currentParent ) ; currentParent = image.getParentId ( ) ; removeSnapshot ( image ) ; } }

Target:
private void removeOtherImageAndParents ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid lastParent ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( imageId ) ; org.ovirt.engine.core.compat.Guid currentParent = image.getParentId ( ) ; removeSnapshot ( image ) ; while ( ! ( lastParent.equals ( currentParent ) ) ) { image = org.ovirt.engine.core.bll.RestoreFromSnapshotCommand.getDiskImageDao ( ) . getSnapshotById ( currentParent ) ; currentParent = image.getParentId ( ) ; removeSnapshot ( image ) ; } }
Source:
public static void isVirtioScsiEnabledForVm ( 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 ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void isSoundcardEnabled ( 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 ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public static void GetExternalNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { 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.RunQuery ( VdcQueryType.GetAllExternalNetworksOnProvider , new org.ovirt.engine.core.common.queries.IdQueryParameters ( providerId ) , aQuery ) ; }

Target:
public static void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { 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.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
public void networkNotInVfsConfigNotValid ( ) { networkInVfsConfigCommonTest ( true ) ; org.junit.Assert.assertThat ( validator.networkNotInVfsConfig ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_ALREADY_IN_VFS_CONFIG , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) ) ; }

Target:
public void networkNotInVfsConfigNotValid ( ) { networkInVfsConfigCommonTest ( true ) ; org.hamcrest.MatcherAssert.assertThat ( validator.networkNotInVfsConfig ( org.ovirt.engine.core.bll.validator.VfsConfigValidatorTest.NETWORK_ID ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_ALREADY_IN_VFS_CONFIG , java.lang.String.format ( VfsConfigValidator.NIC_NAME_REPLACEMENT , nic.getName ( ) ) , java.lang.String.format ( VfsConfigValidator.NETWORK_NAME_REPLACEMENT , network.getName ( ) ) ) ) ; }
Source:
public void InitCdImage ( ) { updateUserCdImage ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getModel ( ) . getDataCenter ( ) . getSelectedItem ( ) ) ) . getId ( ) ) ; }

Target:
private void postInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.NGuid.Empty ) ) ) ) ; updateIsDisksAvailable ( ) ; }
Source:
public void canDoActionFailsOnNullDiskInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.COW ) ; image.setVolumeType ( VolumeType.Preallocated ) ; org.ovirt.engine.core.common.action.AddDiskParameters params = new org.ovirt.engine.core.common.action.AddDiskParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , image ) ; initializeCommand ( storageId , params ) ; org.junit.Assert.assertFalse ( command.validateInputs ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( "VALIDATION.DISK_INTERFACE.NOT_NULL" ) ) ; }

Target:
public void canDoActionFailsOnNullDiskInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.COW ) ; image.setVolumeType ( VolumeType.Preallocated ) ; org.ovirt.engine.core.common.action.AddDiskParameters params = new org.ovirt.engine.core.common.action.AddDiskParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , image ) ; initializeCommand ( storageId , params ) ; org.junit.Assert.assertFalse ( command.validateInputs ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( "VALIDATION_DISK_INTERFACE_NOT_NULL" ) ) ; }
Source:
public static org.ovirt.engine.core.bll.provider.storage.OpenStackVolumeProviderProxy getFromStorageDomainId ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomainStatic = getDbFacade ( ) . getStorageDomainStaticDao ( ) . get ( storageDomainId ) ; if ( storageDomainStatic != null ) { org.ovirt.engine.core.common.businessentities.Provider provider = getDbFacade ( ) . getProviderDao ( ) . get ( new org.ovirt.engine.core.compat.Guid ( storageDomainStatic.getStorage ( ) ) ) ; return org.ovirt.engine.core.bll.provider.ProviderProxyFactory.getInstance ( ) . create ( provider ) ; } return null ; }

Target:
public static org.ovirt.engine.core.bll.provider.storage.OpenStackVolumeProviderProxy getFromStorageDomainId ( org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic storageDomainStatic = getDbFacade ( ) . getStorageDomainStaticDao ( ) . get ( storageDomainId ) ; if ( storageDomainStatic != null ) { return org.ovirt.engine.core.bll.provider.storage.OpenStackVolumeProviderProxy.getProviderFromStorageDomainStatic ( storageDomainStatic ) ; } return null ; }
Source:
private void initInterface ( org.ovirt.engine.core.common.businessentities.network.VmNic iface ) { if ( ( iface.getId ( ) ) == null ) { iface.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; } fillMacAddressIfMissing ( iface ) ; iface.setVmTemplateId ( null ) ; iface.setVmId ( getVmId ( ) ) ; }

Target:
private java.lang.String getMemoryVolumeFromActiveSnapshotInExportDomain ( ) { org.ovirt.engine.core.common.businessentities.Snapshot activeSnapshot = getActiveSnapshot ( ) ; if ( activeSnapshot != null ) { return activeSnapshot.getMemoryVolume ( ) ; } return org.apache.commons.lang.StringUtils.EMPTY ; }
Source:
protected org.ovirt.engine.core.compat.Guid getTemplateId ( org.ovirt.engine.api.model.Template template ) { return template.isSetId ( ) ? asGuid ( template.getId ( ) ) : getTemplateByName ( template ) . getId ( ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VmTemplate lookupTemplate ( org.ovirt.engine.api.model.Template template , org.ovirt.engine.core.compat.Guid datacenterId ) { if ( template.isSetId ( ) ) { return getEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( asGuid ( template.getId ( ) ) ) , "GetVmTemplate" ) ; } else if ( template.isSetName ( ) ) { org.ovirt.engine.core.common.queries.GetVmTemplateParameters params = new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( template.getName ( ) ) ; params.setDataCenterId ( datacenterId ) ; return getEntity ( org.ovirt.engine.core.common.businessentities.VmTemplate.class , VdcQueryType.GetVmTemplate , params , "GetVmTemplate" ) ; } return null ; }
Source:
private < T > void assertSetEquals ( java.util.Collection < T > expected , java.util.Collection < T > actual ) { java.util.Set < T > expectedSet = new java.util.HashSet < > ( ) ; expectedSet.addAll ( expected ) ; java.util.Set < T > actualSet = new java.util.HashSet < > ( ) ; actualSet.addAll ( actual ) ; org.junit.Assert.assertEquals ( expectedSet , actualSet ) ; }

Target:
private < T > void assertSetEquals ( java.util.Collection < T > expected , java.util.Collection < T > actual ) { java.util.Set < T > expectedSet = new java.util.HashSet < > ( ) ; expectedSet.addAll ( expected ) ; java.util.Set < T > actualSet = new java.util.HashSet < > ( ) ; actualSet.addAll ( actual ) ; org.junit.jupiter.api.Assertions.assertEquals ( expectedSet , actualSet ) ; }
Source:
private void doInit ( org.ovirt.engineextensions.aaa.ldap.ExtMap input , org.ovirt.engineextensions.aaa.ldap.ExtMap output ) throws java.lang.Exception { try { ensureFramework ( input ) ; } catch ( java.lang.Exception e ) { org.ovirt.engineextensions.aaa.ldap.AuthnExtension.log.error ( "{} Cannot initialize LDAP framework, deferring initialization. Error: {}" , logPrefix , e.getMessage ( ) ) ; org.ovirt.engineextensions.aaa.ldap.AuthnExtension.log.debug ( "Exception" , e ) ; } }

Target:
private void ensureFramework ( org.ovirt.engineextensions.aaa.ldap.ExtMap input ) throws java.lang.Exception { if ( ! ( frameworkInitialized ) ) { synchronized ( this ) { if ( ! ( frameworkInitialized ) ) { try { framework.getGlobals ( ) . put ( ExtensionUtil.VARS_AUTHN_ENABLE , "1" ) ; framework.open ( ) ; frameworkInitialized = true ; } catch ( java.lang.Exception e ) { org.ovirt.engineextensions.aaa.ldap.AuthnExtension.log.warn ( "{} Cannot initialize LDAP framework, deferring initialization. Error: {}" , logPrefix , e.getMessage ( ) ) ; throw e ; } } } } }
Source:
public void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { 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.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "EntityId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }

Target:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( collection.remove ( GUIDS [ 0 ] . toString ( ) ) ) ; }
Source:
protected void onBind ( ) { super . onBind ( ) ; org.ovirt.engine.ui.common.widget.table.OrderedMultiSelectionModel < ? > tableSelectionModel = ( ( org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.getView ( ) . getTable ( ) ) != null ) ? org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.getView ( ) . getTable ( ) . getSelectionModel ( ) : null ; if ( tableSelectionModel != null ) { registerHandler ( tableSelectionModel.addSelectionChangeHandler ( new com.google.gwt.view.client.SelectionChangeEvent.Handler ( ) { @ java.lang.Override public void onSelectionChange ( com.google.gwt.view.client.SelectionChangeEvent event ) { updateDetailModelSelection ( ) ; } } ) ) ; } }

Target:
protected org.ovirt.engine.ui.common.widget.table.ActionTable < ? > getTable ( ) { return org.ovirt.engine.ui.common.presenter.AbstractSubTabPresenter.getView ( ) . getTable ( ) ; }
Source:
protected boolean canDetachDomain ( boolean isDestroyStoragePool , boolean isRemoveLast , boolean isInternal ) { return ( ( ( ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.checkStoragePool ( ) ) && ( CheckStorageDomain ( ) ) ) && ( checkStorageDomainStatus ( StorageDomainStatus.InActive , StorageDomainStatus.Maintenance ) ) ) && ( ( ( isMaster ( ) ) || isDestroyStoragePool ) || ( CheckMasterDomainIsUp ( ) ) ) ) && ( isNotLocalData ( isInternal ) ) ) && ( isDetachAllowed ( isRemoveLast ) ) ; }

Target:
protected boolean canDetachDomain ( boolean isDestroyStoragePool , boolean isRemoveLast , boolean isInternal ) { return ( ( ( ( ( org.ovirt.engine.core.bll.storage.StorageDomainCommandBase.checkStoragePool ( ) ) && ( checkStorageDomain ( ) ) ) && ( checkStorageDomainStatus ( StorageDomainStatus.InActive , StorageDomainStatus.Maintenance ) ) ) && ( ( ( isMaster ( ) ) || isDestroyStoragePool ) || ( checkMasterDomainIsUp ( ) ) ) ) && ( isNotLocalData ( isInternal ) ) ) && ( isDetachAllowed ( isRemoveLast ) ) ; }
Source:
public void testQueryWithoutHostId ( ) { org.ovirt.engine.core.common.queries.VdsIdParametersBase params = new org.ovirt.engine.core.common.queries.VdsIdParametersBase ( ) ; org.ovirt.engine.core.bll.GetoVirtISOsQuery < org.ovirt.engine.core.common.queries.VdsIdParametersBase > query = new org.ovirt.engine.core.bll.GetoVirtISOsQuery < org.ovirt.engine.core.common.queries.VdsIdParametersBase > ( params ) ; query.setInternalExecution ( true ) ; query.ExecuteCommand ( ) ; checkSucceeded ( query , true ) ; checkReturnValue ( query ) ; }

Target:
public void testPrefixChange ( ) { org.ovirt.engine.core.bll.GetoVirtISOsTest.mcr.mockConfigValue ( ConfigValues.OvirtIsoPrefix , "a different prefix" ) ; getQuery ( ) . setInternalExecution ( true ) ; getQuery ( ) . ExecuteCommand ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkSucceeded ( getQuery ( ) , true ) ; org.junit.Assert.assertTrue ( "Prefix was changed, no ISOs should be returned" , ( ( java.util.List < org.ovirt.engine.core.compat.RpmVersion > ) ( getQuery ( ) . getQueryReturnValue ( ) . getReturnValue ( ) ) ) . isEmpty ( ) ) ; }
Source:
public void versionSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.SupportedClusterLevels , java.util.Collections.singleton ( org.ovirt.engine.core.bll.validator.ClusterValidatorTest.SUPPORTED_VERSION ) ) ; org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.ClusterValidatorTest.SUPPORTED_VERSION ) ; org.junit.Assert.assertThat ( validator.versionSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void versionSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.ovirt.engine.core.compat.Version.getLast ( ) ) ; org.junit.Assert.assertThat ( validator.versionSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void executeVdsBrokerCommand ( ) { if ( getVds ( ) . getHighlyAvailableIsConfigured ( ) ) { status = getBroker ( ) . setHaMaintenanceMode ( getParameters ( ) . getMode ( ) . name ( ) , getParameters ( ) . isEnabled ( ) ) ; proceedProxyReturnValue ( ) ; } }

Target:
protected void executeVdsBrokerCommand ( ) { if ( getVds ( ) . getHighlyAvailableIsConfigured ( ) ) { try { status = getBroker ( ) . setHaMaintenanceMode ( getParameters ( ) . getMode ( ) . name ( ) , getParameters ( ) . isEnabled ( ) ) ; proceedProxyReturnValue ( ) ; } catch ( java.lang.RuntimeException e ) { setVdsRuntimeError ( e ) ; getVDSReturnValue ( ) . setExceptionString ( null ) ; } } }
Source:
public void testListCrashClientLocale ( ) { javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpDiskProfilesQueryExpectations ( t ) ; collection.setUriInfo ( uriInfo ) ; try { org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.getCollection ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } }

Target:
public void testListFailure ( ) { setUpDiskProfilesQueryExpectations ( org.ovirt.engine.api.restapi.resource.FAILURE ) ; javax.ws.rs.core.UriInfo uriInfo = org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.setUpUriExpectations ( null ) ; collection.setUriInfo ( uriInfo ) ; verifyFault ( org.ovirt.engine.api.restapi.resource.AbstractBackendDiskProfilesResourceTest.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) ) ; }
Source:
private boolean selectionContextChanged ( org.ovirt.engine.core.common.businessentities.VM vm ) { org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleSelectionContext newContext = new org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleSelectionContext ( vm.getVmOs ( ) , vm.getDefaultDisplayType ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel selectedConsole = resolveSelectedConsoleModel ( vm.getId ( ) ) ; if ( selectedConsole == null ) { return true ; } return ! ( newContext.equals ( selectedConsole.getSelectionContext ( ) ) ) ; }

Target:
private void setupSelectionContext ( org.ovirt.engine.core.common.businessentities.VM vm ) { for ( org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel model : cachedConsoleModels.get ( vm.getId ( ) ) ) { org.ovirt.engine.core.common.businessentities.DisplayType vmDisplay = ( vm.isRunningOrPaused ( ) ) ? vm.getDisplayType ( ) : vm.getDefaultDisplayType ( ) ; model.setSelectionContext ( new org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleSelectionContext ( vm.getVmOs ( ) , vmDisplay ) ) ; } }
Source:
protected boolean acquireLockInternal ( ) { final boolean acquireLock = super . acquireLockInternal ( ) ; if ( ( ( ! acquireLock ) && ( ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) ) != null ) ) && ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . isAutoStartup ( ) ) ) { org.ovirt.engine.core.bll.AutoStartVmsRunner.getInstance ( ) . addVmToRun ( org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) . getVmId ( ) ) ; } return acquireLock ; }

Target:
protected void refreshBootParameters ( org.ovirt.engine.core.common.action.RunVmParams runVmParameters ) { org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setBootSequence ( org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . getDefaultBootSequence ( ) ) ; org.ovirt.engine.core.bll.RunVmCommand.getVm ( ) . setRunOnce ( false ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.event_subscriber mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.event_subscriber entity = new org.ovirt.engine.core.common.businessentities.event_subscriber ( ) ; entity.setevent_up_name ( rs.getString ( "event_up_name" ) ) ; entity.setevent_notification_method ( org.ovirt.engine.core.common.EventNotificationMethod.valueOfString ( rs.getString ( "notification_method" ) ) ) ; entity.setmethod_address ( rs.getString ( "method_address" ) ) ; entity.setsubscriber_id ( getGuidDefaultEmpty ( rs , "subscriber_id" ) ) ; entity.settag_name ( rs.getString ( "tag_name" ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.EventSubscriber mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.EventSubscriber entity = new org.ovirt.engine.core.common.businessentities.EventSubscriber ( ) ; entity.setEventUpName ( rs.getString ( "event_up_name" ) ) ; entity.setEventNotificationMethod ( org.ovirt.engine.core.common.EventNotificationMethod.valueOfString ( rs.getString ( "notification_method" ) ) ) ; entity.setMethodAddress ( rs.getString ( "method_address" ) ) ; entity.setSubscriberId ( getGuidDefaultEmpty ( rs , "subscriber_id" ) ) ; entity.setTagName ( rs.getString ( "tag_name" ) ) ; return entity ; }
Source:
public void getSubPaths_singlePathElement ( ) { java.lang.String [ ] subPaths = tested.getSubPaths ( "a" ) ; org.junit.Assert.assertThat ( subPaths.length , org.hamcrest.CoreMatchers.equalTo ( 1 ) ) ; org.junit.Assert.assertThat ( subPaths [ 0 ] , org.hamcrest.CoreMatchers.equalTo ( "a" ) ) ; }

Target:
public void getSubPaths_singlePathElement ( ) { java.lang.String [ ] subPaths = tested.getSubPaths ( "a" ) ; org.hamcrest.MatcherAssert.assertThat ( subPaths.length , org.hamcrest.CoreMatchers.equalTo ( 1 ) ) ; org.hamcrest.MatcherAssert.assertThat ( subPaths [ 0 ] , org.hamcrest.CoreMatchers.equalTo ( "a" ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepStart ( volumeName , remoteHost , remoteVolumeName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionStart ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.Boolean force ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeGeoRepSessionStart ( volumeName , remoteHost , remoteVolumeName , force ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public boolean contentEquals ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter , org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { if ( ( dataCenter == null ) || ( cluster == null ) ) { return false ; } return ( dataCenter.getId ( ) . equals ( this . dataCenter.getId ( ) ) ) && ( cluster.getId ( ) . equals ( this . cluster.getId ( ) ) ) ; }

Target:
public boolean contentEquals ( org.ovirt.engine.core.common.businessentities.StoragePool dataCenter , org.ovirt.engine.core.common.businessentities.Cluster cluster ) { if ( ( dataCenter == null ) || ( cluster == null ) ) { return false ; } return ( dataCenter.getId ( ) . equals ( this . dataCenter.getId ( ) ) ) && ( cluster.getId ( ) . equals ( this . cluster.getId ( ) ) ) ; }
Source:
public org.ovirt.engine.core.extensions.mgr.ExtensionProxy getExtensionByName ( java.lang.String name ) throws org.ovirt.engine.core.extensions.mgr.ConfigurationException { org.ovirt.engine.core.extensions.mgr.ExtensionsManager.ExtensionEntry entry = initializedEntries.get ( name ) ; if ( entry == null ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( java.lang.String.format ( "Extension %1$s could not be found" , name ) ) ; } return entry.extension ; }

Target:
public org.ovirt.engine.core.extensions.mgr.ExtensionProxy getExtensionByName ( java.lang.String name ) throws org.ovirt.engine.core.extensions.mgr.ConfigurationException { if ( name == null ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( java.lang.String.format ( "Extension was not specified" ) ) ; } org.ovirt.engine.core.extensions.mgr.ExtensionsManager.ExtensionEntry entry = initializedEntries.get ( name ) ; if ( entry == null ) { throw new org.ovirt.engine.core.extensions.mgr.ConfigurationException ( java.lang.String.format ( "Extension %1$s could not be found" , name ) ) ; } return entry.extension ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnSave" ) ) { onSave ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.CMD_SAVE ) ) { onSave ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.ProviderModel.CMD_CANCEL ) ) { cancel ( ) ; } }