auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void mockBackend ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase addCpuProfileReturnValue = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.action.VdcReturnValueBase.class ) ; org.mockito.Mockito.when ( addCpuProfileReturnValue.getSucceeded ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.backend.runAction ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.action.VdcActionType.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.action.CpuProfileParameters.class ) ) ) . thenReturn ( addCpuProfileReturnValue ) ; }

Target:
private void mockBackend ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase addCpuProfileReturnValue = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.action.VdcReturnValueBase.class ) ; org.mockito.Mockito.when ( addCpuProfileReturnValue.getSucceeded ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( org.ovirt.engine.core.bll.profiles.AddCpuProfileCommandTest.backend.runAction ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.VdcActionType.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.CpuProfileParameters.class ) ) ) . thenReturn ( addCpuProfileReturnValue ) ; }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVnicProfile , org.ovirt.engine.core.common.action.VnicProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , canDo , success ) ) ; try { resource.remove ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfileResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVnicProfile , org.ovirt.engine.core.common.action.VnicProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.remove ( ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendVnicProfileResourceTest.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
java.util.List < com.google.gwt.dom.client.TableCellElement > getTableHeaderCells ( int columnIndex ) { com.google.gwt.dom.client.Element tableHeaderElement = ( showDefaultHeader ) ? table.getElement ( ) : tableHeader.getElement ( ) ; com.google.gwt.dom.client.TableElement tableHeaderElementCast = tableHeaderElement.cast ( ) ; com.google.gwt.dom.client.TableSectionElement tHeadElement = tableHeaderElementCast.getTHead ( ) ; return tHeadElement != null ? getCells ( tHeadElement.getRows ( ) , columnIndex ) : java.util.Collections.< com.google.gwt.dom.client.TableCellElement > emptyList ( ) ; }

Target:
public void ensureColumnPresent ( com.google.gwt.user.cellview.client.Column < T , ? > column , java.lang.String headerText , boolean present ) { table.ensureColumnPresent ( column , headerText , present ) ; tableHeader.ensureColumnPresent ( column , headerText , present ) ; }
Source:
protected void doNonBlockingAction ( final org.ovirt.engine.core.common.action.VdcActionType 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 ( VdcActionType.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.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 ) ) ) ) ; }
Source:
protected void moveOrCopyAllImageGroups ( org.ovirt.engine.core.compat.Guid containerID , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.CopyImageGroup , buildMoveOrCopyImageGroupParametersForDisk ( disk , containerID ) ) ; if ( ! ( vdcRetValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( vdcRetValue.getFault ( ) . getError ( ) , "ImportVmCommand::MoveOrCopyAllImageGroups: Failed to copy disk!" ) ; } getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } }

Target:
protected void moveOrCopyAllImageGroups ( org.ovirt.engine.core.compat.Guid containerID , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : disks ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcRetValue = runInternalActionWithTasksContext ( VdcActionType.CopyImageGroup , buildMoveOrCopyImageGroupParametersForDisk ( disk , containerID ) ) ; if ( ! ( vdcRetValue.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.EngineException ( vdcRetValue.getFault ( ) . getError ( ) , "ImportVmCommand::MoveOrCopyAllImageGroups: Failed to copy disk!" ) ; } org.ovirt.engine.core.bll.ImportVmCommand.getReturnValue ( ) . getVdsmTaskIdList ( ) . addAll ( vdcRetValue.getInternalVdsmTaskIdList ( ) ) ; } }
Source:
public void storagePoolIdWithStoragePool ( ) { b.setStoragePoolId ( null ) ; final org.ovirt.engine.core.common.businessentities.StoragePool p = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; p.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setStoragePool ( p ) ; final org.ovirt.engine.core.compat.Guid n = b.getStoragePoolId ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , n ) ; }

Target:
public void storagePoolIdWithStoragePool ( ) { b.setStoragePoolId ( null ) ; final org.ovirt.engine.core.common.businessentities.StoragePool p = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; p.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setStoragePool ( p ) ; final org.ovirt.engine.core.compat.Guid n = b.getStoragePoolId ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , n ) ; }
Source:
public java.lang.Long parse ( java.lang.CharSequence text ) throws java.text.ParseException { if ( ( text == null ) || ( "" . equals ( text.toString ( ) ) ) ) { return null ; } java.lang.Long ret = null ; try { ret = java.lang.Long.parseLong ( text.toString ( ) ) ; } catch ( java.lang.NumberFormatException e ) { } return ret ; }

Target:
public java.lang.Long parse ( java.lang.CharSequence text ) throws java.text.ParseException { if ( ( text == null ) || ( "" . equals ( text.toString ( ) ) ) ) { return null ; } java.lang.Long ret = null ; try { ret = java.lang.Long.parseLong ( text.toString ( ) ) ; } catch ( java.lang.NumberFormatException e ) { throw new java.text.ParseException ( "Unable to parse String to Long" , 0 ) ; } return ret ; }
Source:
java.lang.String getFullPath ( final java.lang.String path ) { java.lang.String result = null ; if ( ( path != null ) && ( org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( path ) ) ) { result = ( brandingManager.getBrandingRootPath ( ) . getAbsolutePath ( ) ) + path ; } else { org.ovirt.engine.ui.frontend.server.gwt.BrandingServlet.log.error ( ( ( "The path \"" + path ) + "\" is not sane" ) ) ; } return result ; }

Target:
java.lang.String getFullPath ( final java.io.File brandingRootPath , final java.lang.String path ) { java.lang.String result = null ; java.lang.String mergedPath = java.nio.file.FileSystems.getDefault ( ) . getPath ( brandingRootPath.getAbsolutePath ( ) , ( path == null ? "" : path ) ) . toString ( ) ; if ( ( path != null ) && ( org.ovirt.engine.core.utils.servlet.ServletUtils.isSane ( mergedPath ) ) ) { result = mergedPath ; } else { org.ovirt.engine.ui.frontend.server.gwt.BrandingServlet.log.error ( ( ( "The path \"" + mergedPath ) + "\" is not sane" ) ) ; } return result ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( bond.getName ( ) , nicId , nicName , message , existingInterfacesMap ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.action.CreateOrUpdateBond createOrUpdateBond ) { org.ovirt.engine.core.compat.Guid nicId = createOrUpdateBond.getId ( ) ; java.lang.String nicName = createOrUpdateBond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( nicName , nicId , nicName , message , existingInterfacesMap ) ; }
Source:
private void mockOsRepository ( ) { org.ovirt.engine.core.common.osinfo.OsRepository mockOsRepository = control.createMock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.easymock.EasyMock.expect ( mockOsRepository.getUniqueOsNames ( ) ) . andReturn ( new java.util.HashMap < > ( ) ) . anyTimes ( ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , mockOsRepository ) ; }

Target:
private void mockOsRepository ( ) { org.ovirt.engine.core.common.osinfo.OsRepository mockOsRepository = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) ; org.mockito.Mockito.when ( mockOsRepository.getUniqueOsNames ( ) ) . thenReturn ( new java.util.HashMap < > ( ) ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , mockOsRepository ) ; }
Source:
public void testCanDoSuccessOnAddFloatingDiskWithPlugUnset ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createDiskImage ( 1 ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; parameters.setVmId ( Guid.Empty ) ; parameters.setPlugDiskToVm ( false ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionSuccess ( command ) ; }

Target:
public void testValidateSuccessOnAddFloatingDiskWithPlugUnset ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createDiskImage ( 1 ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.storage.disk.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( disk ) ; parameters.setVmId ( Guid.Empty ) ; parameters.setPlugDiskToVm ( false ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockStorageDomain ( storageId ) ; mockStoragePoolIsoMap ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.network.NetworkCluster getNetworkCluster ( ) { if ( ( networkCluster ) == null ) { org.ovirt.engine.core.common.businessentities.network.NetworkClusterId networkClusterId = new org.ovirt.engine.core.common.businessentities.network.NetworkClusterId ( host.getVdsGroupId ( ) , getNetwork ( ) . getId ( ) ) ; networkCluster = getDbFacade ( ) . getNetworkClusterDao ( ) . get ( networkClusterId ) ; } return networkCluster ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult networkNotAttachedToHost ( ) { return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.NETWORK_ALREADY_ATTACHED_TO_HOST , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "networkName" , getNetwork ( ) . getName ( ) ) , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( "hostName" , host.getName ( ) ) ) . when ( networkAttachedToHost ( ) ) ; }
Source:
public static void getRpmVersionViaPublic ( 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.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getUserMessageOfTheDayViaPublic ( 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.frontend.Frontend.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getCustomValues ( ) { AddCustomValue ( GlusterConstants.OPTION_KEY , getParameters ( ) . getVolumeOption ( ) . getKey ( ) ) ; AddCustomValue ( GlusterConstants.OPTION_VALUE , getParameters ( ) . getVolumeOption ( ) . getValue ( ) ) ; return super . getCustomValues ( ) ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getCustomValues ( ) { addCustomValue ( GlusterConstants.OPTION_KEY , getParameters ( ) . getVolumeOption ( ) . getKey ( ) ) ; addCustomValue ( GlusterConstants.OPTION_VALUE , getParameters ( ) . getVolumeOption ( ) . getValue ( ) ) ; return super . getCustomValues ( ) ; }
Source:
protected com.google.gwt.safehtml.shared.SafeHtml getHeaderHtml ( ) { if ( ( headerImage ) == null ) { return com.google.gwt.safehtml.shared.SafeHtmlUtils.fromSafeConstant ( org.ovirt.engine.ui.common.widget.table.header.ImageResourceHeader.CONSTANTS.empty ( ) ) ; } return org.ovirt.engine.ui.common.widget.table.header.ImageResourceHeader.TEMPLATES.headerImage ( com.google.gwt.safehtml.shared.SafeHtmlUtils.fromTrustedString ( com.google.gwt.user.client.ui.AbstractImagePrototype.create ( headerImage ) . getHTML ( ) ) ) ; }

Target:
public boolean isInline ( ) { return inline ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { hostsModel.StopProgress ( ) ; boolean isAllCanDoPassed = true ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { isAllCanDoPassed = isAllCanDoPassed && ( returnValueBase.getCanDoAction ( ) ) ; if ( ! isAllCanDoPassed ) { break ; } } if ( isAllCanDoPassed ) { updateAlerts ( ) ; Cancel ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { hostsModel.stopProgress ( ) ; boolean isAllCanDoPassed = true ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { isAllCanDoPassed = isAllCanDoPassed && ( returnValueBase.getCanDoAction ( ) ) ; if ( ! isAllCanDoPassed ) { break ; } } if ( isAllCanDoPassed ) { updateAlerts ( ) ; cancel ( ) ; } }
Source:
public void testStaticBarToFooInterfaceMapper ( ) { org.ovirt.engine.api.restapi.types.Mapper < org.ovirt.engine.api.restapi.test.mappers.api.IBar , org.ovirt.engine.api.restapi.test.mappers.api.IFoo > mapper = mappingLocator.getMapper ( org.ovirt.engine.api.restapi.test.mappers.api.IBar.class , org.ovirt.engine.api.restapi.test.mappers.api.IFoo.class ) ; org.junit.Assert.assertNotNull ( mapper ) ; org.ovirt.engine.api.restapi.test.mappers.api.IFoo foo = mapper.map ( new org.ovirt.engine.api.restapi.test.mappers.impl.BarImpl ( "bar" ) , null ) ; org.junit.Assert.assertEquals ( "bar" , foo.get ( ) ) ; }

Target:
public void testStaticBarToFooInterfaceMapper ( ) { org.ovirt.engine.api.restapi.types.Mapper < org.ovirt.engine.api.restapi.test.mappers.api.IBar , org.ovirt.engine.api.restapi.test.mappers.api.IFoo > mapper = mappingLocator.getMapper ( org.ovirt.engine.api.restapi.test.mappers.api.IBar.class , org.ovirt.engine.api.restapi.test.mappers.api.IFoo.class ) ; org.junit.jupiter.api.Assertions.assertNotNull ( mapper ) ; org.ovirt.engine.api.restapi.test.mappers.api.IFoo foo = mapper.map ( new org.ovirt.engine.api.restapi.test.mappers.impl.BarImpl ( "bar" ) , null ) ; org.junit.jupiter.api.Assertions.assertEquals ( "bar" , foo.get ( ) ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; org.ovirt.engine.core.common.businessentities.Permissions permission = org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( permission.getObjectId ( ) , permission.getObjectType ( ) , org.ovirt.engine.core.bll.PermissionsCommandBase.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; org.ovirt.engine.core.common.businessentities.Permission permission = org.ovirt.engine.core.bll.PermissionsCommandBase.getParameters ( ) . getPermission ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( permission.getObjectId ( ) , permission.getObjectType ( ) , org.ovirt.engine.core.bll.PermissionsCommandBase.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }
Source:
public static void cancelRecoveryJob ( org.ovirt.engine.core.compat.Guid vdsId ) { java.lang.String jobId = org.ovirt.engine.core.vdsbroker.VdsManager.recoveringJobIdMap.remove ( vdsId ) ; if ( jobId != null ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.info ( "Cancelling the recovery from crash timer for VDS '{}' because vds started initializing" , vdsId ) ; try { org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.getInstance ( ) . deleteJob ( jobId ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.warn ( "Failed deleting job '{}' at cancelRecoveryJob: {}" , jobId , e.getMessage ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsManager.log.debug ( "Exception" , e ) ; } } }

Target:
public void cancelRecoveryJob ( ) { java.lang.String jobId = org.ovirt.engine.core.vdsbroker.VdsManager.recoveringJobIdMap.remove ( vdsId ) ; if ( jobId != null ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.info ( "Cancelling the recovery from crash timer for VDS '{}' because vds started initializing" , vdsId ) ; try { org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.utils.timer.SchedulerUtilQuartzImpl.class ) . deleteJob ( jobId ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.VdsManager.log.warn ( "Failed deleting job '{}' at cancelRecoveryJob: {}" , jobId , e.getMessage ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsManager.log.debug ( "Exception" , e ) ; } } }
Source:
public void testGetNetworkNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( 1 , getIscsiBondContainingNetwork ( ) ) ; java.util.List < org.ovirt.engine.api.restapi.resource.Network > entities = new java.util.ArrayList < > ( ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , entities ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNetworkNotFound ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetIscsiBondById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.ISCSI_BOND_ID } , getIscsiBondContainingNetwork ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetNetworkById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworkResourceTest.NETWORK_ID } , null , null ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public static void removeDiskImage ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.ImagesHandler.removeDiskFromVm ( vmId , diskImage.getId ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.removeImage ( diskImage ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db" , ex ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.DB , ex ) ; } }

Target:
public static void removeDiskImage ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage , org.ovirt.engine.core.compat.Guid vmId ) { try { org.ovirt.engine.core.bll.ImagesHandler.removeDiskFromVm ( vmId , diskImage.getId ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.removeImage ( diskImage ) ; } catch ( java.lang.RuntimeException ex ) { org.ovirt.engine.core.bll.ImagesHandler.log.error ( "Failed adding new disk image and related entities to db: {}" , ex.getMessage ( ) ) ; org.ovirt.engine.core.bll.ImagesHandler.log.debug ( "Exception" , ex ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.DB , ex ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStatus" ) . withParameter ( "volName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolName" , slaveVolumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepSessionList ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepSessionList" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }
Source:
protected void endMoveVmCommand ( ) { boolean vmExists = ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) != null ; if ( vmExists ) { incrementDbGeneration ( ) ; } org.ovirt.engine.core.bll.MoveVmCommand.endActionOnAllImageGroups ( ) ; if ( vmExists ) { org.ovirt.engine.core.bll.VmHandler.UnLockVm ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) ; } else { org.ovirt.engine.core.bll.MoveVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveVmCommand::EndMoveVmCommand: Vm is null - not performing full EndAction" ) ; } org.ovirt.engine.core.bll.MoveVmCommand.setSucceeded ( true ) ; }

Target:
protected void endMoveVmCommand ( ) { boolean vmExists = ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) != null ; if ( vmExists ) { incrementDbGeneration ( ) ; } org.ovirt.engine.core.bll.MoveVmCommand.endActionOnAllImageGroups ( ) ; if ( vmExists ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) ; org.ovirt.engine.core.bll.VmHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.MoveVmCommand.getVm ( ) ) ; } else { org.ovirt.engine.core.bll.MoveVmCommand.setCommandShouldBeLogged ( false ) ; log.warn ( "MoveVmCommand::EndMoveVmCommand: Vm is null - not performing full EndAction" ) ; } org.ovirt.engine.core.bll.MoveVmCommand.setSucceeded ( true ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.SessionsListReturnForXmlRpc getSessionList ( ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getSessionList ( ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.SessionsListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.SessionsListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterHookEnable ( java.lang.String glusterCommand , java.lang.String stage , java.lang.String hookName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterHookEnable ( glusterCommand , stage , hookName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void canDoActionFailsOnNullDiskInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.NewGuid ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.COW ) ; image.setVolumeType ( VolumeType.Preallocated ) ; org.ovirt.engine.core.common.action.AddDiskParameters params = new org.ovirt.engine.core.common.action.AddDiskParameters ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) , image ) ; initializeCommand ( storageId , params ) ; org.junit.Assert.assertFalse ( command.validateInputs ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( "VALIDATION.DISK_INTERFACE.NOT_NULL" ) ) ; }

Target:
public void canDoActionFailsOnNullDiskInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage image = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.COW ) ; image.setVolumeType ( VolumeType.Preallocated ) ; org.ovirt.engine.core.common.action.AddDiskParameters params = new org.ovirt.engine.core.common.action.AddDiskParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , image ) ; initializeCommand ( storageId , params ) ; org.junit.Assert.assertFalse ( command.validateInputs ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( "VALIDATION.DISK_INTERFACE.NOT_NULL" ) ) ; }
Source:
public void confFileConvertToMapFails ( ) throws java.io.IOException , java.net.URISyntaxException { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdcCommand ( ActionType.RetrieveImageData , successfulVdcReturnValue ( load ( "not-a-valid-hosted-engine-config-tar.tar" ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( ActionType.RetrieveImageData , org.mockito.Mockito.times ( 1 ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }

Target:
public void confFileConvertToMapFails ( ) throws java.io.IOException , java.net.URISyntaxException { givenListOfImagesAndVolumes ( ) ; givenTheWantedDiskImage ( ) ; mockVdcCommand ( ActionType.RetrieveImageData , successfulActionReturnValue ( load ( "not-a-valid-hosted-engine-config-tar.tar" ) ) ) ; java.util.Map < java.lang.String , java.lang.String > config = fetchConfig ( ) ; verifyCalled ( ActionType.RetrieveImageData , org.mockito.Mockito.times ( 1 ) ) ; org.junit.Assert.assertThat ( config , org.hamcrest.core.Is.is ( java.util.Collections.emptyMap ( ) ) ) ; }
Source:
public void testGetAllWithName ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = dao.getAllWithName ( existingVds.getName ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS vds : result ) { org.junit.Assert.assertEquals ( existingVds.getName ( ) , vds.getName ( ) ) ; } }

Target:
public void testGetWithName ( ) { org.ovirt.engine.core.common.businessentities.VDS result = dao.getByName ( existingVds.getName ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingVds.getName ( ) , result.getName ( ) ) ; }
Source:
public void init ( ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initializing Scheduling manager" ) ; loadPolicyUnits ( ) ; loadClusterPolicies ( ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread discoveryThread = new org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread ( ) ; if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.ExternalSchedulerEnabled ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Starting external scheduler dicovery thread" ) ; discoveryThread.start ( ) ; } else { discoveryThread.markAllExternalPoliciesAsDisabled ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "External scheduler disabled, discovery skipped" ) ; } org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initialized Scheduling manager" ) ; }

Target:
public void init ( ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initializing Scheduling manager" ) ; loadPolicyUnits ( ) ; loadClusterPolicies ( ) ; org.ovirt.engine.core.bll.scheduling.external.ExternalSchedulerDiscoveryThread discoveryThread = exSchedulerDiscoveryProvider.get ( ) ; if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > getValue ( ConfigValues.ExternalSchedulerEnabled ) ) { org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Starting external scheduler discovery thread" ) ; discoveryThread.start ( ) ; } else { discoveryThread.markAllExternalPoliciesAsDisabled ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "External scheduler disabled, discovery skipped" ) ; } enableLoadBalancer ( ) ; enableHaReservationCheck ( ) ; org.ovirt.engine.core.bll.scheduling.SchedulingManager.log.info ( "Initialized Scheduling manager" ) ; }
Source:
public void testNetworkNotChanged ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid networkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; oldAttachment.setNetworkId ( networkId ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( networkId ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator ( attachment , null ) . networkNotChanged ( oldAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworkNotChanged ( ) throws java.lang.Exception { org.ovirt.engine.core.compat.Guid networkId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment oldAttachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; oldAttachment.setNetworkId ( networkId ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( networkId ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotChanged ( oldAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public static void getGlusterBricksForServer ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid serverId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeBricksByServerId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( serverId ) , aQuery ) ; }

Target:
public static void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }
Source:
public void testCronExpressionForInvalidHourDaily ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageSyncSchedule schedule = new org.ovirt.engine.core.common.businessentities.gluster.StorageSyncSchedule ( ) ; schedule.setFrequency ( Frequency.DAILY ) ; schedule.setHour ( 24 ) ; schedule.setMins ( 59 ) ; java.util.List < java.lang.Class < ? > > validationGroup = new java.util.ArrayList < > ( ) ; java.util.List < java.lang.String > result = org.ovirt.engine.core.common.utils.ValidationUtils.validateInputs ( validationGroup , schedule ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; org.junit.Assert.assertTrue ( result.contains ( "SCHEDULE_HOUR_OUT_OF_RANGE" ) ) ; }

Target:
public void testCronExpressionForInvalidHourDaily ( ) { org.ovirt.engine.core.common.businessentities.gluster.StorageSyncSchedule schedule = new org.ovirt.engine.core.common.businessentities.gluster.StorageSyncSchedule ( ) ; schedule.setFrequency ( Frequency.DAILY ) ; schedule.setHour ( 24 ) ; schedule.setMins ( 59 ) ; java.util.List < java.lang.Class < ? > > validationGroup = new java.util.ArrayList < > ( ) ; java.util.List < java.lang.String > result = org.ovirt.engine.core.common.utils.ValidationUtils.validateInputs ( validationGroup , schedule ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( result.contains ( "SCHEDULE_HOUR_OUT_OF_RANGE" ) ) ; }
Source:
public void testAddLabelToNicAndValidateWhenUsingValidLabel ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setLabels ( new java.util.HashSet < java.lang.String > ( ) ) ; java.util.List < java.lang.Class < ? > > validationGroups = java.util.Arrays.< java.lang.Class < ? > > asList ( javax.validation.groups.Default.class , org.ovirt.engine.core.common.validation.group.UpdateEntity.class , org.ovirt.engine.core.common.validation.group.CreateEntity.class ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . addLabelToNicAndValidate ( "ok" , validationGroups ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testInterfaceByNameExistsWhenInterfaceIsNull ( ) throws java.lang.Exception { org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( null ) . interfaceByNameExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
public void getUsbPolicyOnUpdateCurrentlyDisabledGotEnabledPolicyNotSetUsbOnPre3_1Cluster ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setcompatibility_version ( Version.v3_0 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( usb , UsbPolicy.DISABLED , vdsGroup ) , UsbPolicy.ENABLED_LEGACY ) ; }

Target:
public void getUsbPolicyOnUpdateCurrentlyDisabledGotEnabledPolicyNotSetUsbOnPost3_0Cluster ( ) { org.ovirt.engine.api.model.Usb usb = new org.ovirt.engine.api.model.Usb ( ) ; usb.setEnabled ( true ) ; org.ovirt.engine.core.common.businessentities.VDSGroup vdsGroup = new org.ovirt.engine.core.common.businessentities.VDSGroup ( ) ; vdsGroup.setcompatibility_version ( Version.v3_1 ) ; assertEquals ( org.ovirt.engine.api.restapi.types.VmMapper.getUsbPolicyOnUpdate ( usb , UsbPolicy.DISABLED , vdsGroup.getcompatibility_version ( ) ) , UsbPolicy.ENABLED_NATIVE ) ; }
Source:
public void setVLanTagEnabled ( boolean flag ) { vlanTag.setEnabled ( flag ) ; }

Target:
protected void selectionChanged ( java.lang.Boolean value ) { org.ovirt.engine.ui.uicommonweb.models.ListModel tableModel = clustersTable.flush ( ) ; for ( java.lang.Object model : tableModel.getItems ( ) ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel networkClusterModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.NetworkClusterModel ) ( model ) ) ; if ( networkClusterModel.getIsChangable ( ) ) { networkClusterModel.setAttached ( value ) ; } } clustersTable.edit ( tableModel ) ; }
Source:
protected void updateAllInBatch ( java.lang.String procedureName , java.util.Collection < T > paramValues , org.ovirt.engine.core.dal.dbbroker.MapSqlParameterMapper < T > mapper ) { java.util.List < T > sortedParamValues = new java.util.ArrayList < > ( paramValues ) ; java.util.Collections.sort ( sortedParamValues , org.ovirt.engine.core.common.businessentities.comparators.BusinessEntityComparator.< T , ID > newInstance ( ) ) ; org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getCallsHandler ( ) . executeStoredProcAsBatch ( ( procedureName == null ? org.ovirt.engine.core.dao.MassOperationsGenericDaoDbFacade.getProcedureNameForUpdate ( ) : procedureName ) , sortedParamValues , mapper ) ; }

Target:
protected void updateAllInBatch ( java.lang.String procedureName , java.util.Collection < T > paramValues , org.ovirt.engine.core.dal.dbbroker.MapSqlParameterMapper < T > mapper ) { java.util.List < T > sortedParamValues = new java.util.ArrayList < > ( paramValues ) ; java.util.Collections.sort ( sortedParamValues , org.ovirt.engine.core.common.businessentities.comparators.BusinessEntityComparator.< T , ID > newInstance ( ) ) ; org.ovirt.engine.core.dao.MassOperationsGenericDao.getCallsHandler ( ) . executeStoredProcAsBatch ( ( procedureName == null ? org.ovirt.engine.core.dao.MassOperationsGenericDao.getProcedureNameForUpdate ( ) : procedureName ) , sortedParamValues , mapper ) ; }
Source:
protected void executeVmCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue retValue = runVdsCommand ( VDSCommandType.ConvertVm , buildConvertParameters ( ) ) ; if ( retValue.getSucceeded ( ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( org.ovirt.engine.core.bll.ConvertVmCommand.getVdsId ( ) ) . addV2VJobForVm ( org.ovirt.engine.core.bll.ConvertVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.ConvertVmCommand.setSucceeded ( true ) ; } else { org.ovirt.engine.core.bll.ConvertVmCommand.log.error ( "Failed to convert VM" ) ; setCommandStatus ( CommandStatus.FAILED ) ; } }

Target:
protected org.ovirt.engine.core.vdsbroker.ResourceManager getResourceManager ( ) { return org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) ; }
Source:
protected boolean isDiskPassPciAndIdeLimit ( org.ovirt.engine.core.common.businessentities.Disk diskInfo ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > vmInterfaces = org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmNetworkInterfaceDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Disk > allVmDisks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) ; allVmDisks.add ( diskInfo ) ; return checkPciAndIdeLimit ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getnum_of_monitors ( ) , vmInterfaces , allVmDisks , org.ovirt.engine.core.bll.AbstractDiskVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean isDiskPassPciAndIdeLimit ( org.ovirt.engine.core.common.businessentities.Disk diskInfo ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmNetworkInterface > vmInterfaces = org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmNetworkInterfaceDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVmId ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Disk > allVmDisks = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getDiskMap ( ) . values ( ) ) ; allVmDisks.add ( diskInfo ) ; return checkPciAndIdeLimit ( org.ovirt.engine.core.bll.AbstractDiskVmCommand.getVm ( ) . getNumOfMonitors ( ) , vmInterfaces , allVmDisks , org.ovirt.engine.core.bll.AbstractDiskVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
protected void handleTaskReturn ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask asyncTask ) { org.ovirt.engine.core.compat.Guid externalTaskId = asyncTask.getTaskId ( ) ; asyncTaskStep.setStatus ( JobExecutionStatus.STARTED ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.updateStepExternalId ( asyncTaskStep , externalTaskId , ExternalSystemType.GLUSTER ) ; org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getExecutionContext ( ) . getJob ( ) . setStatus ( JobExecutionStatus.STARTED ) ; }

Target:
protected org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask handleTaskReturn ( org.ovirt.engine.core.common.asynctasks.gluster.GlusterAsyncTask asyncTask ) { org.ovirt.engine.core.compat.Guid externalTaskId = asyncTask.getTaskId ( ) ; asyncTaskStep.setStatus ( JobExecutionStatus.STARTED ) ; org.ovirt.engine.core.bll.job.ExecutionHandler.updateStepExternalId ( asyncTaskStep , externalTaskId , ExternalSystemType.GLUSTER ) ; org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getExecutionContext ( ) . getJob ( ) . setStatus ( JobExecutionStatus.STARTED ) ; asyncTask.setStepId ( asyncTaskStep.getId ( ) ) ; return asyncTask ; }
Source:
public void updateExistingVariable ( ) { java.lang.String name = "fence-kdump-listener" ; org.ovirt.engine.core.common.ExternalVariable existing = dao.get ( name ) ; existing.setValue ( "123456" ) ; existing.setUpdateDate ( new java.util.Date ( ) ) ; dao.update ( existing ) ; org.ovirt.engine.core.common.ExternalVariable found = dao.get ( name ) ; org.junit.Assert.assertNotNull ( found ) ; org.junit.Assert.assertEquals ( existing , found ) ; }

Target:
public void updateExistingVariable ( ) { java.lang.String name = "fence-kdump-listener" ; org.ovirt.engine.core.common.ExternalVariable existing = dao.get ( name ) ; existing.setValue ( "123456" ) ; existing.setUpdateDate ( new java.util.Date ( ) ) ; dao.update ( existing ) ; org.ovirt.engine.core.common.ExternalVariable found = dao.get ( name ) ; org.junit.jupiter.api.Assertions.assertNotNull ( found ) ; org.junit.jupiter.api.Assertions.assertEquals ( existing , found ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.AuditLog auditLog = auditLogDao.get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getParameters ( ) . getAuditLogId ( ) ) ; auditLogDao.remove ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getParameters ( ) . getAuditLogId ( ) ) ; setAuditLogDetails ( auditLog ) ; evict ( auditLogDirector.composeSystemObjectId ( this , auditLog.getLogType ( ) ) ) ; org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.AuditLog auditLog = auditLogDao.get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getParameters ( ) . getAuditLogId ( ) ) ; auditLogDao.remove ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.getParameters ( ) . getAuditLogId ( ) ) ; setAuditLogDetails ( auditLog ) ; auditLog.setUserId ( Guid.Empty ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logableToClear = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( auditLog ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventFloodRegulator eventFloodRegulator = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.EventFloodRegulator ( logableToClear , auditLog.getLogType ( ) ) ; eventFloodRegulator.evict ( ) ; org.ovirt.engine.core.bll.RemoveAuditLogByIdCommand.setSucceeded ( true ) ; }