auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void getNetworkList ( 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 != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
public void testCanDoActionNonExistingStorageDomain ( ) { org.junit.Assert.assertFalse ( "canDoActtion shouldn't be possible for a non-existant storage domain" , command.canDoAction ( ) ) ; java.util.List < java.lang.String > messages = command.getReturnValue ( ) . getCanDoActionMessages ( ) ; org.junit.Assert.assertEquals ( "Wrong number of messages" , 2 , messages.size ( ) ) ; org.junit.Assert.assertEquals ( "Wrong message" , VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN.name ( ) , messages.get ( 0 ) ) ; org.junit.Assert.assertEquals ( "Wrong message" , VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_NOT_EXIST.name ( ) , messages.get ( 1 ) ) ; }

Target:
public void testSetActionMessageParameters ( ) { command.setActionMessageParameters ( ) ; org.ovirt.engine.core.bll.CommandAssertUtils.checkMessages ( command , VdcBllMessages.VAR__TYPE__STORAGE__DOMAIN , VdcBllMessages.VAR__ACTION__REMOVE ) ; }
Source:
public void onSuccess ( java.util.Set < java.lang.String > returnValue ) { if ( returnValue != null ) { java.util.Set < java.lang.String > emulatedSet = new java.util.TreeSet < > ( returnValue ) ; emulatedSet.add ( "" ) ; java.lang.String oldVal = getModel ( ) . getEmulatedMachine ( ) . getSelectedItem ( ) ; getModel ( ) . getEmulatedMachine ( ) . setItems ( emulatedSet ) ; getModel ( ) . getEmulatedMachine ( ) . setSelectedItem ( oldVal ) ; } }

Target:
public void onSuccess ( java.lang.Integer returnValue ) { maxNumOfSockets = returnValue ; updataMaxVmsInPool ( ) ; }
Source:
public void freeMac ( java.lang.String mac ) { org.ovirt.engine.core.bll.MacPoolManager.log.infoFormat ( "MacPoolManager::freeMac(mac = '{0}') - entered" , mac ) ; mLocObj.writeLock ( ) . lock ( ) ; try { if ( ! ( mInitialized ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.MAC_POOL_NOT_INITIALIZED ) ; } internalFreeLock ( mac ) ; } finally { mLocObj.writeLock ( ) . unlock ( ) ; } }

Target:
public void freeMac ( java.lang.String mac ) { org.ovirt.engine.core.bll.MacPoolManager.log.infoFormat ( "MacPoolManager::freeMac(mac = '{0}') - entered" , mac ) ; mLocObj.writeLock ( ) . lock ( ) ; try { if ( ! ( mInitialized ) ) { logInitializationError ( ( ( "Failed to free mac address " + mac ) + " ." ) ) ; } else { internalFreeMac ( mac ) ; } } finally { mLocObj.writeLock ( ) . unlock ( ) ; } }
Source:
public void testValue ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( NumericConditionRelationAutoCompleter.INSTANCE.getCompletion ( "<" ) ) ; assertTrue ( "<" , comps.contains ( "<" ) ) ; assertTrue ( "<=" , comps.contains ( "<=" ) ) ; assertFalse ( "=" , comps.contains ( "=" ) ) ; }

Target:
public void testValue ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( NumericConditionRelationAutoCompleter.INSTANCE.getCompletion ( "<" ) ) ; org.junit.Assert.assertTrue ( "<" , comps.contains ( "<" ) ) ; org.junit.Assert.assertTrue ( "<=" , comps.contains ( "<=" ) ) ; org.junit.Assert.assertFalse ( "=" , comps.contains ( "=" ) ) ; }
Source:
private void insertVolumeOptions ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > options = volume.getOptions ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity option : options ) { if ( ( option.getVolumeId ( ) ) == null ) { option.setVolumeId ( volume.getId ( ) ) ; } dbFacade.getGlusterOptionDao ( ) . save ( option ) ; } }

