auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.Assert.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveDisk , org.ovirt.engine.core.common.action.RemoveDiskParameters.class , new java.lang.String [ ] { "DiskId" } , new java.lang.Object [ ] { GUIDS [ 1 ] } , valid , success ) ) ; try { resource.remove ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.VnicProfileValidator validator = new org.ovirt.engine.core.bll.validator.VnicProfileValidator ( org.ovirt.engine.core.bll.network.vm.UpdateVnicProfileCommand.getVnicProfile ( ) ) ; return ( ( ( ( validate ( validator.vnicProfileIsSet ( ) ) ) && ( validate ( validator.vnicProfileExists ( ) ) ) ) && ( validate ( validator.networkExists ( ) ) ) ) && ( validate ( validator.vnicProfileNameNotUsed ( ) ) ) ) && ( validate ( validator.changingNetworkAllowed ( ) ) ) ; }

Target:
protected boolean canDoAction ( ) { org.ovirt.engine.core.bll.validator.VnicProfileValidator validator = new org.ovirt.engine.core.bll.validator.VnicProfileValidator ( org.ovirt.engine.core.bll.network.vm.UpdateVnicProfileCommand.getVnicProfile ( ) ) ; return ( ( ( ( validate ( validator.vnicProfileIsSet ( ) ) ) && ( validate ( validator.vnicProfileExists ( ) ) ) ) && ( validate ( validator.vnicProfileNameNotUsed ( ) ) ) ) && ( validate ( validator.networkNotChanged ( ) ) ) ) && ( validate ( validator.portMirroringNotChangedIfUsedByVms ( ) ) ) ; }
Source:
public boolean validate ( ) { getPath ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getVfsType ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; return ( getPath ( ) . getIsValid ( ) ) && ( getVfsType ( ) . getIsValid ( ) ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionType getAddStorageDomainVdcAction ( ) { return org.ovirt.engine.core.common.action.VdcActionType.AddGlusterFsStorageDomain ; }
Source:
public static boolean vmDeviceChanged ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.common.businessentities.VmDeviceGeneralType deviceType , boolean deviceEnabled ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.vmDeviceChanged ( vmId , deviceType , null , deviceEnabled ) ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VmBase getVmBase ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.businessentities.VM vm = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDao ( ) . get ( vmId ) ; org.ovirt.engine.core.common.businessentities.VmBase vmBase = ( vm != null ) ? vm.getStaticData ( ) : null ; if ( vmBase == null ) { vmBase = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmTemplateDao ( ) . get ( vmId ) ; } return vmBase ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateParameters ( volume , "name" , "volumeType" , "bricks" ) ; validateEnumParameters ( volume ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getMapper ( org.ovirt.engine.api.model.GlusterVolume.class , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) . map ( volume , null ) ; volumeEntity.setClusterId ( asGuid ( parent.get ( ) . getId ( ) ) ) ; mapBricks ( volume , volumeEntity ) ; return performCreation ( VdcActionType.CreateGlusterVolume , new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( volumeEntity ) , new org.ovirt.engine.api.restapi.resource.gluster.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.gluster.IdQueryParameters.class ) , true ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateParameters ( volume , "name" , "volumeType" , "bricks" ) ; validateEnumParameters ( volume ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getMapper ( org.ovirt.engine.api.model.GlusterVolume.class , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) . map ( volume , null ) ; volumeEntity.setClusterId ( asGuid ( parent.get ( ) . getId ( ) ) ) ; mapBricks ( volume , volumeEntity ) ; return performCreation ( VdcActionType.CreateGlusterVolume , new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( volumeEntity ) , new org.ovirt.engine.api.restapi.resource.gluster.QueryIdResolver < org.ovirt.engine.core.compat.Guid > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) , true ) ; }
Source:
protected void RemoveSnapshot ( org.ovirt.engine.core.common.businessentities.DiskImage snapshot ) { RemoveSnapshotFromDB ( snapshot ) ; AdditionalImageRemoveTreatment ( snapshot ) ; }

Target:
protected void setImageStatus ( org.ovirt.engine.core.common.businessentities.ImageStatus imageStatus ) { org.ovirt.engine.core.common.businessentities.DiskImage diskImage = ( org.ovirt.engine.core.bll.BaseImagesCommand.getParameters ( ) . isImportEntity ( ) ) ? getDestinationDiskImage ( ) : getDiskImage ( ) ; diskImage.setimageStatus ( imageStatus ) ; getImageDao ( ) . update ( diskImage.getImage ( ) ) ; }
Source:
protected void initSoundCard ( org.ovirt.engine.core.compat.Guid id ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isSoundcardEnabled ( new org.ovirt.engine.ui.frontend.AsyncQuery ( getModel ( ) , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { getModel ( ) . getIsSoundcardEnabled ( ) . setEntity ( returnValue ) ; } } ) , id ) ; }

Target:
protected void updateConsoleDevice ( org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetConsoleDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > consoleDevices = ( ( java.util.List < java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; } } ) ) ; }
Source:
public void isConnWithSameDetailsExistBlockDomains ( ) { 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.ovirt.engine.core.common.businessentities.StorageServerConnections connection1 = 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 ( connection1 ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertTrue ( isExists ) ; }

Target:
public void isConnWithSameDetailsExistBlockDomains ( ) { 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.ovirt.engine.core.common.businessentities.StorageServerConnections connection1 = 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 ( connection1 ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.jupiter.api.Assertions.assertTrue ( isExists ) ; }
Source:
protected void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetVdsGroupByVdsGroupId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 2 ] } , getVdsGroupEntity ( ) ) ; super . doTestBadUpdate ( canDo , success , detail ) ; }

Target:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetBallooningExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmTemplate , org.ovirt.engine.core.common.action.VmTemplateParametersBase.class , new java.lang.String [ ] { "VmTemplateId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void setValue ( java.lang.Object value , boolean fireEvents ) { }

Target:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.ListModel model , org.ovirt.engine.core.compat.Version dcCompatibilityVersion , org.ovirt.engine.core.compat.Guid dcId , org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel defaultProfile ) { driver.edit ( model ) ; profiles = ( ( java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel > ) ( model.getItems ( ) ) ) ; this . dcCompatibilityVersion = dcCompatibilityVersion ; this . dcId = dcId ; this . defaultProfile = defaultProfile ; init ( model ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( getVds ( ) . getStaticData ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsStaticDao ( ) . update ( getParameters ( ) . getVdsStaticData ( ) ) ; updateFenceAgents ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntity ( getVds ( ) . getStaticData ( ) ) ; vdsStaticDao.update ( getParameters ( ) . getVdsStaticData ( ) ) ; updateFenceAgents ( ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 1 ; }

Target:
public static boolean isMemorySnapshotSupported ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( vm == null ) { return false ; } boolean archMemorySnapshotSupported = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isMemorySnapshotSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ; return ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.MemorySnapshotSupported , vm.getVdsGroupCompatibilityVersion ( ) . toString ( ) ) ) ) && archMemorySnapshotSupported ; }
Source:
private void doAuthenticate ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { broker.runAdAction ( AdActionType.AuthenticateUser , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapUserPasswordBaseParameters ( input , output ) ) ; output.mput ( Authn.InvokeKeys.USER_MESSAGE , configuration.getProperty ( "config.change.password.msg" ) ) . mput ( Authn.InvokeKeys.CREDENTIALS_CHANGE_URL , configuration.getProperty ( "config.change.password.url" ) ) ; }

Target:
private void doAuthenticate ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { output.mput ( ( ( org.ovirt.engine.api.extensions.ExtMap ) ( broker.runAdAction ( AdActionType.AuthenticateUser , new org.ovirt.engine.extensions.aaa.builtin.kerberosldap.LdapUserPasswordBaseParameters ( configuration , input.< java.lang.String > get ( Authn.InvokeKeys.USER ) , input.< java.lang.String > get ( Authn.InvokeKeys.CREDENTIALS ) ) ) . getReturnValue ( ) ) ) ) ; output.mput ( Authn.InvokeKeys.USER_MESSAGE , configuration.getProperty ( "config.change.password.msg" ) ) . mput ( Authn.InvokeKeys.CREDENTIALS_CHANGE_URL , configuration.getProperty ( "config.change.password.url" ) ) ; }
Source:
private java.util.List < org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback > verifyRunAction ( int exepectedNumOfRunActionExecutions , boolean waitForResult ) { org.mockito.Mockito.verify ( frontend , org.mockito.Mockito.times ( exepectedNumOfRunActionExecutions ) ) . runMultipleAction ( org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.ui.uicommonweb.action.ACTION_TYPE ) , org.mockito.ArgumentMatchers.anyListOf ( org.ovirt.engine.core.common.action.VdcActionParametersBase.class ) , callbackCaptor.capture ( ) , org.mockito.ArgumentMatchers.eq ( false ) , org.mockito.ArgumentMatchers.eq ( waitForResult ) ) ; return callbackCaptor.getAllValues ( ) ; }

