auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { addCustomValue ( org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand.LOGABLE_FIELD_NUMBER_OF_CPUS , java.lang.String.valueOf ( org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand.getParameters ( ) . getVm ( ) . getNumOfCpus ( ) ) ) ; if ( org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand.getSucceeded ( ) ) { return org.ovirt.engine.core.common.AuditLogType.HOT_SET_NUMBER_OF_CPUS ; } else { addCustomValue ( org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand.LOGABLE_FIELD_ERROR_MESSAGE , org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand.getReturnValue ( ) . getFault ( ) . getMessage ( ) ) ; return org.ovirt.engine.core.common.AuditLogType.FAILED_HOT_SET_NUMBER_OF_CPUS ; } }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { addCustomValue ( org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand.LOGABLE_FIELD_NUMBER_OF_CPUS , java.lang.String.valueOf ( org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand.getParameters ( ) . getVm ( ) . getNumOfCpus ( ) ) ) ; addCustomValue ( org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand.LOGABLE_FIELD_PREVIOUS_NUMBER_OF_CPUS , java.lang.String.valueOf ( org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand.getVm ( ) . getNumOfCpus ( ) ) ) ; if ( org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand.getSucceeded ( ) ) { return org.ovirt.engine.core.common.AuditLogType.HOT_SET_NUMBER_OF_CPUS ; } else { addCustomValue ( org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand.LOGABLE_FIELD_ERROR_MESSAGE , org.ovirt.engine.core.bll.HotSetNumberOfCpusCommand.getReturnValue ( ) . getFault ( ) . getMessage ( ) ) ; return org.ovirt.engine.core.common.AuditLogType.FAILED_HOT_SET_NUMBER_OF_CPUS ; } }
Source:
private void AddVmStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics stats = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; stats.setId ( getVmId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStatisticsDAO ( ) . save ( stats ) ; getCompensationContext ( ) . snapshotNewEntity ( stats ) ; getCompensationContext ( ) . stateChanged ( ) ; }

Target:
private void addVmStatistics ( ) { org.ovirt.engine.core.common.businessentities.VmStatistics stats = new org.ovirt.engine.core.common.businessentities.VmStatistics ( ) ; stats.setId ( getVmId ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmStatisticsDao ( ) . save ( stats ) ; getCompensationContext ( ) . snapshotNewEntity ( stats ) ; getCompensationContext ( ) . stateChanged ( ) ; }
Source:
private boolean checkDerivedDisksFromDiskNotExist ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage ) { return validate ( createDiskImagesValidator ( diskImage ) . diskImagesHaveNoDerivedDisks ( org.ovirt.engine.core.bll.RemoveDiskCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; }

Target:
private boolean checkDerivedVmFromTemplateExists ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage ) { java.util.List < java.lang.String > vmNames = getNamesOfDerivedVmsFromTemplate ( diskImage ) ; if ( ! ( vmNames.isEmpty ( ) ) ) { addCanDoActionMessage ( VdcBllMessages.VMT_CANNOT_REMOVE_DETECTED_DERIVED_VM ) ; addCanDoActionMessageVariable ( "vmsList" , org.apache.commons.lang.StringUtils.join ( vmNames , "," ) ) ; return false ; } return true ; }
Source:
public void getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { 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.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }

Target:
public void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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 source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }
Source:
private java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > getSupportedAdditionalClusterFeatures ( java.lang.Boolean enabled ) { org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature clusterFeature = new org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature ( ) ; org.ovirt.engine.core.common.businessentities.AdditionalFeature feature = new org.ovirt.engine.core.common.businessentities.AdditionalFeature ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , ConfigValues.LibgfApiSupported.name ( ) , org.ovirt.engine.core.compat.Version.v4_1 , null , null ) ; clusterFeature.setFeature ( feature ) ; clusterFeature.setEnabled ( enabled ) ; return java.util.Collections.singleton ( clusterFeature ) ; }

