auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static java.lang.Long determineTotalImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.DiskImage sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid dstDomain ) { if ( org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { double totalSizeForClonedDisk = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getTotalActualSizeOfDisk ( sourceImage , org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStorageDomainDao ( ) . get ( dstDomain ) . getStorageStaticData ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( sourceImage.getVolumeFormat ( ) , java.lang.Double.valueOf ( totalSizeForClonedDisk ) . longValue ( ) ) ; } return null ; }

Target:
public java.lang.Long determineTotalImageInitialSize ( org.ovirt.engine.core.common.businessentities.storage.DiskImage sourceImage , org.ovirt.engine.core.common.businessentities.storage.VolumeFormat destFormat , org.ovirt.engine.core.compat.Guid srcDomain , org.ovirt.engine.core.compat.Guid dstDomain ) { if ( isInitialSizeSupportedForFormat ( destFormat , dstDomain ) ) { double totalSizeForClonedDisk = org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.getTotalActualSizeOfDisk ( sourceImage , storageDomainDao.get ( srcDomain ) . getStorageStaticData ( ) ) ; return org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.computeCowImageNeededSize ( sourceImage.getVolumeFormat ( ) , java.lang.Double.valueOf ( totalSizeForClonedDisk ) . longValue ( ) ) ; } return null ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForRoleNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( isRoleNetwork ( ) ) && ( ( ( ipConfiguration == null ) || ( ! ( ipConfiguration.hasPrimaryAddressSet ( ) ) ) ) || ( ( ipConfiguration.getPrimaryAddress ( ) . getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , getNetwork ( ) . getName ( ) ) ) . when ( failWhen ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult bootProtocolSetForRoleNetwork ( ) { org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; boolean failWhen = ( isRoleNetwork ( ) ) && ( ( ( ipConfiguration == null ) || ( ! ( ipConfiguration.hasIpv4PrimaryAddressSet ( ) ) ) ) || ( ( ipConfiguration.getIpv4PrimaryAddress ( ) . getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.NetworkBootProtocol.NONE ) ) ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL , org.ovirt.engine.core.utils.ReplacementUtils.createSetVariableString ( org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator.VAR_ACTION_TYPE_FAILED_ROLE_NETWORK_HAS_NO_BOOT_PROTOCOL_ENTITY , getNetwork ( ) . getName ( ) ) ) . when ( failWhen ) ; }
Source:
public void testValidModifiedBondsFailsWhenReferencingExistingNonBondInterface ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_IS_NOT_BOND ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_INTERFACE_IS_NOT_BOND ) , ValidationResult.VALID ) ; }

Target:
public void testValidateModifiedBondSlavesWhenSlaveInterfaceDoesNotExist ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; org.ovirt.engine.core.common.action.HostSetupNetworksParameters params = new org.ovirt.engine.core.common.action.HostSetupNetworksParameters ( host.getId ( ) ) ; params.setBonds ( java.util.Collections.singletonList ( bond ) ) ; doTestValidateModifiedBondSlaves ( params , null , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > emptyList ( ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.Network > emptyList ( ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOST_NETWORK_INTERFACE_NOT_EXIST ) ) ; }
Source:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.storage_domain_static domain ) { return getCustomMapSqlParameterSource ( ) . addValue ( "id" , domain.getId ( ) ) . addValue ( "storage" , domain.getstorage ( ) ) . addValue ( "storage_name" , domain.getstorage_name ( ) ) . addValue ( "storage_type" , domain.getstorage_type ( ) ) . addValue ( "storage_domain_type" , domain.getstorage_domain_type ( ) ) . addValue ( "storage_domain_format_type" , domain.getStorageFormat ( ) ) ; }

Target:
protected org.springframework.jdbc.core.namedparam.MapSqlParameterSource createFullParametersMapper ( org.ovirt.engine.core.common.businessentities.storage_domain_static domain ) { return getCustomMapSqlParameterSource ( ) . addValue ( "id" , domain.getId ( ) ) . addValue ( "storage" , domain.getstorage ( ) ) . addValue ( "storage_name" , domain.getstorage_name ( ) ) . addValue ( "storage_type" , domain.getstorage_type ( ) ) . addValue ( "storage_domain_type" , domain.getstorage_domain_type ( ) ) . addValue ( "storage_domain_format_type" , domain.getStorageFormat ( ) ) . addValue ( "last_time_used_as_master" , domain.getLastTimeUsedAsMaster ( ) ) ; }
Source:
protected void onBind ( ) { super . onBind ( ) ; registerHandler ( org.ovirt.engine.ui.common.presenter.AbstractHeaderPresenterWidget.getView ( ) . getLogoutLink ( ) . addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { user.logout ( ) ; } } ) ) ; registerHandler ( org.ovirt.engine.ui.common.presenter.AbstractHeaderPresenterWidget.getView ( ) . getGuideLink ( ) . addClickHandler ( new com.google.gwt.event.dom.client.ClickHandler ( ) { @ java.lang.Override public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { org.ovirt.engine.ui.common.utils.WebUtils.openUrlInNewWindow ( windowName , guideUrl ) ; } } ) ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { org.ovirt.engine.ui.uicommonweb.models.OptionsModel model = optionsProvider.getModel ( ) ; model.executeCommand ( model.getEditCommand ( ) ) ; }
Source:
public void canDoActionFailsIHostDoesNotExists ( ) { org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters param = org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommandTest.createParameters ( ) ; org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > command = createCommand ( param ) ; org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommandTest.assertFailsWithCanDoActionMessage ( command , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; }

Target:
public void canDoActionFailsIHostDoesNotExists ( ) { org.mockito.Mockito.when ( vdsDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters param = org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommandTest.createParameters ( ) ; org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommand < org.ovirt.engine.core.common.action.hostdeploy.InstallVdsParameters > command = createCommand ( param ) ; org.ovirt.engine.core.bll.hostdeploy.InstallVdsInternalCommandTest.assertFailsWithCanDoActionMessage ( command , EngineMessage.ACTION_TYPE_FAILED_HOST_NOT_EXIST ) ; }
Source:
private void logMemorySavingFailed ( ) { addCustomValue ( "SnapshotName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotName ( ) ) ; addCustomValue ( "VmName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log ( this , AuditLogType.USER_CREATE_LIVE_SNAPSHOT_NO_MEMORY_FAILURE ) ; }

Target:
private void handleVdsLiveSnapshotFailure ( org.ovirt.engine.core.common.errors.VdcBLLException e ) { log.warn ( ( "Could not perform live snapshot due to error, VM will still be configured to the new created" + " snapshot: {}" ) , e.getMessage ( ) ) ; log.debug ( "Exception" , e ) ; addCustomValue ( "SnapshotName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getSnapshotName ( ) ) ; addCustomValue ( "VmName" , org.ovirt.engine.core.bll.CreateAllSnapshotsFromVmCommand.getVmName ( ) ) ; updateCallStackFromThrowable ( e ) ; auditLogDirector.log ( this , AuditLogType.USER_CREATE_LIVE_SNAPSHOT_FINISHED_FAILURE ) ; }
Source:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { 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.network.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public 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 ) . withoutRefresh ( ) , aQuery ) ; }
Source:
public void setSupportBridgesReportByVDSM ( boolean isSupportBridgesReportByVDSM ) { if ( ! isSupportBridgesReportByVDSM ) { getIsVmNetwork ( ) . setEntity ( true ) ; getIsVmNetwork ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . bridlessNetworkNotSupported ( getSelectedDc ( ) . getcompatibility_version ( ) . toString ( ) ) ) ; getIsVmNetwork ( ) . setIsChangable ( false ) ; } else { if ( ( this . isSupportBridgesReportByVDSM ) != isSupportBridgesReportByVDSM ) { initIsVm ( ) ; } getIsVmNetwork ( ) . setIsChangable ( true ) ; } this . isSupportBridgesReportByVDSM = isSupportBridgesReportByVDSM ; }

Target:
public void setSupportBridgesReportByVDSM ( boolean isSupportBridgesReportByVDSM ) { if ( ! isSupportBridgesReportByVDSM ) { getIsVmNetwork ( ) . setEntity ( true ) ; getIsVmNetwork ( ) . setChangeProhibitionReason ( org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . bridlessNetworkNotSupported ( getSelectedDc ( ) . getCompatibilityVersion ( ) . toString ( ) ) ) ; getIsVmNetwork ( ) . setIsChangable ( false ) ; } else { if ( ( this . isSupportBridgesReportByVDSM ) != isSupportBridgesReportByVDSM ) { initIsVm ( ) ; } getIsVmNetwork ( ) . setIsChangable ( true ) ; } this . isSupportBridgesReportByVDSM = isSupportBridgesReportByVDSM ; }
Source:
private static void flatGroups ( java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > groupIds , java.util.List < java.lang.String > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : groupIds ) { if ( ! ( accumulator.contains ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ) ) { accumulator.add ( group.get ( Authz.GroupRecord.ID ) ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.flatGroups ( group , Authz.GroupRecord.GROUPS , accumulator ) ; } } }

Target:
private static void flatGroups ( java.util.Collection < org.ovirt.engine.api.extensions.ExtMap > groupIds , java.util.Map < java.lang.String , org.ovirt.engine.api.extensions.ExtMap > accumulator ) { for ( org.ovirt.engine.api.extensions.ExtMap group : groupIds ) { if ( ! ( accumulator.containsKey ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) ) ) ) { accumulator.put ( group.< java.lang.String > get ( Authz.GroupRecord.ID ) , group ) ; org.ovirt.engine.core.bll.aaa.CreateUserSessionCommand.flatGroups ( group , Authz.GroupRecord.GROUPS , accumulator ) ; } } }
Source:
protected void handleError ( ) { if ( ( org.ovirt.engine.core.bll.pm.VdsNotRespondingTreatmentCommand.getVds ( ) . getSpmStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VdsSpmStatus.None ) ) { log.info ( "Fence failed on vds '{}' which is spm of pool '{}' - moving pool to non operational" , org.ovirt.engine.core.bll.pm.VdsNotRespondingTreatmentCommand.getVds ( ) . getName ( ) , org.ovirt.engine.core.bll.pm.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) ) ; runInternalAction ( VdcActionType.SetStoragePoolStatus , new org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters ( org.ovirt.engine.core.bll.pm.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational , org.ovirt.engine.core.common.AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_NO_HOST_FOR_SPM ) ) ; } log.error ( "Failed to run Fence script on vds '{}'." , org.ovirt.engine.core.bll.pm.VdsNotRespondingTreatmentCommand.getVdsName ( ) ) ; org.ovirt.engine.core.bll.pm.VdsNotRespondingTreatmentCommand.alertIfPowerManagementOperationSkipped ( org.ovirt.engine.core.bll.pm.VdsNotRespondingTreatmentCommand.RESTART , null ) ; }

Target:
private void setStoragePoolNonOperational ( ) { log.info ( "Fence failed on vds '{}' which is spm of pool '{}' - moving pool to non operational" , org.ovirt.engine.core.bll.pm.VdsNotRespondingTreatmentCommand.getVds ( ) . getName ( ) , org.ovirt.engine.core.bll.pm.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) ) ; org.ovirt.engine.core.bll.context.CommandContext commandContext = org.ovirt.engine.core.bll.pm.VdsNotRespondingTreatmentCommand.getContext ( ) . clone ( ) ; commandContext.withExecutionContext ( new org.ovirt.engine.core.bll.job.ExecutionContext ( commandContext.getExecutionContext ( ) ) ) ; runInternalAction ( VdcActionType.SetStoragePoolStatus , new org.ovirt.engine.core.common.action.SetStoragePoolStatusParameters ( org.ovirt.engine.core.bll.pm.VdsNotRespondingTreatmentCommand.getVds ( ) . getStoragePoolId ( ) , org.ovirt.engine.core.common.businessentities.StoragePoolStatus.NotOperational , org.ovirt.engine.core.common.AuditLogType.SYSTEM_CHANGE_STORAGE_POOL_STATUS_NO_HOST_FOR_SPM ) , commandContext ) ; }
Source:
public void getUserMessageOfTheDayViaPublic ( 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.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getStorageDomainsByConnection ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , java.lang.String connectionPath ) { 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.StorageDomain > ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters param = new org.ovirt.engine.core.common.queries.GetStorageDomainsByConnectionParameters ( ) ; param.setConnection ( connectionPath ) ; if ( storagePoolId != null ) { param.setStoragePoolId ( storagePoolId ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByConnection , param , aQuery ) ; }
Source:
public java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > getEligibleVolumes ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity masterVolume ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > possiblyEligibleVolumes = getAllGlusterVolumesWithMasterCompatibleVersion ( masterVolume.getId ( ) ) ; java.util.Map < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason , java.util.function.Predicate < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > > eligibilityPredicateMap = getGeoRepUtilInstance ( ) . getEligibilityPredicates ( masterVolume ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason , java.util.function.Predicate < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > > eligibilityPredicateMapEntries : eligibilityPredicateMap.entrySet ( ) ) { possiblyEligibleVolumes = possiblyEligibleVolumes.stream ( ) . filter ( eligibilityPredicateMapEntries.getValue ( ) ) . collect ( java.util.stream.Collectors.toList ( ) ) ; } return possiblyEligibleVolumes ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > getEligibleVolumes ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity masterVolume ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > possiblyEligibleVolumes = getAllGlusterVolumesWithMasterCompatibleVersion ( masterVolume.getId ( ) ) ; java.util.Map < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepNonEligibilityReason , java.util.function.Predicate < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > > eligibilityPredicateMap = getGeoRepUtilInstance ( ) . getEligibilityPredicates ( masterVolume ) ; for ( java.util.function.Predicate < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > eligibilityPredicateMapEntries : eligibilityPredicateMap.values ( ) ) { possiblyEligibleVolumes = possiblyEligibleVolumes.stream ( ) . filter ( eligibilityPredicateMapEntries ) . collect ( java.util.stream.Collectors.toList ( ) ) ; } return possiblyEligibleVolumes ; }
Source:
public void testGetDefaultSortbyPhrase ( ) { org.junit.Assert.assertTrue ( "HOST" , comp.getDefaultSort ( "HOST" ) . contains ( "vds_name" ) ) ; org.junit.Assert.assertEquals ( "Garbage" , "" , comp.getDefaultSort ( "kjfhkjdshkjfs" ) ) ; org.junit.Assert.assertEquals ( "Null" , "" , comp.getDefaultSort ( null ) ) ; }

Target:
public void testGetDefaultSortbyPhrase ( ) { org.junit.jupiter.api.Assertions.assertTrue ( comp.getDefaultSort ( "HOST" ) . contains ( "vds_name" ) , "HOST" ) ; org.junit.jupiter.api.Assertions.assertEquals ( "" , comp.getDefaultSort ( "kjfhkjdshkjfs" ) , "Garbage" ) ; org.junit.jupiter.api.Assertions.assertEquals ( "" , comp.getDefaultSort ( null ) , "Null" ) ; }
Source:
public static void getVmListByClusterName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vms = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VM > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return vms ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( "Vms: cluster=" + clusterName ) , org.ovirt.engine.core.common.interfaces.SearchType.VM ) , aQuery ) ; }

Target:
public static void getUpHostListByCluster ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String clusterName ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > list = org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.VDS > cast ( ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.IVdcQueryable > ) ( source ) ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getUpHostListByCluster ( aQuery , clusterName , null ) ; }
Source:
private static javax.ws.rs.core.Response.Status getStatus ( org.ovirt.engine.core.common.errors.ErrorType errorType ) { switch ( errorType ) { case BAD_PARAMETERS : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; case CONFLICT : return javax.ws.rs.core.Response.Status.CONFLICT ; case CONSTRAINT_VIOLATION : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; case DATA_CORRUPTION : return javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR ; default : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; } }

Target:
private static javax.ws.rs.core.Response.Status getStatus ( org.ovirt.engine.core.common.errors.ErrorType errorType ) { switch ( errorType ) { case BAD_PARAMETERS : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; case CONFLICT : return javax.ws.rs.core.Response.Status.CONFLICT ; case CONSTRAINT_VIOLATION : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; case DATA_CORRUPTION : return javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR ; case INTERNAL_ERROR : return javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR ; case NO_AUTHENTICATION : return javax.ws.rs.core.Response.Status.UNAUTHORIZED ; case NO_PERMISSION : return javax.ws.rs.core.Response.Status.FORBIDDEN ; case NOT_SUPPORTED : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; case INCOMPATIBLE_VERSION : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; default : return javax.ws.rs.core.Response.Status.BAD_REQUEST ; } }
Source:
private boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.isInternalExecution ( ) ) || ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.VdcActionType.RestartVds ) ) ) ? 0 : auditLogDao.getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getVds ( ) . getName ( ) , getRequestedAuditEvent ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addValidationMessage ( EngineMessage.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.addValidationMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }

Target:
private boolean isQuietTimeFromLastActionPassed ( ) { int secondsLeftToNextPmOp = ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.isInternalExecution ( ) ) || ( ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getParameters ( ) . getParentCommand ( ) ) == ( org.ovirt.engine.core.common.action.ActionType.RestartVds ) ) ) ? 0 : auditLogDao.getTimeToWaitForNextPmOp ( org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.getVds ( ) . getName ( ) , getRequestedAuditEvent ( ) ) ; if ( secondsLeftToNextPmOp > 0 ) { addValidationMessage ( EngineMessage.VDS_FENCE_DISABLED_AT_QUIET_TIME ) ; org.ovirt.engine.core.bll.pm.FenceVdsBaseCommand.addValidationMessageVariable ( "seconds" , secondsLeftToNextPmOp ) ; return false ; } else { return true ; } }
Source:
public void testSave ( ) { dao.save ( new_permissions ) ; org.ovirt.engine.core.common.businessentities.Permissions result = dao.getForRoleAndAdElementAndObject ( new_permissions.getrole_id ( ) , new_permissions.getad_element_id ( ) , new_permissions.getObjectId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_permissions , result ) ; }

Target:
public void testSave ( ) { dao.save ( new_permissions ) ; org.ovirt.engine.core.common.businessentities.Permissions result = dao.getForRoleAndAdElementAndObject ( new_permissions.getRoleId ( ) , new_permissions.getAdElementId ( ) , new_permissions.getObjectId ( ) ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( new_permissions , result ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object ReturnValue ) { org.ovirt.engine.ui.uicommonweb.models.storage.StorageDiskListModel storageDiskListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.storage.StorageDiskListModel ) ( model ) ) ; storageDiskListModel.setItems ( ( ( java.util.ArrayList ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( ReturnValue ) ) . getReturnValue ( ) ) ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } super . syncSearch ( ) ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( getEntity ( ) . getId ( ) ) ; parameters.setRefresh ( getIsQueryFirstTime ( ) ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByStorageDomainId , parameters , new org.ovirt.engine.ui.uicommonweb.models.storage.SetItemsAsyncQuery ( ) ) ; }
Source:
public void Cluster_SelectedItemChanged ( ) { UpdateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; UpdateMinAllocatedMemory ( ) ; UpdateNumOfSockets ( ) ; updateQuotaByCluster ( null , "" ) ; updateCpuPinningVisibility ( ) ; }

Target:
public void cluster_SelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateCpuPinningVisibility ( ) ; }
Source:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterBrick model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.BackendGlusterBrickResourceTest.serverId.toString ( ) , model.getServerId ( ) ) ; assertEquals ( GlusterTestHelper.brickDir , model.getBrickDir ( ) ) ; verifyLinks ( model ) ; }

Target:
protected void verifyModel ( org.ovirt.engine.api.model.GlusterBrick model , int index ) { assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.resource.gluster.GlusterTestHelper.serverId.toString ( ) , model.getServerId ( ) ) ; assertEquals ( GlusterTestHelper.brickDir , model.getBrickDir ( ) ) ; verifyLinks ( model ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterTaskInfoReturnForXmlRpc glusterVolumeRebalanceStart ( java.lang.String volumeName , java.lang.Boolean fixLayoutOnly , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.rebalanceStart" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "rebalanceType" , fixLayoutOnly ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterTaskInfoReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterTaskInfoReturn glusterVolumeRebalanceStart ( java.lang.String volumeName , java.lang.Boolean fixLayoutOnly , java.lang.Boolean force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "GlusterVolume.rebalanceStart" ) . withParameter ( "volumeName" , volumeName ) . withParameter ( "rebalanceType" , fixLayoutOnly ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withIgnoreResponseKey ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterTaskInfoReturn ( response ) ; }
Source:
public void syncNetworkQosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; org.ovirt.engine.core.compat.Guid qosId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.when ( qosDao.get ( qosId ) ) . thenReturn ( createQos ( ) ) ; network.setQosId ( qosId ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { final org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
protected void handleSpecificCommandActions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > mVmList = org.ovirt.engine.core.bll.pm.StopVdsCommand.getVmList ( ) ; if ( ( mVmList.size ( ) ) > 0 ) { org.ovirt.engine.core.bll.RestartVdsVmsOperation restartVmsOper = new org.ovirt.engine.core.bll.RestartVdsVmsOperation ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getContext ( ) , org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) ) ; restartVmsOper.restartVms ( mVmList ) ; runVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) . getId ( ) ) ) ; } }

Target:
protected void handleSpecificCommandActions ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmList = org.ovirt.engine.core.bll.pm.StopVdsCommand.getVmList ( ) ; if ( ( vmList.size ( ) ) > 0 ) { org.ovirt.engine.core.bll.RestartVdsVmsOperation restartVmsOper = new org.ovirt.engine.core.bll.RestartVdsVmsOperation ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getContext ( ) , org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) ) ; restartVmsOper.restartVms ( vmList ) ; runVdsCommand ( VDSCommandType.UpdateVdsVMsCleared , new org.ovirt.engine.core.common.vdscommands.UpdateVdsVMsClearedVDSCommandParameters ( org.ovirt.engine.core.bll.pm.StopVdsCommand.getVds ( ) . getId ( ) ) ) ; } }
Source:
public void getAuditLogTypeValueTest ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = new org.ovirt.engine.core.common.action.VdcReturnValueBase ( ) ; returnValueBase.setSucceeded ( true ) ; addCpuProfileCommand.setReturnValue ( returnValueBase ) ; org.junit.Assert.assertEquals ( AuditLogType.USER_ADDED_CPU_PROFILE , addCpuProfileCommand.getAuditLogTypeValue ( ) ) ; returnValueBase.setSucceeded ( false ) ; addCpuProfileCommand.setReturnValue ( returnValueBase ) ; org.junit.Assert.assertEquals ( AuditLogType.USER_FAILED_TO_ADD_CPU_PROFILE , addCpuProfileCommand.getAuditLogTypeValue ( ) ) ; }

Target:
public void getAuditLogTypeValueTest ( ) { org.ovirt.engine.core.common.action.ActionReturnValue returnValueBase = new org.ovirt.engine.core.common.action.ActionReturnValue ( ) ; returnValueBase.setSucceeded ( true ) ; addCpuProfileCommand.setReturnValue ( returnValueBase ) ; org.junit.Assert.assertEquals ( AuditLogType.USER_ADDED_CPU_PROFILE , addCpuProfileCommand.getAuditLogTypeValue ( ) ) ; returnValueBase.setSucceeded ( false ) ; addCpuProfileCommand.setReturnValue ( returnValueBase ) ; org.junit.Assert.assertEquals ( AuditLogType.USER_FAILED_TO_ADD_CPU_PROFILE , addCpuProfileCommand.getAuditLogTypeValue ( ) ) ; }
Source:
public void updateStatus ( org.ovirt.engine.core.common.businessentities.network_cluster cluster ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , cluster.getcluster_id ( ) ) . addValue ( "network_id" , cluster.getnetwork_id ( ) ) . addValue ( "status" , cluster.getstatus ( ) ) ; getCallsHandler ( ) . executeModification ( "Updatenetwork_cluster_status" , parameterSource ) ; }

Target:
public void updateStatus ( org.ovirt.engine.core.common.businessentities.NetworkCluster cluster ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource ( ) . addValue ( "cluster_id" , cluster.getcluster_id ( ) ) . addValue ( "network_id" , cluster.getnetwork_id ( ) ) . addValue ( "status" , cluster.getstatus ( ) ) ; getCallsHandler ( ) . executeModification ( "Updatenetwork_cluster_status" , parameterSource ) ; }
Source:
public void ExecuteCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . ExecuteCommand ( command ) ; if ( command.equals ( getEnableHookCommand ( ) ) ) { enableHook ( ) ; } else if ( command.equals ( getDisableHookCommand ( ) ) ) { disableHook ( ) ; } else if ( command.getName ( ) . equals ( "OnDisableHook" ) ) { onDisableHook ( ) ; } else if ( command.getName ( ) . equals ( "OnCancelConfirmation" ) ) { cancelConfirmation ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command.equals ( getEnableHookCommand ( ) ) ) { enableHook ( ) ; } else if ( command.equals ( getDisableHookCommand ( ) ) ) { disableHook ( ) ; } else if ( command.getName ( ) . equals ( "OnDisableHook" ) ) { onDisableHook ( ) ; } else if ( command.getName ( ) . equals ( "OnCancelConfirmation" ) ) { cancelConfirmation ( ) ; } }
Source:
protected void enterPressed ( ) { super . enterPressed ( ) ; int pos = getContentWidget ( ) . getCursorPos ( ) ; getContentWidget ( ) . setText ( ( ( ( getContentWidget ( ) . getText ( ) . substring ( 0 , pos ) ) + '\n' ) + ( getContentWidget ( ) . getText ( ) . substring ( pos ) ) ) ) ; getContentWidget ( ) . setCursorPos ( ( pos + 1 ) ) ; }

Target:
protected void enterPressed ( ) { super . enterPressed ( ) ; int pos = getContentWidget ( ) . getCursorPos ( ) ; getContentWidget ( ) . setText ( ( ( ( getContentWidget ( ) . getText ( ) . substring ( 0 , pos ) ) + '\n' ) + ( getContentWidget ( ) . getText ( ) . substring ( ( pos + ( getContentWidget ( ) . getSelectionLength ( ) ) ) ) ) ) ) ; getContentWidget ( ) . setCursorPos ( ( pos + 1 ) ) ; }
Source:
public org.ovirt.engine.core.common.action.ActionParametersBase getParameters ( org.ovirt.engine.api.model.Disk incoming , org.ovirt.engine.api.model.Disk entity ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dveFromDb = runQuery ( VdcQueryType.GetDiskVmElementById , new org.ovirt.engine.core.common.queries.VmDeviceIdQueryParameters ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( entity.getId ( ) , vmId ) ) ) . getReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement updatedDve = updateDiskVmElementFromDisk ( incoming , dveFromDb ) ; return new org.ovirt.engine.core.common.action.VmDiskOperationParameterBase ( updatedDve , map ( incoming , entity ) ) ; }

Target:
public org.ovirt.engine.core.common.action.ActionParametersBase getParameters ( org.ovirt.engine.api.model.Disk incoming , org.ovirt.engine.api.model.Disk entity ) { org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dveFromDb = runQuery ( QueryType.GetDiskVmElementById , new org.ovirt.engine.core.common.queries.VmDeviceIdQueryParameters ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( entity.getId ( ) , vmId ) ) ) . getReturnValue ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement updatedDve = updateDiskVmElementFromDisk ( incoming , dveFromDb ) ; return new org.ovirt.engine.core.common.action.VmDiskOperationParameterBase ( updatedDve , map ( incoming , entity ) ) ; }
Source:
public java.lang.String customProperties ( java.lang.String predefinedProperties , java.lang.String userDefinedProperties ) { java.lang.StringBuilder result = new java.lang.StringBuilder ( ) ; result.append ( ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( predefinedProperties ) ? "" : predefinedProperties ) ) ; result.append ( ( ( result.length ( ) ) == 0 ? "" : ";" ) ) ; result.append ( ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( userDefinedProperties ) ? "" : userDefinedProperties ) ) ; return result.toString ( ) ; }

Target:
public java.lang.String customProperties ( java.lang.String predefinedProperties , java.lang.String userDefinedProperties ) { java.lang.StringBuilder result = new java.lang.StringBuilder ( ) ; result.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( predefinedProperties ) ? "" : predefinedProperties ) ) ; result.append ( ( ( result.length ( ) ) == 0 ? "" : ";" ) ) ; result.append ( ( org.apache.commons.lang.StringUtils.isEmpty ( userDefinedProperties ) ? "" : userDefinedProperties ) ) ; return result.toString ( ) ; }
Source:
public void testGetAllForRoleAndAdElementAndObject ( ) { org.ovirt.engine.core.common.businessentities.Permissions result = dao.getForRoleAndAdElementAndObject ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , result.getrole_id ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , result.getad_element_id ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , result.getObjectId ( ) ) ; }

Target:
public void testGetAllForRoleAndAdElementAndObject ( ) { org.ovirt.engine.core.common.businessentities.Permissions result = dao.getForRoleAndAdElementAndObject ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID ) ; org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.ROLE_ID , result.getRoleId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.AD_ELEMENT_ID , result.getAdElementId ( ) ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dao.PermissionDAOTest.VM_ENTITY_ID , result.getObjectId ( ) ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVnicProfile , org.ovirt.engine.core.common.action.VnicProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource resource = ( ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource ) ( this . resource ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 0 ) ) , 0 ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateVnicProfile , org.ovirt.engine.core.common.action.VnicProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , true , true ) ) ; org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource resource = ( ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResource ) ( this . resource ) ) ; verifyModel ( resource.update ( org.ovirt.engine.api.restapi.resource.BackendVnicProfileResourceTest.getModel ( 0 ) ) , 0 ) ; }
Source:
protected void EndVmCommand ( ) { try { if ( org.ovirt.engine.core.bll.RemoveVmCommand.acquireLock ( ) ) { setVm ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDAO ( ) . get ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ; if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) != null ) { updateDisksAfterVmRemoved ( ) ; RemoveVmFromDb ( ) ; } } org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( true ) ; } finally { org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; } }

Target:
protected void endVmCommand ( ) { try { if ( org.ovirt.engine.core.bll.RemoveVmCommand.acquireLock ( ) ) { setVm ( org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDAO ( ) . get ( org.ovirt.engine.core.bll.RemoveVmCommand.getVmId ( ) ) ) ; if ( ( org.ovirt.engine.core.bll.RemoveVmCommand.getVm ( ) ) != null ) { updateDisksAfterVmRemoved ( ) ; removeVmFromDb ( ) ; } } org.ovirt.engine.core.bll.RemoveVmCommand.setSucceeded ( true ) ; } finally { org.ovirt.engine.core.bll.RemoveVmCommand.freeLock ( ) ; } }
Source:
public int compare ( org.ovirt.engine.core.common.businessentities.VmOsType o1 , org.ovirt.engine.core.common.businessentities.VmOsType o2 ) { if ( o1.name ( ) . equals ( VmOsType.Unassigned.name ( ) ) ) { return - 1 ; } if ( o2.name ( ) . equals ( VmOsType.Unassigned.name ( ) ) ) { return 1 ; } return o1.name ( ) . compareTo ( o2.name ( ) ) ; }

Target:
public void setDataCentersAndClusters ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model , java.util.List < org.ovirt.engine.core.common.businessentities.StoragePool > dataCenters , java.util.List < org.ovirt.engine.core.common.businessentities.VDSGroup > clusters , org.ovirt.engine.core.compat.Guid selectedCluster ) { if ( ( ( model.getBehavior ( ) . getSystemTreeSelectedItem ( ) ) != null ) && ( ( model.getBehavior ( ) . getSystemTreeSelectedItem ( ) . getType ( ) ) != ( org.ovirt.engine.ui.uicommonweb.models.SystemTreeItemType.System ) ) ) { setupDataCenterWithClustersFromSystemTree ( model , dataCenters , clusters , selectedCluster ) ; } else { setupDataCenterWithClusters ( model , dataCenters , clusters , selectedCluster ) ; } }
Source:
public void readData ( java.io.ObjectInputStream dis ) { synchronized ( ovirt_engine_dwh.aggregationtohourly_3_4.AggregationToHourly.row11Struct.commonByteArrayLock_OVIRT_ENGINE_DWH_AggregationToHourly ) { try { int length = 0 ; this . var_name = readString ( dis ) ; this . var_value = readString ( dis ) ; this . var_datetime = readDate ( dis ) ; } catch ( java.io.IOException e ) { throw new java.lang.RuntimeException ( e ) ; } } }

Target:
public java.lang.String toString ( ) { java.lang.StringBuilder sb = new java.lang.StringBuilder ( ) ; sb.append ( super . toString ( ) ) ; sb.append ( "[" ) ; sb.append ( ( "key=" + ( key ) ) ) ; sb.append ( ( ",value=" + ( value ) ) ) ; sb.append ( "]" ) ; return sb.toString ( ) ; }
Source:
public static void GetVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }

Target:
public static void getVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }
Source:
protected boolean validateSpaceRequirements ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator sdValidator = createMultipleStorageDomainsValidator ( disksList ) ; if ( ( ! ( validate ( sdValidator.allDomainsExistAndActive ( ) ) ) ) || ( ! ( validate ( sdValidator.allDomainsWithinThresholds ( ) ) ) ) ) { return false ; } if ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getParameters ( ) . getCopyCollapse ( ) ) { return validate ( sdValidator.allDomainsHaveSpaceForClonedDisks ( disksList ) ) ; } return validate ( sdValidator.allDomainsHaveSpaceForDisksWithSnapshots ( disksList ) ) ; }

Target:
protected boolean validateSpaceRequirements ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages ) { org.ovirt.engine.core.bll.validator.MultipleStorageDomainsValidator sdValidator = createMultipleStorageDomainsValidator ( diskImages ) ; if ( ( ! ( validate ( sdValidator.allDomainsExistAndActive ( ) ) ) ) || ( ! ( validate ( sdValidator.allDomainsWithinThresholds ( ) ) ) ) ) { return false ; } if ( org.ovirt.engine.core.bll.MoveOrCopyTemplateCommand.getParameters ( ) . getCopyCollapse ( ) ) { return validate ( sdValidator.allDomainsHaveSpaceForClonedDisks ( diskImages ) ) ; } return validate ( sdValidator.allDomainsHaveSpaceForDisksWithSnapshots ( diskImages ) ) ; }