Target:
private void insertVolumeOptions ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity > options = volume.getOptions ( ) ; for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeOptionEntity option : options ) { if ( ( option.getVolumeId ( ) ) == null ) { option.setVolumeId ( volume.getId ( ) ) ; } glusterOptionDao.save ( option ) ; } }
Source:
protected boolean isSourceAndDestTheSame ( ) { if ( ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getOperation ( ) ) == ( org.ovirt.engine.core.common.businessentities.ImageOperation.Move ) ) && ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getSourceDomainId ( ) . equals ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_SOURCE_AND_TARGET_SAME ) ; return false ; } return true ; }

Target:
protected boolean isImageExist ( ) { if ( ( org.ovirt.engine.core.bll.MoveOrCopyDiskCommand.getImage ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; } return true ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ( getSourceVmFromDb ( ) ) == null ) { return null ; } return java.util.Collections.singletonMap ( getSourceVmFromDb ( ) . getId ( ) . toString ( ) , LockMessagesMatchUtil.VM ) ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ( getSourceVmFromDb ( ) ) == null ) { return null ; } return java.util.Collections.singletonMap ( getSourceVmFromDb ( ) . getId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM , VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; }
Source:
public void testTypedViewCache ( ) throws java.lang.Exception { java.io.File file = writeConf ( ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; junit.framework.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString view1 = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString.class ) ; junit.framework.Assert.assertNotNull ( view1 ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString view2 = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString.class ) ; junit.framework.Assert.assertNotNull ( view2 ) ; junit.framework.Assert.assertTrue ( ( view1 == view2 ) ) ; }

Target:
public void testTypedViewCache ( ) throws java.lang.Exception { java.io.File file = writeConf ( ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString view1 = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString.class ) ; org.junit.Assert.assertNotNull ( view1 ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString view2 = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString.class ) ; org.junit.Assert.assertNotNull ( view2 ) ; org.junit.Assert.assertTrue ( ( view1 == view2 ) ) ; }
Source:
protected void updateDataProvider ( java.util.List < T > items ) { super . updateDataProvider ( items ) ; if ( ( selectedItems ) != null ) { super . setSelectedItems ( selectedItems ) ; } if ( ( dataChangeListener ) != null ) { dataChangeListener.onDataChange ( items ) ; } }

Target:
protected void updateDataProvider ( java.util.List < T > items ) { super . updateDataProvider ( items ) ; retainSelectedItems ( ) ; if ( ( dataChangeListener ) != null ) { dataChangeListener.onDataChange ( items ) ; } }
Source:
private void mockCheckStatus ( java.lang.String status ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue retValue = new org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue ( ) ; retValue.setSucceeded ( true ) ; org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue stat = new org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ( status , "" ) ; retValue.setReturnValue ( stat ) ; org.mockito.Mockito.when ( executor.checkStatus ( ) ) . thenReturn ( retValue ) ; }

Target:
private void mockCheckStatus ( java.lang.String status ) { org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue retValue = new org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue ( ) ; retValue.setSucceeded ( true ) ; org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue stat = new org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ( status , "" ) ; retValue.setReturnValue ( stat ) ; org.mockito.Mockito.when ( executor.checkHostStatus ( ) ) . thenReturn ( retValue ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tags : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ) ( source ) ) ) { if ( ( tags.gettype ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { ret.add ( tags ) ; } } return ret ; } return new org.ovirt.engine.core.common.businessentities.Tags ( ) ; }

