auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void isConnectionForISCSIDomainAttached ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( "0cc146e8-e5ed-482c-8814-270bc48c297e" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = getConnections ( ) ; connections.add ( connection ) ; org.mockito.Mockito.doReturn ( connections ) . when ( validator ) . getAllConnectionsForDomain ( domain.getId ( ) ) ; org.junit.Assert.assertTrue ( validator.isConnectionForISCSIDomainAttached ( domain ) ) ; }

Target:
public void isConnectionForISCSIDomainAttached ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections connection = new org.ovirt.engine.core.common.businessentities.StorageServerConnections ( ) ; connection.setId ( org.ovirt.engine.core.bll.validator.storage.StorageConnectionValidatorTest.CONNECTION_ID_FOR_VALIDATION ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = getConnections ( ) ; connections.add ( connection ) ; org.mockito.Mockito.doReturn ( connections ) . when ( validator ) . getAllConnectionsForDomain ( domain.getId ( ) ) ; org.junit.Assert.assertTrue ( validator.isConnectionForISCSIDomainAttached ( domain ) ) ; }
Source:
public static void GetExternalProviderHostList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid providerId ) { 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.VDS > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetHostListFromExternalProvider , new org.ovirt.engine.core.common.queries.GetHostListFromExternalProviderParameters ( providerId ) , aQuery ) ; }

Target:
private static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }
Source:
public void canRunVmDuringInit ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }

Target:
public void canRunVmDuringInit ( ) { final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.mockito.Mockito.doReturn ( true ) . when ( runVmValidator ) . isVmDuringInitiating ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; org.ovirt.engine.core.bll.validator.RunVmValidatorTest.validateResult ( runVmValidator.vmDuringInitialization ( vm ) , false , EngineMessage.ACTION_TYPE_FAILED_VM_IS_RUNNING ) ; }
Source:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc getReturnStatus ( ) { org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc status = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusForXmlRpc ( ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = ( ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ) ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getReturnValue ( ) ) ) ; if ( result == null ) { status.code = 1 ; status.message = "" ; } else { status.code = ( ( result.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult.Status.ERROR ) ) ? 1 : 0 ; status.message = result.getMessage ( ) ; } return status ; }

Target:
protected org.ovirt.engine.core.vdsbroker.vdsbroker.Status getReturnStatus ( ) { org.ovirt.engine.core.vdsbroker.vdsbroker.Status status = new org.ovirt.engine.core.vdsbroker.vdsbroker.Status ( ) ; org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult result = ( ( org.ovirt.engine.core.common.businessentities.pm.FenceOperationResult ) ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getReturnValue ( ) ) ) ; if ( result == null ) { status.code = 1 ; status.message = "" ; } else { status.code = ( ( result.getStatus ( ) ) == ( FenceOperationResult.Status.ERROR ) ) ? 1 : 0 ; status.message = result.getMessage ( ) ; } return status ; }
Source:
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 ) ; }