Target:
private java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > getSupportedAdditionalClusterFeatures ( java.lang.Boolean enabled ) { org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature clusterFeature = new org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature ( ) ; org.ovirt.engine.core.common.businessentities.AdditionalFeature feature = new org.ovirt.engine.core.common.businessentities.AdditionalFeature ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , VmInfoBuildUtils.VDSM_LIBGF_CAP_NAME , org.ovirt.engine.core.compat.Version.v4_1 , null , null ) ; clusterFeature.setFeature ( feature ) ; clusterFeature.setEnabled ( enabled ) ; return java.util.Collections.singleton ( clusterFeature ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.StorageType getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { if ( ( object.getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.IMAGE ) ) { return null ; } org.ovirt.engine.core.common.businessentities.DiskImage disk = ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( object ) ) ; return disk.getStorageTypes ( ) . isEmpty ( ) ? null : disk.getStorageTypes ( ) . get ( 0 ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.storage.StorageType getRawValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { if ( ( object.getDiskStorageType ( ) ) != ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.IMAGE ) ) { return null ; } org.ovirt.engine.core.common.businessentities.storage.DiskImage disk = ( ( org.ovirt.engine.core.common.businessentities.storage.DiskImage ) ( object ) ) ; return disk.getStorageTypes ( ) . isEmpty ( ) ? null : disk.getStorageTypes ( ) . get ( 0 ) ; }
Source:
private void endCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { if ( ! ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . isRemoveDuringExecution ( ) ) ) { removeImageFromDB ( true ) ; } } else { org.ovirt.engine.core.bll.RemoveImageCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.RemoveImageCommand.unLockImage ( ) ; } org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }

Target:
private void performImageDbOperations ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { removeImageFromDB ( ) ; } else { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( getParameters ( ) . getImageId ( ) , getParameters ( ) . getStorageDomainId ( ) ) ) ; unLockImage ( ) ; return null ; } } ) ; } }
Source:
public void testAddExistingSuccessfully ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.ArgumentMatchers.any ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; command.executeCommand ( ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getSucceeded ( ) ) ; }

Target:
public void testAddExistingSuccessfully ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainStatic sdStatic = command.getStorageDomain ( ) . getStorageStaticData ( ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.common.utils.Pair ( sdStatic , sdStatic.getId ( ) ) ) . when ( command ) . executeHSMGetStorageDomainInfo ( org.mockito.ArgumentMatchers.any ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( command ) ; command.executeCommand ( ) ; org.junit.jupiter.api.Assertions.assertTrue ( command.getReturnValue ( ) . getSucceeded ( ) ) ; }
Source:
public void testPositiveCanDoActionWithNoDisks ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.junit.Assert.assertTrue ( cmd.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getCanDoActionMessages ( ) . isEmpty ( ) ) ; }

Target:
public void testPositiveValidateWithNoDisks ( ) { setUpGeneralValidations ( ) ; setUpDiskValidations ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) . when ( cmd ) . getStorageDomainId ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; org.junit.Assert.assertTrue ( cmd.getReturnValue ( ) . getValidationMessages ( ) . isEmpty ( ) ) ; }
Source:
private org.ovirt.engine.ui.uicommonweb.models.hosts.NetworkParameters createBeforeSyncNetParams ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic , org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment ) { org.ovirt.engine.ui.uicommonweb.models.hosts.NetworkParameters params = new org.ovirt.engine.ui.uicommonweb.models.hosts.NetworkParameters ( ) ; params.setBootProtocol ( nic.getIpv4BootProtocol ( ) ) ; params.setAddress ( nic.getIpv4Address ( ) ) ; params.setSubnet ( nic.getIpv4Subnet ( ) ) ; params.setGateway ( nic.getIpv4Gateway ( ) ) ; params.setQos ( nic.getQos ( ) ) ; params.setQosOverridden ( attachment.isQosOverridden ( ) ) ; params.setCustomProperties ( attachment.getProperties ( ) ) ; return params ; }

Target:
private boolean shouldCreateUnmanagedNetworkModel ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface nic ) { return ( ( ( nic.getNetworkImplementationDetails ( ) ) != null ) && ( ! ( nic.getNetworkImplementationDetails ( ) . isManaged ( ) ) ) ) && ( ! ( hostSetupNetworksParametersData.getRemovedUnmanagedNetworks ( ) . contains ( nic.getNetworkName ( ) ) ) ) ; }
Source:
public void update ( org.ovirt.engine.core.common.businessentities.event_subscriber subscriber , int oldMethodId ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "event_up_name" , subscriber.getevent_up_name ( ) ) . addValue ( "old_method_id" , oldMethodId ) . addValue ( "new_method_id" , subscriber.getmethod_id ( ) ) . addValue ( "subscriber_id" , subscriber.getsubscriber_id ( ) ) ; getCallsHandler ( ) . executeModification ( "Updateevent_subscriber" , parameterSource ) ; }

Target:
public void subscribe ( org.ovirt.engine.core.common.businessentities.event_subscriber subscriber ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "event_up_name" , subscriber.getevent_up_name ( ) ) . addValue ( "notification_method" , subscriber.getevent_notification_method ( ) . name ( ) ) . addValue ( "method_address" , subscriber.getmethod_address ( ) ) . addValue ( "subscriber_id" , subscriber.getsubscriber_id ( ) ) . addValue ( "tag_name" , subscriber.gettag_name ( ) ) ; getCallsHandler ( ) . executeModification ( "Insertevent_subscriber" , parameterSource ) ; }
Source:
public void getWANColorDepth ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? org.ovirt.engine.ui.uicommonweb.models.vms.WanColorDepth.fromInt ( ( ( java.lang.Integer ) ( source ) ) . intValue ( ) ) : org.ovirt.engine.ui.uicommonweb.models.vms.WanColorDepth.depth16 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.WANColorDepth , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getWANColorDepth ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? org.ovirt.engine.core.common.console.ConsoleOptions.WanColorDepth.fromInt ( ( ( java.lang.Integer ) ( source ) ) . intValue ( ) ) : org.ovirt.engine.core.common.console.ConsoleOptions.WanColorDepth.depth16 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.WANColorDepth , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveBond , org.ovirt.engine.core.common.action.RemoveBondParameters.class , new java.lang.String [ ] { "VdsId" , "BondName" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID , org.ovirt.engine.api.restapi.resource.BackendHostNicResourceTest.NIC_NAME } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveBond , org.ovirt.engine.core.common.action.RemoveBondParameters.class , new java.lang.String [ ] { "VdsId" , "BondName" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID , org.ovirt.engine.api.restapi.resource.BackendHostNicResourceTest.NIC_NAME } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public static void getMaximalVmMemSize32OS ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 20480 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VM32BitMaxMemorySizeInMB , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static boolean canVmsBePaused ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > items ) { for ( org.ovirt.engine.core.common.businessentities.VM vm : items ) { if ( ! ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.isSuspendSupportedByArchitecture ( vm.getClusterArch ( ) , vm.getVdsGroupCompatibilityVersion ( ) ) ) ) { return false ; } } return true ; }
Source:
public void checkValidCidr ( ) { org.mockito.Mockito.doReturn ( true ) . when ( mockedCidrValidator ) . isCidrFormatValid ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.mockito.Mockito.doReturn ( true ) . when ( mockedCidrValidator ) . isCidrNetworkAddressValid ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult actualResult = underTest.validate ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult expectedResult = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; org.junit.Assert.assertEquals ( expectedResult , actualResult ) ; }

Target:
public void checkValidCidr ( ) { org.mockito.Mockito.doReturn ( true ) . when ( mockedCidrValidator ) . isCidrFormatValid ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.mockito.Mockito.doReturn ( true ) . when ( mockedCidrValidator ) . isCidrNetworkAddressValid ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult actualResult = underTest.validate ( org.ovirt.engine.ui.uicommonweb.validation.CidrValidationTest.CIDR ) ; org.ovirt.engine.ui.uicommonweb.validation.ValidationResult expectedResult = new org.ovirt.engine.ui.uicommonweb.validation.ValidationResult ( ) ; org.junit.jupiter.api.Assertions.assertEquals ( expectedResult , actualResult ) ; }
Source:
public void testGetWatchDogModels ( ) { java.util.List < java.lang.String > watchDogModels = OsRepositoryImpl.INSTANCE.getWatchDogModels ( 777 , null ) ; org.junit.Assert.assertEquals ( 2 , watchDogModels.size ( ) ) ; for ( java.lang.String model : org.ovirt.engine.core.utils.OsRepositoryImplTest.WATCH_DOG_MODELS.split ( "," ) ) { org.junit.Assert.assertTrue ( watchDogModels.contains ( model.trim ( ) ) ) ; } }

Target:
public void testGetWatchDogModels ( ) { java.util.List < java.lang.String > watchDogModels = OsRepositoryImpl.INSTANCE.getWatchDogModels ( 777 , null ) ; org.junit.jupiter.api.Assertions.assertEquals ( 2 , watchDogModels.size ( ) ) ; for ( java.lang.String model : org.ovirt.engine.core.utils.OsRepositoryImplTest.WATCH_DOG_MODELS.split ( "," ) ) { org.junit.jupiter.api.Assertions.assertTrue ( watchDogModels.contains ( model.trim ( ) ) ) ; } }
Source:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid perm = org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getDbFacade ( ) . getPermissionDao ( ) . getEntityPermissions ( org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getParameters ( ) . getAdElementId ( ) , ActionGroup.RECONNECT_TO_VM , org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getParameters ( ) . getObjectId ( ) , VdcObjectType.VM ) ; org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getQueryReturnValue ( ) . setReturnValue ( ( perm != null ) ) ; }

Target:
protected void executeQueryCommand ( ) { org.ovirt.engine.core.compat.Guid perm = permissionDao.getEntityPermissions ( org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getParameters ( ) . getAdElementId ( ) , ActionGroup.RECONNECT_TO_VM , org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getParameters ( ) . getObjectId ( ) , VdcObjectType.VM ) ; org.ovirt.engine.core.bll.HasAdElementReconnectPermissionQuery.getQueryReturnValue ( ) . setReturnValue ( ( perm != null ) ) ; }
Source:
private java.util.List < org.ovirt.engine.api.model.Network > getNetworks ( ) { java.util.List < org.ovirt.engine.api.model.Network > entities = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < ( NAMES.length ) ; i ++ ) { entities.add ( getEntity ( i ) ) ; } return entities ; }

Target:
public int compare ( org.ovirt.engine.api.model.Network n1 , org.ovirt.engine.api.model.Network n2 ) { if ( n1.getId ( ) . equals ( n2.getId ( ) ) ) { return 0 ; } else { return n1.getId ( ) . compareTo ( n2.getId ( ) ) ; } }
Source:
public static void GetVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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 ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.GetVmConfigurationBySnapshotQueryParams ( snapshotSourceId ) , 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.IdQueryParameters ( id ) , aQuery ) ; }
Source:
protected boolean ValidateAdd ( java.util.List < org.ovirt.engine.core.common.businessentities.event_notification_methods > event_notification_methods , org.ovirt.engine.core.common.businessentities.event_subscriber event_subscriber , org.ovirt.engine.core.common.businessentities.DbUser user ) { java.lang.String tagName = event_subscriber.gettag_name ( ) ; boolean retValue = ValidateNotificationMethod ( event_notification_methods , event_subscriber , user ) ; if ( retValue && ( ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( tagName ) ) ) ) { retValue = ValidateTag ( tagName ) ; } return retValue ; }

Target:
protected boolean ValidateAdd ( java.util.List < org.ovirt.engine.core.common.businessentities.event_notification_methods > event_notification_methods , org.ovirt.engine.core.common.businessentities.event_subscriber event_subscriber , org.ovirt.engine.core.common.businessentities.DbUser user ) { java.lang.String tagName = event_subscriber.gettag_name ( ) ; boolean retValue = ValidateNotificationMethod ( event_notification_methods , event_subscriber , user ) ; if ( retValue && ( org.apache.commons.lang.StringUtils.isNotEmpty ( tagName ) ) ) { retValue = ValidateTag ( tagName ) ; } return retValue ; }
Source:
public int hashCode ( ) { int result = ( ( macPoolId ) != null ) ? macPoolId.hashCode ( ) : 0 ; result = ( 31 * result ) + ( ( macFrom ) != null ? macFrom.hashCode ( ) : 0 ) ; result = ( 31 * result ) + ( ( macTo ) != null ? macTo.hashCode ( ) : 0 ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( macFrom ) == null ? 0 : macFrom.hashCode ( ) ) ; result = ( prime * result ) + ( ( macPoolId ) == null ? 0 : macPoolId.hashCode ( ) ) ; result = ( prime * result ) + ( ( macTo ) == null ? 0 : macTo.hashCode ( ) ) ; return result ; }
Source:
private void setUpGetVmExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getVmEntity ( ) ) ; } }

Target:
private void setUpGetVmExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , getVmEntity ( ) ) ; } }
Source:
public void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType action , org.ovirt.engine.core.common.errors.VdcFault fault ) { if ( isRaiseErrorModalPanel ( action , fault ) ) { errorPopupManager.show ( messages.uiCommonRunActionExecutionFailed ( org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . get ( action ) , fault.getMessage ( ) ) ) ; } }

Target:
public void runActionExecutionFailed ( org.ovirt.engine.core.common.action.VdcActionType action , org.ovirt.engine.core.common.errors.VdcFault fault ) { if ( isRaiseErrorModalPanel ( action , fault ) ) { errorPopupManager.show ( messages.uiCommonRunActionExecutionFailed ( org.ovirt.engine.ui.uicompat.EnumTranslator.getInstance ( ) . translate ( action ) , fault.getMessage ( ) ) ) ; } }
Source:
public org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VMStatus , java.lang.Boolean > getStatusWithConsoleState ( ) { boolean consoleTaken = false ; if ( ( getVM ( ) ) != null ) { consoleTaken = ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( getVM ( ) . getConsoleCurentUserName ( ) ) ) ; } return new org.ovirt.engine.core.common.utils.Pair ( getStatus ( ) , consoleTaken ) ; }

Target:
public org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.VMStatus , java.lang.Boolean > getStatusWithConsoleState ( ) { boolean consoleTaken = ( ( getVM ( ) ) != null ) && ( ! ( org.ovirt.engine.ui.uicompat.external.StringUtils.isEmpty ( getVM ( ) . getClientIp ( ) ) ) ) ; return new org.ovirt.engine.core.common.utils.Pair ( getStatus ( ) , consoleTaken ) ; }
Source:
public void networkQosExists ( ) { org.mockito.Mockito.when ( vnicProfile.getNetworkQosId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkQosDao.get ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ) . thenReturn ( networkQos ) ; org.junit.Assert.assertThat ( validator.networkQosExistsOrNull ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void networkQosNull ( ) { org.mockito.Mockito.when ( vnicProfile.getNetworkQosId ( ) ) . thenReturn ( null ) ; org.hamcrest.MatcherAssert.assertThat ( validator.networkQosExistsOrNull ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public javax.ws.rs.core.Response remove ( org.ovirt.engine.api.model.Action action ) { get ( ) ; boolean forceRemove = ( ( action != null ) && ( action.isSetForce ( ) ) ) ? action.isForce ( ) : false ; org.ovirt.engine.core.common.action.RemoveVmParameters params = new org.ovirt.engine.core.common.action.RemoveVmParameters ( guid , forceRemove ) ; boolean detachOnly = org.ovirt.engine.api.common.util.QueryHelper.getBooleanMatrixParameter ( uriInfo , org.ovirt.engine.api.restapi.resource.BackendVmResource.DETACH_ONLY , true , false ) ; if ( detachOnly ) { params.setRemoveDisks ( false ) ; } return performAction ( VdcActionType.RemoveVm , params ) ; }

Target:
public javax.ws.rs.core.Response remove ( ) { get ( ) ; boolean force = org.ovirt.engine.api.common.util.QueryHelper.getBooleanMatrixParameter ( uriInfo , org.ovirt.engine.api.restapi.resource.BackendVmResource.FORCE , true , false ) ; org.ovirt.engine.core.common.action.RemoveVmParameters params = new org.ovirt.engine.core.common.action.RemoveVmParameters ( guid , force ) ; boolean detachOnly = org.ovirt.engine.api.common.util.QueryHelper.getBooleanMatrixParameter ( uriInfo , org.ovirt.engine.api.restapi.resource.BackendVmResource.DETACH_ONLY , true , false ) ; if ( detachOnly ) { params.setRemoveDisks ( false ) ; } return performAction ( VdcActionType.RemoveVm , params ) ; }
Source:
public void testRemove ( ) { org.junit.Assert.assertNotNull ( dao.get ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAOTest.INTERFACE_ID ) ) ; dao.remove ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAOTest.INTERFACE_ID ) ; org.junit.Assert.assertNull ( dao.get ( org.ovirt.engine.core.dao.VmNetworkInterfaceDAOTest.INTERFACE_ID ) ) ; }

Target:
public void testRemove ( ) { org.junit.Assert.assertNotNull ( dao.get ( FixturesTool.VM_NETWORK_INTERFACE ) ) ; dao.remove ( FixturesTool.VM_NETWORK_INTERFACE ) ; org.junit.Assert.assertNull ( dao.get ( FixturesTool.VM_NETWORK_INTERFACE ) ) ; dao.save ( existingVmInterface ) ; org.junit.Assert.assertNotNull ( dao.get ( FixturesTool.VM_NETWORK_INTERFACE ) ) ; }
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.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 < java.lang.Integer , java.lang.String > ( 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 testDetachDisk ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachDiskFromVm , org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "EntityInfo" } , new java.lang.Object [ ] { PARENT_ID , new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID ) } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setDetach ( true ) ; verifyRemove ( collection.remove ( org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID.toString ( ) , action ) ) ; }

Target:
public void testDetachDisk ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachDiskFromVm , org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters.class , new java.lang.String [ ] { "VmId" , "EntityInfo" } , new java.lang.Object [ ] { PARENT_ID , new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID ) } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; action.setDetach ( true ) ; verifyRemove ( collection.deprecatedRemove ( org.ovirt.engine.api.restapi.resource.BackendVmDisksResourceTest.DISK_ID.toString ( ) , action ) ) ; }
Source:
protected void afterReadResponse ( java.net.HttpURLConnection connection , byte [ ] response ) throws java.lang.Exception { if ( ( ( connection.getResponseCode ( ) ) != ( java.net.HttpURLConnection.HTTP_OK ) ) && ( ( connection.getResponseCode ( ) ) != ( java.net.HttpURLConnection.HTTP_MOVED_TEMP ) ) ) { org.ovirt.engine.core.bll.host.provider.foreman.ForemanErrorWrapper ferr = objectMapper.readValue ( response , org.ovirt.engine.core.bll.host.provider.foreman.ForemanErrorWrapper.class ) ; java.lang.String err = org.apache.commons.lang.StringUtils.join ( ferr.getForemanError ( ) . getFull_messages ( ) , ", " ) ; throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.PROVIDER_FAILURE , err ) ; } }

Target:
protected void afterReadResponse ( java.net.HttpURLConnection connection , byte [ ] response ) throws java.lang.Exception { if ( ( ( connection.getResponseCode ( ) ) != ( java.net.HttpURLConnection.HTTP_OK ) ) && ( ( connection.getResponseCode ( ) ) != ( java.net.HttpURLConnection.HTTP_MOVED_TEMP ) ) ) { org.ovirt.engine.core.bll.host.provider.foreman.ForemanErrorWrapper ferr = objectMapper.readValue ( response , org.ovirt.engine.core.bll.host.provider.foreman.ForemanErrorWrapper.class ) ; java.lang.String err = org.apache.commons.lang.StringUtils.join ( ferr.getForemanError ( ) . getFull_messages ( ) , ", " ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , err ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setTitle ( ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ? getDefaultTitle ( ) : null ) ) ; return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.externalDiskIcon ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.storage.DiskStorageType.LUN ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.externalDiskIcon ( ) : null ; }
Source:
public void securityKeysExists ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . haveSecurityKey ( ) ; org.junit.Assert.assertThat ( validator.securityKeysExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void securityKeysExists ( ) { validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . haveSecurityKey ( ) ; org.junit.Assert.assertThat ( validator.securityKeysExists ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
public void replaceWithMoreThanMaxItems ( ) { java.util.List < java.lang.Object > items = createItems ( ) ; java.lang.String [ ] messageItems = org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_NAME , items ) ; validateMessageContainsProperties ( messageItems ) ; validateMessageDoesNotContainUnexpectedItems ( messageItems [ 0 ] , items ) ; org.junit.Assert.assertTrue ( messageItems [ 1 ] . contains ( java.lang.String.valueOf ( items.size ( ) ) ) ) ; }

Target:
public void replaceWithMoreThanMaxItems ( ) { java.util.List < java.lang.Object > items = createItems ( ) ; java.util.Collection < java.lang.String > replacements = org.ovirt.engine.core.utils.ReplacementUtils.replaceWith ( org.ovirt.engine.core.utils.ReplacementUtilsTest.PROPERTY_NAME , items ) ; validateReplacementsContainsExpectedProperties ( replacements , items ) ; validateReplacementsDoNotContainUnexpectedItems ( replacements , items ) ; }
Source:
public static void GetNextAvailableDiskAliasNameByVMId ( 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 ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.GetAllDisksByVmIdParameters ( vmId ) , aQuery ) ; }

Target:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , 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 ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetAllAttachableDisks params = new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) ; params.setVmId ( vmId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , params , aQuery ) ; }
Source:
public void testStatisticalQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.DiskImage entity = setUpStatisticalExpectations ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Disk , org.ovirt.engine.core.common.businessentities.DiskImage > statisticsResource = ( ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Disk , org.ovirt.engine.core.common.businessentities.DiskImage > ) ( ( ( org.ovirt.engine.api.resource.VmDiskResource ) ( resource ) ) . getStatisticsResource ( ) ) ) ; assertNotNull ( statisticsResource ) ; verifyQuery ( statisticsResource.getQuery ( ) , entity ) ; }

Target:
public void testStatisticalQuery ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.storage.DiskImage entity = setUpStatisticalExpectations ( ) ; @ java.lang.SuppressWarnings ( value = "unchecked" ) org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Disk , org.ovirt.engine.core.common.businessentities.storage.DiskImage > statisticsResource = ( ( org.ovirt.engine.api.restapi.resource.BackendStatisticsResource < org.ovirt.engine.api.model.Disk , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( ( ( org.ovirt.engine.api.resource.VmDiskResource ) ( resource ) ) . getStatisticsResource ( ) ) ) ; assertNotNull ( statisticsResource ) ; verifyQuery ( statisticsResource.getQuery ( ) , entity ) ; }
Source:
public boolean isSmtpEncryptionOptionValid ( ) { return ( isSmtpEncryptionNone ( ) ) || ( isSmtpEncryptionSsl ( ) ) ; }

Target:
public boolean isSmtpEncryptionOptionValid ( ) { return ( ( org.ovirt.engine.core.notifier.utils.NotificationProperties.MAIL_SMTP_ENCRYPTION_NONE.equals ( getProperty ( org.ovirt.engine.core.notifier.utils.NotificationProperties.MAIL_SMTP_ENCRYPTION , true ) ) ) || ( org.ovirt.engine.core.notifier.utils.NotificationProperties.MAIL_SMTP_ENCRYPTION_SSL.equals ( getProperty ( org.ovirt.engine.core.notifier.utils.NotificationProperties.MAIL_SMTP_ENCRYPTION , true ) ) ) ) || ( org.ovirt.engine.core.notifier.utils.NotificationProperties.MAIL_SMTP_ENCRYPTION_TLS.equals ( getProperty ( org.ovirt.engine.core.notifier.utils.NotificationProperties.MAIL_SMTP_ENCRYPTION , true ) ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { "Bookmark.bookmark_id" , "Bookmark.bookmark_name" , "Bookmark.bookmark_value" } , new java.lang.Object [ ] { GUIDS [ 0 ] , NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ 0 ] } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 0 ) ; setUpGetEntityExpectations ( 0 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { "Bookmark.Id" , "Bookmark.Name" , "Bookmark.Value" } , new java.lang.Object [ ] { GUIDS [ 0 ] , NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ 0 ] } , true , true ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) , 0 ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult networkNotUsedByRunningVm ( ) { java.lang.String networkName = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkName ( ) ; for ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster : getClusters ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vms = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getVmStaticDAO ( ) . getAllByGroupAndNetworkName ( cluster.getId ( ) , networkName ) ; if ( ( vms.size ( ) ) > 0 ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_INTERFACE_IN_USE_BY_VM ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult networkNotUsedByRunningVm ( ) { java.lang.String networkName = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetworkName ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterAttachment : getClusterAttachments ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vms = org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getVmStaticDAO ( ) . getAllByGroupAndNetworkName ( clusterAttachment.getClusterId ( ) , networkName ) ; if ( ( vms.size ( ) ) > 0 ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_INTERFACE_IN_USE_BY_VM ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void testNotManagementNetworkPositive ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( DEFAULT_GUID ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( DEFAULT_GUID ) ) . thenReturn ( true ) ; org.junit.Assert.assertThat ( validator.notManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK ) ) ; }

Target:
public void testNotManagementNetworkPositive ( ) { org.mockito.Mockito.when ( network.getId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( managementNetworkUtil.isManagementNetwork ( org.ovirt.engine.core.bll.validator.NetworkValidatorTest.DEFAULT_GUID ) ) . thenReturn ( true ) ; org.junit.Assert.assertThat ( validator.notManagementNetwork ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.NETWORK_CANNOT_REMOVE_MANAGEMENT_NETWORK ) ) ; }
Source:
private void handleResuming ( ) { org.ovirt.engine.core.bll.storage.disk.image.UploadImageCommand.lockImage ( ) ; boolean resumeSessionSuccess = startImageTransferSession ( ) ; if ( resumeSessionSuccess ) { log.info ( "Resuming upload session for {}" , getUploadDescription ( ) ) ; } else { log.error ( "Failed to resume upload session for {}" , getUploadDescription ( ) ) ; } updateEntityPhase ( ( resumeSessionSuccess ? org.ovirt.engine.core.common.businessentities.storage.ImageTransferPhase.TRANSFERRING : org.ovirt.engine.core.common.businessentities.storage.ImageTransferPhase.PAUSED_SYSTEM ) ) ; resetPeriodicPauseLogTime ( 0 ) ; }

Target:
private void handleResuming ( ) { org.ovirt.engine.core.bll.storage.disk.image.TransferImageCommand.lockImage ( ) ; boolean resumeSessionSuccess = startImageTransferSession ( ) ; if ( resumeSessionSuccess ) { log.info ( "Resuming session for {}" , getTransferDescription ( ) ) ; } else { log.error ( "Failed to resume session for {}" , getTransferDescription ( ) ) ; } updateEntityPhase ( ( resumeSessionSuccess ? org.ovirt.engine.core.common.businessentities.storage.ImageTransferPhase.TRANSFERRING : org.ovirt.engine.core.common.businessentities.storage.ImageTransferPhase.PAUSED_SYSTEM ) ) ; resetPeriodicPauseLogTime ( 0 ) ; }
Source:
public boolean CheckIfServerAndClusterCanFit ( java.lang.String clusterCpuName , java.lang.String serverFlags ) { if ( clusterCpuName == null ) { return false ; } else { if ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( serverFlags ) ) { return true ; } else { java.util.Set < java.lang.String > lstServerflags = new java.util.HashSet < java.lang.String > ( java.util.Arrays.asList ( serverFlags.split ( "[,]" , ( - 1 ) ) ) ) ; return lstServerflags.contains ( _intelFlag ) ? _intelCpuByNameDictionary.containsKey ( clusterCpuName ) : _amdCpuByNameDictionary.containsKey ( clusterCpuName ) ; } } }

Target:
public boolean CheckIfServerAndClusterCanFit ( java.lang.String clusterCpuName , java.lang.String serverFlags ) { if ( clusterCpuName == null ) { return false ; } else { if ( org.apache.commons.lang.StringUtils.isEmpty ( serverFlags ) ) { return true ; } else { java.util.Set < java.lang.String > lstServerflags = new java.util.HashSet < java.lang.String > ( java.util.Arrays.asList ( serverFlags.split ( "[,]" , ( - 1 ) ) ) ) ; return lstServerflags.contains ( _intelFlag ) ? _intelCpuByNameDictionary.containsKey ( clusterCpuName ) : _amdCpuByNameDictionary.containsKey ( clusterCpuName ) ; } } }