auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected org.ovirt.engine.core.common.action.VdcActionParametersBase getAddParameters ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity , org.ovirt.engine.api.model.NIC nic ) { return new org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters ( parentId , setNetwork ( nic , entity ) ) ; }

Target:
protected org.ovirt.engine.core.common.action.VdcActionParametersBase getAddParameters ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity , org.ovirt.engine.api.model.NIC nic ) { org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface iface = setNetwork ( nic , entity ) ; return new org.ovirt.engine.core.common.action.AddVmTemplateInterfaceParameters ( parentId , iface , ( nic.isSetNetwork ( ) ? iface.getNetworkName ( ) : null ) , ( nic.isSetPortMirroring ( ) ? iface.isPortMirroring ( ) : false ) ) ; }
Source:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { if ( ( object.getLastAlignmentScan ( ) ) != null ) { java.lang.String lastScanDate = com.google.gwt.i18n.client.DateTimeFormat.getFormat ( "yyyy-MM-dd, HH:mm" ) . format ( object.getLastAlignmentScan ( ) ) ; setTitle ( org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.messages.lastDiskAlignment ( lastScanDate ) ) ; } else { setTitle ( null ) ; } return object.getAlignment ( ) . toString ( ) ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setEnumTitle ( object.getVmEntityType ( ) ) ; return ( object.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.VM ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.vmsImage ( ) : ( object.getVmEntityType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.TEMPLATE ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.templatesImage ( ) : null ; }
Source:
public org.ovirt.optimizer.solver.test.TestOptimizer addVm ( org.ovirt.engine.sdk.entities.VM vm ) { bestSolution.getVms ( ) . add ( vm ) ; return this ; }

Target:
public org.ovirt.optimizer.solver.test.TestOptimizer addVm ( org.ovirt.engine.sdk.entities.VM vm ) { bestSolution.getVms ( ) . put ( vm.getId ( ) , vm ) ; final org.ovirt.optimizer.solver.facts.Instance instance = new org.ovirt.optimizer.solver.facts.Instance ( vm ) ; primaryInstances.put ( vm , instance ) ; bestSolution.getInstances ( ) . add ( instance ) ; return this ; }
Source:
public java.util.concurrent.Future < java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse > > batchCall ( java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest > requests ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.internal.BatchCall call = new org.ovirt.vdsm.jsonrpc.client.internal.BatchCall ( requests ) ; for ( final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request : requests ) { if ( ( this . runningCalls.putIfAbsent ( request.getId ( ) , call ) ) != null ) { throw new org.ovirt.vdsm.jsonrpc.client.RequestAlreadySentException ( ) ; } } this . getClient ( ) . sendMessage ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.jsonToByteArray ( requests , objectMapper ) ) ; retryBatchCall ( requests , call ) ; return call ; }

Target:
public java.util.concurrent.Future < java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcResponse > > batchCall ( java.util.List < org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest > requests ) throws org.ovirt.vdsm.jsonrpc.client.ClientConnectionException { final org.ovirt.vdsm.jsonrpc.client.internal.BatchCall call = new org.ovirt.vdsm.jsonrpc.client.internal.BatchCall ( requests ) ; for ( final org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request : requests ) { this . tracker.registerCall ( request , call ) ; } this . getClient ( ) . sendMessage ( org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.jsonToByteArray ( requests , objectMapper ) ) ; retryBatchCall ( requests , call ) ; return call ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeReplaceBrickStart ( java.lang.String volumeName , java.lang.String existingBrickDir , java.lang.String newBrickDir ) { try { return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( vdsServer.glusterVolumeReplaceBrickStart ( volumeName , existingBrickDir , newBrickDir ) ) ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesListReturnForXmlRpc glusterVolumeInfo ( org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumesList ( volumeName ) ; org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumesListReturnForXmlRpc ( clusterId , xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
protected void buildModel ( org.ovirt.engine.core.common.businessentities.VmBase vmBase , org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.BuilderExecutionFinished < org.ovirt.engine.core.common.businessentities.VmBase , org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel > callback ) { super . buildModel ( vmBase , callback ) ; if ( ! ( instanceTypeManager.isActive ( ) ) ) { org.ovirt.engine.ui.uicommonweb.builders.BuilderExecutor.build ( vmBase , getModel ( ) , new org.ovirt.engine.ui.uicommonweb.builders.vm.HwOnlyVmBaseToUnitBuilder ( ) ) ; } }

Target:
public void setupWindowFromVmBase ( org.ovirt.engine.core.common.businessentities.VmBase from ) { doChangeDefaultHost ( from.getDedicatedVmForVdsList ( ) ) ; getModel ( ) . getCustomPropertySheet ( ) . deserialize ( from.getCustomProperties ( ) ) ; setupWindowModelFrom ( from ) ; }
Source:
public void testExistingPassDiscardFunctionalityIsPreservedAllLunsHaveDiscardFunctionality ( ) { setSdFullDiscardSupport ( ) ; storageDomainDisks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; junit.framework.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , true ) , createLunWithDiscardFunctionality ( 2048L , true ) ) , storageDomain ) ) ; }

Target:
public void testExistingPassDiscardFunctionalityIsPreservedAllLunsHaveDiscardFunctionality ( ) { setSdFullDiscardSupport ( ) ; storageDomainDisks.add ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; org.junit.Assert.assertTrue ( discardHelper.isExistingPassDiscardFunctionalityPreserved ( java.util.Arrays.asList ( createLunWithDiscardFunctionality ( 1024L , true ) , createLunWithDiscardFunctionality ( 2048L , true ) ) , storageDomain ) ) ; }
Source:
private void handleVdsLiveSnapshotFailure ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.warnFormat ( "Could not perform live snapshot due to error: {0}. VM will still be configured to the new created snapshot" , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; addCustomValue ( "SnapshotName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotName ( ) ) ; addCustomValue ( "VmName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ; updateCallStackFromThrowable ( e ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE ) ; }

Target:
private void handleVdsLiveSnapshotFailure ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.warn ( "Could not perform live snapshot due to error, VM will still be configured to the new created snapshot: {}" , org.apache.commons.lang.exception.ExceptionUtils.getMessage ( e ) ) ; addCustomValue ( "SnapshotName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotName ( ) ) ; addCustomValue ( "VmName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ; updateCallStackFromThrowable ( e ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE ) ; }
Source:
public static < T > java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ToEntityModelList ( java.util.ArrayList < T > list ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > entityModelList = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; if ( list != null ) { for ( java.lang.Object item : list ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel model = new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( ) ; model.setEntity ( item ) ; entityModelList.add ( model ) ; } } return entityModelList ; }

Target:
public static < T > java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > toEntityModelList ( java.util.ArrayList < T > list ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > entityModelList = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; if ( list != null ) { for ( java.lang.Object item : list ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel model = new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( ) ; model.setEntity ( item ) ; entityModelList.add ( model ) ; } } return entityModelList ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel > getEntityList ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel > labels = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.LABELS.length ) ; i ++ ) { labels.add ( getEntity ( i ) ) ; } return labels ; }

Target:
private java.util.List < org.ovirt.engine.api.model.NetworkLabel > getEntityList ( ) { java.util.List < org.ovirt.engine.api.model.NetworkLabel > labels = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( org.ovirt.engine.api.restapi.resource.BackendNetworkLabelsResourceTest.LABELS.length ) ; i ++ ) { labels.add ( getEntity ( i ) ) ; } return labels ; }
Source:
private void ExpandAll ( ) { SetIsExpandedRecursively ( true , getItems ( ) . get ( 0 ) ) ; }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getResetCommand ( ) ) ) { reset ( ) ; } else if ( command == ( getExpandAllCommand ( ) ) ) { expandAll ( ) ; } else if ( command == ( getCollapseAllCommand ( ) ) ) { collapseAll ( ) ; } }
Source:
private void sortVms ( java.util.Collection < org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > > vms ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsList = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < org.ovirt.engine.core.common.businessentities.VM > vm : vms ) { vmsList.add ( vm.getEntity ( ) ) ; } java.util.Collections.sort ( vmsList , new org.ovirt.engine.core.common.businessentities.comparators.LexoNumericNameableComparator ( ) ) ; vms.clear ( ) ; for ( org.ovirt.engine.core.common.businessentities.VM vm : vmsList ) { vms.add ( new org.ovirt.engine.ui.uicommonweb.models.EntityModel ( vm ) ) ; } }

Target:
public boolean validateArchitectures ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsToImport = getVmsToImport ( ) ; final org.ovirt.engine.core.common.businessentities.StoragePool dataCenter = getDataCenters ( ) . getSelectedItem ( ) ; if ( ( vmsToImport.isEmpty ( ) ) || ( dataCenter == null ) ) { return false ; } return ( validateSameArchitecture ( vmsToImport ) ) && ( validateClusterExistsForArchitecture ( vmsToImport.get ( 0 ) . getClusterArch ( ) , dataCenter ) ) ; }
Source:
public javax.ws.rs.core.Response end ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "status" ) ; return doAction ( VdcActionType.EndExternalJob , new org.ovirt.engine.core.common.action.EndExternalJobParameters ( guid , org.ovirt.engine.api.restapi.types.JobMapper.map ( action.getStatus ( ) , null ) , ( action.isSetForce ( ) ? action.isForce ( ) : false ) ) , action ) ; }

Target:
public javax.ws.rs.core.Response end ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "status" ) ; org.ovirt.engine.api.model.JobStatus status = org.ovirt.engine.api.model.JobStatus.fromValue ( action.getStatus ( ) ) ; return doAction ( VdcActionType.EndExternalJob , new org.ovirt.engine.core.common.action.EndExternalJobParameters ( guid , org.ovirt.engine.api.restapi.types.JobMapper.mapJobStatus ( status ) , ( action.isSetForce ( ) ? action.isForce ( ) : false ) ) , action ) ; }
Source:
private boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.isInternalExecution ( ) ) || ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.RestartVds ) ) ) ? 0 : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getVds ( ) . getName ( ) , getRequestedAuditEvent ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addValidationMessage ( EngineMessage.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.addValidationMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }

Target:
private boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.isInternalExecution ( ) ) || ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.RestartVds ) ) ) ? 0 : auditLogDao.getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getVds ( ) . getName ( ) , getRequestedAuditEvent ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addValidationMessage ( EngineMessage.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.addValidationMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }
Source:
private org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface lookupNic ( org.ovirt.engine.core.compat.Guid nicId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = getBackendCollection ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface.class , VdcQueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : nics ) { if ( java.util.Objects.equals ( nic.getId ( ) , nicId ) ) { return nic ; } } return null ; }

Target:
private org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface lookupNic ( org.ovirt.engine.core.compat.Guid nicId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = getBackendCollection ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface.class , QueryType.GetVmInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : nics ) { if ( java.util.Objects.equals ( nic.getId ( ) , nicId ) ) { return nic ; } } return null ; }
Source:
protected org.ovirt.engine.api.model.Tag lookupTagByName ( java.lang.String name ) { for ( org.ovirt.engine.core.common.businessentities.Tags tag : getBackendCollection ( org.ovirt.engine.core.common.businessentities.Tags.class , VdcQueryType.GetAllTags , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ) { if ( tag.getTagName ( ) . equals ( name ) ) { return map ( tag ) ; } } return handleError ( new org.ovirt.engine.api.restapi.resource.EntityNotFoundException ( name ) , false ) ; }

Target:
protected org.ovirt.engine.api.model.Tag lookupTagByName ( java.lang.String name ) { for ( org.ovirt.engine.core.common.businessentities.Tags tag : getBackendCollection ( org.ovirt.engine.core.common.businessentities.Tags.class , QueryType.GetAllTags , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ) { if ( tag.getTagName ( ) . equals ( name ) ) { return map ( tag ) ; } } return handleError ( new org.ovirt.engine.api.restapi.resource.EntityNotFoundException ( name ) , false ) ; }
Source:
private void afterMigrationFrom ( org.ovirt.engine.core.common.businessentities.VmDynamic runningVm , org.ovirt.engine.core.common.businessentities.VM vmToUpdate ) { org.ovirt.engine.core.common.businessentities.VMStatus oldVmStatus = vmToUpdate.getStatus ( ) ; if ( ( oldVmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( runningVm.getstatus ( ) . isGuestUp ( ) ) ) { _vmsToRerun.add ( runningVm.getId ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "adding VM {0} to re-run list" , runningVm.getId ( ) ) ; vmToUpdate.setMigratingToVds ( null ) ; } }

Target:
private void afterMigrationFrom ( org.ovirt.engine.core.common.businessentities.VmDynamic runningVm , org.ovirt.engine.core.common.businessentities.VM vmToUpdate ) { org.ovirt.engine.core.common.businessentities.VMStatus oldVmStatus = vmToUpdate.getStatus ( ) ; if ( ( oldVmStatus == ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) && ( runningVm.getstatus ( ) . isGuestUp ( ) ) ) { _vmsToRerun.add ( runningVm.getId ( ) ) ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.infoFormat ( "Adding VM {0} to re-run list" , runningVm.getId ( ) ) ; vmToUpdate.setMigratingToVds ( null ) ; } }
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase object ) { org.ovirt.engine.ui.common.widget.uicommon.storage.AbstractSanStorageView.Driver.driver.edit ( object ) ; initLists ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.core.compat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.core.compat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( propName.equals ( "IsValid" ) ) { onIsValidPropertyChange ( object ) ; } } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.storage.SanStorageModelBase object ) { org.ovirt.engine.ui.common.widget.uicommon.storage.AbstractSanStorageView.Driver.driver.edit ( object ) ; initLists ( object ) ; object.getPropertyChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { java.lang.String propName = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) . PropertyName ; if ( propName.equals ( "IsValid" ) ) { onIsValidPropertyChange ( object ) ; } } } ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > networkQoSes = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ; networkQoSes.add ( 0 , org.ovirt.engine.ui.uicommonweb.models.profiles.VnicProfileModel.getEmptyQos ( ) ) ; getNetworkQoS ( ) . setItems ( networkQoSes ) ; setSelectedNetworkQoSId ( defaultQosId ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > networkQoSes = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( ReturnValue ) ) ; getNetworkQoS ( ) . setItems ( networkQoSes ) ; getNetworkQoS ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.findNetworkQosById ( networkQoSes , defaultQosId ) ) ; }
Source:
public void testDetachSuccess ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpActionExpectations ( ActionType.DetachStorageConnectionFromStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ; javax.ws.rs.core.Response response = resource.remove ( ) ; assertEquals ( 200 , response.getStatus ( ) ) ; }

Target:
public void testDetachSuccess ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpGetEntityExpectations ( ) ; setUpActionExpectations ( ActionType.DetachStorageConnectionFromStorageDomain , org.ovirt.engine.core.common.action.AttachDetachStorageConnectionParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ; javax.ws.rs.core.Response response = resource.remove ( ) ; org.junit.Assert.assertEquals ( 200 , response.getStatus ( ) ) ; }
Source:
public void getoVirtISOsList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? new java.util.ArrayList < > ( ( ( java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ) ( source ) ) ) : new java.util.ArrayList < org.ovirt.engine.core.compat.RpmVersion > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetoVirtISOs , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotSchedule fetchedSchedule = getGlusterVolumeSnapshotScheduleDao ( ) . getByVolumeId ( getGlusterVolumeId ( ) ) ; if ( fetchedSchedule == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_NOT_SCHEDULED ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ! ( super . validate ( ) ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeSnapshotSchedule fetchedSchedule = glusterVolumeSnapshotScheduleDao.getByVolumeId ( getGlusterVolumeId ( ) ) ; if ( fetchedSchedule == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_GLUSTER_VOLUME_SNAPSHOT_NOT_SCHEDULED ) ; } return true ; }
Source:
private static void toStringBuilder ( java.lang.Iterable xmlRpc , java.lang.StringBuilder builder ) { if ( xmlRpc == null ) { return ; } for ( java.lang.Object value : xmlRpc ) { if ( value instanceof java.lang.Iterable ) { org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcObjectDescriptor.toStringBuilder ( ( ( java.lang.Iterable ) ( value ) ) , builder ) ; } else { builder.append ( value.toString ( ) ) ; builder.append ( "\n" ) ; } } }