Target:
public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tags : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ) ( source ) ) ) { if ( ( tags.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { ret.add ( tags ) ; } } return ret ; } return new org.ovirt.engine.core.common.businessentities.Tags ( ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.core.common.businessentities.AuditLog model , int index ) { assertNotNull ( model.getaudit_log_id ( ) ) ; assertNotNull ( model.getseverity ( ) ) ; assertNotNull ( model.getmessage ( ) ) ; assertNotNull ( model.getOrigin ( ) ) ; assertNotNull ( model.getCustomEventId ( ) ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.Event model , int index ) { assertNotNull ( model ) ; assertEquals ( model.getId ( ) , java.lang.String.valueOf ( org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.LOG_IDS [ index ] ) ) ; assertEquals ( model.getSeverity ( ) , LogSeverity.ALERT.value ( ) ) ; assertEquals ( model.getDescription ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.MESSAGES [ index ] ) ; assertEquals ( model.getOrigin ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.ORIGIN_NAMES [ index ] ) ; assertEquals ( model.getCustomId ( ) , org.ovirt.engine.api.restapi.resource.BackendEventsResourceTest.CUSTOMER_EVENT_IDS [ index ] ) ; }
Source:
public static java.lang.String map ( org.ovirt.engine.api.model.Snapshot.SnapshotType snapshotType , java.lang.String template ) { switch ( snapshotType ) { case ACTIVE : return SnapshotType.ACTIVE.value ( ) ; case PREVIEW : return SnapshotType.PREVIEW.value ( ) ; case REGULAR : return SnapshotType.REGULAR.value ( ) ; case STATELESS : return SnapshotType.STATELESS.value ( ) ; default : return null ; } }

Target:
public static org.ovirt.engine.api.model.SnapshotType map ( org.ovirt.engine.api.model.Snapshot.SnapshotType snapshotType , org.ovirt.engine.api.model.SnapshotType template ) { switch ( snapshotType ) { case ACTIVE : return org.ovirt.engine.api.model.SnapshotType.ACTIVE ; case PREVIEW : return org.ovirt.engine.api.model.SnapshotType.PREVIEW ; case REGULAR : return org.ovirt.engine.api.model.SnapshotType.REGULAR ; case STATELESS : return org.ovirt.engine.api.model.SnapshotType.STATELESS ; default : return null ; } }
Source:
public void testUpdateUnregisteredDisksWithVMsWithEmptyUnregDisks ( ) throws java.lang.Exception { org.ovirt.engine.core.utils.ovf.xml.XmlDocument xmlDocument = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( getXmlOvfData ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregDisks = new java.util.ArrayList < > ( ) ; ovfUtils.updateUnregisteredDisksWithVMs ( unregDisks , org.ovirt.engine.core.compat.Guid.newGuid ( ) , "TestVM" , xmlDocument ) ; org.junit.Assert.assertTrue ( "The list of disks should not be empty" , unregDisks.isEmpty ( ) ) ; }

Target:
public void testUpdateUnregisteredDisksWithVMsWithEmptyUnregDisks ( ) throws java.lang.Exception { org.ovirt.engine.core.utils.ovf.xml.XmlDocument xmlDocument = new org.ovirt.engine.core.utils.ovf.xml.XmlDocument ( getXmlOvfData ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.UnregisteredDisk > unregDisks = new java.util.ArrayList < > ( ) ; ovfUtils.updateUnregisteredDisksWithVMs ( unregDisks , org.ovirt.engine.core.compat.Guid.newGuid ( ) , "TestVM" , xmlDocument ) ; org.junit.jupiter.api.Assertions.assertTrue ( unregDisks.isEmpty ( ) , "The list of disks should not be empty" ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImageWithExcessData ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage , org.ovirt.engine.core.compat.Guid sdId ) { org.ovirt.engine.core.common.businessentities.DiskImage dummy = org.ovirt.engine.core.common.businessentities.DiskImage.copyOf ( diskImage ) ; dummy.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Collections.singletonList ( sdId ) ) ) ; dummy.getSnapshots ( ) . addAll ( org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots ( dummy.getImageId ( ) ) ) ; return dummy ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createDiskImageWithExcessData ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage , org.ovirt.engine.core.compat.Guid sdId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage dummy = org.ovirt.engine.core.common.businessentities.storage.DiskImage.copyOf ( diskImage ) ; dummy.setStorageIds ( new java.util.ArrayList ( java.util.Collections.singletonList ( sdId ) ) ) ; dummy.getSnapshots ( ) . addAll ( org.ovirt.engine.core.bll.ImagesHandler.getAllImageSnapshots ( dummy.getImageId ( ) ) ) ; return dummy ; }
Source:
protected void executeQuery ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.DirectorySearcher directorySearcher ) { final java.util.List < org.ovirt.engine.core.common.businessentities.aaa.LdapUser > userList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.aaa.LdapUser > ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.List < org.ovirt.engine.core.common.businessentities.aaa.LdapUser > usersList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.LdapUser > ) ( directorySearcher.findAll ( getLdapQueryData ( ) ) ) ) ; for ( final org.ovirt.engine.core.common.businessentities.aaa.LdapUser searchResult : usersList ) { { org.ovirt.engine.core.common.businessentities.aaa.LdapUser user = populateUserData ( searchResult , getLdapQueryData ( ) . getDomain ( ) , populateGroups ) ; userList.add ( user ) ; } } setReturnValue ( userList ) ; setSucceeded ( true ) ; }

