auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissions.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.ForceSelectSPMCommand.getParameters ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.VdcObjectType.StoragePool , org.ovirt.engine.core.common.businessentities.ActionGroup.MANIPUTLATE_HOST ) ) ; permissions.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.ForceSelectSPMCommand.getParameters ( ) . getPreferredSPMId ( ) , org.ovirt.engine.core.common.VdcObjectType.VDS , org.ovirt.engine.core.common.businessentities.ActionGroup.MANIPUTLATE_HOST ) ) ; return permissions ; }

Target:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissions = new java.util.ArrayList < org.ovirt.engine.core.bll.utils.PermissionSubject > ( ) ; permissions.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.ForceSelectSPMCommand.getParameters ( ) . getPreferredSPMId ( ) , org.ovirt.engine.core.common.VdcObjectType.VDS , org.ovirt.engine.core.common.businessentities.ActionGroup.MANIPUTLATE_HOST ) ) ; return permissions ; }
Source:
public org.ovirt.engine.sdk.entities.Response delete ( java.lang.Boolean async ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; if ( async != null ) { urlBuilder.add ( "async" , async , UrlParameterType.MATRIX ) ; } url = urlBuilder.build ( ) ; return getProxy ( ) . delete ( url , org.ovirt.engine.sdk.entities.Response.class , headers ) ; }

Target:
public org.ovirt.engine.sdk.entities.Response delete ( ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = this . getHref ( ) ; org.ovirt.engine.sdk.utils.HttpHeaderBuilder headersBuilder = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) ; java.util.List < org.apache.http.Header > headers = headersBuilder.build ( ) ; org.ovirt.engine.sdk.utils.UrlBuilder urlBuilder = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) ; url = urlBuilder.build ( ) ; return getProxy ( ) . delete ( url , org.ovirt.engine.sdk.entities.Response.class , headers ) ; }
Source:
protected void setUpFilteredQueryExpectations ( ) { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < java.lang.String > ( ) ; filterValue.add ( "true" ) ; org.easymock.EasyMock.reset ( httpHeaders ) ; org.easymock.classextension.EasyMock.expect ( httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.USER_FILTER_HEADER ) ) . andReturn ( filterValue ) ; }

Target:
protected void setUpFilteredQueryExpectations ( ) { java.util.List < java.lang.String > filterValue = new java.util.ArrayList < java.lang.String > ( ) ; filterValue.add ( "true" ) ; org.easymock.EasyMock.reset ( httpHeaders ) ; org.easymock.EasyMock.expect ( httpHeaders.getRequestHeader ( org.ovirt.engine.api.restapi.resource.USER_FILTER_HEADER ) ) . andReturn ( filterValue ) ; }
Source:
public void validateFailureNotExists ( ) { org.ovirt.engine.core.bll.ValidationResult result = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( result ) ; org.mockito.Mockito.when ( validator.isISCSIConnectionAndDomain ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.mockito.Mockito.when ( validator.isDomainOfConnectionExistsAndInactive ( domain ) ) . thenReturn ( ValidationResult.VALID ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; }

Target:
public void validateFailureNotExists ( ) { org.ovirt.engine.core.bll.ValidationResult result = new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; org.mockito.Mockito.when ( validator.isConnectionExists ( ) ) . thenReturn ( result ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_STORAGE_CONNECTION_NOT_EXIST ) ; }
Source:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getVm ( ) . getDynamicData ( ) , getVm ( ) . getStatus ( ) ) ; updateVmData ( getVm ( ) . getDynamicData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Void runInTransaction ( ) { getCompensationContext ( ) . snapshotEntityStatus ( getVm ( ) . getDynamicData ( ) ) ; updateVmData ( getVm ( ) . getDynamicData ( ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
public void testListGlobalLimit ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaStorage ( getStorageGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; control.replay ( ) ; org.ovirt.engine.api.model.QuotaStorageLimits storageLimits = collection.list ( ) ; assertStorageLimitsFound ( storageLimits , 1 ) ; org.ovirt.engine.api.model.QuotaStorageLimit storageLimit = storageLimits.getQuotaStorageLimits ( ) . get ( 0 ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendQuotaStorageLimitsResourceTest.STORAGE_SIZE_GB , storageLimit.getLimit ( ) ) ; }

Target:
public void testListGlobalLimit ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.Quota quota = getQuota ( ) ; quota.setGlobalQuotaStorage ( getStorageGlobalCpuLimit ( ) ) ; setUpGetEntityExpectations ( quota ) ; org.ovirt.engine.api.model.QuotaStorageLimits storageLimits = collection.list ( ) ; assertStorageLimitsFound ( storageLimits , 1 ) ; org.ovirt.engine.api.model.QuotaStorageLimit storageLimit = storageLimits.getQuotaStorageLimits ( ) . get ( 0 ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.BackendQuotaStorageLimitsResourceTest.STORAGE_SIZE_GB , storageLimit.getLimit ( ) ) ; }
Source:
public static org.ovirt.engine.core.compat.Version getMinimalSupportedVersion ( org.ovirt.engine.core.common.businessentities.FencingPolicy fp ) { if ( fp == null ) { throw new java.lang.IllegalArgumentException ( ) ; } org.ovirt.engine.core.compat.Version ver = Version.ALL.get ( 0 ) ; if ( fp.isSkipFencingIfSDActive ( ) ) { for ( org.ovirt.engine.core.compat.Version v : org.ovirt.engine.core.compat.Version.ALL ) { if ( org.ovirt.engine.core.common.FeatureSupported.isSkipFencingIfSDActiveSupported ( v ) ) { ver = v ; break ; } } } return ver ; }

Target:
public static org.ovirt.engine.core.compat.Version getMinimalSupportedVersion ( org.ovirt.engine.core.common.businessentities.FencingPolicy fp ) { if ( fp == null ) { throw new java.lang.IllegalArgumentException ( ) ; } return Version.ALL.get ( 0 ) ; }
Source:
public void endTaskStep ( org.ovirt.engine.core.compat.Guid stepId , org.ovirt.engine.core.common.job.JobExecutionStatus exitStatus ) { try { if ( stepId != null ) { org.ovirt.engine.core.common.job.Step step = jobRepository.getStep ( stepId ) ; if ( step != null ) { step.markStepEnded ( exitStatus ) ; jobRepository.updateStep ( step ) ; } } } catch ( java.lang.Exception e ) { log.error ( "Failed to terminate step '{}' with status '{}': {}" , stepId , exitStatus , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; } }

Target:
public void endTaskStep ( org.ovirt.engine.core.compat.Guid stepId , org.ovirt.engine.core.common.job.JobExecutionStatus exitStatus ) { try { if ( stepId != null ) { org.ovirt.engine.core.common.job.Step step = jobRepository.getStep ( stepId , false ) ; if ( step != null ) { step.markStepEnded ( exitStatus ) ; jobRepository.updateStep ( step ) ; } } } catch ( java.lang.Exception e ) { log.error ( "Failed to terminate step '{}' with status '{}': {}" , stepId , exitStatus , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; } }
Source:
protected void pollVds ( org.ovirt.engine.core.compat.Guid vdsId ) { int retries = 10 ; while ( ( ( retries > 0 ) && ( ( retVal ) == null ) ) && ( ! ( editNetworkThreadFinish ) ) ) { retries -- ; try { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( vdsId ) ) ; } catch ( java.lang.Exception e ) { } } }

Target:
protected void pollVds ( org.ovirt.engine.core.common.businessentities.VDS vds ) { int retries = 10 ; while ( ( ( retries > 0 ) && ( ( retVal ) == null ) ) && ( ! ( editNetworkThreadFinish ) ) ) { retries -- ; try { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( vds ) ) ; } catch ( java.lang.Exception e ) { } } }
Source:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; control.replay ( ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }

Target:
public void testGetNotFound ( ) throws java.lang.Exception { setUriInfo ( setUpBasicUriExpectations ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetDiskByDiskId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmDiskResourceTest.DISK_ID } , null ) ; try { resource.get ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyNotFoundException ( wae ) ; } }
Source:
public void testValidateXmlProtocolForCluster ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Cluster.class ) ; org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( Version.v3_6 ) ; validator = mockHostForProtocol ( VdsProtocol.XML ) ; org.junit.Assert.assertThat ( validator.protocolIsNotXmlrpc ( cluster ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NOT_SUPPORTED_PROTOCOL_FOR_CLUSTER_VERSION ) ) ; }

Target:
public void testValidateXmlProtocolForCluster ( ) { validator = mockHostForProtocol ( VdsProtocol.XML ) ; org.junit.Assert.assertThat ( validator.protocolIsNotXmlrpc ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NOT_SUPPORTED_PROTOCOL_FOR_CLUSTER_VERSION ) ) ; }
Source:
public static java.lang.String getJsonDiskDescription ( org.ovirt.engine.core.common.businessentities.Disk disk ) throws java.io.IOException { java.util.Map < java.lang.String , java.lang.Object > description = new java.util.TreeMap < > ( ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_ALIAS , disk.getDiskAlias ( ) ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_DESCRIPTION , ( ( disk.getDiskDescription ( ) ) != null ? disk.getDiskDescription ( ) : "" ) ) ; return org.ovirt.engine.core.utils.JsonHelper.mapToJson ( description , false ) ; }

Target:
public java.lang.String getJsonDiskDescription ( org.ovirt.engine.core.common.businessentities.Disk disk ) throws java.io.IOException { java.util.Map < java.lang.String , java.lang.Object > description = new java.util.TreeMap < > ( ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_ALIAS , disk.getDiskAlias ( ) ) ; description.put ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.DISK_DESCRIPTION , ( ( disk.getDiskDescription ( ) ) != null ? disk.getDiskDescription ( ) : "" ) ) ; return org.ovirt.engine.core.utils.JsonHelper.mapToJson ( description , false ) ; }
Source:
public void validateFailsDiscardFunctionalityBreaks ( ) { passAllValidations ( ) ; org.ovirt.engine.core.common.errors.EngineMessage lunsBreakStorageDomainDiscardSupportMessage = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_LUN_BREAKS_STORAGE_DOMAIN_PASS_DISCARD_SUPPORT ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( lunsBreakStorageDomainDiscardSupportMessage ) ) . when ( discardHelper ) . isExistingDiscardFunctionalityPreserved ( org.mockito.ArgumentMatchers.anyList ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , lunsBreakStorageDomainDiscardSupportMessage ) ; }

Target:
public void validateFailsDiscardFunctionalityBreaks ( ) { passAllValidations ( ) ; org.ovirt.engine.core.common.errors.EngineMessage lunsBreakStorageDomainDiscardSupportMessage = org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_LUN_BREAKS_STORAGE_DOMAIN_PASS_DISCARD_SUPPORT ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( lunsBreakStorageDomainDiscardSupportMessage ) ) . when ( discardHelper ) . isExistingDiscardFunctionalityPreserved ( org.mockito.ArgumentMatchers.any ( ) , org.mockito.ArgumentMatchers.any ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , lunsBreakStorageDomainDiscardSupportMessage ) ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.RemoveProvidersModel.CMD_REMOVE ) ) { onRemove ( ) ; } else if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , org.ovirt.engine.ui.uicommonweb.models.providers.RemoveProvidersModel.CMD_CANCEL ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.ui.uicommonweb.models.providers.RemoveProvidersModel.CMD_REMOVE.equals ( command.getName ( ) ) ) { onRemove ( ) ; } else if ( org.ovirt.engine.ui.uicommonweb.models.providers.RemoveProvidersModel.CMD_CANCEL.equals ( command.getName ( ) ) ) { cancel ( ) ; } }
Source:
private void initializeOsRepository ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface ) { java.util.ArrayList < java.lang.String > supportedDiskInterfaces = new java.util.ArrayList < > ( ) ; supportedDiskInterfaces.add ( diskInterface.name ( ) ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.ovirt.engine.core.bll.validator.storage.DiskVmElementValidatorTest.OS_WITH_SUPPORTED_INTERFACES , null ) ) . thenReturn ( supportedDiskInterfaces ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.ovirt.engine.core.bll.validator.storage.DiskVmElementValidatorTest.OS_WITH_NO_SUPPORTED_INTERFACES , null ) ) . thenReturn ( new java.util.ArrayList < > ( ) ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }

Target:
private void initializeOsRepository ( org.ovirt.engine.core.common.businessentities.storage.DiskInterface diskInterface ) { java.util.ArrayList < java.lang.String > supportedDiskInterfaces = new java.util.ArrayList < > ( ) ; supportedDiskInterfaces.add ( diskInterface.name ( ) ) ; org.mockito.Mockito.when ( osRepository.getDiskInterfaces ( org.ovirt.engine.core.bll.validator.storage.DiskVmElementValidatorTest.OS_WITH_SUPPORTED_INTERFACES , null ) ) . thenReturn ( supportedDiskInterfaces ) ; org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; }
Source:
public void initNicHotplugSupportMap ( ) { org.ovirt.engine.ui.frontend.AsyncQuery callback = new org.ovirt.engine.ui.frontend.AsyncQuery ( ) ; callback.asyncCallback = new org.ovirt.engine.ui.frontend.AsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object returnValue ) { nicHotplugSupportMap = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetNicHotplugSupportMap ) , callback ) ; }

Target:
public void initNicHotplugSupportMap ( ) { org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.OsRepository , new org.ovirt.engine.core.common.queries.OsQueryParameters ( org.ovirt.engine.core.common.queries.OsQueryParameters.OsRepositoryVerb.GetNicHotplugSupportMap ) , new org.ovirt.engine.ui.frontend.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < org.ovirt.engine.core.common.queries.VdcQueryReturnValue > ( ) { @ java.lang.Override public void onSuccess ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue ) { nicHotplugSupportMap = returnValue.getReturnValue ( ) ; } } ) ) ; }
Source:
public boolean isStartupTimeoutPassed ( java.util.List < java.lang.String > messages ) { java.util.Date waitTo = getBackend ( ) . getStartedAt ( ) . addSeconds ( ( ( java.lang.Integer ) ( org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DisableFenceAtStartupInSec ) ) ) ) ; java.util.Date now = new java.util.Date ( ) ; if ( ! ( ( waitTo.before ( now ) ) || ( waitTo.equals ( now ) ) ) ) { messages.add ( EngineMessage.VDS_FENCE_DISABLED_AT_SYSTEM_STARTUP_INTERVAL.name ( ) ) ; return false ; } else { return true ; } }

Target:
public boolean isStartupTimeoutPassed ( ) { java.util.Date waitTo = getBackend ( ) . getStartedAt ( ) . addSeconds ( ( ( java.lang.Integer ) ( org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.DisableFenceAtStartupInSec ) ) ) ) ; java.util.Date now = new java.util.Date ( ) ; if ( ! ( ( waitTo.before ( now ) ) || ( waitTo.equals ( now ) ) ) ) { return false ; } else { return true ; } }
Source:
public static org.ovirt.engine.core.common.businessentities.VmDevice addDiskDevice ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid deviceId , java.lang.Boolean isPlugged , java.lang.Boolean isReadOnly , java.lang.String address , boolean isUsingScsiReservation ) { return org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vmId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , org.ovirt.engine.core.bll.utils.VmDeviceUtils.EMPTY_SPEC_PARAMS , isPlugged , isReadOnly , address , null , isUsingScsiReservation ) ; }

Target:
public org.ovirt.engine.core.common.businessentities.VmDevice addDiskDevice ( org.ovirt.engine.core.compat.Guid vmId , org.ovirt.engine.core.compat.Guid deviceId , java.lang.Boolean isPlugged , java.lang.Boolean isReadOnly , java.lang.String address , boolean isUsingScsiReservation ) { return addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( deviceId , vmId ) , VmDeviceGeneralType.DISK , VmDeviceType.DISK , org.ovirt.engine.core.bll.utils.VmDeviceUtils.EMPTY_SPEC_PARAMS , isPlugged , isReadOnly , address , null , isUsingScsiReservation ) ; }
Source:
private void CacheFencingAgentsOptionTypes ( ) { java.lang.String localfencingOptionTypes = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.VdsFenceOptionTypes ) ; java.lang.String [ ] types = localfencingOptionTypes.split ( java.util.regex.Pattern.quote ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.COMMA ) , ( - 1 ) ) ; for ( java.lang.String entry : types ) { java.lang.String [ ] optionKeyVal = entry.split ( java.util.regex.Pattern.quote ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.EQUAL ) , ( - 1 ) ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionTypes.put ( optionKeyVal [ 0 ] , optionKeyVal [ 1 ] ) ; } }

Target:
private void CacheFencingAgentsOptionTypes ( ) { java.lang.String localfencingOptionTypes = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.VdsFenceOptionTypes ) ; java.lang.String [ ] types = localfencingOptionTypes.split ( java.util.regex.Pattern.quote ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.COMMA ) , ( - 1 ) ) ; for ( java.lang.String entry : types ) { java.lang.String [ ] optionKeyVal = entry.split ( java.util.regex.Pattern.quote ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.EQUAL ) , ( - 1 ) ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionTypes.put ( optionKeyVal [ 0 ] , optionKeyVal [ 1 ] ) ; } }
Source:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vm.getStaticData ( ) . setId ( new org.ovirt.engine.core.compat.Guid ( section.Attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { if ( node.InnerText.equals ( java.lang.String.valueOf ( OsRepository.OLD_OTHER_ID ) ) ) { node.InnerText = java.lang.String.valueOf ( OsRepository.DEFAULT_OS ) ; } _vm.getStaticData ( ) . setOsId ( osRepository.getOsIdByUniqueName ( node.InnerText ) ) ; } }

Target:
protected void readOsSection ( org.ovirt.engine.core.compat.backendcompat.XmlNode section ) { _vm.getStaticData ( ) . setId ( new org.ovirt.engine.core.compat.Guid ( section.Attributes.get ( "ovf:id" ) . getValue ( ) ) ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node = section.SelectSingleNode ( "Description" ) ; if ( node != null ) { _vm.getStaticData ( ) . setOsId ( osRepository.getOsIdByUniqueName ( node.InnerText ) ) ; } }
Source:
public void encodeDecodeWithNonAsciiDiskAlias ( ) throws java.lang.Exception { disk.setDiskAlias ( "áéíñ" ) ; disk.setDiskDescription ( "DiskDescription" ) ; assertDiskDescriptionMap ( disk , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateDiskAliasJsonEntry ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.encodeString ( "áéíñ" ) ) , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateDiskDescriptionJsonEntry ( "DiskDescription" ) , org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.generateEncodingJsonEntry ( 1 ) ) ; org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.assertDiskDescriptionDecoding ( disk ) ; }

Target:
public void encodeDecodeWithNonAsciiDiskAlias ( ) throws java.lang.Exception { disk.setDiskAlias ( "áéíñ" ) ; disk.setDiskDescription ( "DiskDescription" ) ; assertDiskDescriptionMap ( disk , generateDiskAliasJsonEntry ( org.ovirt.engine.core.bll.storage.disk.image.MetadataDiskDescriptionHandlerTest.encodeString ( "áéíñ" ) ) , generateDiskDescriptionJsonEntry ( "DiskDescription" ) , generateEncodingJsonEntry ( 1 ) ) ; assertDiskDescriptionDecoding ( disk ) ; }
Source:
private void onForceSave ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel confirmationModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getConfirmWindow ( ) ) ) ; if ( ( confirmationModel != null ) && ( ! ( confirmationModel.Validate ( ) ) ) ) { return ; } cancelConfirm ( ) ; getSanStorageModel ( ) . setForce ( true ) ; onSave ( ) ; }

Target:
private void onForceSave ( ) { org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel confirmationModel = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getConfirmWindow ( ) ) ) ; if ( ( confirmationModel != null ) && ( ! ( confirmationModel.validate ( ) ) ) ) { return ; } cancelConfirm ( ) ; getSanStorageModel ( ) . setForce ( true ) ; onSave ( ) ; }
Source:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.StatsInfo > getStatsInfo ( ) { org.ovirt.engine.core.common.businessentities.gluster.StatsInfo statInfo = new org.ovirt.engine.core.common.businessentities.gluster.StatsInfo ( ) ; statInfo.setDuration ( 2 ) ; statInfo.setDurationFormatted ( new org.ovirt.engine.core.common.utils.Pair ( 2 , java.util.concurrent.TimeUnit.SECONDS.toString ( ) ) ) ; statInfo.setTotalRead ( 0 ) ; statInfo.setTotalWrite ( 0 ) ; statInfo.setBlockStats ( getBlockStats ( ) ) ; statInfo.setFopStats ( getFopStats ( ) ) ; return java.util.Collections.singletonList ( statInfo ) ; }

Target:
private java.util.List < org.ovirt.engine.core.common.businessentities.gluster.StatsInfo > getStatsInfo ( ) { org.ovirt.engine.core.common.businessentities.gluster.StatsInfo statInfo = new org.ovirt.engine.core.common.businessentities.gluster.StatsInfo ( ) ; statInfo.setDuration ( 2 ) ; statInfo.setDurationFormatted ( new org.ovirt.engine.core.common.utils.Pair ( new java.lang.Integer ( 2 ) , java.util.concurrent.TimeUnit.SECONDS.toString ( ) ) ) ; statInfo.setTotalRead ( 0 ) ; statInfo.setTotalWrite ( 0 ) ; statInfo.setBlockStats ( getBlockStats ( ) ) ; statInfo.setFopStats ( getFopStats ( ) ) ; return java.util.Collections.singletonList ( statInfo ) ; }
Source:
public void run ( ) { setCorrelationId ( params ) ; try { backend.RunAction ( task , sp ) ; } finally { if ( ( user ) != null ) { backend.Logoff ( sh.sessionize ( new org.ovirt.engine.core.common.action.LogoutUserParameters ( user.getUserId ( ) ) ) ) ; } sh.clean ( ) ; } }

Target:
public void run ( ) { try { backend.RunAction ( task , sp ) ; } finally { if ( ( user ) != null ) { backend.Logoff ( sh.sessionize ( new org.ovirt.engine.core.common.action.LogoutUserParameters ( user.getUserId ( ) ) ) ) ; } sh.clean ( ) ; } }
Source:
protected boolean canRunVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { return getVmRunHandler ( ) . canRunVm ( vm , org.ovirt.engine.core.bll.RunVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVdsSelector ( ) , org.ovirt.engine.core.bll.RunVmCommand.getSnapshotsValidator ( ) , getVmPropertiesUtils ( ) ) ; }

Target:
protected boolean canRunVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { return getVmRunHandler ( ) . canRunVm ( vm , org.ovirt.engine.core.bll.RunVmCommand.getReturnValue ( ) . getCanDoActionMessages ( ) , org.ovirt.engine.core.bll.RunVmCommand.getParameters ( ) , org.ovirt.engine.core.bll.RunVmCommand.getVdsSelector ( ) , org.ovirt.engine.core.bll.RunVmCommand.getSnapshotsValidator ( ) ) ; }
Source:
public void testAddSetAndUploadIconFailure ( ) throws java.lang.Exception { control.replay ( ) ; final org.ovirt.engine.api.model.Template restModel = getRestModel ( 0 ) ; restModel.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; restModel.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( restModel ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }

Target:
public void testAddSetAndUploadIconFailure ( ) throws java.lang.Exception { final org.ovirt.engine.api.model.Template restModel = getRestModel ( 0 ) ; restModel.setLargeIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIconWithData ( ) ) ; restModel.setSmallIcon ( org.ovirt.engine.api.restapi.resource.IconTestHelpler.createIcon ( GUIDS [ 2 ] ) ) ; try { collection.add ( restModel ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , org.ovirt.engine.api.restapi.resource.BAD_REQUEST ) ; } }
Source:
protected boolean namedDataCenter ( org.ovirt.engine.api.model.Network network ) { return ( ( ( network != null ) && ( network.isSetDataCenter ( ) ) ) && ( network.getDataCenter ( ) . isSetName ( ) ) ) && ( ! ( network.getDataCenter ( ) . isSetId ( ) ) ) ; }

Target:
private boolean namedDataCenter ( org.ovirt.engine.api.model.Network network ) { return ( ( ( network != null ) && ( network.isSetDataCenter ( ) ) ) && ( network.getDataCenter ( ) . isSetName ( ) ) ) && ( ! ( network.getDataCenter ( ) . isSetId ( ) ) ) ; }
Source:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStoragesByDatacenterId ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains , org.ovirt.engine.core.compat.NGuid diskDatacenterId ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storage : storageDomains ) { if ( storage.getStoragePoolId ( ) . equals ( diskDatacenterId ) ) { storages.add ( storage ) ; } } return storages ; }

Target:
protected java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > filterStoragesByDatacenterId ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains , org.ovirt.engine.core.compat.Guid diskDatacenterId ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storages = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ( ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain storage : storageDomains ) { if ( storage.getStoragePoolId ( ) . equals ( diskDatacenterId ) ) { storages.add ( storage ) ; } } return storages ; }
Source:
private void createCluster ( org.ovirt.engine.core.compat.Version version ) { existingCluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; existingCluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.CLUSTER_ID ) ; existingCluster.setName ( "cluster" ) ; existingCluster.setGlusterService ( true ) ; existingCluster.setVirtService ( false ) ; existingCluster.setCompatibilityVersion ( version ) ; existingCluster.setGlusterCliBasedSchedulingOn ( true ) ; createObjects ( version ) ; }

Target:
private void createCluster ( ) { existingCluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; existingCluster.setId ( org.ovirt.engine.core.bll.gluster.GlusterSyncJobTest.CLUSTER_ID ) ; existingCluster.setName ( "cluster" ) ; existingCluster.setGlusterService ( true ) ; existingCluster.setVirtService ( false ) ; existingCluster.setGlusterCliBasedSchedulingOn ( true ) ; createObjects ( ) ; }
Source:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public static void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { 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.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Object > ( ) { @ java.lang.Override public java.lang.Object runInTransaction ( ) { try { org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CancelTasks ( getReturnValue ( ) . getTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , org.ovirt.engine.core.bll.CommandBase.this . getClass ( ) . getName ( ) ) ; } return null ; } } ) ; }

Target:
public void run ( ) { log.infoFormat ( "Rollback for command: {0}." , this . getClass ( ) . getName ( ) ) ; try { org.ovirt.engine.core.bll.AsyncTaskManager.getInstance ( ) . CancelTasks ( getReturnValue ( ) . getTaskIdList ( ) ) ; } catch ( java.lang.Exception e ) { log.errorFormat ( "Failed to cancel tasks for command: {0}." , this . getClass ( ) . getName ( ) ) ; } }
Source:
public void getClusterWithVds ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS v = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; v.setClusterId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVds ( v ) ; final org.ovirt.engine.core.common.businessentities.Cluster g = b.getCluster ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g.getId ( ) ) ; }

Target:
public void getClusterWithVds ( ) { final org.ovirt.engine.core.common.businessentities.VDS v = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; v.setClusterId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; b.setVds ( v ) ; final org.ovirt.engine.core.common.businessentities.Cluster g = b.getCluster ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID , g.getId ( ) ) ; }
Source:
public void setUp ( ) { quota = setUpQuota ( org.ovirt.engine.core.bll.UpdateQuotaCommandTest.QUOTA_ID ) ; org.mockito.Mockito.when ( quotaDao.getById ( org.ovirt.engine.core.bll.UpdateQuotaCommandTest.QUOTA_ID ) ) . thenReturn ( quota ) ; org.mockito.Mockito.doReturn ( quotaDao ) . when ( command ) . getQuotaDao ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . removeQuotaFromCache ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . afterUpdate ( ) ; }

Target:
public void setUp ( ) { quota = setUpQuota ( org.ovirt.engine.core.bll.UpdateQuotaCommandTest.QUOTA_ID ) ; org.mockito.Mockito.when ( quotaDao.getById ( org.ovirt.engine.core.bll.UpdateQuotaCommandTest.QUOTA_ID ) ) . thenReturn ( quota ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . removeQuotaFromCache ( ) ; org.mockito.Mockito.doNothing ( ) . when ( command ) . afterUpdate ( ) ; }
Source:
private void mockFenceFailure ( boolean succeedOnSecondAttempt ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue firstReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; firstReturnValue.setSucceeded ( false ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue secondReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; secondReturnValue.setSucceeded ( ( succeedOnSecondAttempt ? true : false ) ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Mockito.eq ( VDSCommandType.FenceVds ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters.class ) ) ) . thenReturn ( firstReturnValue ) . thenReturn ( secondReturnValue ) ; }

Target:
private void mockFenceFailure ( boolean succeedOnSecondAttempt ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue firstReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; firstReturnValue.setSucceeded ( false ) ; org.ovirt.engine.core.common.vdscommands.VDSReturnValue secondReturnValue = new org.ovirt.engine.core.common.vdscommands.VDSReturnValue ( ) ; secondReturnValue.setSucceeded ( ( succeedOnSecondAttempt ? true : false ) ) ; org.mockito.Mockito.when ( vdsBrokerFrontend.RunVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.FenceVds ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.GetDeviceListVDSCommandParameters.class ) ) ) . thenReturn ( firstReturnValue ) . thenReturn ( secondReturnValue ) ; }
Source:
public void testDiscoverGeoRepData ( ) { org.mockito.Mockito.doReturn ( getSessionsVDSReturnVal ( true , 2 ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.discoverGeoRepData ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . save ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession.class ) ) ; }

Target:
public void testDiscoverGeoRepData ( ) { org.mockito.Mockito.doReturn ( getSessionsVDSReturnVal ( 2 ) ) . when ( syncJob ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.GetGlusterVolumeGeoRepSessionList ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeGeoRepSessionVDSParameters.class ) ) ; syncJob.discoverGeoRepData ( ) ; org.mockito.Mockito.verify ( geoRepDao , org.mockito.Mockito.times ( 2 ) ) . save ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession.class ) ) ; }
Source:
private static java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > filterDisksBasedOnCinder ( java.util.Collection < ? extends org.ovirt.engine.core.common.businessentities.storage.Disk > listOfDisks , boolean onlyPluggedDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : listOfDisks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.CINDER ) ) { if ( ( ! onlyPluggedDisks ) || ( disk.getPlugged ( ) ) ) { cinderDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( disk ) ) ) ; } } } return cinderDisks ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > filterDisksBasedOnCinder ( java.util.Collection < ? extends org.ovirt.engine.core.common.businessentities.storage.Disk > listOfDisks , boolean onlyPluggedDisks ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.CinderDisk > cinderDisks = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.Disk disk : listOfDisks ) { if ( ( disk.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.CINDER ) ) { if ( ( ! onlyPluggedDisks ) || ( disk.getPlugged ( ) ) ) { cinderDisks.add ( ( ( org.ovirt.engine.core.common.businessentities.storage.CinderDisk ) ( disk ) ) ) ; } } } return cinderDisks ; }
Source:
private void configureLocalStorage2 ( org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel model ) { java.lang.String prefix = ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( ConfigurationValues.RhevhLocalFSPath ) ) ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( prefix ) ) ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel pathModel = model.getStorage ( ) . getPath ( ) ; pathModel.setEntity ( prefix ) ; pathModel.setIsChangable ( false ) ; } configureLocalStorage3 ( model ) ; }

Target:
private void configureLocalStorage2 ( org.ovirt.engine.ui.uicommonweb.models.hosts.ConfigureLocalStorageModel model ) { java.lang.String prefix = ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.RhevhLocalFSPath ) ) ) ; if ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( prefix ) ) ) { org.ovirt.engine.ui.uicommonweb.models.EntityModel pathModel = model.getStorage ( ) . getPath ( ) ; pathModel.setEntity ( prefix ) ; pathModel.setIsChangable ( false ) ; } configureLocalStorage3 ( model ) ; }
Source:
public void validateFailsOnCompatVersion ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CommitRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTask , getBricks ( volumeWithRemoveBricksTask ) ) ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.UNSUPPORTED_VERSION ) . when ( cluster ) . getCompatibilityVersion ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.GLUSTER_TASKS_NOT_SUPPORTED_FOR_CLUSTER_LEVEL.toString ( ) ) ) ; }

Target:
public void validateFailsOnCompatVersion ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.CommitRemoveGlusterVolumeBricksCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeRemoveBricksParameters ( volumeWithRemoveBricksTask , getBricks ( volumeWithRemoveBricksTask ) ) , null ) ) ; prepareMocks ( cmd ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.gluster.UNSUPPORTED_VERSION ) . when ( cluster ) . getCompatibilityVersion ( ) ; org.junit.Assert.assertFalse ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.GLUSTER_TASKS_NOT_SUPPORTED_FOR_CLUSTER_LEVEL.toString ( ) ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getNetwork ( ) ) ) ) { network_SelectedItemChanged ( null ) ; } else if ( sender == ( getQosOverridden ( ) ) ) { updateQosChangeability ( ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( sender == ( getQosOverridden ( ) ) ) { updateQosChangeability ( ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { M list = ( ( M ) ( sender ) ) ; if ( ( list.getSelectedItems ( ) ) != null ) { for ( java.lang.Object item : list.getSelectedItems ( ) ) { getSelectionModel ( ) . setSelected ( ( ( IVdcQueryable ) ( item ) ) , true ) ; } } }

Target:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { M list = ( ( M ) ( sender ) ) ; getSelectionModel ( ) . setSelected ( ( ( IVdcQueryable ) ( list.getSelectedItem ( ) ) ) , true ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue addStoragePoolInIrs ( ) { return runVdsCommand ( VDSCommandType.CreateStoragePool , new org.ovirt.engine.core.common.vdscommands.CreateStoragePoolVDSCommandParameters ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getVds ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getstorage_pool_type ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getname ( ) , masterStorageDomain.getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getParameters ( ) . getStorages ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getmaster_domain_version ( ) ) ) ; }

Target:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue addStoragePoolInIrs ( ) { return runVdsCommand ( VDSCommandType.CreateStoragePool , new org.ovirt.engine.core.common.vdscommands.CreateStoragePoolVDSCommandParameters ( org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getVds ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getstorage_pool_type ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getName ( ) , masterStorageDomain.getId ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getParameters ( ) . getStorages ( ) , org.ovirt.engine.core.bll.storage.AddStoragePoolWithStoragesCommand.getStoragePool ( ) . getmaster_domain_version ( ) ) ) ; }
Source:
public void testUpdateConsoleUserWithOptimisticLockingSuccess ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmDynamic vmWithoutConsoleUser = dao.get ( org.ovirt.engine.core.compat.Guid.createGuidFromStringDefaultEmpty ( "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ) ; vmWithoutConsoleUser.setConsoleUserId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; boolean result = dao.updateConsoleUserWithOptimisticLocking ( vmWithoutConsoleUser ) ; org.junit.Assert.assertTrue ( result ) ; }

Target:
public void testUpdateConsoleUserWithOptimisticLockingSuccess ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmDynamic vmWithoutConsoleUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ) ; vmWithoutConsoleUser.setConsoleUserId ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; boolean result = dao.updateConsoleUserWithOptimisticLocking ( vmWithoutConsoleUser ) ; org.junit.Assert.assertTrue ( result ) ; }
Source:
protected void failedToMigrate ( ) { try { determineMigrationFailureForAuditLog ( ) ; decreasePendingVms ( getDestinationVds ( ) . getId ( ) ) ; _isRerun = false ; org.ovirt.engine.core.bll.MigrateVmCommand.setSucceeded ( false ) ; org.ovirt.engine.core.bll.MigrateVmCommand.log ( ) ; failedToRunVm ( ) ; } finally { org.ovirt.engine.core.bll.MigrateVmCommand.freeLock ( ) ; } }

Target:
protected void failedToMigrate ( ) { try { determineMigrationFailureForAuditLog ( ) ; _isRerun = false ; org.ovirt.engine.core.bll.MigrateVmCommand.setSucceeded ( false ) ; org.ovirt.engine.core.bll.MigrateVmCommand.log ( ) ; failedToRunVm ( ) ; } finally { org.ovirt.engine.core.bll.MigrateVmCommand.freeLock ( ) ; } }