Target:
private static void toStringBuilder ( java.lang.Iterable xmlRpc , java.lang.StringBuilder builder ) { if ( xmlRpc == null ) { return ; } for ( java.lang.Object value : xmlRpc ) { if ( value instanceof java.lang.Iterable ) { org.ovirt.engine.core.vdsbroker.ObjectDescriptor.toStringBuilder ( ( ( java.lang.Iterable ) ( value ) ) , builder ) ; } else { builder.append ( value.toString ( ) ) ; builder.append ( "\n" ) ; } } }
Source:
public static int random ( int maxNum ) { return ( ( int ) ( ( java.lang.Math.random ( ) ) * ( maxNum + 1 ) ) ) ; }

Target:
public static org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity findBrick ( java.util.Collection < org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity > bricks , org.ovirt.engine.core.compat.Guid serverId , java.lang.String brickDir ) { for ( org.ovirt.engine.core.common.businessentities.gluster.GlusterBrickEntity brick : bricks ) { if ( ( brick.getServerId ( ) . equals ( serverId ) ) && ( brick.getBrickDirectory ( ) . equals ( brickDir ) ) ) { return brick ; } } return null ; }
Source:
private void Edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel.createInstance ( getEntityStronglyTyped ( ) , cluster.getcompatibility_version ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , ( ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ) ( getSelectedItem ( ) ) ) , this ) ; setWindow ( model ) ; }

Target:
private void edit ( ) { if ( ( getWindow ( ) ) != null ) { return ; } org.ovirt.engine.ui.uicommonweb.models.vms.VmInterfaceModel model = org.ovirt.engine.ui.uicommonweb.models.vms.EditTemplateInterfaceModel.createInstance ( getEntityStronglyTyped ( ) , cluster.getcompatibility_version ( ) , ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ) ( getItems ( ) ) ) , ( ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface ) ( getSelectedItem ( ) ) ) , this ) ; setWindow ( model ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeEventListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand.equals ( getModel ( ) . getDetailsCommand ( ) ) ) { return eventPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.gluster.VolumeParameterListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getAddParameterCommand ( ) ) ) { return addParameterPopupProvider.get ( ) ; } else if ( lastExecutedCommand == ( getModel ( ) . getEditParameterCommand ( ) ) ) { return editParameterPopupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
static org.ovirt.engine.api.model.Disk getModel ( int index ) { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; model.setSparse ( true ) ; model.setBootable ( false ) ; model.setShareable ( false ) ; model.setAllowSnapshot ( false ) ; model.setPropagateErrors ( true ) ; return model ; }

Target:
static org.ovirt.engine.api.model.Disk getModel ( int index ) { org.ovirt.engine.api.model.Disk model = new org.ovirt.engine.api.model.Disk ( ) ; model.setFormat ( DiskFormat.COW.toString ( ) ) ; model.setInterface ( DiskInterface.VirtIO.toString ( ) ) ; model.setSparse ( true ) ; model.setBootable ( false ) ; model.setShareable ( false ) ; model.setAllowSnapshot ( false ) ; model.setPropagateErrors ( true ) ; return model ; }
Source:
public void run ( ) { org.ovirt.engine.core.bll.RunVmCommandBase.DoCompressionCheck ( vds , vmDynamic ) ; if ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.PowerClientAutoMigrateToPowerClientOnConnect ) ) || ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.PowerClientAutoMigrateFromPowerClientToVdsWhenConnectingFromRegularClient ) ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.PowerClientMigrateOnConnectCheck , new org.ovirt.engine.core.common.action.PowerClientMigrateOnConnectCheckParameters ( false , vmDynamic.getId ( ) , vmDynamic.getclient_ip ( ) , vds.getId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; } }

Target:
public void run ( ) { org.ovirt.engine.core.bll.RunVmCommandBase.doCompressionCheck ( vds , vmDynamic ) ; if ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.PowerClientAutoMigrateToPowerClientOnConnect ) ) || ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.PowerClientAutoMigrateFromPowerClientToVdsWhenConnectingFromRegularClient ) ) ) { org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.PowerClientMigrateOnConnectCheck , new org.ovirt.engine.core.common.action.PowerClientMigrateOnConnectCheckParameters ( false , vmDynamic.getId ( ) , vmDynamic.getclient_ip ( ) , vds.getId ( ) ) , org.ovirt.engine.core.bll.job.ExecutionHandler.createInternalJobContext ( ) ) ; } }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; updateDefaultNetworkFilterIfRequired ( ) ; vnicProfileDao.save ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) ) ; org.ovirt.engine.core.bll.network.cluster.NetworkHelper.addPermissionsOnVnicProfile ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getCurrentUser ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getParameters ( ) . isPublicUse ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) . setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; updateDefaultNetworkFilterIfRequired ( ) ; vnicProfileDao.save ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) ) ; networkHelper.addPermissionsOnVnicProfile ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getCurrentUser ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) . getId ( ) , org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getParameters ( ) . isPublicUse ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getReturnValue ( ) . setActionReturnValue ( org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.getVnicProfile ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.network.vm.AddVnicProfileCommand.setSucceeded ( true ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.action.MigrateVmToServerParameters ) ) { return false ; } org.ovirt.engine.core.common.action.MigrateVmToServerParameters other = ( ( org.ovirt.engine.core.common.action.MigrateVmToServerParameters ) ( obj ) ) ; return ( super . equals ( obj ) ) && ( org.ovirt.engine.core.common.utils.ObjectUtils.objectsEqual ( vdsId , other.vdsId ) ) ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.action.MigrateVmToServerParameters ) ) { return false ; } org.ovirt.engine.core.common.action.MigrateVmToServerParameters other = ( ( org.ovirt.engine.core.common.action.MigrateVmToServerParameters ) ( obj ) ) ; return ( super . equals ( obj ) ) && ( java.util.Objects.equals ( vdsId , other.vdsId ) ) ; }
Source:
public static boolean isDisplayTypeSupported ( int osId , org.ovirt.engine.core.common.businessentities.DisplayType defaultDisplayType , java.util.List < java.lang.String > reasons , org.ovirt.engine.core.compat.Version clusterVersion ) { boolean result = org.ovirt.engine.core.bll.validator.VmValidationUtils.isDisplayTypeSupported ( osId , clusterVersion , defaultDisplayType ) ; if ( ! result ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_VM_DISPLAY_TYPE_IS_NOT_SUPPORTED_BY_OS.name ( ) ) ; } return result ; }

Target:
public static boolean isGraphicsAndDisplaySupported ( int osId , java.util.Collection < org.ovirt.engine.core.common.businessentities.GraphicsType > graphics , org.ovirt.engine.core.common.businessentities.DisplayType displayType , java.util.List < java.lang.String > reasons , org.ovirt.engine.core.compat.Version clusterVersion ) { boolean result = org.ovirt.engine.core.bll.validator.VmValidationUtils.isGraphicsAndDisplaySupported ( osId , clusterVersion , graphics , displayType ) ; if ( ! result ) { reasons.add ( VdcBllMessages.ACTION_TYPE_FAILED_ILLEGAL_VM_DISPLAY_TYPE_IS_NOT_SUPPORTED_BY_OS.name ( ) ) ; } return result ; }
Source:
protected void syncSearch ( ) { org.ovirt.engine.core.common.VdcObjectType objType = getObjectType ( ) ; boolean directOnly = ( objType == ( org.ovirt.engine.core.common.VdcObjectType.VM ) ) ? true : false ; org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters tempVar = new org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ( ) ; tempVar.setObjectId ( getEntityGuid ( ) ) ; tempVar.setVdcObjectType ( objType ) ; tempVar.setDirectOnly ( directOnly ) ; tempVar.setRefresh ( getIsQueryFirstTime ( ) ) ; super . syncSearch ( VdcQueryType.GetPermissionsForObject , tempVar ) ; }