Target:
protected void executeQuery ( org.ovirt.engine.extensions.aaa.builtin.kerberosldap.DirectorySearcher directorySearcher ) { final java.util.List < org.ovirt.engine.core.common.businessentities.aaa.LdapUser > userList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.aaa.LdapUser > ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) final java.util.List < org.ovirt.engine.core.common.businessentities.aaa.LdapUser > usersList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.LdapUser > ) ( directorySearcher.findAll ( getLdapQueryData ( ) ) ) ) ; for ( final org.ovirt.engine.core.common.businessentities.aaa.LdapUser searchResult : usersList ) { { org.ovirt.engine.core.common.businessentities.aaa.LdapUser user = populateUserData ( searchResult , getLdapQueryData ( ) . getDomain ( ) , populateGroups , populateGroupsRecursively ) ; userList.add ( user ) ; } } setReturnValue ( userList ) ; setSucceeded ( true ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.String > getStepMessageMap ( org.ovirt.engine.core.common.job.JobExecutionStatus status ) { java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; values.put ( GlusterConstants.CLUSTER , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getVdsGroupName ( ) ) ; values.put ( GlusterConstants.VOLUME , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getGlusterVolumeName ( ) ) ; values.put ( GlusterConstants.JOB_STATUS , status.toString ( ) ) ; values.put ( GlusterConstants.JOB_INFO , " " ) ; return values ; }

Target:
protected java.util.Map < java.lang.String , java.lang.String > getStepMessageMap ( org.ovirt.engine.core.common.job.JobExecutionStatus status , java.lang.String jobInfo ) { java.util.Map < java.lang.String , java.lang.String > values = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; values.put ( GlusterConstants.CLUSTER , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getVdsGroupName ( ) ) ; values.put ( GlusterConstants.VOLUME , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getGlusterVolumeName ( ) ) ; values.put ( GlusterConstants.JOB_STATUS , status.toString ( ) ) ; values.put ( GlusterConstants.JOB_INFO , ( jobInfo == null ? " " : jobInfo ) ) ; return values ; }
Source:
public void failedFenceWithDifferentProxyRetry ( ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceVdsResult1 = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceVdsResult2 = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR ) ; mockFenceVdsResult ( fenceVdsResult1 , fenceVdsResult2 ) ; mockProxyHost ( true ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.fence ( FenceActionType.START , createAgent ( ) ) ; org.junit.Assert.assertEquals ( Status.ERROR , result.getStatus ( ) ) ; verifyAttemptToFindDifferentProxy ( ) ; verifyAuditFenceExecutionFailure ( 2 ) ; }

Target:
public void failedFenceWithDifferentProxyRetry ( ) { org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceVdsResult1 = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult fenceVdsResult2 = new org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR ) ; mockFenceVdsResult ( fenceVdsResult1 , fenceVdsResult2 ) ; mockProxyHost ( true ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = executor.fence ( FenceActionType.START , createAgent ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( Status.ERROR , result.getStatus ( ) ) ; verifyAttemptToFindDifferentProxy ( ) ; verifyAuditFenceExecutionFailure ( 2 ) ; }
Source:
public static void updateConsoleDevice ( org.ovirt.engine.core.compat.Guid vmId , java.lang.Boolean consoleEnabled ) { if ( consoleEnabled == null ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > consoles = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDeviceDao ( ) . getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.CONSOLE , VmDeviceType.CONSOLE.getName ( ) ) ; if ( consoleEnabled ) { if ( consoles.isEmpty ( ) ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addConsoleDevice ( vmId ) ; } } else { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : consoles ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.remove ( device.getId ( ) ) ; } } }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > getVirtioScsiControllers ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid userID , boolean isFiltered ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.dao.getVmDeviceByVmIdTypeAndDevice ( vmId , VmDeviceGeneralType.CONTROLLER , VmDeviceType.VIRTIOSCSI.getName ( ) , userID , isFiltered ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getDefaultImage ( ) { return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.externalDiskIcon ( ) ; }

Target:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > getCinderVolumeTypeColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.storage.Disk > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return object.getCinderVolumeType ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
public void onContextMenu ( com.google.gwt.event.dom.client.ContextMenuEvent event ) { event.preventDefault ( ) ; event.stopPropagation ( ) ; if ( hasActionButtons ( ) ) { int eventX = event.getNativeEvent ( ) . getClientX ( ) ; int eventY = event.getNativeEvent ( ) . getClientY ( ) ; updateContextMenu ( contextMenuBar , actionButtonList , contextPopupPanel ) ; contextPopupPanel.showAndFitToScreen ( eventX , eventY ) ; } }

Target:
protected void onContextMenu ( final com.google.gwt.event.dom.client.ContextMenuEvent event ) { final int eventX = event.getNativeEvent ( ) . getClientX ( ) ; final int eventY = event.getNativeEvent ( ) . getClientY ( ) ; event.preventDefault ( ) ; event.stopPropagation ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { if ( hasActionButtons ( ) ) { updateContextMenu ( contextMenuBar , actionButtonList , contextPopupPanel ) ; contextPopupPanel.showAndFitToScreen ( eventX , eventY ) ; } } } ) ; }
Source:
private void addManagementNetworksToPool ( int numberOfNetworks ) { for ( int i = 0 ; i < numberOfNetworks ; i ++ ) { final org.ovirt.engine.core.compat.Guid managementNetworkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; allDcNetworks.add ( createNetwork ( managementNetworkId ) ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( managementNetworkId ) ) . thenReturn ( true ) ; } org.mockito.Mockito.when ( networkDao.getAllForDataCenter ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( allDcNetworks ) ; }

Target:
private void addManagementNetworksToPool ( int numberOfNetworks ) { addNetworksToPool ( numberOfNetworks , true ) ; }
Source:
private boolean hostExists ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > glusterServers , org.ovirt.engine.core.common.businessentities.VDS server ) { for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo glusterServer : glusterServers ) { if ( glusterServer.getHostnameOrIp ( ) . equals ( server.gethost_name ( ) ) ) { return true ; } for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNwInterface : getVdsInterfaces ( server.getId ( ) ) ) { if ( glusterServer.getHostnameOrIp ( ) . equals ( vdsNwInterface.getAddress ( ) ) ) { return true ; } } } return false ; }