Target:
private java.util.List < org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback > verifyRunAction ( int exepectedNumOfRunActionExecutions , boolean waitForResult ) { org.mockito.Mockito.verify ( frontend , org.mockito.Mockito.times ( exepectedNumOfRunActionExecutions ) ) . runMultipleAction ( org.mockito.ArgumentMatchers.eq ( org.ovirt.engine.ui.uicommonweb.action.ACTION_TYPE ) , org.mockito.ArgumentMatchers.anyListOf ( org.ovirt.engine.core.common.action.ActionParametersBase.class ) , callbackCaptor.capture ( ) , org.mockito.ArgumentMatchers.eq ( false ) , org.mockito.ArgumentMatchers.eq ( waitForResult ) ) ; return callbackCaptor.getAllValues ( ) ; }
Source:
private void mockBackendQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValueMock = org.mockito.Mockito.when ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue.class ) . getReturnValue ( ) ) . thenReturn ( returnValue ) . getMock ( ) ; org.mockito.Mockito.when ( mockBackend.runPublicQuery ( org.mockito.Matchers.eq ( queryType ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ) . thenReturn ( queryReturnValueMock ) ; }

Target:
private void mockBackendQuery ( org.ovirt.engine.core.common.queries.VdcQueryType queryType , java.lang.Object returnValue ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryReturnValueMock = org.mockito.Mockito.when ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue.class ) . getReturnValue ( ) ) . thenReturn ( returnValue ) . getMock ( ) ; org.mockito.Mockito.when ( mockBackend.runPublicQuery ( org.mockito.ArgumentMatchers.eq ( queryType ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class ) ) ) . thenReturn ( queryReturnValueMock ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { return org.ovirt.engine.core.bll.MigrateVmCommand.getSucceeded ( ) ? ( org.ovirt.engine.core.bll.MigrateVmCommand.getActionReturnValue ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_DONE : org.ovirt.engine.core.bll.MigrateVmCommand.isInternalExecution ( ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START_SYSTEM_INITIATED : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START : _isRerun ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_TRYING_RERUN : ( org.ovirt.engine.core.bll.MigrateVmCommand.getVds ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED_DURING_MOVE_TO_MAINTENANCE : ( getDestinationVds ( ) ) == null ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED_NO_VDS_TO_RUN_ON : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_FAILED ; }

Target:
private org.ovirt.engine.core.common.AuditLogType getAuditLogForMigrationStarted ( ) { return org.ovirt.engine.core.bll.MigrateVmCommand.isInternalExecution ( ) ? org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START_SYSTEM_INITIATED : org.ovirt.engine.core.common.AuditLogType.VM_MIGRATION_START ; }
Source:
private void createSnapshotsForDisks ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getDisksList ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.CreateSnapshot , buildCreateSnapshotParameters ( image ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getContext ( ) ) ) ; if ( vdcReturnValue.getSucceeded ( ) ) { getTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcReturnValue.getFault ( ) . getError ( ) , "Failed to create snapshot!" ) ; } } }

Target:
private void createSnapshotsForDisks ( ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : getDisksList ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.CreateSnapshot , buildCreateSnapshotParameters ( image ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createDefaultContextForTasks ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getContext ( ) ) ) ; if ( vdcReturnValue.getSucceeded ( ) ) { getTaskIdList ( ) . addAll ( vdcReturnValue.getInternalVdsmTaskIdList ( ) ) ; } else { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( vdcReturnValue.getFault ( ) . getError ( ) , "Failed to create snapshot!" ) ; } } }
Source:
private void loadVncData ( org.ovirt.engine.ui.uicommonweb.models.HasConsoleModel model , org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.KeyMaker keyMaker ) { if ( ! ( ( model.getDefaultConsoleModel ( ) ) instanceof org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel ) ) { return ; } model.setSelectedProtocol ( ConsoleProtocol.VNC ) ; try { asVncConsoleModel ( model ) . setVncImplementation ( VncConsoleModel.ClientConsoleMode.valueOf ( clientStorage.getLocalItem ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.VNC_CLIENT_MODE ) ) ) ) ; } catch ( java.lang.Exception e ) { } }

Target:
private void loadVncData ( org.ovirt.engine.ui.uicommonweb.models.VmConsoles vmConsoles , org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.KeyMaker keyMaker ) { vmConsoles.selectProtocol ( ConsoleProtocol.VNC ) ; try { vmConsoles.getConsoleModel ( org.ovirt.engine.ui.uicommonweb.models.vms.VncConsoleModel.class ) . setVncImplementation ( VncConsoleModel.ClientConsoleMode.valueOf ( clientStorage.getLocalItem ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.VNC_CLIENT_MODE ) ) ) ) ; asVnc ( vmConsoles ) . setRemapCtrlAltDelete ( readBool ( keyMaker.make ( org.ovirt.engine.ui.common.utils.ConsoleOptionsFrontendPersisterImpl.REMAP_CAD_VNC ) ) ) ; } catch ( java.lang.Exception e ) { logger.log ( java.util.logging.Level.WARNING , ( "Failed loading VNC data. Exception message: " + ( e.getMessage ( ) ) ) ) ; } }
Source:
public void testListCrashClientLocale ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpMacPoolsQueryExpectations ( t ) ; collection.setUriInfo ( uriInfo ) ; try { getCollection ( ) ; org.junit.jupiter.api.Assertions.fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; } }

Target:
public void testListCrashClientLocale ( ) { javax.ws.rs.core.UriInfo uriInfo = setUpUriExpectations ( null ) ; locales.add ( org.ovirt.engine.api.restapi.resource.CLIENT_LOCALE ) ; java.lang.Throwable t = new java.lang.RuntimeException ( FAILURE ) ; setUpMacPoolsQueryExpectations ( t ) ; collection.setUriInfo ( uriInfo ) ; verifyFault ( org.junit.jupiter.api.Assertions.assertThrows ( javax.ws.rs.WebApplicationException.class , this :: getCollection ) , org.ovirt.engine.api.restapi.resource.BACKEND_FAILED_CLIENT_LOCALE , t ) ; }
Source:
com.gwtplatform.mvp.client.proxy.PlaceRequest getSubTabRequest ( ) { java.lang.String subTabName = modelProvider.getModel ( ) . getActiveDetailModel ( ) . getHashName ( ) ; java.lang.String requestToken = ( ( org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.getMainTabRequest ( ) . getNameToken ( ) ) + ( org.ovirt.engine.ui.webadmin.place.ApplicationPlaces.SUB_TAB_PREFIX ) ) + subTabName ; return new com.gwtplatform.mvp.client.proxy.PlaceRequest ( requestToken ) ; }

Target:
com.gwtplatform.mvp.client.proxy.PlaceRequest getSubTabRequest ( ) { java.lang.String subTabName = modelProvider.getModel ( ) . getActiveDetailModel ( ) . getHashName ( ) ; java.lang.String requestToken = ( ( org.ovirt.engine.ui.webadmin.section.main.presenter.AbstractMainTabWithDetailsPresenter.getMainTabRequest ( ) . getNameToken ( ) ) + ( org.ovirt.engine.ui.webadmin.place.ApplicationPlaces.SUB_TAB_PREFIX ) ) + subTabName ; return org.ovirt.engine.ui.common.place.PlaceRequestFactory.get ( requestToken ) ; }
Source:
private org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase getLoggableQuotaVdsGroupParams ( java.lang.String quotaName , java.lang.Double value , boolean isMemory ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.AddCustomValue ( "QuotaName" , quotaName ) ; java.lang.String str = ( isMemory ) ? "memPercentage" : "VCPUPercentage" ; logable.AddCustomValue ( str , value.toString ( ) ) ; return logable ; }

Target:
private org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase getLoggableQuotaStorageParams ( java.lang.String quotaName , double storageUsagePercentage , double storageRequestedPercentage ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase logable = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; logable.AddCustomValue ( "QuotaName" , quotaName ) ; logable.AddCustomValue ( "CurrentStorage" , org.ovirt.engine.core.bll.quota.QuotaManager.percentageFormatter.format ( storageUsagePercentage ) ) ; logable.AddCustomValue ( "Requested" , org.ovirt.engine.core.bll.quota.QuotaManager.percentageFormatter.format ( storageRequestedPercentage ) ) ; return logable ; }
Source:
public void testGetAllWithQuery ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getAllWithQuery ( ( ( "select * from gluster_volumes_view where vol_type = '" + ( GlusterVolumeType.DISTRIBUTED_REPLICATE.name ( ) ) ) + "'" ) ) ; org.junit.Assert.assertTrue ( ( volumes != null ) ) ; org.junit.Assert.assertTrue ( ( ( volumes.size ( ) ) == 1 ) ) ; org.junit.Assert.assertEquals ( existingReplVol , volumes.get ( 0 ) ) ; }

Target:
public void testGetAllWithQuery ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = dao.getAllWithQuery ( ( ( "select * from gluster_volumes_view where vol_type = '" + ( GlusterVolumeType.DISTRIBUTED_REPLICATE.name ( ) ) ) + "'" ) ) ; org.junit.Assert.assertNotNull ( volumes ) ; org.junit.Assert.assertEquals ( 1 , volumes.size ( ) ) ; org.junit.Assert.assertEquals ( existingReplVol , volumes.get ( 0 ) ) ; }
Source:
private void initOSType ( ) { getOSType ( ) . setItems ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getOsIds ( ) ) ; getOSType ( ) . setSelectedItem ( OsRepository.DEFAULT_OS ) ; }

Target:
private void vmInitEnabledChanged ( ) { if ( ! ( getVmInitEnabled ( ) . getEntity ( ) ) ) { getSysprepEnabled ( ) . setEntity ( false ) ; getCloudInitEnabled ( ) . setEntity ( false ) ; } else { getSysprepEnabled ( ) . setEntity ( getIsWindowsOS ( ) ) ; getCloudInitEnabled ( ) . setEntity ( ( ! ( getIsWindowsOS ( ) ) ) ) ; } }
Source:
public void onRefreshActiveModel ( org.ovirt.engine.ui.frontend.communication.RefreshActiveModelEvent event ) { if ( getTimer ( ) . isActive ( ) ) { if ( handleRefreshActiveModel ( event ) ) { syncSearch ( ) ; } if ( event.isDoFastForward ( ) ) { getTimer ( ) . fastForward ( ) ; } } }

Target:
public void onRefreshActiveModel ( org.ovirt.engine.ui.frontend.communication.RefreshActiveModelEvent event ) { if ( ( getTimer ( ) . isActive ( ) ) || ( refreshOnInactiveTimer ( ) ) ) { if ( handleRefreshActiveModel ( event ) ) { syncSearch ( ) ; } if ( event.isDoFastForward ( ) ) { getTimer ( ) . fastForward ( ) ; } } }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.ui.uicommonweb.Linq.DiskByAliasComparer ( ) ) ; setItems ( disks ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disks = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ; java.util.Collections.sort ( disks , new org.ovirt.engine.core.common.businessentities.comparators.DiskByDiskAliasComparator ( ) ) ; setItems ( disks ) ; }
Source:
private void movePoolToProblematicInDB ( org.ovirt.engine.core.common.businessentities.storage_pool storagePool ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolStatusChange ( storagePool.getId ( ) , StoragePoolStatus.Problematic , AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC , VdcBllErrors.ENGINE ) ; storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; }

Target:
private void movePoolToProblematicInDB ( org.ovirt.engine.core.common.businessentities.StoragePool storagePool ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getEventListener ( ) . storagePoolStatusChange ( storagePool.getId ( ) , StoragePoolStatus.NonResponsive , AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_PROBLEMATIC , VdcBllErrors.ENGINE ) ; storagePool.setspm_vds_id ( null ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolDao ( ) . update ( storagePool ) ; }
Source:
protected org.ovirt.engine.core.dao.DiskDao getDiskDao ( ) { return org.ovirt.engine.core.bll.ExportRepoImageCommand.getDbFacade ( ) . getDiskDao ( ) ; }

Target:
private boolean validateDiskImage ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.bll.ExportRepoImageCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.ExportRepoImageCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( ( disk != null ) && ( ! ( validate ( new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) . validateDiskIsNotLun ( ) ) ) ) ) { return false ; } if ( ( getDiskImage ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_DISK_NOT_EXIST ) ; } return true ; }
Source:
private static < R extends org.ovirt.engine.api.model.BaseResource > void setActions ( javax.ws.rs.core.UriInfo uriInfo , R model , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { org.ovirt.engine.api.restapi.util.LinkHelper.Collection collection = org.ovirt.engine.api.restapi.util.LinkHelper.getCollection ( model ) ; javax.ws.rs.core.UriBuilder uriBuilder = org.ovirt.engine.api.restapi.util.LinkHelper.getUriBuilder ( uriInfo , model , suggestedParentType ) ; if ( uriBuilder != null ) { org.ovirt.engine.api.restapi.util.ActionsBuilder actionsBuilder = new org.ovirt.engine.api.restapi.util.ActionsBuilder ( uriBuilder , collection.getResourceType ( ) ) ; model.setActions ( actionsBuilder.build ( ) ) ; } }

Target:
public static < R extends org.ovirt.engine.api.model.BaseResource > R addLinks ( R model ) { return org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( model , null ) ; }
Source:
private void assertExecuteActionFailure ( ) { try { underTest.executeCommand ( ) ; } catch ( java.lang.Exception expected ) { } org.junit.Assert.assertFalse ( underTest.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.NETWORK_ATTACH_NETWORK_TO_CLUSTER_FAILED , underTest.getAuditLogTypeValue ( ) ) ; }

Target:
private void assertExecuteActionFailure ( ) { try { underTest.executeCommand ( ) ; } catch ( java.lang.Exception expected ) { } org.junit.jupiter.api.Assertions.assertFalse ( underTest.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( AuditLogType.NETWORK_ATTACH_NETWORK_TO_CLUSTER_FAILED , underTest.getAuditLogTypeValue ( ) ) ; }
Source:
private static void copy ( java.lang.String resourceName , java.io.File outputDirectory ) throws java.io.IOException { org.ovirt.engine.api.rsdl.RsdlIOManager.copy ( org.ovirt.engine.api.rsdl.RsdlIOManager.loadAsStream ( ( "/" + resourceName ) ) , new java.io.FileOutputStream ( new java.io.File ( outputDirectory , resourceName ) ) ) ; }

Target:
private static void exportResource ( java.lang.String apiVersion , java.lang.String resourceName , java.io.File outputDirectory ) throws java.io.IOException { java.lang.String resourcePath = java.lang.String.format ( "/v%s/%s" , apiVersion , resourceName ) ; java.io.InputStream inputResource = org.ovirt.engine.api.rsdl.RsdlIOManager.class . getResourceAsStream ( resourcePath ) ; java.io.File outputFile = new java.io.File ( outputDirectory , resourceName ) ; java.lang.System.out.printf ( "Copying resource \"%s\" to file \"%s\"\n" , resourcePath , outputFile.getAbsolutePath ( ) ) ; org.apache.commons.io.FileUtils.copyInputStreamToFile ( inputResource , outputFile ) ; }
Source:
protected org.ovirt.engine.ui.common.widget.table.SimpleActionTable < T > createActionTable ( ) { return new org.ovirt.engine.ui.userportal.widget.table.column.UserPortalSimpleActionTable < T > ( modelProvider , getTableResources ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getClientStorage ( ) ) ; }

Target:
protected org.ovirt.engine.ui.common.widget.table.SimpleActionTable < T > createActionTable ( ) { return new org.ovirt.engine.ui.userportal.widget.table.UserPortalSimpleActionTable < T > ( modelProvider , getTableResources ( ) , getTableHeaderResources ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getEventBus ( ) , org.ovirt.engine.ui.userportal.gin.ClientGinjectorProvider.getClientStorage ( ) ) { @ java.lang.Override protected java.lang.String getTableContainerStyleName ( ) { return ( org.ovirt.engine.ui.userportal.section.main.view.AbstractSideTabWithDetailsView.this . getTableContainerStyleName ( ) ) == null ? super . getTableContainerStyleName ( ) : org.ovirt.engine.ui.userportal.section.main.view.AbstractSideTabWithDetailsView.this . getTableContainerStyleName ( ) ; } } ; }
Source:
private org.ovirt.engine.core.bll.RemoveQuotaCommand createCommand ( ) { org.ovirt.engine.core.common.action.QuotaCRUDParameters param = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( ) ; param.setQuotaId ( generalGuidQuota ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveQuotaCommand ( param ) ) ; org.mockito.Mockito.doReturn ( storagePoolDAO ) . when ( command ) . getStoragePoolDAO ( ) ; org.mockito.Mockito.doReturn ( quotaDAO ) . when ( command ) . getQuotaDAO ( ) ; org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; return command ; }

Target:
private org.ovirt.engine.core.bll.RemoveQuotaCommand createCommand ( ) { org.ovirt.engine.core.common.action.QuotaCRUDParameters param = new org.ovirt.engine.core.common.action.QuotaCRUDParameters ( ) ; param.setQuotaId ( generalGuidQuota ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveQuotaCommand ( param ) ) ; org.mockito.Mockito.doReturn ( storagePoolDAO ) . when ( command ) . getStoragePoolDAO ( ) ; org.mockito.Mockito.doReturn ( quotaDAO ) . when ( command ) . getQuotaDAO ( ) ; org.mockito.Mockito.doReturn ( vmDAO ) . when ( command ) . getVmDAO ( ) ; org.mockito.Mockito.doReturn ( quotaManager ) . when ( command ) . getQuotaManager ( ) ; return command ; }
Source:
private void mockStorageDomainDAOGetForStoragePool ( int domainSpaceGB , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.mockito.Mockito.when ( sdDAO.getForStoragePool ( org.mockito.Matchers.< org.ovirt.engine.core.compat.Guid > eq ( storageDomainId ) , org.mockito.Matchers.< org.ovirt.engine.core.compat.NGuid > any ( org.ovirt.engine.core.compat.NGuid.class ) ) ) . thenReturn ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.createStorageDomain ( domainSpaceGB , storageDomainId ) ) ; }

Target:
private void mockStorageDomainDAOGetForStoragePool ( int domainSpaceGB , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.mockito.Mockito.when ( sdDAO.getForStoragePool ( storageDomainId , org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_POOLD_ID ) ) . thenReturn ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.createStorageDomain ( domainSpaceGB , storageDomainId ) ) ; }
Source:
public static java.util.Collection < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > findAllInterfaceNetworkNameNotEmpty ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > items ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i : items ) { if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ) { ret.add ( i ) ; } } return ret ; }

Target:
public boolean match ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface i ) { return ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( i.getNetworkName ( ) ) ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( getId ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getGlusterServerUuid ( ) ) == null ? 0 : getGlusterServerUuid ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getKnownAddresses ( ) ) == null ? 0 : getKnownAddresses ( ) . hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { return java.util.Objects.hash ( serverId , glusterServerUuid , knownAddresses ) ; }
Source:
private void initCheckboxEditors ( ) { tcpTransportTypeEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; rdmaTransportTypeEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }

Target:
private void initCheckboxEditors ( ) { tcpTransportTypeEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; rdmaTransportTypeEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; arbiterVolumeEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; glusterAccessProtocolEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; nfsAccessProtocolEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; cifsAccessProtocolEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; optimizeForVirtStoreEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }
Source:
private static void setDiskList ( org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommandTestAbstract.getDiskImageList ( ) ) { vmTemplate.getDiskList ( ) . add ( diskImage ) ; } java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > diskImageTemplate = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommandTestAbstract.getDiskImageTempalteList ( ) ; for ( org.ovirt.engine.core.compat.Guid key : diskImageTemplate.keySet ( ) ) { vmTemplate.getDiskMap ( ) . put ( key , diskImageTemplate.get ( key ) ) ; } }

Target:
private static void setDiskList ( org.ovirt.engine.core.common.businessentities.VmTemplate vmTemplate ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommandTestAbstract.getDiskImageList ( ) ) { vmTemplate.getDiskList ( ) . add ( diskImage ) ; } java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > diskImageTemplate = org.ovirt.engine.core.bll.CommonVmPoolWithVmsCommandTestAbstract.getDiskImageTempalteList ( ) ; vmTemplate.getDiskTemplateMap ( ) . putAll ( diskImageTemplate ) ; }
Source:
public void unmanagedVlanNetworkWithVmNetworkDenied ( ) { org.ovirt.engine.core.common.businessentities.network.Network net1 = createNetwork ( "net1" ) ; org.ovirt.engine.core.common.businessentities.network.Network net2 = createNetwork ( "net2" ) ; net2.setVlanId ( 100 ) ; mockExistingNetworks ( net1 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net1 ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanNic = createVlan ( nic.getName ( ) , net2.getVlanId ( ) , net2.getName ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , vlanNic ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , nic.getName ( ) ) ; }

Target:
public void unmanagedVlanNetworkWithVmNetworkDenied ( ) { org.ovirt.engine.core.common.businessentities.network.Network net1 = createNetwork ( "net1" ) ; org.ovirt.engine.core.common.businessentities.network.Network net2 = createNetwork ( "net2" ) ; net2.setVlanId ( 100 ) ; mockExistingNetworks ( net1 ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic = createNicSyncedWithNetwork ( "nic0" , net1 ) ; mockExistingIfaces ( nic ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanNic = createVlan ( nic.getName ( ) , net2.getVlanId ( ) , net2.getName ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( nic , vlanNic ) ) ; validateAndExpectViolation ( helper , EngineMessage.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , nic.getName ( ) ) ; }
Source:
private void AddChildren ( org.ovirt.engine.core.common.businessentities.Tags tag ) { org.ovirt.engine.core.bll.TagsDirector.log.infoFormat ( "Tag {0} added to tree" , tag.gettag_name ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Tags > children = getTagDAO ( ) . getAllForParent ( tag.gettag_id ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Tags child : children ) { AddChildren ( child ) ; org.ovirt.engine.core.bll.TagsDirector.log.infoFormat ( "Tag {0} added as child to parent {1}" , child.gettag_name ( ) , tag.gettag_name ( ) ) ; tag.getChildren ( ) . add ( child ) ; AddTagToHash ( tag ) ; AddTagToHash ( child ) ; } }

Target:
private void addChildren ( org.ovirt.engine.core.common.businessentities.Tags tag ) { org.ovirt.engine.core.bll.TagsDirector.log.infoFormat ( "Tag {0} added to tree" , tag.gettag_name ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.Tags > children = getTagDAO ( ) . getAllForParent ( tag.gettag_id ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Tags child : children ) { addChildren ( child ) ; org.ovirt.engine.core.bll.TagsDirector.log.infoFormat ( "Tag {0} added as child to parent {1}" , child.gettag_name ( ) , tag.gettag_name ( ) ) ; tag.getChildren ( ) . add ( child ) ; addTagToHash ( tag ) ; addTagToHash ( child ) ; } }
Source:
public void testGetDbFieldName ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AdGroupConditionFieldAutoCompleter ( ) ; org.junit.Assert.assertEquals ( "$CN" , "$CN" , comp.getDbFieldName ( "NAME" ) ) ; org.junit.Assert.assertNull ( "name" , comp.getDbFieldType ( "name" ) ) ; org.junit.Assert.assertNull ( "22" , comp.getDbFieldType ( "22" ) ) ; }

Target:
public void testGetDbFieldName ( ) { org.ovirt.engine.core.searchbackend.IConditionFieldAutoCompleter comp = new org.ovirt.engine.core.searchbackend.AdGroupConditionFieldAutoCompleter ( ) ; org.junit.Assert.assertEquals ( "cn" , "cn" , comp.getDbFieldName ( "NAME" ) ) ; org.junit.Assert.assertNull ( "name" , comp.getDbFieldType ( "name" ) ) ; org.junit.Assert.assertNull ( "22" , comp.getDbFieldType ( "22" ) ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterHook model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.CHECKSUM , model.getChecksum ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.CONTENT , model.getContent ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterHook model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.clusterId.toString ( ) , model.getCluster ( ) . getId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.CHECKSUM , model.getChecksum ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterHookResourceTest.CONTENT , model.getContent ( ) ) ; verifyLinks ( model ) ; }
Source:
protected void addMoveOrCopyParameters ( java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , org.ovirt.engine.core.compat.Guid sourceStorageDomainGuid , org.ovirt.engine.core.compat.Guid destStorageDomainGuid , org.ovirt.engine.core.common.businessentities.DiskImage disk ) { org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = createParameters ( sourceStorageDomainGuid , destStorageDomainGuid , disk ) ; params.setQuotaId ( disk.getQuotaId ( ) ) ; params.setDiskProfileId ( disk.getDiskProfileId ( ) ) ; parameters.add ( params ) ; }

Target:
protected void addMoveOrCopyParameters ( java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters , org.ovirt.engine.core.compat.Guid sourceStorageDomainGuid , org.ovirt.engine.core.compat.Guid destStorageDomainGuid , org.ovirt.engine.core.common.businessentities.storage.DiskImage disk ) { org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = createParameters ( sourceStorageDomainGuid , destStorageDomainGuid , disk ) ; params.setQuotaId ( disk.getQuotaId ( ) ) ; params.setDiskProfileId ( disk.getDiskProfileId ( ) ) ; parameters.add ( params ) ; }
Source:
public static void getTemplateDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public static void getStorageDomainList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
private org.ovirt.engine.core.common.action.ImagesContainterParametersBase buildChildCommandParameters ( org.ovirt.engine.core.common.businessentities.storage.DiskImage cinderDisk ) { org.ovirt.engine.core.common.action.ImagesContainterParametersBase createParams = new org.ovirt.engine.core.common.action.ImagesContainterParametersBase ( cinderDisk.getId ( ) ) ; createParams.setVmSnapshotId ( newActiveSnapshotId ) ; createParams.setParentHasTasks ( ( ( ! ( cachedImagesDisks.isEmpty ( ) ) ) || ( getMemoryImageBuilder ( ) . isCreateTasks ( ) ) ) ) ; return withRootCommandInfo ( createParams , getActionType ( ) ) ; }

Target:
private org.ovirt.engine.core.common.action.ImagesContainterParametersBase buildChildCommandParameters ( org.ovirt.engine.core.common.businessentities.storage.DiskImage cinderDisk ) { org.ovirt.engine.core.common.action.ImagesContainterParametersBase createParams = new org.ovirt.engine.core.common.action.ImagesContainterParametersBase ( cinderDisk.getId ( ) ) ; createParams.setVmSnapshotId ( newActiveSnapshotId ) ; createParams.setParentHasTasks ( ( ( ! ( cachedImagesDisks.isEmpty ( ) ) ) || ( getMemoryImageBuilder ( ) . isCreateTasks ( ) ) ) ) ; createParams.setDescription ( getParameters ( ) . getDescription ( ) ) ; return withRootCommandInfo ( createParams , getActionType ( ) ) ; }