auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster createNetworkCluster ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.common.businessentities.network.Network net ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster = net.getCluster ( ) ; if ( networkCluster == null ) { return org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.createNetworkClusterWithDefaultValues ( clusterId , net ) ; } return new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( clusterId , net.getId ( ) , org.ovirt.engine.core.common.businessentities.network.NetworkStatus.NON_OPERATIONAL , networkCluster.isDisplay ( ) , networkCluster.isRequired ( ) , networkCluster.isMigration ( ) , networkCluster.isManagement ( ) , networkCluster.isGluster ( ) ) ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster createNetworkCluster ( org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.common.businessentities.network.Network net ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster networkCluster = net.getCluster ( ) ; if ( networkCluster == null ) { return org.ovirt.engine.core.common.action.AttachNetworkToClusterParameter.createNetworkClusterWithDefaultValues ( clusterId , net ) ; } return new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( clusterId , net.getId ( ) , org.ovirt.engine.core.common.businessentities.network.NetworkStatus.NON_OPERATIONAL , networkCluster.isDisplay ( ) , networkCluster.isRequired ( ) , networkCluster.isMigration ( ) , networkCluster.isManagement ( ) , networkCluster.isGluster ( ) , networkCluster.isDefaultRoute ( ) ) ; }
Source:
private java.lang.String getSnapshotIsBeingTakenForVmMessage ( ) { if ( ( cachedSnapshotIsBeingTakenMessage ) == null ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( VdcBllMessages.ACTION_TYPE_FAILED_SNAPSHOT_IS_BEING_TAKEN_FOR_VM.name ( ) ) ; if ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) != null ) { builder.append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ) ; } cachedSnapshotIsBeingTakenMessage = builder.toString ( ) ; } return cachedSnapshotIsBeingTakenMessage ; }

Target:
private java.lang.String getSnapshotIsBeingTakenForVmMessage ( ) { if ( ( cachedSnapshotIsBeingTakenMessage ) == null ) { java.lang.StringBuilder builder = new java.lang.StringBuilder ( EngineMessage.ACTION_TYPE_FAILED_SNAPSHOT_IS_BEING_TAKEN_FOR_VM.name ( ) ) ; if ( ( org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) != null ) { builder.append ( java.lang.String.format ( "$VmName %1$s" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ) ; } cachedSnapshotIsBeingTakenMessage = builder.toString ( ) ; } return cachedSnapshotIsBeingTakenMessage ; }
Source:
protected void addUrlParams ( java.lang.StringBuffer methodExtraParamsDef , java.lang.StringBuffer urlParamsToBuild , org.ovirt.engine.sdk.entities.Parameter parameter ) { methodExtraParamsDef.append ( org.ovirt.engine.sdk.codegen.templates.AbstractOverloadableTemplate.extraMethodParameterTemplate.getTemplate ( org.ovirt.engine.sdk.codegen.utils.TypeUtils.toJava ( parameter.getType ( ) ) , org.ovirt.engine.sdk.codegen.utils.UrlUtils.toQueryParam ( parameter.getName ( ) ) ) ) ; urlParamsToBuild.append ( ( "\n" + ( org.ovirt.engine.sdk.codegen.templates.AbstractOverloadableTemplate.urlBuilderParameterTemplate.getTemplate ( parameter.getName ( ) , org.ovirt.engine.sdk.codegen.utils.UrlUtils.toQueryParam ( parameter.getName ( ) ) , org.ovirt.engine.sdk.codegen.utils.UrlUtils.toParamType ( parameter.getContext ( ) ) ) ) ) ) ; }

Target:
protected java.lang.String getUrlBuilderCode ( java.util.List < org.ovirt.engine.sdk.entities.Parameter > parameters ) { java.lang.StringBuilder buffer = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.sdk.entities.Parameter parameter : parameters ) { org.ovirt.engine.sdk.codegen.templates.UrlBuilderParameterTemplate template = new org.ovirt.engine.sdk.codegen.templates.UrlBuilderParameterTemplate ( ) ; buffer.append ( "\n" ) ; buffer.append ( template.getTemplate ( parameter.getName ( ) , org.ovirt.engine.sdk.codegen.utils.UrlUtils.toQueryParam ( parameter.getName ( ) ) , org.ovirt.engine.sdk.codegen.utils.UrlUtils.toParamType ( parameter.getContext ( ) ) ) ) ; } return buffer.toString ( ) ; }
Source:
protected void mockVmDevice ( boolean plugged ) { vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; vmDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( ) ) ; vmDevice.setIsPlugged ( plugged ) ; org.mockito.Mockito.when ( vmDeviceDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmDeviceId.class ) ) ) . thenReturn ( vmDevice ) ; }