Target:
private boolean hostExists ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo > glusterServers , org.ovirt.engine.core.common.businessentities.VDS server ) { for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerInfo glusterServer : glusterServers ) { if ( glusterServer.getHostnameOrIp ( ) . equals ( server.getHostName ( ) ) ) { return true ; } for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNwInterface : getVdsInterfaces ( server.getId ( ) ) ) { if ( glusterServer.getHostnameOrIp ( ) . equals ( vdsNwInterface.getAddress ( ) ) ) { return true ; } } } return false ; }
Source:
public void validateFailsForDifferentStorageDevice ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice1 = getStorageDevice ( "sda" ) ; org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice2 = getStorageDevice ( "sdb" ) ; storageDevice2.setDevType ( "SDA" ) ; org.mockito.Mockito.doReturn ( 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 ( storageDevice1 , storageDevice2 ) ) ) . when ( cmd ) . getParameters ( ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }

Target:
public void validateFailsForDifferentStorageDevice ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice1 = getStorageDevice ( "sda" ) ; org.ovirt.engine.core.common.businessentities.gluster.StorageDevice storageDevice2 = getStorageDevice ( "sdb" ) ; storageDevice2.setDevType ( "SDA" ) ; org.mockito.Mockito.doReturn ( 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 ( storageDevice1 , storageDevice2 ) , getStorageDevice ( "sdb" ) , org.ovirt.engine.core.common.businessentities.CacheModeType.writethrough , 10 ) ) . when ( cmd ) . getParameters ( ) ; prepareMocks ( VDSStatus.Up ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; }
Source:
protected void doNonBlockingAction ( final org.ovirt.engine.core.common.action.ActionType task , final org.ovirt.engine.core.common.action.VdcActionParametersBase params ) { org.ovirt.engine.core.common.interfaces.BackendLocal backend = getBackend ( ) ; setCorrelationId ( params ) ; setJobOrStepId ( params ) ; backend.runAction ( ActionType.RunAsyncAction , sessionize ( new org.ovirt.engine.core.common.action.RunAsyncActionParameters ( task , sessionize ( params ) ) ) ) ; }

Target:
protected void doNonBlockingAction ( final org.ovirt.engine.core.common.action.ActionType task , final org.ovirt.engine.core.common.action.ActionParametersBase params ) { org.ovirt.engine.core.common.interfaces.BackendLocal backend = getBackend ( ) ; setCorrelationId ( params ) ; setJobOrStepId ( params ) ; backend.runAction ( ActionType.RunAsyncAction , sessionize ( new org.ovirt.engine.core.common.action.RunAsyncActionParameters ( task , sessionize ( params ) ) ) ) ; }
Source:
private void InitSpmPriorities1 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetDefaultSpmPriority ( 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 ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { UpdateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; } } ) ) ; }

Target:
private void initSpmPriorities1 ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultSpmPriority ( 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 ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( target ) ) ; model.defaultSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; if ( ( postponedSpmPriority ) != null ) { updateSpmPriority ( postponedSpmPriority ) ; } spmInitialized = true ; } } ) ) ; }
Source:
private void setHostProviderWidgetsAvailability ( boolean enabled ) { getProviders ( ) . setIsAvailable ( enabled ) ; getProviderSearchFilter ( ) . setIsAvailable ( enabled ) ; getProviderSearchFilterLabel ( ) . setIsAvailable ( enabled ) ; getExternalHostName ( ) . setIsAvailable ( enabled ) ; getExternalHostName ( ) . setSelectedItem ( null ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalComputeResource > computeResources = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ExternalComputeResource > ) ( result ) ) ; org.ovirt.engine.ui.uicommonweb.models.ListModel externalComputeResourceListModel = getExternalComputeResource ( ) ; externalComputeResourceListModel.setItems ( computeResources ) ; externalComputeResourceListModel.setIsChangable ( true ) ; }
Source:
public static void GetStorageDomainMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StorageDomainNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getDataCenterMaxNameLength ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
protected void EndImportCommand ( ) { setVm ( null ) ; EndActionOnAllImageGroups ( ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( getVm ( ) . getId ( ) ) ; UpdateVmImSpm ( ) ; } else { setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full EndAction" ) ; } setSucceeded ( true ) ; }

Target:
protected void EndImportCommand ( ) { EndActionOnAllImageGroups ( ) ; endVmRelatedOps ( ) ; setSucceeded ( true ) ; }
Source:
public void postOnCreateVolume ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; if ( model.getOptimizeForVirtStore ( ) . getEntity ( ) ) { optimizeVolumesForVirtStore ( java.util.Arrays.asList ( volume ) ) ; } } }

Target:
public void postOnCreateVolume ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volume ) { org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; if ( model.getOptimizeForVirtStore ( ) . getEntity ( ) ) { volume.setId ( ( ( org.ovirt.engine.core.compat.Guid ) ( returnValue.getActionReturnValue ( ) ) ) ) ; optimizeVolumesForVirtStore ( java.util.Arrays.asList ( volume ) ) ; } } }
Source:
public void updateConnectionNoDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getId ( ) ) ) . thenReturn ( oldNFSConnection ) ; org.mockito.Mockito.doReturn ( domains ) . when ( command ) . getStorageDomainsByConnId ( newNFSConnection.getId ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }

Target:
public void updateConnectionNoDomain ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; parameters.setStorageServerConnection ( newNFSConnection ) ; org.mockito.Mockito.when ( storageConnDao.get ( newNFSConnection.getId ( ) ) ) . thenReturn ( oldNFSConnection ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > domains = java.util.Collections.emptyList ( ) ; org.mockito.Mockito.doReturn ( domains ) . when ( command ) . getStorageDomainsByConnId ( newNFSConnection.getId ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
public static void getMinimalVmMemSize ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VMMinMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }
Source:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > object ) { if ( ( ( object.getSecond ( ) ) != null ) && ( object.getSecond ( ) . getis_display ( ) ) ) { return templates.imageTextSetupNetwork ( dispalyImage , constants.displayItemInfo ( ) ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( "" ) ; }

Target:
public com.google.gwt.safehtml.shared.SafeHtml getTooltip ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.VDSGroup , org.ovirt.engine.core.common.businessentities.network.NetworkCluster > object ) { if ( ( ( object.getSecond ( ) ) != null ) && ( object.getSecond ( ) . isDisplay ( ) ) ) { return templates.imageTextSetupNetwork ( dispalyImage , constants.displayItemInfo ( ) ) ; } return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( "" ) ; }
Source:
public static void GetStorageDomainList ( 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.StorageDomain > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getDataCentersByStorageDomain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
protected int getNeededDiskSize ( org.ovirt.engine.core.compat.Guid storageId ) { double actualSize = 0 ; java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disks = storageToDisksMap.get ( storageId ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : disks ) { actualSize += disk.getActualSize ( ) ; } return ( ( int ) ( actualSize ) ) ; }

Target:
protected boolean validateFreeSpace ( org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > snapshots = getAllImageSnapshots ( diskImage ) ; diskImage.getSnapshots ( ) . addAll ( snapshots ) ; } return validate ( storageDomainValidator.hasSpaceForClonedDisks ( disksList ) ) ; }
Source:
protected void init ( ) { super . init ( ) ; resource.getParent ( ) . backend = backend ; resource.getParent ( ) . sessionHelper = sessionHelper ; resource.getParent ( ) . mappingLocator = resource.mappingLocator ; resource.getParent ( ) . httpHeaders = httpHeaders ; resource.getParent ( ) . messageBundle = messageBundle ; }

Target:
protected void init ( ) { super . init ( ) ; resource.getParent ( ) . backend = backend ; resource.getParent ( ) . sessionHelper = sessionHelper ; resource.getParent ( ) . mappingLocator = resource.mappingLocator ; resource.getParent ( ) . httpHeaders = httpHeaders ; resource.getParent ( ) . messageBundle = messageBundle ; org.ovirt.engine.api.restapi.utils.OsTypeMockUtils.mockOsTypes ( ) ; }
Source:
private void analyzeExternalVms ( ) { if ( ( dbVm ) == null ) { if ( ( getDbFacade ( ) . getVmStaticDao ( ) . get ( vdsmVm.getVmDynamic ( ) . getId ( ) ) ) == null ) { externalVm = true ; } } }

Target:
private boolean isUnmanagedVm ( ) { externalVm = ( ( dbVm ) == null ) && ( ( getDbFacade ( ) . getVmStaticDao ( ) . get ( vdsmVm.getVmDynamic ( ) . getId ( ) ) ) == null ) ; hostedEngineUnmanaged = ( ( dbVm ) != null ) && ( ( dbVm.getOrigin ( ) ) == ( org.ovirt.engine.core.common.businessentities.OriginType.HOSTED_ENGINE ) ) ; return ( externalVm ) || ( hostedEngineUnmanaged ) ; }
Source:
public void testUpdateByClusterIdAndName ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig config = dao.getConfigByClusterIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_3 ) ; org.junit.Assert.assertNotNull ( config ) ; org.junit.Assert.assertEquals ( "value3" , config.getParamValue ( ) ) ; dao.updateConfigByClusterIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_3 , "new_value" ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig modifiedConfig = dao.getConfigByClusterIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_3 ) ; org.junit.Assert.assertNotNull ( modifiedConfig ) ; org.junit.Assert.assertEquals ( "new_value" , modifiedConfig.getParamValue ( ) ) ; }

Target:
public void testUpdateByClusterIdAndName ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig config = dao.getConfigByClusterIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_3 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( config ) ; org.junit.jupiter.api.Assertions.assertEquals ( "value3" , config.getParamValue ( ) ) ; dao.updateConfigByClusterIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_3 , "new_value" ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotConfig modifiedConfig = dao.getConfigByClusterIdAndName ( org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.CLUSTER_ID , org.ovirt.engine.core.dao.gluster.GlusterVolumeSnapshotConfigDaoTest.PARAM_NAME_3 ) ; org.junit.jupiter.api.Assertions.assertNotNull ( modifiedConfig ) ; org.junit.jupiter.api.Assertions.assertEquals ( "new_value" , modifiedConfig.getParamValue ( ) ) ; }
Source:
public void testRemove ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , true , true ) ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( 1 , true ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.storage_server_connections > parseTargets ( java.util.List < java.lang.String > iqnList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage_server_connections > connections = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_server_connections > ( iqnList.size ( ) ) ; for ( java.lang.String iqn : iqnList ) { org.ovirt.engine.core.common.businessentities.storage_server_connections con = storage_server_connections.copyOf ( org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getConnection ( ) ) ; con.setiqn ( iqn ) ; connections.add ( con ) ; } return connections ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > parseTargets ( java.util.List < java.lang.String > iqnList ) { java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageServerConnections > ( iqnList.size ( ) ) ; for ( java.lang.String iqn : iqnList ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections con = org.ovirt.engine.core.common.businessentities.StorageServerConnections.copyOf ( org.ovirt.engine.core.vdsbroker.vdsbroker.DiscoverSendTargetsVDSCommand.getParameters ( ) . getConnection ( ) ) ; con.setiqn ( iqn ) ; connections.add ( con ) ; } return connections ; }
Source:
public void run ( ) { try { while ( ! ( shutdown ) ) { synchronized ( this ) { wait ( this . wait_ttl ) ; connMgr.closeExpiredConnections ( ) ; connMgr.closeIdleConnections ( this . close_ttl , java.util.concurrent.TimeUnit.SECONDS ) ; } } } catch ( java.lang.InterruptedException ex ) { } }

Target:
public void run ( ) { try { while ( ! ( shutdown ) ) { synchronized ( this ) { wait ( this . waitTtl ) ; connMgr.closeExpiredConnections ( ) ; connMgr.closeIdleConnections ( this . closeTtl , java.util.concurrent.TimeUnit.SECONDS ) ; } } } catch ( java.lang.InterruptedException ex ) { } }