Target:
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 ) ; }
Source:
protected void flush ( ) { super . flush ( ) ; networkQoS.setName ( ( ( java.lang.String ) ( getName ( ) . getEntity ( ) ) ) ) ; networkQoS.setStoragePoolId ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenters ( ) . getSelectedItem ( ) ) ) . getId ( ) ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.network.NetworkQoS flush ( ) { super . flush ( ) ; networkQoS.setName ( ( ( java.lang.String ) ( getName ( ) . getEntity ( ) ) ) ) ; networkQoS.setStoragePoolId ( ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getDataCenters ( ) . getSelectedItem ( ) ) ) . getId ( ) ) ; return networkQoS ; }
Source:
private boolean validateInterfaceNotProcessedAlready ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { if ( ifaceNames.contains ( iface.getName ( ) ) ) { if ( isBond ( iface ) ) { violations.add ( VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; } else { violations.add ( VdcBllMessages.NETWORK_INTERFACE_NAME_ALREADY_IN_USE ) ; } return false ; } ifaceNames.add ( iface.getName ( ) ) ; return true ; }

Target:
private boolean addInterfaceToProcessedList ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { if ( ifaceNames.contains ( iface.getName ( ) ) ) { if ( isBond ( iface ) ) { violations.add ( VdcBllMessages.NETWORK_BOND_NAME_EXISTS ) ; } else { violations.add ( VdcBllMessages.NETWORK_INTERFACE_NAME_ALREADY_IN_USE ) ; } return false ; } ifaceNames.add ( iface.getName ( ) ) ; return true ; }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getParameters ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.bll.FenceExecutor executor = new org.ovirt.engine.core.bll.FenceExecutor ( vds ) ; org.ovirt.engine.core.common.vdscommands.VDSFenceReturnValue result = executor.checkHostStatus ( ) ; if ( result.getSucceeded ( ) ) { org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getQueryReturnValue ( ) . setReturnValue ( result ) ; } else { handleError ( result ) ; } }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVdsDao ( ) . get ( org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getParameters ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.bll.pm.HostFenceActionExecutor executor = new org.ovirt.engine.core.bll.pm.HostFenceActionExecutor ( vds ) ; org.ovirt.engine.core.bll.GetVdsFenceStatusQuery.getQueryReturnValue ( ) . setReturnValue ( executor.fence ( FenceActionType.STATUS ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.commonModel = null ; loginModel.resetAfterLogout ( ) ; user.onUserLogout ( ) ; frontendFailureEventListener.hide ( ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { loginModel.resetAfterLogout ( ) ; user.onUserLogout ( ) ; com.google.gwt.core.client.Scheduler.get ( ) . scheduleDeferred ( new com.google.gwt.core.client.Scheduler.ScheduledCommand ( ) { @ java.lang.Override public void execute ( ) { org.ovirt.engine.ui.common.uicommon.model.CommonModelManager.commonModel = null ; } } ) ; }
Source:
private void createSnapshotsForDisks ( ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage image : getDisksList ( ) ) { org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValue = executeChildCommand ( image.getImageId ( ) ) ; 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.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 static void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public static void GetProviderCertificateChain ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetProviderCertificateChain , new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( provider ) , aQuery ) ; }
Source:
public org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient call ( ) throws java.lang.Exception { org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = reactorForClient.createClient ( org.ovirt.vdsm.jsonrpc.client.reactors.TestReactor.HOSTNAME , 6668 ) ; client.addEventListener ( new org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.MessageListener ( ) { @ java.lang.Override public void onMessageReceived ( byte [ ] message ) { queue.add ( message ) ; } } ) ; client.setRetryPolicy ( new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy ( 2000 , 10 , java.io.IOException.class ) ) ; client.connect ( ) ; return client ; }

Target:
public org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient call ( ) throws java.lang.Exception { org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient client = reactorForClient.createClient ( org.ovirt.vdsm.jsonrpc.client.reactors.TestReactor.HOSTNAME , 6668 ) ; client.addEventListener ( new org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient.MessageListener ( ) { @ java.lang.Override public void onMessageReceived ( byte [ ] message ) { queue.add ( message ) ; } } ) ; client.setRetryPolicy ( new org.ovirt.vdsm.jsonrpc.client.utils.retry.RetryPolicy ( 2000 , 10 , 10000 , java.io.IOException.class ) ) ; client.connect ( ) ; return client ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc prepareImage ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.prepareImage ( sdID , spID , imageID , volumeID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.PrepareImageReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc verifyUntrustedVolume ( java.lang.String spID , java.lang.String sdID , java.lang.String imageID , java.lang.String volumeID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.verifyUntrustedVolume ( sdID , spID , imageID , volumeID ) ; org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.irsbroker.StatusReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( java.lang.String volumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepStatus" ) . withParameter ( "volName" , volumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeConfigListXmlRpc glusterVolumeGeoRepConfigList ( java.lang.String volumeName , java.lang.String slaveHost , java.lang.String slaveVolumeName ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.geoRepConfigList" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "remoteHost" , slaveHost ) . withParameter ( "remoteVolumeName" , slaveVolumeName ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeConfigListXmlRpc ( response ) ; }
Source:
private boolean isVmMigratable ( ) { if ( ( java.lang.Boolean.TRUE.equals ( getModel ( ) . getRunVMOnSpecificHost ( ) . getEntity ( ) ) ) || ( ( ( java.lang.Boolean.FALSE.equals ( getModel ( ) . getIsAutoAssign ( ) . getEntity ( ) ) ) && ( java.lang.Boolean.TRUE.equals ( getModel ( ) . getDontMigrateVM ( ) . getEntity ( ) ) ) ) && ( java.lang.Boolean.TRUE.equals ( getModel ( ) . getHostCpu ( ) . getEntity ( ) ) ) ) ) { return false ; } return true ; }

Target:
private boolean isVmMigratable ( ) { return ( getModel ( ) . getMigrationMode ( ) . getSelectedItem ( ) ) != ( org.ovirt.engine.core.common.businessentities.MigrationSupport.PINNED_TO_HOST ) ; }
Source:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void countAllTemplates ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
protected boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.isInternalExecution ( ) ) ? 0 : org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getAuditLogDao ( ) . getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.getVds ( ) . getName ( ) , AuditLogType.USER_VDS_RESTART.name ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addValidationMessage ( EngineMessage.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.pm.RestartVdsCommand.addValidationMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }

Target:
protected boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.isInternalExecution ( ) ) ? 0 : auditLogDao.getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.getVds ( ) . getName ( ) , AuditLogType.USER_VDS_RESTART.name ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addValidationMessage ( EngineMessage.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.pm.RestartVdsCommand.addValidationMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }
Source:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = createBondSlaves ( null , 1 ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; }

Target:
public void onlyOneSlaveForBonding ( ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface bond = createBond ( org.ovirt.engine.core.bll.SetupNetworksHelperTest.BOND_NAME , null ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > slaves = java.util.Arrays.asList ( createNic ( "nic0" , null ) ) ; mockExistingIfacesWithBond ( bond , slaves ) ; org.ovirt.engine.core.bll.SetupNetworksHelper helper = createHelper ( createParametersForBond ( bond , slaves ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.NETWORK_BOND_PARAMETERS_INVALID ) ; }
Source:
protected boolean verifySourceDomains ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > poolDomainsMap = org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getPoolDomains ( ) ) ; java.util.EnumSet < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > validDomainStatuses = java.util.EnumSet.of ( StorageDomainStatus.Active ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > templateDiskImages = org.ovirt.engine.core.bll.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getImagesToCheckDestinationStorageDomains ( ) , true , false , false ) ; validDisksDomains = org.ovirt.engine.core.bll.ImagesHandler.findDomainsInApplicableStatusForDisks ( templateDiskImages , poolDomainsMap , validDomainStatuses ) ; return validate ( new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( templateDiskImages ) . diskImagesOnAnyApplicableDomains ( validDisksDomains , poolDomainsMap , EngineMessage.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , validDomainStatuses ) ) ; }

Target:
protected boolean verifySourceDomains ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.StorageDomain > poolDomainsMap = org.ovirt.engine.core.common.businessentities.Entities.businessEntitiesById ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getPoolDomains ( ) ) ; java.util.EnumSet < org.ovirt.engine.core.common.businessentities.StorageDomainStatus > validDomainStatuses = java.util.EnumSet.of ( StorageDomainStatus.Active ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > templateDiskImages = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.filterImageDisks ( org.ovirt.engine.core.bll.AddVmFromTemplateCommand.getImagesToCheckDestinationStorageDomains ( ) , true , false , false ) ; validDisksDomains = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.findDomainsInApplicableStatusForDisks ( templateDiskImages , poolDomainsMap , validDomainStatuses ) ; return validate ( new org.ovirt.engine.core.bll.validator.storage.DiskImagesValidator ( templateDiskImages ) . diskImagesOnAnyApplicableDomains ( validDisksDomains , poolDomainsMap , EngineMessage.ACTION_TYPE_FAILED_NO_VALID_DOMAINS_STATUS_FOR_TEMPLATE_DISKS , validDomainStatuses ) ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( "repoimagename" , ( ( getDiskImage ( ) ) != null ? getDiskImage ( ) . getDiskAlias ( ) : "" ) ) ; } return jobProperties ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getJobMessageProperties ( ) { if ( ( jobProperties ) == null ) { jobProperties = super . getJobMessageProperties ( ) ; jobProperties.put ( "repoimagename" , getRepoImageName ( ) ) ; } return jobProperties ; }
Source:
protected void startSubStep ( ) { asyncTaskStep = org.ovirt.engine.core.bll.job.ExecutionHandler.addSubStep ( this . getExecutionContext ( ) , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getExecutionContext ( ) . getJob ( ) . getStep ( StepEnum.EXECUTING ) , getStepType ( ) , org.ovirt.engine.core.dal.job.ExecutionMessageDirector.resolveStepMessage ( getStepType ( ) , getStepMessageMap ( ) ) ) ; }

Target:
protected void startSubStep ( ) { asyncTaskStep = org.ovirt.engine.core.bll.job.ExecutionHandler.addSubStep ( this . getExecutionContext ( ) , org.ovirt.engine.core.bll.gluster.GlusterAsyncCommandBase.getExecutionContext ( ) . getJob ( ) . getStep ( StepEnum.EXECUTING ) , getStepType ( ) , org.ovirt.engine.core.dal.job.ExecutionMessageDirector.resolveStepMessage ( getStepType ( ) , getStepMessageMap ( JobExecutionStatus.STARTED ) ) ) ; }
Source:
public void resolve ( ) { if ( ( entry ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol bootproto = org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ; if ( bootProtocolDhcp ( ) ) { bootproto = org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.DHCP ; } else if ( org.apache.commons.lang.StringUtils.isNotEmpty ( fetchIpAddress ( ) ) ) { bootproto = org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ; } if ( bootproto == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) { java.lang.String gateway = fetchGateway ( ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( gateway ) ) { org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.setGatewayIfNecessary ( iface , gateway ) ; } } iface.setBootProtocol ( bootproto ) ; }

Target:
public void resolve ( ) { if ( ( entry ) == null ) { return ; } org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol bootproto = org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ; if ( bootProtocolDhcp ( ) ) { bootproto = org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.DHCP ; } else if ( org.apache.commons.lang.StringUtils.isNotEmpty ( fetchIpAddress ( ) ) ) { bootproto = org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ; } if ( bootproto == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.STATIC_IP ) ) { java.lang.String gateway = fetchGateway ( ) ; if ( org.apache.commons.lang.StringUtils.isNotEmpty ( gateway ) ) { org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilder.setGatewayIfNecessary ( iface , gateway ) ; } } iface.setIpv4BootProtocol ( bootproto ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_pool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool pool = pools.get ( 0 ) ; if ( pool != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetStorageDomainList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; if ( pool != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getStorageDomainList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }
Source:
private void endVmRelatedOps ( ) { org.ovirt.engine.core.bll.ImportVmCommand.setVm ( null ) ; if ( ( getVm ( ) ) != null ) { org.ovirt.engine.core.bll.VmHandler.unLockVm ( getVm ( ) ) ; } else { org.ovirt.engine.core.bll.ImportVmCommand.setCommandShouldBeLogged ( false ) ; org.ovirt.engine.core.bll.ImportVmCommand.log.warn ( "ImportVmCommand::EndImportCommand: Vm is null - not performing full endAction" ) ; } }

Target:
private void removeMemoryVolumes ( java.lang.String memoryVolume , org.ovirt.engine.core.compat.Guid vmId ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = runInternalAction ( VdcActionType.RemoveMemoryVolumes , new org.ovirt.engine.core.common.action.RemoveMemoryVolumesParameters ( memoryVolume , vmId ) , org.ovirt.engine.core.bll.ImportVmCommand.cloneContextAndDetachFromParent ( ) ) ; if ( ! ( retVal.getSucceeded ( ) ) ) { org.ovirt.engine.core.bll.ImportVmCommand.log.error ( "Failed to remove memory volumes '{}'" , memoryVolume ) ; } }
Source:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry = new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY , org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_DOMAIN_ID , FixturesTool.DEFAULT_QUOTA_GENERAL , FixturesTool.DISK_PROFILE_1 ) ; dao.save ( entry ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY ) ; org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertEquals ( 1 , entries.size ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entryFromDb = entries.get ( 0 ) ; org.junit.Assert.assertEquals ( entry , entryFromDb ) ; }

Target:
public void testSave ( ) { org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entry = new org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY , FixturesTool.STORAGE_DOMAIN_SCALE_SD5 , FixturesTool.DEFAULT_QUOTA_GENERAL , FixturesTool.DISK_PROFILE_1 ) ; dao.save ( entry ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap > entries = dao.getAllByImageId ( org.ovirt.engine.core.dao.ImageStorageDomainMapDaoTest.EXISTING_IMAGE_ID_WITH_NO_MAP_ENTRY ) ; org.junit.Assert.assertNotNull ( entries ) ; org.junit.Assert.assertEquals ( 1 , entries.size ( ) ) ; org.ovirt.engine.core.common.businessentities.storage.ImageStorageDomainMap entryFromDb = entries.get ( 0 ) ; org.junit.Assert.assertEquals ( entry , entryFromDb ) ; }
Source:
protected boolean setAndValidateCpuProfile ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) . getTemplateType ( ) ) == ( org.ovirt.engine.core.common.businessentities.VmEntityType.INSTANCE_TYPE ) ) { return true ; } return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ; }

Target:
protected boolean setAndValidateCpuProfile ( ) { if ( ( isInstanceType ( ) ) || ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.isBlankTemplate ( ) ) ) { return true ; } return validate ( org.ovirt.engine.core.bll.profiles.CpuProfileHelper.setAndValidateCpuProfile ( org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVmTemplate ( ) , org.ovirt.engine.core.bll.UpdateVmTemplateCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) ; }
Source:
private boolean canScheduleVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.compat.Guid > blacklist = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; if ( ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) != null ) { blacklist.add ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) ; } return org.ovirt.engine.core.bll.scheduling.SchedulingManager.getInstance ( ) . canSchedule ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsGroup ( ) , vm , blacklist , java.util.Collections.< org.ovirt.engine.core.compat.Guid > emptyList ( ) , vm.getDedicatedVmForVds ( ) , new java.util.ArrayList < java.lang.String > ( ) ) ; }