Target:
protected void mockVmDevice ( boolean plugged ) { vmDevice = new org.ovirt.engine.core.common.businessentities.VmDevice ( ) ; vmDevice.setId ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( ) ) ; vmDevice.setIsPlugged ( plugged ) ; org.mockito.Mockito.when ( vmDeviceDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.VmDeviceId.class ) ) ) . thenReturn ( vmDevice ) ; }
Source:
public void canDoActionFailedWrongPlugStatus ( ) throws java.lang.Exception { initializeCommand ( ) ; mockVmStatusUp ( ) ; cretaeDiskWrongPlug ( true ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.HOT_PLUG_DISK_IS_NOT_UNPLUGGED.toString ( ) ) ) ; }

Target:
public void initializeCommand ( ) { command = org.mockito.Mockito.spy ( createCommand ( ) ) ; mockVds ( ) ; org.mockito.Mockito.when ( command.getActionType ( ) ) . thenReturn ( getCommandActionType ( ) ) ; org.mockito.Mockito.doReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAO.class ) ) . when ( command ) . getVmNetworkInterfaceDAO ( ) ; }
Source:
private void importSanStorage ( final org.ovirt.engine.ui.uicompat.TaskContext context ) { this . context = context ; org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; storageModel = model.getSelectedItem ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.ImportSanStorageModel importSanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.ImportSanStorageModel ) ( storageModel ) ) ; checkSanDomainAttachedToDc ( "OnImportSan" , importSanStorageModel.getStorageDomains ( ) . getSelectedItems ( ) ) ; }

Target:
private void importSanStorage ( final org.ovirt.engine.ui.uicompat.TaskContext context ) { this . context = context ; org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageModel ) ( getWindow ( ) ) ) ; storageModel = model.getCurrentStorageItem ( ) ; org.ovirt.engine.ui.uicommonweb.models.storage.ImportSanStorageModel importSanStorageModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.ImportSanStorageModel ) ( storageModel ) ) ; checkSanDomainAttachedToDc ( "OnImportSan" , importSanStorageModel.getStorageDomains ( ) . getSelectedItems ( ) ) ; }
Source:
public boolean StorageDomainRemoved ( org.ovirt.engine.core.common.businessentities.storage_domain_static storageDomain ) { java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > lunsList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getLunDAO ( ) . getAllForVolumeGroup ( storageDomain.getstorage ( ) ) ; if ( ( lunsList.size ( ) ) != 0 ) { for ( org.ovirt.engine.core.common.businessentities.LUNs lun : lunsList ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getLunDAO ( ) . remove ( lun.getLUN_id ( ) ) ; } } return true ; }

Target:
public boolean StorageDomainRemoved ( org.ovirt.engine.core.common.businessentities.storage_domain_static storageDomain ) { java.util.List < org.ovirt.engine.core.common.businessentities.LUNs > lunsList = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getLunDao ( ) . getAllForVolumeGroup ( storageDomain.getstorage ( ) ) ; if ( ( lunsList.size ( ) ) != 0 ) { for ( org.ovirt.engine.core.common.businessentities.LUNs lun : lunsList ) { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getLunDao ( ) . remove ( lun.getLUN_id ( ) ) ; } } return true ; }
Source:
public void testSave ( ) { staticDao.save ( newStaticDomain ) ; newDynamicDomain.setId ( newStaticDomain.getId ( ) ) ; dao.save ( newDynamicDomain ) ; org.ovirt.engine.core.common.businessentities.storage_domain_dynamic result = dao.get ( newDynamicDomain.getId ( ) ) ; assertNotNull ( result ) ; }

Target:
public void testSave ( ) { staticDao.save ( newStaticDomain ) ; newDynamicDomain.setId ( newStaticDomain.getId ( ) ) ; dao.save ( newDynamicDomain ) ; org.ovirt.engine.core.common.businessentities.StorageDomainDynamic result = dao.get ( newDynamicDomain.getId ( ) ) ; assertNotNull ( result ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) ) == null ) { return failCanDoAction ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { return org.ovirt.engine.core.bll.VmSlaPolicyCommand.failVmStatusIllegal ( ) ; } if ( ! ( org.ovirt.engine.core.common.FeatureSupported.vmSlaPolicy ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ) { return failCanDoAction ( EngineMessage.VM_SLA_POLICY_NOT_SUPPORTED ) ; } return true ; }

Target:
protected boolean validate ( ) { if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) ) == null ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_VM_NOT_FOUND ) ; } if ( ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) { return org.ovirt.engine.core.bll.VmSlaPolicyCommand.failVmStatusIllegal ( ) ; } if ( ! ( org.ovirt.engine.core.common.FeatureSupported.vmSlaPolicy ( org.ovirt.engine.core.bll.VmSlaPolicyCommand.getVm ( ) . getCompatibilityVersion ( ) ) ) ) { return failValidation ( EngineMessage.VM_SLA_POLICY_NOT_SUPPORTED ) ; } return true ; }
Source:
public void testValidRemovedBondsWhenReferencedInterfaceBondViaInexistingId ( ) { org.ovirt.engine.core.compat.Guid idOfInexistingInterface = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedBonds ( idOfInexistingInterface ) ) . build ( ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_BOND_RECORDS_DOES_NOT_EXISTS ; org.junit.Assert.assertThat ( validator.validRemovedBonds ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getListVariableAssignmentString ( engineMessage , java.util.Collections.singletonList ( idOfInexistingInterface ) ) ) ) ; }

Target:
public void testValidRemovedBondsWhenReferencedInterfaceBondViaInexistingId ( ) { org.ovirt.engine.core.compat.Guid idOfInexistingInterface = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.HostSetupNetworksValidatorBuilder ( ) . setParams ( new org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder ( ) . addRemovedBonds ( idOfInexistingInterface ) ) . build ( ) ; org.ovirt.engine.core.common.errors.EngineMessage engineMessage = org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_BOND_RECORDS_DOES_NOT_EXISTS ; org.hamcrest.MatcherAssert.assertThat ( validator.validRemovedBonds ( java.util.Collections.emptyList ( ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( engineMessage , org.ovirt.engine.core.utils.ReplacementUtils.getListVariableAssignmentString ( engineMessage , java.util.Collections.singletonList ( idOfInexistingInterface ) ) ) ) ; }
Source:
protected R resolveCreated ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.EntityIdResolver entityResolver ) { try { Q created = entityResolver.resolve ( ( ( org.ovirt.engine.core.compat.Guid ) ( result.getActionReturnValue ( ) ) ) ) ; return addLinks ( populate ( org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.map ( created ) , created ) ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; return null ; } }

Target:
protected R resolveCreated ( org.ovirt.engine.core.common.action.VdcReturnValueBase result , org.ovirt.engine.api.restapi.resource.EntityIdResolver entityResolver , java.lang.Class < ? extends org.ovirt.engine.api.model.BaseResource > suggestedParentType ) { try { Q created = entityResolver.resolve ( ( ( org.ovirt.engine.core.compat.Guid ) ( result.getActionReturnValue ( ) ) ) ) ; return addLinks ( populate ( org.ovirt.engine.api.restapi.resource.AbstractBackendCollectionResource.map ( created ) , created ) , suggestedParentType ) ; } catch ( java.lang.Exception e ) { e.printStackTrace ( ) ; return null ; } }
Source:
public void testNetworkNotAttachedToHost ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.mockito.Mockito.when ( networkDaoMock.get ( network.getId ( ) ) ) . thenReturn ( network ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( network.getId ( ) ) ; org.junit.Assert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotAttachedToHost ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testNetworkNotAttachedToHost ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.mockito.Mockito.when ( networkDaoMock.get ( network.getId ( ) ) ) . thenReturn ( network ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = new org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ( ) ; attachment.setNetworkId ( network.getId ( ) ) ; org.hamcrest.MatcherAssert.assertThat ( createNetworkAttachmentValidator ( attachment ) . networkNotAttachedToHost ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
void updateButton ( ) { getButtonWidget ( ) . setVisible ( ( ( command.getIsAvailable ( ) ) && ( command.getIsVisible ( ) ) ) ) ; getButtonWidget ( ) . setEnabled ( command.getIsExecutionAllowed ( ) ) ; getButtonWidget ( ) . setTitle ( command.getTitle ( ) ) ; }

Target:
void updateButton ( ) { getButtonWidget ( ) . setVisible ( ( ( command.getIsAvailable ( ) ) && ( command.getIsVisible ( ) ) ) ) ; getButtonWidget ( ) . setEnabled ( command.getIsExecutionAllowed ( ) ) ; getButtonWidget ( ) . setText ( command.getTitle ( ) ) ; getButtonWidget ( ) . setTitle ( command.getTitle ( ) ) ; }
Source:
public org.ovirt.engine.core.common.errors.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate ) { if ( ( ! ( vds.getVdsGroupId ( ) . equals ( getVm ( ) . getVdsGroupId ( ) ) ) ) || ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { sb.append ( "is not in up status or belongs to the VM's cluster" ) ; return org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER ; } return null ; }

Target:
public org.ovirt.engine.core.common.errors.VdcBllMessages validate ( org.ovirt.engine.core.common.businessentities.VDS vds , java.lang.StringBuilder sb , boolean isMigrate , java.util.List < org.ovirt.engine.core.compat.Guid > vdsBlackList ) { if ( ( ! ( vds.getVdsGroupId ( ) . equals ( getVm ( ) . getVdsGroupId ( ) ) ) ) || ( ( vds.getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VDSStatus.Up ) ) ) { sb.append ( "is not in up status or belongs to the VM's cluster" ) ; return org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CLUSTER ; } return null ; }
Source:
public void getManagementNetworkName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.DefaultManagementNetwork , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getAllDataCenterNetworks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { 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.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( storagePoolId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNetworksByDataCenterId , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.storage.SetStoragePoolStatusCommand.getSucceeded ( ) ) { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( org.ovirt.engine.core.bll.storage.SetStoragePoolStatusCommand.getVdsName ( ) ) ) { org.ovirt.engine.core.bll.storage.SetStoragePoolStatusCommand.setVdsName ( "Unavailable" ) ; } return org.ovirt.engine.core.bll.storage.SetStoragePoolStatusCommand.getParameters ( ) . getAuditLogType ( ) ; } else { return org.ovirt.engine.core.common.AuditLogType.SYSTEM_FAILED_CHANGE_STORAGE_POOL_STATUS ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.storage.SetStoragePoolStatusCommand.getSucceeded ( ) ) { if ( org.apache.commons.lang.StringUtils.isEmpty ( org.ovirt.engine.core.bll.storage.SetStoragePoolStatusCommand.getVdsName ( ) ) ) { org.ovirt.engine.core.bll.storage.SetStoragePoolStatusCommand.setVdsName ( "Unavailable" ) ; } return org.ovirt.engine.core.bll.storage.SetStoragePoolStatusCommand.getParameters ( ) . getAuditLogType ( ) ; } else { return org.ovirt.engine.core.common.AuditLogType.SYSTEM_FAILED_CHANGE_STORAGE_POOL_STATUS ; } }
Source:
public java.lang.String getDescription ( ) { return ( ( ( ( ( "URL: " + ( url ) ) + " | Provider: " ) + ( provider ) ) + "\n" ) + " | User: " ) + ( user ) ; }

Target:
public java.lang.String getDescription ( ) { return ( ( ( ( ( ( "URL: " + ( ( url ) != null ? url : "[N/A]" ) ) + "\n" ) + " | Provider: " ) + ( ( provider ) != null ? provider : "[N/A]" ) ) + "\n" ) + " | User: " ) + ( ( user ) != null ? user : "[N/A]" ) ; }
Source:
public void setup ( ) { BaseConditionFieldAutoCompleter.tagsHandler = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.interfaces.ITagsHandler.class ) ; org.ovirt.engine.core.common.businessentities.Tags tags = new org.ovirt.engine.core.common.businessentities.Tags ( ) ; tags.setTagName ( org.ovirt.engine.core.searchbackend.SyntaxCheckerTest.TAG_NAME ) ; org.mockito.Mockito.when ( BaseConditionFieldAutoCompleter.tagsHandler.getTagByTagName ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( tags ) ; org.mockito.Mockito.when ( BaseConditionFieldAutoCompleter.tagsHandler.getTagNamesAndChildrenNamesByRegExp ( org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.searchbackend.SyntaxCheckerTest.TAG_NAME_WITH_CHILDREN ) ; }

Target:
public void setup ( ) { BaseConditionFieldAutoCompleter.tagsHandler = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.interfaces.ITagsHandler.class ) ; org.ovirt.engine.core.common.businessentities.Tags tags = new org.ovirt.engine.core.common.businessentities.Tags ( ) ; tags.setTagName ( org.ovirt.engine.core.searchbackend.SyntaxCheckerTest.TAG_NAME ) ; org.mockito.Mockito.when ( BaseConditionFieldAutoCompleter.tagsHandler.getTagByTagName ( org.mockito.ArgumentMatchers.anyString ( ) ) ) . thenReturn ( tags ) ; org.mockito.Mockito.when ( BaseConditionFieldAutoCompleter.tagsHandler.getTagNamesAndChildrenNamesByRegExp ( org.mockito.ArgumentMatchers.anyString ( ) ) ) . thenReturn ( org.ovirt.engine.core.searchbackend.SyntaxCheckerTest.TAG_NAME_WITH_CHILDREN ) ; }
Source:
public static 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.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.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public static void GetVmSnapshotList ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }
Source:
public org.ovirt.engine.api.model.VmPools list ( ) { if ( isFiltered ( ) ) { org.ovirt.engine.core.common.queries.GetAllVmPoolsAttachedToUserParameters params = new org.ovirt.engine.core.common.queries.GetAllVmPoolsAttachedToUserParameters ( getCurrent ( ) . get ( org.ovirt.engine.core.common.users.VdcUser.class ) . getUserId ( ) ) ; return mapCollection ( getBackendCollection ( VdcQueryType.GetAllVmPoolsAttachedToUser , params ) ) ; } else { return mapCollection ( getBackendCollection ( SearchType.VmPools ) ) ; } }

Target:
public org.ovirt.engine.api.model.VmPools list ( ) { if ( isFiltered ( ) ) { return mapCollection ( getBackendCollection ( VdcQueryType.GetAllVmPoolsAttachedToUser , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) ) ) ; } else { return mapCollection ( getBackendCollection ( SearchType.VmPools ) ) ; } }
Source:
public void getUserFQN ( ) { org.ovirt.engine.core.common.users.VdcUser user = new org.ovirt.engine.core.common.users.VdcUser ( ) ; org.junit.Assert.assertTrue ( ( ( user.getFQN ( ) ) == null ) ) ; user.setUserName ( "Legolas" ) ; user.setDomainControler ( "" ) ; org.junit.Assert.assertTrue ( user.getFQN ( ) . equals ( "Legolas" ) ) ; user.setDomainControler ( "MiddleEarth.com" ) ; org.junit.Assert.assertTrue ( user.getFQN ( ) . equals ( "Legolas@MiddleEarth.com" ) ) ; }

Target:
public void setUp ( ) { adUser = new org.ovirt.engine.core.common.businessentities.LdapUser ( ) ; adUser.setUserName ( "UserName" ) ; adUser.setUserId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; adUser.setDomainControler ( "DomainController" ) ; }
Source:
private void doLoad ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { context = input.< org.ovirt.engine.api.extensions.ExtMap > get ( Base.InvokeKeys.CONTEXT ) ; java.util.Properties configuration = context.< java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) ; context.mput ( Base.ContextKeys.AUTHOR , "The oVirt Project" ) . mput ( Base.ContextKeys.EXTENSION_NAME , "Internal Authz (Built-in)" ) . mput ( Base.ContextKeys.LICENSE , "ASL 2.0" ) . mput ( Base.ContextKeys.HOME_URL , "http://www.ovirt.org" ) . mput ( Base.ContextKeys.VERSION , "N/A" ) . mput ( Authz.ContextKeys.QUERY_MAX_FILTER_SIZE , java.lang.Integer.parseInt ( configuration.getProperty ( "config.query.filter.size" ) ) ) . mput ( Base.ContextKeys.BUILD_INTERFACE_VERSION , Base.INTERFACE_VERSION_CURRENT ) . mput ( Authz.ContextKeys.AVAILABLE_NAMESPACES , java.util.Arrays.asList ( org.ovirt.engine.extensions.aaa.builtin.internal.InternalAuthz.NAMESPACE ) ) ; java.lang.String userName = configuration.getProperty ( "config.authz.user.name" ) ; adminUser = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.PrincipalRecord.NAMESPACE , org.ovirt.engine.extensions.aaa.builtin.internal.InternalAuthz.NAMESPACE ) . mput ( Authz.PrincipalRecord.NAME , userName ) . mput ( Authz.PrincipalRecord.FIRST_NAME , userName ) . mput ( Authz.PrincipalRecord.ID , configuration.getProperty ( "config.authz.user.id" ) ) . mput ( Authz.PrincipalRecord.PRINCIPAL , userName ) ; }

Target:
private void doLoad ( org.ovirt.engine.api.extensions.ExtMap input , org.ovirt.engine.api.extensions.ExtMap output ) { context = input.< org.ovirt.engine.api.extensions.ExtMap > get ( Base.InvokeKeys.CONTEXT ) ; java.util.Properties configuration = context.< java.util.Properties > get ( Base.ContextKeys.CONFIGURATION ) ; context.mput ( Base.ContextKeys.AUTHOR , "The oVirt Project" ) . mput ( Base.ContextKeys.EXTENSION_NAME , "Internal Authz (Built-in)" ) . mput ( Base.ContextKeys.LICENSE , "ASL 2.0" ) . mput ( Base.ContextKeys.HOME_URL , "http://www.ovirt.org" ) . mput ( Base.ContextKeys.VERSION , "N/A" ) . mput ( Authz.ContextKeys.QUERY_MAX_FILTER_SIZE , java.lang.Integer.parseInt ( configuration.getProperty ( "config.query.filter.size" ) ) ) . mput ( Base.ContextKeys.BUILD_INTERFACE_VERSION , Base.INTERFACE_VERSION_CURRENT ) . mput ( Authz.ContextKeys.AVAILABLE_NAMESPACES , java.util.Arrays.asList ( org.ovirt.engine.extensions.aaa.builtin.internal.InternalAuthz.NAMESPACE ) ) ; userName = configuration.getProperty ( "config.authz.user.name" ) ; adminUser = new org.ovirt.engine.api.extensions.ExtMap ( ) . mput ( Authz.PrincipalRecord.NAMESPACE , org.ovirt.engine.extensions.aaa.builtin.internal.InternalAuthz.NAMESPACE ) . mput ( Authz.PrincipalRecord.NAME , userName ) . mput ( Authz.PrincipalRecord.FIRST_NAME , userName ) . mput ( Authz.PrincipalRecord.ID , configuration.getProperty ( "config.authz.user.id" ) ) . mput ( Authz.PrincipalRecord.PRINCIPAL , userName ) ; }
Source:
protected void service ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String state = org.ovirt.engine.core.aaa.SsoUtils.createUniqueStateInSessionIfNotExists ( request ) ; java.lang.String scope = java.lang.String.format ( "ovirt-app-admin ovirt-app-portal ovirt-ext=auth:sequence-priority=%s" , org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getProperty ( authSequencePriorityPropertyName ) ) ; request.getSession ( true ) . setAttribute ( "app_url" , request.getParameter ( "app_url" ) ) ; java.lang.String redirectUri = java.lang.String.format ( "%s://%s:%s%s" , request.getScheme ( ) , org.ovirt.engine.core.aaa.filters.FiltersHelper.getRedirectUriServerName ( request.getServerName ( ) ) , request.getServerPort ( ) , postActionUrl ) ; response.sendRedirect ( new org.ovirt.engine.core.uutils.net.URLBuilder ( org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getProperty ( "ENGINE_SSO_AUTH_URL" ) , "/oauth/authorize" ) . addParameter ( "client_id" , org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getProperty ( "ENGINE_SSO_CLIENT_ID" ) ) . addParameter ( "response_type" , "code" ) . addParameter ( "redirect_uri" , redirectUri ) . addParameter ( "scope" , scope ) . addParameter ( "state" , state ) . build ( ) ) ; }

Target:
protected void service ( javax.servlet.http.HttpServletRequest request , javax.servlet.http.HttpServletResponse response ) throws java.io.IOException , javax.servlet.ServletException { java.lang.String state = org.ovirt.engine.core.aaa.SsoUtils.createUniqueStateInSessionIfNotExists ( request ) ; java.lang.String scope = java.lang.String.format ( "ovirt-app-admin ovirt-app-portal ovirt-ext=auth:sequence-priority=%s" , org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getProperty ( authSequencePriorityPropertyName ) ) ; request.getSession ( true ) . setAttribute ( "app_url" , request.getParameter ( "app_url" ) ) ; java.lang.String redirectUri = java.lang.String.format ( "%s://%s:%s%s" , request.getScheme ( ) , org.ovirt.engine.core.aaa.filters.FiltersHelper.getRedirectUriServerName ( request.getServerName ( ) ) , request.getServerPort ( ) , postActionUrl ) ; response.sendRedirect ( new org.ovirt.engine.core.uutils.net.URLBuilder ( org.ovirt.engine.core.aaa.filters.FiltersHelper.getEngineSsoUrl ( request ) , "/oauth/authorize" ) . addParameter ( "client_id" , org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) . getProperty ( "ENGINE_SSO_CLIENT_ID" ) ) . addParameter ( "response_type" , "code" ) . addParameter ( "engine_url" , org.ovirt.engine.core.aaa.filters.FiltersHelper.getEngineUrl ( request ) ) . addParameter ( "redirect_uri" , redirectUri ) . addParameter ( "scope" , scope ) . addParameter ( "state" , state ) . build ( ) ) ; }
Source:
public static 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.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.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }

Target:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { 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 ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
private void initServerUrl ( ) throws org.ovirt.engine.core.notifier.NotificationServiceException { org.ovirt.engine.core.utils.LocalConfig config = org.ovirt.engine.core.utils.LocalConfig.getInstance ( ) ; try { if ( isHttpsProtocol ) { serverUrl = config.getExternalHttpsUrl ( org.ovirt.engine.core.notifier.EngineMonitorService.HEALTH_SERVLET_PATH ) ; } else { serverUrl = config.getExternalHttpUrl ( org.ovirt.engine.core.notifier.EngineMonitorService.HEALTH_SERVLET_PATH ) ; } org.ovirt.engine.core.notifier.EngineMonitorService.log.info ( ( ( "Engine health servlet URL is \"" + ( serverUrl ) ) + "\"." ) ) ; } catch ( java.net.MalformedURLException exception ) { throw new org.ovirt.engine.core.notifier.NotificationServiceException ( "Can't get engine health servlet URL." , exception ) ; } }

Target:
private void initServerUrl ( ) throws org.ovirt.engine.core.notifier.NotificationServiceException { org.ovirt.engine.core.utils.EngineLocalConfig config = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) ; try { if ( isHttpsProtocol ) { serverUrl = config.getExternalHttpsUrl ( org.ovirt.engine.core.notifier.EngineMonitorService.HEALTH_SERVLET_PATH ) ; } else { serverUrl = config.getExternalHttpUrl ( org.ovirt.engine.core.notifier.EngineMonitorService.HEALTH_SERVLET_PATH ) ; } org.ovirt.engine.core.notifier.EngineMonitorService.log.info ( ( ( "Engine health servlet URL is \"" + ( serverUrl ) ) + "\"." ) ) ; } catch ( java.net.MalformedURLException exception ) { throw new org.ovirt.engine.core.notifier.NotificationServiceException ( "Can't get engine health servlet URL." , exception ) ; } }
Source:
public void validateFailsOnNonExistingEvent ( ) { command.getParameters ( ) . setAuditLogId ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_1 ) ; prepareMocks ( command ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.AUDIT_LOG_CANNOT_REMOVE_AUDIT_LOG_NOT_EXIST ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( auditLogDao ) . when ( command ) . getAuditLogDao ( ) ; org.mockito.Mockito.doReturn ( getEventWithOvirtOrigin ( ) ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_2 ) ; org.mockito.Mockito.doReturn ( getEventWithExternalOrigin ( ) ) . when ( auditLogDao ) . get ( org.ovirt.engine.core.bll.RemoveAuditLogByIdCommandTest.EVENT_ID_3 ) ; }
Source:
private boolean interfaceOrItsVlanDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( java.util.Set < java.lang.String > removedNetworkAttachmentsNicNames , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface potentialSlave ) { boolean validSlave = interfaceDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( removedNetworkAttachmentsNicNames , potentialSlave ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > vlanInterfacesForInterface = vlanInterfacesForInterface ( potentialSlave ) ; for ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface : vlanInterfacesForInterface ) { validSlave = validSlave && ( interfaceDoesNotHaveNetworkOrOneIsAboutToBeRemovedFromIt ( removedNetworkAttachmentsNicNames , vdsNetworkInterface ) ) ; } return validSlave ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( bond.getName ( ) , nicId , nicName , message , existingInterfacesMap ) ; }
Source:
public org.ovirt.engine.core.compat.Guid persistAsyncTaskPlaceHolder ( ) { return super . persistAsyncTaskPlaceHolder ( getActionType ( ) ) ; }

Target:
protected void executeCommand ( ) { if ( isMemoryRemovable ( ) ) { java.util.List < org.ovirt.engine.core.compat.Guid > guids = org.ovirt.engine.core.utils.GuidUtils.getGuidListFromString ( org.ovirt.engine.core.bll.RemoveMemoryVolumesCommand.getParameters ( ) . getMemoryVolumes ( ) ) ; org.ovirt.engine.core.common.action.RemoveDiskParameters removeMemoryDumpDiskParameters = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( guids.get ( 2 ) ) ; removeMemoryDumpDiskParameters.setShouldBeLogged ( false ) ; runInternalAction ( VdcActionType.RemoveDisk , removeMemoryDumpDiskParameters ) ; org.ovirt.engine.core.common.action.RemoveDiskParameters removeMemoryMetadataDiskParameters = new org.ovirt.engine.core.common.action.RemoveDiskParameters ( guids.get ( 4 ) ) ; removeMemoryMetadataDiskParameters.setShouldBeLogged ( false ) ; runInternalAction ( VdcActionType.RemoveDisk , removeMemoryMetadataDiskParameters ) ; } org.ovirt.engine.core.bll.RemoveMemoryVolumesCommand.setSucceeded ( true ) ; }
Source:
protected void initWidget ( T widget ) { super . initWidget ( widget ) ; widget.setModal ( true ) ; widget.setGlassEnabled ( true ) ; widget.addStyleName ( org.ovirt.engine.ui.common.view.AbstractPopupView.POPUP_CONTENT_STYLE_NAME ) ; widget.removeStyleName ( org.ovirt.engine.ui.common.view.AbstractPopupView.GWT_POPUPPANEL ) ; widget.getElement ( ) . getStyle ( ) . setZIndex ( org.ovirt.engine.ui.common.view.AbstractPopupView.BOOTSTRAP_MODAL_ZINDEX ) ; }

Target:
protected void initWidget ( T widget ) { super . initWidget ( widget ) ; widget.setModal ( true ) ; widget.setGlassEnabled ( true ) ; widget.addStyleName ( org.ovirt.engine.ui.common.view.AbstractPopupView.POPUP_CONTENT_STYLE_NAME ) ; widget.removeStyleName ( org.ovirt.engine.ui.common.view.AbstractPopupView.GWT_POPUPPANEL ) ; widget.getElement ( ) . getStyle ( ) . setZIndex ( PatternflyConstants.ZINDEX_MODAL ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) || ( lastExecutedCommand.getName ( ) . equals ( "DetachClusters" ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterNetworkListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) || ( lastExecutedCommand.getName ( ) . equals ( "Apply" ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
public org.ovirt.engine.core.common.businessentities.storage.Disk mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.storage.Disk disk = null ; org.ovirt.engine.core.common.businessentities.storage.Disk.DiskStorageType diskStorageType = Disk.DiskStorageType.forValue ( rs.getInt ( "disk_storage_type" ) ) ; switch ( diskStorageType ) { case IMAGE : disk = DiskImageRowMapper.instance.mapRow ( rs , rowNum ) ; break ; case LUN : disk = org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.LunDiskRowMapper.instance.mapRow ( rs , rowNum ) ; break ; } return disk ; }

Target:
public org.ovirt.engine.core.common.businessentities.storage.Disk mapRow ( java.sql.ResultSet rs , int rowNum ) throws java.sql.SQLException { org.ovirt.engine.core.common.businessentities.storage.Disk disk = null ; org.ovirt.engine.core.common.businessentities.storage.DiskStorageType diskStorageType = org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.forValue ( rs.getInt ( "disk_storage_type" ) ) ; switch ( diskStorageType ) { case IMAGE : disk = DiskImageRowMapper.instance.mapRow ( rs , rowNum ) ; break ; case LUN : disk = org.ovirt.engine.core.dao.DiskDaoDbFacadeImpl.LunDiskRowMapper.instance.mapRow ( rs , rowNum ) ; break ; } return disk ; }
Source:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.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.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmsWithNumaByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }

Target:
public void getAllRelevantQuotasForClusterSorted ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId , org.ovirt.engine.core.compat.Guid topQuotaId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.QuotaConverter ( topQuotaId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllRelevantQuotasForCluster , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { boolean isEnabled = bootSequenceModel.getNetworkOption ( ) . getIsChangable ( ) ; java.lang.String itemName = bootSequenceModel.getNetworkOption ( ) . getTitle ( ) ; updateItemAvailability ( itemName , isEnabled ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { updateBootSequenceItems ( ) ; bootSequenceBox.setSelectedIndex ( bootSequenceModel.getSelectedItemIndex ( ) ) ; }
Source:
private boolean isHostNetworkUnreacable ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = vds.getDynamicData ( ) ; return ( ( ( vdsDynamic.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Down ) ) || ( ( vdsDynamic.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Reboot ) ) ) || ( ( ( vdsDynamic.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) && ( ( vdsDynamic.getNonOperationalReason ( ) ) == ( org.ovirt.engine.core.common.businessentities.NonOperationalReason.NETWORK_UNREACHABLE ) ) ) ; }

Target:
private boolean isHostNetworkUnreacable ( org.ovirt.engine.core.common.businessentities.VDS vds ) { org.ovirt.engine.core.common.businessentities.VdsDynamic vdsDynamic = vds.getDynamicData ( ) ; return ( ( ( ( vdsDynamic.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Down ) ) || ( ( vdsDynamic.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Reboot ) ) ) || ( ( vdsDynamic.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.Kdumping ) ) ) || ( ( ( vdsDynamic.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.NonOperational ) ) && ( ( vdsDynamic.getNonOperationalReason ( ) ) == ( org.ovirt.engine.core.common.businessentities.NonOperationalReason.NETWORK_UNREACHABLE ) ) ) ; }
Source:
public boolean validateStoragePoolConnectionsInHost ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.List < org.ovirt.engine.core.common.businessentities.storage_server_connections > connections , org.ovirt.engine.core.compat.Guid storagePoolId ) { if ( ( connections.size ( ) ) > 0 ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Map < java.lang.String , java.lang.String > validateConnections = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ValidateStorageServerConnection , new org.ovirt.engine.core.common.vdscommands.ConnectStorageServerVDSCommandParameters ( vds.getId ( ) , storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType.ISCSI , connections ) ) . getReturnValue ( ) ) ) ; return IsConnectSucceeded ( validateConnections , connections ) ; } return true ; }

Target:
public boolean validateStoragePoolConnectionsInHost ( org.ovirt.engine.core.common.businessentities.VDS vds , java.util.List < org.ovirt.engine.core.common.businessentities.StorageServerConnections > connections , org.ovirt.engine.core.compat.Guid storagePoolId ) { if ( ( connections.size ( ) ) > 0 ) { @ java.lang.SuppressWarnings ( value = "unchecked" ) java.util.Map < java.lang.String , java.lang.String > validateConnections = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.ValidateStorageServerConnection , new org.ovirt.engine.core.common.vdscommands.ConnectStorageServerVDSCommandParameters ( vds.getId ( ) , storagePoolId , org.ovirt.engine.core.common.businessentities.StorageType.ISCSI , connections ) ) . getReturnValue ( ) ) ) ; return isConnectSucceeded ( validateConnections , connections ) ; } return true ; }
Source:
public void storagePoolStatusChange ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StoragePoolStatus status , org.ovirt.engine.core.common.AuditLogType auditLogType , org.ovirt.engine.core.common.errors.VdcBllErrors error , org.ovirt.engine.core.compat.TransactionScopeOption transactionScopeOption ) { org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters tempVar = new org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters ( storagePoolId , status , auditLogType ) ; tempVar.setError ( error ) ; if ( transactionScopeOption != null ) { tempVar.setTransactionScopeOption ( transactionScopeOption ) ; } org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalAction ( VdcActionType.SetStoragePoolStatus , tempVar ) ; }

Target:
public void storagePoolStatusChange ( org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.StoragePoolStatus status , org.ovirt.engine.core.common.AuditLogType auditLogType , org.ovirt.engine.core.common.errors.VdcBllErrors error , org.ovirt.engine.core.compat.TransactionScopeOption transactionScopeOption ) { org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters tempVar = new org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters ( storagePoolId , status , auditLogType ) ; tempVar.setError ( error ) ; if ( transactionScopeOption != null ) { tempVar.setTransactionScopeOption ( transactionScopeOption ) ; } backend.runInternalAction ( VdcActionType.SetStoragePoolStatus , tempVar ) ; }
Source:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.Assert.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetAffinityGroupsByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpAffinityGroups ( ) , failure ) ; }

Target:
protected void setUpQueryExpectations ( java.lang.String query , java.lang.Object failure ) { org.junit.jupiter.api.Assertions.assertEquals ( "" , query ) ; setUpEntityQueryExpectations ( QueryType.GetAffinityGroupsByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , setUpAffinityGroups ( ) , failure ) ; }