Target:
protected void syncSearch ( ) { org.ovirt.engine.core.common.VdcObjectType objType = getObjectType ( ) ; boolean directOnly = ( objType == ( org.ovirt.engine.core.common.VdcObjectType.VM ) ) ? true : false ; org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters tempVar = new org.ovirt.engine.core.common.queries.GetPermissionsForObjectParameters ( ) ; tempVar.setObjectId ( getEntityGuid ( ) ) ; tempVar.setVdcObjectType ( objType ) ; tempVar.setDirectOnly ( directOnly ) ; tempVar.setRefresh ( getIsQueryFirstTime ( ) ) ; tempVar.setAllUsersWithPermission ( getAllUsersWithPermission ( ) ) ; super . syncSearch ( VdcQueryType.GetPermissionsForObject , tempVar ) ; }
Source:
public org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity entity = new org.ovirt.engine.core.dao.JobSubjectEntityDaoFacadeImpl.JobSubjectEntity ( ) ; entity.setEntityId ( getGuidDefaultEmpty ( rs , "entity_id" ) ) ; entity.setEntityType ( org.ovirt.engine.core.common.VdcObjectType.valueOf ( rs.getString ( "entity_type" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.SubjectEntity mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { return new org.ovirt.engine.core.common.businessentities.SubjectEntity ( org.ovirt.engine.core.common.VdcObjectType.valueOf ( rs.getString ( "entity_type" ) ) , getGuidDefaultEmpty ( rs , "entity_id" ) ) ; }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > imagesSubtract ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > images , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.DiskImage > imagesToSubtract ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > subtract = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage image : images ) { if ( ( org.ovirt.engine.ui.uicommonweb.Linq.getDiskImageById ( image.getId ( ) , imagesToSubtract ) ) == null ) { subtract.add ( image ) ; } } return subtract ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesSubtract ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > images , java.lang.Iterable < org.ovirt.engine.core.common.businessentities.storage.DiskImage > imagesToSubtract ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > subtract = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage image : images ) { if ( ( org.ovirt.engine.ui.uicommonweb.Linq.getDiskImageById ( image.getId ( ) , imagesToSubtract ) ) == null ) { subtract.add ( image ) ; } } return subtract ; }
Source:
public void testGetUserIDWithNoUser ( ) { org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery query = new org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery ( new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ; junit.framework.Assert.assertEquals ( "wrong guid" , null , query.getUserID ( ) ) ; }

Target:
public void testGetUserID ( ) { org.ovirt.engine.core.common.businessentities.DbUser user = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.DbUser.class ) ; org.mockito.Mockito.when ( user.getId ( ) ) . thenReturn ( Guid.EVERYONE ) ; java.lang.String session = org.jgroups.util.UUID.randomUUID ( ) . toString ( ) ; org.ovirt.engine.core.bll.session.SessionDataContainer.getInstance ( ) . setUser ( session , user ) ; org.ovirt.engine.core.common.queries.VdcQueryParametersBase params = new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( session ) ; params.setRefresh ( false ) ; org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery query = new org.ovirt.engine.core.bll.QueriesCommandBaseTest.ThereIsNoSuchQuery ( params ) ; org.junit.Assert.assertEquals ( "wrong guid" , Guid.EVERYONE , query.getUserID ( ) ) ; }
Source:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BONDS_INVALID_SLAVE_COUNT , bond.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 , VdcBllMessages.NETWORK_INTERFACES_NOT_EXCLUSIVELY_USED_BY_NETWORK , nic.getName ( ) ) ; }
Source:
public void canDoActionFailsWhenGlusterServerHasPeers ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterDBUtils.serverExists ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.Matchers.eq ( org.ovirt.engine.core.bll.hostdeploy.AddVdsCommandTest.PEER_1 ) ) ) . thenReturn ( false ) ; org.junit.Assert.assertFalse ( commandMock.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( commandMock.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.SERVER_ALREADY_PART_OF_ANOTHER_CLUSTER.toString ( ) ) ) ; }

Target:
public void validateSucceedsWhenHasPeersThrowsException ( ) throws java.lang.Exception { setupGlusterMock ( true , new org.ovirt.engine.core.common.businessentities.VDS ( ) , true ) ; org.mockito.Mockito.when ( glusterUtil.getPeers ( org.mockito.Matchers.any ( org.ovirt.engine.core.bll.utils.EngineSSHClient.class ) ) ) . thenThrow ( new java.lang.RuntimeException ( ) ) ; org.junit.Assert.assertTrue ( commandMock.validate ( ) ) ; }
Source:
private static void setGatewayIfManagementNetwork ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , java.lang.String gateway ) { if ( org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) . equals ( iface.getNetworkName ( ) ) ) { iface.setGateway ( gateway ) ; } }

Target:
private static void setGatewayIfManagementNetwork ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.core.common.businessentities.VDS host , java.lang.String gateway ) { if ( ( org.ovirt.engine.core.utils.NetworkUtils.getEngineNetwork ( ) . equals ( iface.getNetworkName ( ) ) ) || ( iface.getName ( ) . equals ( host.getActiveNic ( ) ) ) ) { iface.setGateway ( gateway ) ; } }
Source:
public void testRemove ( ) throws java.lang.Exception { 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.BackendDataCenterNetworkResourceTest.NETWORK_ID } , getEntity ( 0 ) ) ; setUpActionExpectations ( VdcActionType.RemoveNetwork , org.ovirt.engine.core.common.action.RemoveNetworkParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.NETWORK_ID } , true , true ) ; verifyRemove ( resource.remove ( ) ) ; }

Target:
public void testRemoveNonExistant ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByDataCenterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendDataCenterNetworkResourceTest.dataCenterId } , new java.util.ArrayList < org.ovirt.engine.api.model.Network > ( ) , null ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { assertNotNull ( wae.getResponse ( ) ) ; assertEquals ( 404 , wae.getResponse ( ) . getStatus ( ) ) ; } }
Source:
public void search ( ) { if ( ( getSearchPageSize ( ) ) == ( org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.UnknownInteger ) ) { asyncCallback.requestSearch ( ) ; } else { stopRefresh ( ) ; if ( getIsQueryFirstTime ( ) ) { setSelectedItem ( null ) ; org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.setSelectedItems ( null ) ; } if ( ( getIsTimerDisabled ( ) ) == false ) { setIsQueryFirstTime ( true ) ; syncSearch ( ) ; setIsQueryFirstTime ( false ) ; getTimer ( ) . start ( ) ; } else { syncSearch ( ) ; } } }

Target:
protected void doGridTimerExecute ( ) { org.ovirt.engine.ui.uicommonweb.models.SearchableListModel.logger.fine ( ( ( this . getClass ( ) . getName ( ) ) + ": Executing search" ) ) ; syncSearch ( ) ; }
Source:
public static void getStorageDomainListByTemplate ( 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByVmTemplateId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , aQuery ) ; }

Target:
public void getDataCenterList ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }
Source:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { "" } , canDo , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadUpdate ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetEntityWithNoCertificateInfoExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVds , org.ovirt.engine.core.common.action.UpdateVdsActionParameters.class , new java.lang.String [ ] { "RootPassword" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostResourceTest.ROOT_PASSWORD } , canDo , success ) ) ; try { resource.update ( org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }