auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private org.ovirt.engine.core.aaa.DirectoryGroup getGroupById ( java.lang.String directoryName , java.lang.String namespace , java.lang.String groupId ) { try { groupId = org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( groupId ) ; } catch ( java.lang.IllegalArgumentException exception ) { return null ; } return getEntity ( org.ovirt.engine.core.aaa.DirectoryGroup.class , VdcQueryType.GetDirectoryGroupById , new org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters ( directoryName , namespace , groupId ) , groupId , true ) ; }

Target:
private org.ovirt.engine.core.aaa.DirectoryGroup getGroupById ( java.lang.String directoryName , java.lang.String namespace , java.lang.String groupId ) { try { groupId = org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( groupId ) ; } catch ( java.lang.IllegalArgumentException exception ) { return null ; } return getEntity ( org.ovirt.engine.core.aaa.DirectoryGroup.class , QueryType.GetDirectoryGroupById , new org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters ( directoryName , namespace , groupId ) , groupId , true ) ; }
Source:
public void testSaveAndGetById ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brickToAdd = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.EXISTING_VOL_ID , server , "/export/test-vol-distribute-1/dir3" , org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ; dao.save ( brickToAdd ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity retrievedBrick = dao.getById ( brickToAdd.getId ( ) ) ; org.junit.Assert.assertNotNull ( retrievedBrick ) ; org.junit.Assert.assertEquals ( brickToAdd , retrievedBrick ) ; }

Target:
public void testSaveAndGetById ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brickToAdd = new org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity ( org.ovirt.engine.core.dao.gluster.GlusterBrickDaoTest.EXISTING_VOL_ID , server , "/export/test-vol-distribute-1/dir3" , org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.UP ) ; brickToAdd.setBrickOrder ( 0 ) ; dao.save ( brickToAdd ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity retrievedBrick = dao.getById ( brickToAdd.getId ( ) ) ; org.junit.Assert.assertNotNull ( retrievedBrick ) ; org.junit.Assert.assertEquals ( brickToAdd , retrievedBrick ) ; }
Source:
public static java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > getImagesLeaf ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > retVal = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( image.getId ( ) , image , retVal ) ; } for ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > list : retVal.values ( ) ) { org.ovirt.engine.core.bll.ImportVmCommand.sortImageList ( list ) ; } return retVal ; }

Target:
protected boolean validateDiskInterface ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : images ) { if ( ( ( diskImage.getDiskInterface ( ) ) == ( org.ovirt.engine.core.common.businessentities.DiskInterface.VirtIO_SCSI ) ) && ( ! ( org.ovirt.engine.core.common.FeatureSupported.virtIoScsi ( getVdsGroup ( ) . getcompatibility_version ( ) ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.VIRTIO_SCSI_INTERFACE_IS_NOT_AVAILABLE_FOR_CLUSTER_LEVEL ) ; return false ; } } return true ; }
Source:
public static void getDataCenterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStoragePoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , boolean filterInternalDomain ) { 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 ? new java.util.ArrayList < java.lang.String > ( ( ( java.util.ArrayList < java.lang.String > ) ( source ) ) ) : new java.util.ArrayList < java.lang.String > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetDomainListParameters tempVar = new org.ovirt.engine.core.common.queries.GetDomainListParameters ( ) ; tempVar.setFilterInternalDomain ( filterInternalDomain ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetDomainList , tempVar , aQuery ) ; }
Source:
private static void assertNicValidation ( org.ovirt.engine.core.common.businessentities.network.NetworkInterface < ? > nic , java.lang.Class < ? > validationGroup , boolean shouldValidationFail , java.lang.String possibleViolation ) { java.util.List < java.lang.String > violations = org.ovirt.engine.core.common.utils.ValidationUtils.validateInputs ( java.util.Arrays.asList ( new java.lang.Class < ? > [ ] { validationGroup } ) , new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterfaceValidationTest.TestParams ( nic ) ) ; org.junit.Assert.assertEquals ( ( ( ( ( ( "Validation should" + ( shouldValidationFail ? "" : "'nt" ) ) + " fail due to violation: [" ) + possibleViolation ) + "]; Actual violations were: " ) + violations ) , shouldValidationFail , violations.contains ( possibleViolation ) ) ; }

Target:
private static void assertNicValidation ( org.ovirt.engine.core.common.businessentities.network.NetworkInterface < ? > nic , java.lang.Class < ? > validationGroup , boolean shouldValidationFail , java.lang.String possibleViolation ) { java.util.List < java.lang.String > violations = org.ovirt.engine.core.common.utils.ValidationUtils.validateInputs ( java.util.Arrays.asList ( new java.lang.Class < ? > [ ] { validationGroup } ) , new org.ovirt.engine.core.common.businessentities.network.VmNetworkInterfaceValidationTest.TestParams ( nic ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( shouldValidationFail , violations.contains ( possibleViolation ) , ( ( ( ( ( "Validation should" + ( shouldValidationFail ? "" : "'nt" ) ) + " fail due to violation: [" ) + possibleViolation ) + "]; Actual violations were: " ) + violations ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getDisksList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , disk.getStorageIds ( ) . get ( 0 ) , disk.getActualSize ( ) ) ) ; } return list ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > getQuotaStorageConsumptionParameters ( ) { java.util.List < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > list = new java.util.ArrayList < org.ovirt.engine.core.bll.quota.QuotaConsumptionParameter > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : getDisksList ( ) ) { list.add ( new org.ovirt.engine.core.bll.quota.QuotaStorageConsumptionParameter ( disk.getQuotaId ( ) , null , QuotaConsumptionParameter.QuotaAction.CONSUME , disk.getStorageIds ( ) . get ( 0 ) , disk.getActualSize ( ) ) ) ; } return list ; }
Source:
public void getAuthzGroupsByUserId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > > ( ) { @ java.lang.Override public java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAuthzGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void getAuthzGroupsByUserId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.aaa.AuthzGroup > > aQuery , org.ovirt.engine.core.compat.Guid userId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAuthzGroupsByUserId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }
Source:
private void decreasePendingVms ( ) { org.ovirt.engine.core.compat.Guid vdsId = getCurrentVdsId ( ) ; org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.RunVmCommandBase.getVm ( ) ; if ( ( vdsId == null ) || ( vdsId.equals ( lastDecreasedVds ) ) ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debug ( "PendingVms for the guest '{}' running on host '{}' was already released, not releasing again" , vm.getName ( ) , vdsId ) ; return ; } lastDecreasedVds = vdsId ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVms ( vm , vdsId ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; }

Target:
private void decreasePendingVms ( ) { decreasePendingVms ( org.ovirt.engine.core.bll.RunVmCommandBase.getVm ( ) . getStaticData ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > pmOptions = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; if ( pmOptions != null ) { getPmPort ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmPortKey ) ) ; getPmSlot ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSlotKey ) ) ; getPmSecure ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSecureKey ) ) ; getPmEncryptOptions ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmEncryptOptions ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > pmTypes = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; updatePmTypeList ( pmTypes ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > setUpFiles ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > isos = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.RepoFileMetaData file = new org.ovirt.engine.core.common.businessentities.RepoFileMetaData ( ) ; file.setRepoFileName ( NAMES [ i ] ) ; isos.add ( file ) ; } return isos ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > setUpFiles ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > isos = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.RepoFileMetaData > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { org.ovirt.engine.core.common.businessentities.RepoFileMetaData file = new org.ovirt.engine.core.common.businessentities.RepoFileMetaData ( ) ; file.setRepoImageId ( NAMES [ i ] ) ; isos.add ( file ) ; } return isos ; }
Source:
protected void RemoveNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VmNetworkInterface iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( iface.getId ( ) , org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . remove ( iface.getId ( ) ) ; } }

Target:
protected void RemoveNetwork ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > list = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface : list ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( iface.getId ( ) , org.ovirt.engine.core.bll.VmTemplateCommand.getVmTemplateId ( ) ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmNetworkInterfaceDao ( ) . remove ( iface.getId ( ) ) ; } }
Source:
public boolean getAllCleared ( ) { synchronized ( _listTasks ) { for ( org.ovirt.engine.core.bll.EntityAsyncTask task : _listTasks.values ( ) ) { if ( ! ( taskWasCleared ( task ) ) ) { org.ovirt.engine.core.bll.EntityMultiAsyncTasks.log.infoFormat ( "[within thread]: Some of the tasks related to command id {0} were not cleared yet (Task id {1} is in state {2})." , getCommandId ( ) , task.getVdsmTaskId ( ) , task.getState ( ) ) ; return false ; } } } return true ; }

Target:
public boolean getAllCleared ( ) { synchronized ( _listTasks ) { for ( org.ovirt.engine.core.bll.CommandAsyncTask task : _listTasks.values ( ) ) { if ( ! ( taskWasCleared ( task ) ) ) { org.ovirt.engine.core.bll.CommandMultiAsyncTasks.log.infoFormat ( "[within thread]: Some of the tasks related to command id {0} were not cleared yet (Task id {1} is in state {2})." , getCommandId ( ) , task.getVdsmTaskId ( ) , task.getState ( ) ) ; return false ; } } } return true ; }
Source:
public void testNotRemovingLabeledNetworksLabelRemovedFromNicValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nicWithLabel = createNic ( "nicWithLabel" ) ; nicWithLabel.setLabels ( new java.util.HashSet < > ( java.util.Arrays.asList ( "lbl1" ) ) ) ; org.ovirt.engine.core.common.businessentities.network.Network network = createNetworkWithNameAndLabel ( "net" , "lbl1" ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment = createNetworkAttachment ( network , nicWithLabel ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.getRemovedLabels ( ) . add ( "lbl1" ) ; assertTestNotRemovingLabeledNetworksValid ( nicWithLabel , removedAttachment , params , network ) ; }

Target:
public void testNotRemovingLabeledNetworksLabelRemovedFromNicValid ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nicWithLabel = createNic ( "nicWithLabel" ) ; nicWithLabel.setLabels ( java.util.Collections.singleton ( "lbl1" ) ) ; org.ovirt.engine.core.common.businessentities.network.Network network = createNetworkWithNameAndLabel ( "net" , "lbl1" ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment removedAttachment = createNetworkAttachment ( network , nicWithLabel ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.getRemovedLabels ( ) . add ( "lbl1" ) ; assertTestNotRemovingLabeledNetworksValid ( nicWithLabel , removedAttachment , params , network ) ; }
Source:
public java.lang.String createSnapshot ( final org.ovirt.engine.core.common.businessentities.storage.CinderDisk cinderDisk , final java.lang.Boolean force ) { return execute ( new java.util.concurrent.Callable < java.lang.String > ( ) { @ java.lang.Override public java.lang.String call ( ) { com.woorea.openstack.cinder.model.SnapshotForCreate snapshotForCreate = new com.woorea.openstack.cinder.model.SnapshotForCreate ( ) ; snapshotForCreate.setVolumeId ( cinderDisk.getId ( ) . toString ( ) ) ; snapshotForCreate.setForce ( force ) ; return proxy.createSnapshot ( snapshotForCreate ) ; } } ) ; }

Target:
public java.lang.Void deleteSnapshot ( final org.ovirt.engine.core.compat.Guid snapshotId ) { return execute ( new java.util.concurrent.Callable < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void call ( ) { proxy.deleteSnapshot ( snapshotId.toString ( ) ) ; return null ; } } ) ; }
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( getEntity ( ) . getId ( ) ) ; parameters.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetQuotaByStoragePoolId , parameters , new org.ovirt.engine.ui.uicommonweb.models.datacenters.SetItemsAsyncQuery ( ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( getEntity ( ) . getId ( ) ) ; parameters.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( QueryType.GetQuotaByStoragePoolId , parameters , new org.ovirt.engine.ui.uicommonweb.models.datacenters.SetItemsAsyncQuery ( ) ) ; }
Source:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetTagExpectations ( false ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpGetTagExpectations ( false ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { org.junit.Assert.assertNotNull ( wae.getResponse ( ) ) ; org.junit.Assert.assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { false , false } , getUsers ( ) ) ; setUpGetEntityExpectations ( 1 ) ; verifyModel ( resource.get ( ) , 0 ) ; }

Target:
public void testGet ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetAllDbUsers , org.ovirt.engine.core.common.queries.QueryParametersBase.class , new java.lang.String [ ] { "Refresh" , "Filtered" } , new java.lang.Object [ ] { false , false } , getUsers ( ) ) ; setUpGetEntityExpectations ( 1 ) ; verifyModel ( resource.get ( ) , 0 ) ; }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Cell.Context context , com.google.gwt.dom.client.Element parent , java.lang.Boolean value , com.google.gwt.safehtml.shared.SafeHtml tooltipContent , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < java.lang.Boolean > valueUpdater ) { if ( tooltipContent == null ) { tooltipContent = getTooltip ( value ) ; } org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.handleTooltipEvent ( parent , tooltipContent , event ) ; super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , java.lang.Boolean value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < java.lang.Boolean > valueUpdater ) { org.ovirt.engine.ui.common.utils.ElementTooltipUtils.handleCellEvent ( event , parent , getTooltip ( value ) ) ; super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; }
Source:
protected boolean canDoAction ( ) { boolean retValue = true ; if ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) { retValue = super . canDoAction ( ) ; if ( ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) ) { addCanDoActionMessage ( EngineMessage.VDS_STATUS_NOT_VALID_FOR_STOP ) ; retValue = false ; } } org.ovirt.engine.core.bll.pm.StopVdsCommand.getReturnValue ( ) . setCanDoAction ( retValue ) ; return retValue ; }

Target:
protected boolean validate ( ) { boolean retValue = true ; if ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.Unknown ) ) { retValue = super . validate ( ) ; if ( ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) ) != null ) && ( ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Maintenance ) ) ) { addValidationMessage ( EngineMessage.VDS_STATUS_NOT_VALID_FOR_STOP ) ; retValue = false ; } } org.ovirt.engine.core.bll.pm.StopVdsCommand.getReturnValue ( ) . setValid ( retValue ) ; return retValue ; }
Source:
public static boolean setDiskAlias ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , org.ovirt.engine.core.common.businessentities.VM vm ) { if ( disk != null ) { java.lang.String vmName = "" ; int count = 1 ; if ( vm != null ) { vmName = vm.getvm_name ( ) ; count = ( vm.getDiskMapCount ( ) ) + 1 ; } disk.setDiskAlias ( org.ovirt.engine.core.bll.ImagesHandler.getSuggestedDiskAlias ( disk , vmName , count ) ) ; return true ; } else { org.ovirt.engine.core.bll.ImagesHandler.log.errorFormat ( "Disk object is null" ) ; return false ; } }

Target:
private static java.lang.String nullSafeGetVmName ( org.ovirt.engine.core.common.businessentities.VM vm ) { return vm == null ? "" : vm.getVmName ( ) ; }
Source:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v3_6 ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isVirtioScsiEnabledForVm ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.UpdateVmCommandTest.osRepository.getDiskInterfaces ( org.mockito.ArgumentMatchers.any ( java.lang.Integer.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( "VirtIO" ) ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }

Target:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v3_6 ) ; org.mockito.Mockito.doReturn ( true ) . when ( command ) . isVirtioScsiEnabledForVm ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.UpdateVmCommandTest.osRepository.getDiskInterfaces ( org.mockito.ArgumentMatchers.anyInt ( ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( "VirtIO" ) ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }
Source:
private void setUpEntityQueryExpectations ( int index , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDirectoryUserById , org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters.class , new java.lang.String [ ] { "Domain" , "Id" } , new java.lang.Object [ ] { DOMAIN , EXTERNAL_IDS [ index ] } , ( notFound ? null : getEntity ( index ) ) ) ; }

Target:
private void setUpEntityQueryExpectations ( int index , boolean notFound ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetDirectoryUserById , org.ovirt.engine.core.common.queries.DirectoryIdQueryParameters.class , new java.lang.String [ ] { "Domain" , "Id" } , new java.lang.Object [ ] { DOMAIN , org.ovirt.engine.api.restapi.utils.DirectoryEntryIdUtils.decode ( EXTERNAL_IDS [ index ] ) } , ( notFound ? null : getEntity ( index ) ) ) ; }
Source:
public void validateIsoPrefixInTheMiddleOfTheInitrdAndKerenelName ( ) throws java.lang.Exception { java.lang.String initrd = "initrd " + ( org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ) ; java.lang.String kernelUrl = "kernelUrl " + ( org.ovirt.engine.core.bll.RunVmCommandTest.ISO_PREFIX ) ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( initrd , kernelUrl ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , initrd ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , kernelUrl ) ; }

Target:
public void validateIsoPrefixInTheMiddleOfTheInitrdAndKerenelName ( ) throws java.lang.Exception { java.lang.String initrd = "initrd " + ( RunVmCommand.ISO_PREFIX ) ; java.lang.String kernelUrl = "kernelUrl " + ( RunVmCommand.ISO_PREFIX ) ; org.ovirt.engine.core.common.businessentities.VM vm = createVmForTesting ( initrd , kernelUrl ) ; org.junit.Assert.assertEquals ( vm.getInitrdUrl ( ) , initrd ) ; org.junit.Assert.assertEquals ( vm.getKernelUrl ( ) , kernelUrl ) ; }
Source:
public void glusterServiceNotSupported ( ) { org.mockito.Mockito.when ( cluster.getcompatibility_version ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . glusterFeatureEnabled ( ) ; org.junit.Assert.assertThat ( validator.glusterServiceSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.GLUSTER_NOT_SUPPORTED , "compatibilityVersion" , null ) ) ; }

Target:
public void glusterServiceNotSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( false ) . when ( validator ) . glusterFeatureEnabled ( ) ; org.junit.Assert.assertThat ( validator.glusterServiceSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.GLUSTER_NOT_SUPPORTED , "compatibilityVersion" , null ) ) ; }
Source:
public void testValidDedicatedHost ( ) { prepareVmToPassCanDoAction ( ) ; org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setVdsGroupId ( group.getId ( ) ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.when ( vdsDAO.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vds ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; junit.framework.Assert.assertTrue ( "canDoAction should have passed." , command.canDoAction ( ) ) ; }

Target:
public void testNameNotChanged ( ) { prepareVmToPassCanDoAction ( ) ; vm.setName ( "vm1" ) ; mockSameNameQuery ( true ) ; org.junit.Assert.assertTrue ( "canDoAction should have passed." , command.canDoAction ( ) ) ; }
Source:
public org.ovirt.engine.core.common.job.Job runInTransaction ( ) { org.ovirt.engine.core.common.job.Job job = jobDao.get ( jobId ) ; if ( job != null ) { job.getJobSubjectEntities ( ) ; } return job ; }

Target:
public java.lang.Void runInTransaction ( ) { jobDao.save ( job ) ; java.util.Set < java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > > entrySet = job.getJobSubjectEntities ( ) . entrySet ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.VdcObjectType > entry : entrySet ) { jobSubjectEntityDao.save ( job.getId ( ) , entry.getKey ( ) , entry.getValue ( ) ) ; } return null ; }
Source:
protected boolean validate ( org.ovirt.engine.api.model.CdRom cdrom ) { return ( ( cdrom.isSetFile ( ) ) && ( cdrom.getFile ( ) . isSetId ( ) ) ) && ( ! ( "" . equals ( cdrom.getFile ( ) . getId ( ) ) ) ) ; }

Target:
protected boolean validate ( org.ovirt.engine.api.model.Cdrom cdrom ) { return ( ( cdrom.isSetFile ( ) ) && ( cdrom.getFile ( ) . isSetId ( ) ) ) && ( ! ( "" . equals ( cdrom.getFile ( ) . getId ( ) ) ) ) ; }
Source:
protected boolean checkDomainCanBeAttached ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { return ( ( ( ( checkStorageDomainType ( storageDomain ) ) && ( isStorageDomainFormatCorrectForPool ( storageDomain , org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ) ) ) && ( checkStorageDomainSharedStatusNotLocked ( storageDomain ) ) ) && ( ( ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) || ( ( storageDomain.getstorage_domain_type ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) || ( isStorageDomainNotInPool ( storageDomain ) ) ) ) && ( isStorageDomainTypeCorrect ( storageDomain ) ) ; }

Target:
protected boolean checkDomainCanBeAttached ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { return ( ( ( ( checkStorageDomainType ( storageDomain ) ) && ( isStorageDomainFormatCorrectForPool ( storageDomain , org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ) ) ) && ( checkStorageDomainSharedStatusNotLocked ( storageDomain ) ) ) && ( ( ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) || ( ( storageDomain.getStorageDomainType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) || ( isStorageDomainNotInPool ( storageDomain ) ) ) ) && ( isStorageDomainTypeCorrect ( storageDomain ) ) ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; }

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.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getClusterByServiceList ( list , supportsVirtService , supportsGlusterService ) ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; }
Source:
public static void getClusterById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public static void getRedirectServletReportsPage ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RedirectServletReportsPage , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public void testParseSingle ( ) { java.util.List < org.ovirt.engine.api.model.PowerManagement > ret = org.ovirt.engine.api.restapi.util.FencingOptionsParser.parse ( "foo:one=1,two=2,three=3" , "one=bool,two=int,three=bool" ) ; assertNotNull ( ret ) ; assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" , "three" , "bool" , "3" ) ; }

Target:
public void testParseSingle ( ) { java.util.List < org.ovirt.engine.api.model.PowerManagement > ret = org.ovirt.engine.api.restapi.util.FenceOptionsParser.parse ( "foo:one=1,two=2,three=3" , "one=bool,two=int,three=bool" ) ; assertNotNull ( ret ) ; assertEquals ( 1 , ret.size ( ) ) ; verifyResult ( ret.get ( 0 ) , "foo" , "one" , "bool" , "1" , "two" , "int" , "2" , "three" , "bool" , "3" ) ; }
Source:
public void save ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity glusterHook ) { getCallsHandler ( ) . executeModification ( "InsertGlusterHook" , createFullParametersMapper ( glusterHook ) ) ; saveGlusterServerHook ( glusterHook.getId ( ) , null , glusterHook.getChecksum ( ) , glusterHook.getStatus ( ) ) ; }

Target:
public void save ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity glusterHook ) { getCallsHandler ( ) . executeModification ( "InsertGlusterHook" , createFullParametersMapper ( glusterHook ) ) ; if ( ( glusterHook.getServerHooks ( ) ) != null ) { for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterServerHook serverHook : glusterHook.getServerHooks ( ) ) { saveGlusterServerHook ( serverHook ) ; } } }
Source:
public void testDiskStats ( ) { java.util.Map < java.lang.String , java.lang.Object > disksStats = new java.util.HashMap < > ( ) ; java.util.Map < java.lang.String , java.lang.Object > disk = new java.util.HashMap < > ( ) ; disk.put ( VdsProperties.DISK_STATS_FREE , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.SIZE_FOR_DISK_STATS ) ; disksStats.put ( "a" , disk ) ; disksStats.put ( "b" , disk ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksStatsInXmlRpc ( disksStats ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.validateDisksStatsList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVds ( ) , xml , false ) ; }

Target:
public void testDiskStats ( ) { java.util.Map < java.lang.String , java.lang.Object > disksStats = new java.util.HashMap < > ( ) ; java.util.Map < java.lang.String , java.lang.Object > disk = new java.util.HashMap < > ( ) ; disk.put ( VdsProperties.DISK_STATS_FREE , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.SIZE_FOR_DISK_STATS ) ; disksStats.put ( "a" , disk ) ; disksStats.put ( "b" , disk ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.setDisksStats ( disksStats ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.validateDisksStatsList ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectBuilderTest.getVds ( ) , xml , false ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( java.lang.Object object ) { return ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . isExistsInSystem ( ) ? org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmFromExportDomainPopupView.resources.alertImage ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( java.lang.Object object ) { org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData importVmData = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) ; if ( ( ( importVmData.getError ( ) ) != null ) || ( importVmData.isNameExistsInTheSystem ( ) ) ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmFromExportDomainPopupView.resources.errorImage ( ) ; } if ( ( importVmData.getWarning ( ) ) != null ) { return org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.backup.ImportVmFromExportDomainPopupView.resources.alertImage ( ) ; } return null ; }
Source:
public static void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public void countAllTemplates ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v3_6 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( "VirtIO" ) ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }

Target:
public void testCannotUpdateOSNotSupportVirtioScsi ( ) { prepareVmToPassValidate ( ) ; group.setCompatibilityVersion ( Version.v3_6 ) ; org.mockito.Mockito.when ( command.isVirtioScsiEnabledForVm ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.UpdateVmCommandTest.osRepository.getDiskInterfaces ( org.mockito.Matchers.any ( java.lang.Integer.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) ) ) . thenReturn ( java.util.Collections.singletonList ( "VirtIO" ) ) ; command.initEffectiveCompatibilityVersion ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_ILLEGAL_OS_TYPE_DOES_NOT_SUPPORT_VIRTIO_SCSI ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > notFilteredProfiles = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfile > filteredProfiles = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfile > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfile profile : notFilteredProfiles ) { filteredProfiles.add ( profile ) ; } org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( filteredProfiles ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > notFilteredProfiles = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ) ( returnValue ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > filteredProfiles = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VnicProfileView profile : notFilteredProfiles ) { filteredProfiles.add ( profile ) ; } org.ovirt.engine.ui.uicommonweb.models.SearchableListModel searchableListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel ) ( model ) ) ; searchableListModel.setItems ( filteredProfiles ) ; }
Source:
private static void cacheConfigValues ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ; aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( returnValue != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cachedConfigValuesPreConvert.putAll ( ( ( java.util.HashMap < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > , java.lang.Object > ) ( returnValue ) ) ) ; } return org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.cachedConfigValuesPreConvert ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConfigurationValues , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
private void cacheConfigValues ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { getDefaultConfigurationVersion ( ) ; aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( returnValue != null ) { cachedConfigValuesPreConvert.putAll ( ( ( java.util.HashMap < org.ovirt.engine.core.compat.KeyValuePairCompat < org.ovirt.engine.core.common.queries.ConfigurationValues , java.lang.String > , java.lang.Object > ) ( returnValue ) ) ) ; } return cachedConfigValuesPreConvert ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConfigurationValues , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
public void initDisks ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getModel ( ) . getTemplateWithVersion ( ) . getSelectedItem ( ) . getTemplateVersion ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getTemplateDiskList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { initTemplateDisks ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( returnValue ) ) ) ; } } ) , template.getId ( ) ) ; }

Target:
public void initDisks ( ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = getModel ( ) . getTemplateWithVersion ( ) . getSelectedItem ( ) . getTemplateVersion ( ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getTemplateDiskList ( asyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > returnValue ) { initTemplateDisks ( returnValue ) ; } } ) , template.getId ( ) ) ; }
Source:
public void testValues ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( " " ) ) ; org.junit.Assert.assertTrue ( "Monday" , ( ( comps.contains ( "Monday" ) ) || ( comps.contains ( "Tuesday" ) ) ) ) ; org.junit.Assert.assertTrue ( "mace" , comps.contains ( "mace" ) ) ; }

Target:
public void testValues ( ) { java.util.List < java.lang.String > comps = java.util.Arrays.asList ( comp.getCompletion ( " " ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( ( ( comps.contains ( "Monday" ) ) || ( comps.contains ( "Tuesday" ) ) ) , "Monday" ) ; org.junit.jupiter.api.Assertions.assertTrue ( comps.contains ( "mace" ) , "mace" ) ; }
Source:
public void isConnWithSameDetailsExistCheckSameConn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; org.mockito.Mockito.when ( iscsiStorageHelper.findConnectionWithSameDetails ( newISCSIConnection ) ) . thenReturn ( newISCSIConnection ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertFalse ( isExists ) ; }

Target:
public void isConnWithSameDetailsExistCheckSameConn ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newISCSIConnection = createISCSIConnection ( "1.2.3.4" , StorageType.ISCSI , "iqn.2013-04.myhat.com:aaa-target1" , "3260" , "user1" , "mypassword123" ) ; org.mockito.Mockito.when ( iscsiStorageHelper.findConnectionWithSameDetails ( newISCSIConnection ) ) . thenReturn ( newISCSIConnection ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.jupiter.api.Assertions.assertFalse ( isExists ) ; }