Target:
private boolean canScheduleVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { java.util.List < org.ovirt.engine.core.compat.Guid > blacklist = new java.util.ArrayList < > ( ) ; if ( ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) != null ) { blacklist.add ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsId ( ) ) ; } return schedulingManager.canSchedule ( org.ovirt.engine.core.bll.MaintenanceVdsCommand.getVdsGroup ( ) , vm , blacklist , java.util.Collections.< org.ovirt.engine.core.compat.Guid > emptyList ( ) , vm.getDedicatedVmForVdsList ( ) , new java.util.ArrayList < java.lang.String > ( ) ) ; }
Source:
public void mixedClusterServicesSupported ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AllowClusterWithVirtGlusterEnabled , true ) ; org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( cluster.supportsVirtService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.mixedClusterServicesSupported ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void clusterServiceDefined ( ) { org.mockito.Mockito.when ( cluster.supportsGlusterService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.clusterServiceDefined ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.compat.Guid qosId = getQosId ( ) ; org.ovirt.engine.core.common.businessentities.network.HostNetworkQos oldQos = getQosDao ( ) . get ( qosId ) ; org.ovirt.engine.core.common.businessentities.network.HostNetworkQos newQos = getQos ( ) ; super . executeCommand ( ) ; if ( networkUpdateRequired ( oldQos , newQos ) ) { applyNetworkChangesToHosts ( ) ; } }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.compat.Guid qosId = getQosId ( ) ; org.ovirt.engine.core.common.businessentities.network.HostNetworkQos oldQos = getQosDao ( ) . get ( qosId ) ; org.ovirt.engine.core.common.businessentities.network.HostNetworkQos newQos = getQos ( ) ; super . executeCommand ( ) ; if ( networkUpdateRequired ( oldQos , newQos ) ) { refreshNetworks ( refreshNetworksParametersFactory.create ( qosId ) ) ; } }
Source:
protected void executeCommand ( ) { MoveVdssToGoingToMaintananceMode ( ) ; MigrateAllVdss ( ) ; for ( org.ovirt.engine.core.compat.Guid id : _vdsGroupIds ) { java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForCluster ( id ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : networks ) { org.ovirt.engine.core.bll.AttachNetworkToVdsGroupCommand.SetNetworkStatus ( id , net ) ; } } org.ovirt.engine.core.bll.MaintananceNumberOfVdssCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { MoveVdssToGoingToMaintananceMode ( ) ; MigrateAllVdss ( ) ; for ( org.ovirt.engine.core.compat.Guid id : _vdsGroupIds ) { java.util.List < org.ovirt.engine.core.common.businessentities.Network > networks = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getNetworkDao ( ) . getAllForCluster ( id ) ; for ( org.ovirt.engine.core.common.businessentities.Network net : networks ) { org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelper.setStatus ( id , net ) ; } } org.ovirt.engine.core.bll.MaintananceNumberOfVdssCommand.setSucceeded ( true ) ; }
Source:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap entity = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; entity.setstorage_id ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( rs.getString ( "storage_id" ) ) ) ; entity.setstorage_pool_id ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( rs.getString ( "storage_pool_id" ) ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.forValue ( rs.getInt ( "status" ) ) ) ; return entity ; }

Target:
public org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap entity = new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap ( ) ; entity.setstorage_id ( getGuidDefaultEmpty ( rs , "storage_id" ) ) ; entity.setstorage_pool_id ( getGuid ( rs , "storage_pool_id" ) ) ; entity.setstatus ( org.ovirt.engine.core.common.businessentities.StorageDomainStatus.forValue ( rs.getInt ( "status" ) ) ) ; return entity ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( ( ( java.lang.Boolean ) ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ) ) ; param.setConsoleEnabled ( ( ( java.lang.Boolean ) ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }

Target:
public void queryFailed ( ) { stopProgress ( this ) ; cancel ( ) ; }
Source:
protected org.ovirt.engine.ui.webadmin.widget.provider.DnsServerEditor createWidget ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > value ) { org.ovirt.engine.ui.webadmin.widget.provider.DnsServerEditor widget = new org.ovirt.engine.ui.webadmin.widget.provider.DnsServerEditor ( ) ; widget.edit ( value ) ; return widget ; }

Target:
protected org.ovirt.engine.ui.webadmin.widget.provider.DnsServerEditor createWidget ( org.ovirt.engine.ui.uicommonweb.models.EntityModel < java.lang.String > value ) { org.ovirt.engine.ui.webadmin.widget.provider.DnsServerEditor widget = new org.ovirt.engine.ui.webadmin.widget.provider.DnsServerEditor ( ) ; if ( usePatternFly ) { widget.setUsePatternFly ( true ) ; widget.hideLabel ( ) ; widget.getElement ( ) . getStyle ( ) . setWidth ( width , Unit.PX ) ; } widget.edit ( value ) ; return widget ; }
Source:
public void testAddAllSupportedHostFeature ( ) { java.util.Set < java.lang.String > newFatures = new java.util.HashSet < > ( java.util.Arrays.asList ( "NEW__FEATURE_1" , "NEW__FEATURE_2" , "NEW__FEATURE_3" ) ) ; dao.addAllSupportedHostFeature ( org.ovirt.engine.core.dao.SupportedHostFeatureDaoTest.EXISTING_HOST_ID_1 , newFatures ) ; java.util.Set < java.lang.String > featuresSupported = dao.getSupportedHostFeaturesByHostId ( org.ovirt.engine.core.dao.SupportedHostFeatureDaoTest.EXISTING_HOST_ID_1 ) ; org.junit.Assert.assertTrue ( "Failed to add the feature" , featuresSupported.containsAll ( newFatures ) ) ; }

Target:
public void testRemoveAllSupportedHostFeature ( ) { java.util.Set < java.lang.String > featuresSupported = dao.getSupportedHostFeaturesByHostId ( FixturesTool.HOST_ID ) ; org.junit.Assert.assertFalse ( featuresSupported.isEmpty ( ) ) ; dao.removeAllSupportedHostFeature ( FixturesTool.HOST_ID , featuresSupported ) ; java.util.Set < java.lang.String > featuresSupportedAfterDeletion = dao.getSupportedHostFeaturesByHostId ( FixturesTool.HOST_ID ) ; org.junit.Assert.assertTrue ( "Failed to remove addtional supported features" , featuresSupportedAfterDeletion.isEmpty ( ) ) ; }
Source:
private java.lang.String formatSpiceMenuItem ( int parentId , int itemId , java.lang.String itemText , int itemCode ) { return new java.lang.StringBuilder ( java.lang.Integer.toString ( parentId ) ) . append ( "\r" ) . append ( itemId ) . append ( "\r" ) . append ( itemText ) . append ( "\r" ) . append ( itemCode ) . append ( "\r\n" ) . toString ( ) ; }

Target:
private java.lang.String formatSpiceMenuItem ( int parentId , int itemId , java.lang.String itemText , int itemCode ) { return new java.lang.StringBuilder ( java.lang.Integer.toString ( parentId ) ) . append ( "\r" ) . append ( itemId ) . append ( "\r" ) . append ( itemText.replaceAll ( "_" , "__" ) ) . append ( "\r" ) . append ( itemCode ) . append ( "\r\n" ) . toString ( ) ; }
Source:
public void testGetAllInterfacesByLabelForCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces = dao.getAllInterfacesByLabelForCluster ( FixturesTool.CLUSTER , org.ovirt.engine.core.dao.network.InterfaceDaoImplTest.LABEL ) ; org.junit.Assert.assertNotNull ( interfaces ) ; org.junit.Assert.assertFalse ( interfaces.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : interfaces ) { org.junit.Assert.assertTrue ( nic.getLabels ( ) . contains ( org.ovirt.engine.core.dao.network.InterfaceDaoImplTest.LABEL ) ) ; } }

Target:
public void testGetAllInterfacesByLabelForCluster ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > interfaces = dao.getAllInterfacesByLabelForCluster ( FixturesTool.CLUSTER , org.ovirt.engine.core.dao.network.InterfaceDaoImplTest.LABEL ) ; org.junit.jupiter.api.Assertions.assertNotNull ( interfaces ) ; org.junit.jupiter.api.Assertions.assertFalse ( interfaces.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic : interfaces ) { org.junit.jupiter.api.Assertions.assertTrue ( nic.getLabels ( ) . contains ( org.ovirt.engine.core.dao.network.InterfaceDaoImplTest.LABEL ) ) ; } }
Source:
protected void executeVmCommand ( ) { if ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVm ( ) . getStatus ( ) . isUpOrPaused ( ) ) { org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.updateDisksFromDb ( ) ; performPlugCommand ( getPlugAction ( ) , getDisk ( ) , oldVmDevice ) ; } updateDeviceProperties ( ) ; if ( disk.isBoot ( ) ) { updateBootOrder ( ) ; } org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVmStaticDAO ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVm ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.setSucceeded ( true ) ; }

Target:
protected void executeVmCommand ( ) { if ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVm ( ) . getStatus ( ) . isUpOrPaused ( ) ) { org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.updateDisksFromDb ( ) ; performPlugCommand ( getPlugAction ( ) , getDisk ( ) , oldVmDevice ) ; } updateDeviceProperties ( ) ; if ( disk.isBoot ( ) ) { updateBootOrder ( ) ; } org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVmStaticDao ( ) . incrementDbGeneration ( org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.getVm ( ) . getId ( ) ) ; org.ovirt.engine.core.bll.HotPlugDiskToVmCommand.setSucceeded ( true ) ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getTemplateDisks ( ) { if ( ( ( _templateDisks ) == null ) && ( ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) ) { org.ovirt.engine.core.bll.VmTemplateHandler.UpdateDisksFromDb ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; _templateDisks = org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) . getDiskList ( ) ; } return _templateDisks ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > getTemplateDisks ( ) { if ( ( ( _templateDisks ) == null ) && ( ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) != null ) ) { org.ovirt.engine.core.bll.VmTemplateHandler.updateDisksFromDb ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) ) ; _templateDisks = org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getVmTemplate ( ) . getDiskList ( ) ; } return _templateDisks ; }
Source:
public void isConnWithSameDetailsExistNoConnections ( ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections newNFSConnection = createNFSConnection ( "multipass.my.domain.tlv.company.com:/export/allstorage/data2" , StorageType.NFS , NfsVersion.V4 , 300 , 0 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; org.mockito.Mockito.when ( storageConnDao.getAllForStorage ( newNFSConnection.getconnection ( ) ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newNFSConnection , null ) ; org.junit.Assert.assertFalse ( 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" ) ; java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections = new java.util.ArrayList < > ( ) ; 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" ) ; connections.add ( connection1 ) ; org.mockito.Mockito.when ( storageConnDao.getAllForConnection ( newISCSIConnection ) ) . thenReturn ( connections ) ; boolean isExists = command.isConnWithSameDetailsExists ( newISCSIConnection , null ) ; org.junit.Assert.assertTrue ( isExists ) ; }
Source:
public static java.lang.String getMessage ( java.util.ResourceBundle bundle , org.ovirt.engine.core.common.AuditLogType logType ) { final java.lang.String key = logType.name ( ) ; try { return bundle.getString ( key ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( ( ( ( ( "Key '" + key ) + "' is not translated in '" ) + ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.APP_ERRORS_MESSAGES_FILE_NAME ) ) + "'" ) ) ; return "" ; } }

Target:
public static java.lang.String getMessage ( java.util.ResourceBundle bundle , org.ovirt.engine.core.common.AuditLogType logType ) { final java.lang.String key = logType.name ( ) ; try { return bundle.getString ( key ) ; } catch ( java.lang.Exception e ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.error ( "Key '{}' is not translated in '{}'" , key , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.APP_ERRORS_MESSAGES_FILE_NAME ) ; return "" ; } }
Source:
public void qosCommitmentMissingBondSpeedMode2 ( ) { org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = qosCommitmendMissingBondSpeed ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_MODE_2 ) ; validateAndExpectNoViolations ( helper ) ; }

Target:
public void bridgePropertiesNonVm ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; network.setVmNetwork ( false ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_BAD_INPUT , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }