auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getLabelListByEntityId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid entityId ) { 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.Label > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Label > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLabelByEntityId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( entityId ) , aQuery ) ; }
Source:
public static void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { 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.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.IsVmWithSameNameExistParameters ( name ) , aQuery ) ; }

Target:
public static void getRpmVersionViaPublic ( 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.RunPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private boolean isTemplateInDestStorageDomain ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid sourceDomainId ) { org.ovirt.engine.core.compat.Guid templateId = getDiskImageByImageId ( imageId ) . getImageTemplateId ( ) ; if ( ! ( Guid.Empty.equals ( templateId ) ) ) { org.ovirt.engine.core.common.businessentities.DiskImage templateImage = getDiskImageDao ( ) . get ( templateId ) ; if ( ! ( templateImage.getStorageIds ( ) . contains ( sourceDomainId ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN ) ; } } return true ; }

Target:
private boolean isTemplateInDestStorageDomain ( org.ovirt.engine.core.compat.Guid imageId , org.ovirt.engine.core.compat.Guid sourceDomainId ) { org.ovirt.engine.core.compat.Guid templateId = getDiskImageByImageId ( imageId ) . getImageTemplateId ( ) ; if ( ! ( Guid.Empty.equals ( templateId ) ) ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage templateImage = getDiskImageDao ( ) . get ( templateId ) ; if ( ! ( templateImage.getStorageIds ( ) . contains ( sourceDomainId ) ) ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_NOT_FOUND_ON_DESTINATION_DOMAIN ) ; } } return true ; }
Source:
public void countAllTemplates ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplateCount , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_BASIC_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.userportal.section.DefaultMainSectionExtendedPlace.class ) . to ( ApplicationPlaces.DEFAULT_MAIN_SECTION_EXTENDED_PLACE ) ; bindResourceConfiguration ( org.ovirt.engine.ui.userportal.ApplicationConstants.class , org.ovirt.engine.ui.userportal.ApplicationMessages.class , org.ovirt.engine.ui.userportal.ApplicationResources.class , org.ovirt.engine.ui.userportal.ApplicationTemplates.class , org.ovirt.engine.ui.userportal.ApplicationDynamicMessages.class ) ; bind ( org.ovirt.engine.ui.userportal.ApplicationResourcesWithLookup.class ) . in ( com.google.inject.Singleton.class ) ; }

Target:
void bindConfiguration ( ) { bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultLoginSectionPlace.class ) . to ( UserPortalApplicationPlaces.DEFAULT_LOGIN_SECTION_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.section.DefaultMainSectionPlace.class ) . to ( UserPortalApplicationPlaces.DEFAULT_MAIN_SECTION_BASIC_PLACE ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.userportal.section.DefaultMainSectionExtendedPlace.class ) . to ( UserPortalApplicationPlaces.DEFAULT_MAIN_SECTION_EXTENDED_PLACE ) ; bindResourceConfiguration ( org.ovirt.engine.ui.userportal.ApplicationConstants.class , org.ovirt.engine.ui.userportal.ApplicationMessages.class , org.ovirt.engine.ui.userportal.ApplicationResources.class , org.ovirt.engine.ui.userportal.ApplicationTemplates.class , org.ovirt.engine.ui.userportal.ApplicationDynamicMessages.class ) ; bind ( org.ovirt.engine.ui.userportal.ApplicationResourcesWithLookup.class ) . in ( com.google.inject.Singleton.class ) ; }
Source:
public static < T > org.ovirt.engine.ui.uicompat.Translator Create ( T type ) { org.ovirt.engine.ui.uicompat.EnumTranslator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.translatorsMap.get ( type ) ; if ( translator == null ) { translator = new org.ovirt.engine.ui.uicompat.EnumTranslator ( type ) ; org.ovirt.engine.ui.uicompat.EnumTranslator.translatorsMap.put ( ( ( java.lang.Class < ? > ) ( type ) ) , translator ) ; } return translator ; }

Target:
public static < T > org.ovirt.engine.ui.uicompat.Translator create ( T type ) { org.ovirt.engine.ui.uicompat.EnumTranslator translator = org.ovirt.engine.ui.uicompat.EnumTranslator.translatorsMap.get ( type ) ; if ( translator == null ) { translator = new org.ovirt.engine.ui.uicompat.EnumTranslator ( type ) ; org.ovirt.engine.ui.uicompat.EnumTranslator.translatorsMap.put ( ( ( java.lang.Class < ? > ) ( type ) ) , translator ) ; } return translator ; }
Source:
public static void isClusterEmpty ( 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.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return ( ( java.lang.Boolean ) ( source ) ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsClusterEmpty , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public void getClusterById ( 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVdsGroupById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public boolean equals ( java.lang.Object obj ) { if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotConfigInfo ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotConfigInfo configInfo = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotConfigInfo ) ( obj ) ) ; if ( ! ( java.util.Objects.equals ( getClusterConfigOptions ( ) , configInfo.getClusterConfigOptions ( ) ) ) ) { return false ; } if ( ! ( java.util.Objects.equals ( getVolumeConfigOptions ( ) , configInfo.getVolumeConfigOptions ( ) ) ) ) { return false ; } return true ; }

Target:
public boolean equals ( java.lang.Object obj ) { if ( ( this ) == obj ) { return true ; } if ( ! ( obj instanceof org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotConfigInfo ) ) { return false ; } org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotConfigInfo other = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotConfigInfo ) ( obj ) ) ; return ( java.util.Objects.equals ( clusterConfigOptions , other.clusterConfigOptions ) ) && ( java.util.Objects.equals ( volumeConfigOptions , other.volumeConfigOptions ) ) ; }
Source:
public void getVmAndTemplatesIdsWithoutAttachedImageDisks ( ) { addVmDevice ( FixturesTool.VM_WITH_NO_ATTACHED_DISKS , FixturesTool.IMAGE_GROUP_ID_2 , null ) ; addVmDevice ( FixturesTool.VM_WITH_NO_ATTACHED_DISKS , FixturesTool.DISK_ID , FixturesTool.EXISTING_SNAPSHOT_ID ) ; java.util.List < org.ovirt.engine.core.compat.Guid > ids = dao.getVmAndTemplatesIdsWithoutAttachedImageDisks ( false ) ; org.junit.Assert.assertTrue ( ids.contains ( FixturesTool.VM_RHEL5_POOL_51 ) ) ; org.junit.Assert.assertTrue ( ids.contains ( FixturesTool.VM_TEMPLATE_RHEL5_2 ) ) ; org.junit.Assert.assertTrue ( ids.contains ( FixturesTool.VM_WITH_NO_ATTACHED_DISKS ) ) ; org.junit.Assert.assertFalse ( ids.contains ( FixturesTool.VM_TEMPLATE_RHEL5 ) ) ; }

Target:
private void checkVmsDcAndDisks ( java.util.List < org.ovirt.engine.core.compat.Guid > vmIds , org.ovirt.engine.core.compat.Guid storagePoolId , boolean hasDisks ) { for ( org.ovirt.engine.core.compat.Guid vmId : vmIds ) { org.junit.Assert.assertEquals ( storagePoolId , dbFacade.getVmDao ( ) . get ( vmId ) . getStoragePoolId ( ) ) ; checkDisks ( vmId , hasDisks ) ; } }
Source:
public static java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsType > getGraphicsTypesOfEntity ( org.ovirt.engine.core.compat.Guid entityId ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsType > result = new java.util.ArrayList < > ( ) ; if ( entityId != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( entityId , VmDeviceGeneralType.GRAPHICS ) ; if ( devices != null ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { result.add ( org.ovirt.engine.core.common.businessentities.GraphicsType.fromString ( device.getDevice ( ) ) ) ; } } } return result ; }

Target:
public static java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsType > getGraphicsTypesOfEntity ( org.ovirt.engine.core.compat.Guid entityId ) { java.util.List < org.ovirt.engine.core.common.businessentities.GraphicsType > result = new java.util.ArrayList < > ( ) ; if ( entityId != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > devices = org.ovirt.engine.core.bll.utils.VmDeviceUtils.dbFacade.getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( entityId , VmDeviceGeneralType.GRAPHICS ) ; if ( devices != null ) { for ( org.ovirt.engine.core.common.businessentities.VmDevice device : devices ) { result.add ( org.ovirt.engine.core.common.businessentities.GraphicsType.fromString ( device.getDevice ( ) ) ) ; } } } return result ; }
Source:
public void setMessage ( java.lang.String message ) { super . setMessage ( message ) ; if ( ( message != null ) && ( ! ( message.isEmpty ( ) ) ) ) { messagePanel.add ( new com.google.gwt.user.client.ui.HTML ( templates.iconWithText ( warningImage , message ) ) ) ; } messagePanel.setVisible ( messagePanel.iterator ( ) . hasNext ( ) ) ; }

Target:
public void setMessage ( java.lang.String message ) { super . setMessage ( message ) ; if ( ( message != null ) && ( ! ( message.isEmpty ( ) ) ) ) { messagePanel.add ( new com.google.gwt.user.client.ui.HTML ( org.ovirt.engine.ui.webadmin.section.main.view.popup.storage.DisksAllocationPopupView.templates.iconWithText ( warningImage , message ) ) ) ; } messagePanel.setVisible ( messagePanel.iterator ( ) . hasNext ( ) ) ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult networkActuallyExists ( org.ovirt.engine.core.compat.Guid networkId ) { if ( ( networkBusinessEntityMap.get ( networkId ) ) == null ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.NETWORK_NOT_EXISTS ) ; } else { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } }

Target:
private org.ovirt.engine.core.bll.ValidationResult referencedNetworkAttachmentActuallyExists ( org.ovirt.engine.core.compat.Guid networkAttachmentId ) { boolean doesNotReferenceExistingNetworkAttachment = networkAttachmentId == null ; if ( doesNotReferenceExistingNetworkAttachment ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment existingAttachment : existingAttachments ) { if ( existingAttachment.getId ( ) . equals ( networkAttachmentId ) ) { return org.ovirt.engine.core.bll.ValidationResult.VALID ; } } return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS ) ; }
Source:
private void setHostProviderWidgetsAvailability ( boolean enabled ) { getProviders ( ) . setIsAvailable ( enabled ) ; getProviderSearchFilter ( ) . setIsAvailable ( enabled ) ; getProviderSearchFilterLabel ( ) . setIsAvailable ( enabled ) ; getExternalHostName ( ) . setIsAvailable ( enabled ) ; getExternalHostName ( ) . setSelectedItem ( null ) ; }

Target:
public void updateHosts ( ) { updateExternalHostModels ( ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { return org.ovirt.engine.core.bll.ChangeDiskCommand.getSucceeded ( ) ? "" . equals ( cdImagePath ) ? org.ovirt.engine.core.common.AuditLogType.USER_EJECT_VM_DISK : org.ovirt.engine.core.common.AuditLogType.USER_CHANGE_DISK_VM : org.ovirt.engine.core.common.AuditLogType.USER_FAILED_CHANGE_DISK_VM ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.ChangeDiskCommand.shouldSkipCommandExecutionCached ( ) ) { return "" . equals ( cdImagePath ) ? org.ovirt.engine.core.common.AuditLogType.VM_DISK_ALREADY_EJECTED : org.ovirt.engine.core.common.AuditLogType.VM_DISK_ALREADY_CHANGED ; } if ( ! ( org.ovirt.engine.core.bll.ChangeDiskCommand.getSucceeded ( ) ) ) { return org.ovirt.engine.core.common.AuditLogType.USER_FAILED_CHANGE_DISK_VM ; } return "" . equals ( cdImagePath ) ? org.ovirt.engine.core.common.AuditLogType.USER_EJECT_VM_DISK : org.ovirt.engine.core.common.AuditLogType.USER_CHANGE_DISK_VM ; }
Source:
public java.lang.Object runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.storage_pool_iso_map mapToRemove = getStorageDomain ( ) . getStoragePoolIsoMapData ( ) ; getCompensationContext ( ) . snapshotEntity ( mapToRemove ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( mapToRemove.getstorage_id ( ) , mapToRemove.getstorage_pool_id ( ) ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }

Target:
public java.lang.Object runInTransaction ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap mapToRemove = getStorageDomain ( ) . getStoragePoolIsoMapData ( ) ; getCompensationContext ( ) . snapshotEntity ( mapToRemove ) ; org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getStoragePoolIsoMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.StoragePoolIsoMapId ( mapToRemove.getstorage_id ( ) , mapToRemove.getstorage_pool_id ( ) ) ) ; getCompensationContext ( ) . stateChanged ( ) ; return null ; }
Source:
protected void writeAdditionalContent ( com.google.gwt.core.ext.TreeLogger logger , com.google.gwt.core.ext.GeneratorContext context , com.google.gwt.editor.rebind.model.EditorModel model , com.google.gwt.user.rebind.SourceWriter sw ) throws com.google.gwt.core.ext.UnableToCompleteException { com.google.gwt.core.ext.typeinfo.TypeOracle typeOracle = context.getTypeOracle ( ) ; entityModelType = eraseType ( typeOracle.findType ( "org.ovirt.engine.ui.uicommonweb.models.EntityModel" ) ) ; listModelType = eraseType ( typeOracle.findType ( "org.ovirt.engine.ui.uicommonweb.models.ListModel" ) ) ; this . logger = logger ; this . model = model ; this . sw = sw ; logger.log ( Type.DEBUG , "Strating to write additional Driver code" ) ; writeListenerMap ( ) ; writeEventMap ( ) ; writeOwnerModels ( ) ; }

Target:
protected void writeAdditionalContent ( com.google.gwt.core.ext.TreeLogger logger , com.google.gwt.core.ext.GeneratorContext context , com.google.gwt.editor.rebind.model.EditorModel model , com.google.gwt.user.rebind.SourceWriter sw ) throws com.google.gwt.core.ext.UnableToCompleteException { com.google.gwt.core.ext.typeinfo.TypeOracle typeOracle = context.getTypeOracle ( ) ; entityModelType = eraseType ( typeOracle.findType ( "org.ovirt.engine.ui.uicommonweb.models.EntityModel" ) ) ; listModelType = eraseType ( typeOracle.findType ( "org.ovirt.engine.ui.uicommonweb.models.ListModel" ) ) ; this . logger = logger ; this . model = model ; this . sw = sw ; logger.log ( Type.DEBUG , "Starting to write additional Driver code" ) ; writeListenerMap ( ) ; writeEventMap ( ) ; writeOwnerModels ( ) ; }
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 , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
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.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos = createQos ( ) ; org.mockito.Mockito.when ( qosDao.get ( qosId ) ) . thenReturn ( qos ) ; network.setQosId ( qosId ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( iface ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }
Source:
public void setUpBefore ( ) throws java.lang.Exception { super . setUpBefore ( ) ; baseIface = createBaseInterface ( null , null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanIface = createVlanInterface ( baseIface , networkName , qosA ) ; setTestIface ( vlanIface ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( vlanIface ) ) . thenReturn ( baseIface ) ; }

Target:
public void setUpBefore ( ) throws java.lang.Exception { super . setUpBefore ( ) ; baseIface = createBaseInterface ( null , null ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vlanIface = createVlanInterface ( baseIface , networkName , qosA ) ; setTestIface ( vlanIface ) ; mcr.mockConfigValue ( ConfigValues.DefaultMTU , 1500 ) ; org.mockito.Mockito.when ( calculateBaseNic.getBaseNic ( vlanIface ) ) . thenReturn ( baseIface ) ; }
Source:
public java.util.Set < java.lang.String > getConsumedEvents ( ) { java.util.Set < java.lang.String > set = new java.util.HashSet < java.lang.String > ( ) ; org.ovirt.engine.ui.common.widget.tooltip.TooltipMixin.addTooltipsEvents ( set ) ; set.add ( BrowserEvents.CHANGE ) ; set.add ( BrowserEvents.KEYDOWN ) ; set.add ( BrowserEvents.MOUSEMOVE ) ; return set ; }

Target:
public java.util.Set < java.lang.String > getConsumedEvents ( ) { java.util.Set < java.lang.String > set = new java.util.HashSet < java.lang.String > ( ) ; org.ovirt.engine.ui.common.widget.tooltip.ElementTooltipUtils.addTooltipsEvents ( set ) ; set.add ( BrowserEvents.CHANGE ) ; set.add ( BrowserEvents.KEYDOWN ) ; set.add ( BrowserEvents.MOUSEMOVE ) ; return set ; }
Source:
protected boolean isBalloonEnabled ( ) { java.lang.Boolean balloonEnabled = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isBalloonEnabled ( ) ; return balloonEnabled != null ? balloonEnabled : osRepository.isBalloonEnabled ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getOsId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getcompatibility_version ( ) ) ; }

Target:
protected boolean isBalloonEnabled ( ) { java.lang.Boolean balloonEnabled = org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . isBalloonEnabled ( ) ; return balloonEnabled != null ? balloonEnabled : osRepository.isBalloonEnabled ( org.ovirt.engine.core.bll.AddVmCommand.getParameters ( ) . getVmStaticData ( ) . getOsId ( ) , org.ovirt.engine.core.bll.AddVmCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ; }
Source:
public static void GetHighUtilizationForEvenDistribution ( 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 ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.HighUtilizationForEvenlyDistribute ) , aQuery ) ; }

Target:
public static void GetStorageDomainList ( 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.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage_domains > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Storage:" , org.ovirt.engine.core.common.interfaces.SearchType.StorageDomain ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }
Source:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( VdcQueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }

Target:
protected void setUpGetPayloadExpectations ( int times , int index ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmPayload payload = new org.ovirt.engine.core.common.businessentities.VmPayload ( ) ; for ( int i = 0 ; i < times ; i ++ ) { setUpGetEntityExpectations ( QueryType.GetVmPayload , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , payload ) ; } }
Source:
public void testRemoveAllButOne ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity newHook = getGlusterHook ( ) ; newHook.setId ( FixturesTool.NEW_HOOK_ID ) ; dao.save ( newHook ) ; java.util.List < org.ovirt.engine.core.compat.Guid > hookIds = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; hookIds.add ( FixturesTool.HOOK_ID ) ; hookIds.add ( FixturesTool.HOOK_ID2 ) ; dao.removeAll ( hookIds ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > hooks = dao.getByClusterId ( FixturesTool.CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( hooks ) ; org.junit.Assert.assertEquals ( 1 , hooks.size ( ) ) ; }

Target:
public void testRemoveAllButOne ( ) { org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity newHook = getGlusterHook ( ) ; newHook.setId ( FixturesTool.NEW_HOOK_ID ) ; dao.save ( newHook ) ; java.util.List < org.ovirt.engine.core.compat.Guid > hookIds = new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( ) ; hookIds.add ( FixturesTool.HOOK_ID ) ; hookIds.add ( FixturesTool.HOOK_ID2 ) ; dao.removeAll ( hookIds ) ; java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > hooks = dao.getByClusterId ( FixturesTool.GLUSTER_CLUSTER_ID ) ; org.junit.Assert.assertNotNull ( hooks ) ; org.junit.Assert.assertEquals ( 1 , hooks.size ( ) ) ; }
Source:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.users.UserGroup > items = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.users.UserGroup > ( ) ; for ( java.lang.String groupFullName : getEntity ( ) . getgroups ( ) . split ( "[,]" , ( - 1 ) ) ) { items.add ( org.ovirt.engine.ui.uicommonweb.models.users.UserGroupListModel.createUserGroup ( groupFullName ) ) ; } setItems ( items ) ; } else { setItems ( null ) ; } }

Target:
protected void onEntityChanged ( ) { super . onEntityChanged ( ) ; if ( ( getEntity ( ) ) != null ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.users.UserGroup > items = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.users.UserGroup > ( ) ; for ( java.lang.String groupFullName : getEntity ( ) . getGroupNames ( ) . split ( "[,]" , ( - 1 ) ) ) { items.add ( org.ovirt.engine.ui.uicommonweb.models.users.UserGroupListModel.createUserGroup ( groupFullName ) ) ; } setItems ( items ) ; } else { setItems ( null ) ; } }
Source:
protected void doTestBadRemove ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , canDo , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 1 ) ; setAllContentHeaderExpectation ( ) ; setGetGuestAgentQueryExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVmInterface , org.ovirt.engine.core.common.action.RemoveVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "InterfaceId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.VM_ID , org.ovirt.engine.api.restapi.resource.BackendVmNicResourceTest.NIC_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void testGetFileSize ( ) { java.io.File file = new java.io.File ( "/etc/hosts" ) ; long hostsSize = file.length ( ) ; org.junit.Assert.assertTrue ( "We should be able to read this file." , org.ovirt.engine.core.utils.servlet.ServletUtils.canReadFile ( file ) ) ; org.junit.Assert.assertEquals ( "Values should match" , hostsSize , org.ovirt.engine.core.utils.servlet.ServletUtils.getFileSize ( file ) ) ; }

Target:
public void testGetFileSize ( ) { java.io.File file = new java.io.File ( canReadFileName ) ; long hostsSize = file.length ( ) ; org.junit.Assert.assertTrue ( "We should be able to read this file." , org.ovirt.engine.core.utils.servlet.ServletUtils.canReadFile ( file ) ) ; org.junit.Assert.assertEquals ( "Values should match" , hostsSize , org.ovirt.engine.core.utils.servlet.ServletUtils.getFileSize ( file ) ) ; }
Source:
public void verifyOsFormatCanBeParsed ( ) { final org.ovirt.engine.core.utils.OS validOs = org.ovirt.engine.core.utils.OS.fromPackageVersionString ( name ) ; org.assertj.core.api.Assertions.assertThat ( validOs.isValid ( ) ) . isTrue ( ) ; org.assertj.core.api.Assertions.assertThat ( validOs.getVersion ( ) ) . isEqualTo ( version ) ; }

Target:
public void verifyOsFormatCanBeParsed ( ) { final org.ovirt.engine.core.utils.OS validOs = org.ovirt.engine.core.utils.OS.fromPackageVersionString ( name ) ; org.assertj.core.api.Assertions.assertThat ( validOs.isValid ( ) ) . isTrue ( ) ; org.assertj.core.api.Assertions.assertThat ( validOs.getVersion ( ) ) . isEqualTo ( version ) ; org.assertj.core.api.Assertions.assertThat ( validOs.getFullVersion ( ) ) . isEqualTo ( fullVersion ) ; }
Source:
public static boolean isAdminUser ( org.ovirt.engine.core.common.users.VdcUser user ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > userRoles = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getRoleDAO ( ) . getAllForUserAndGroups ( user.getUserId ( ) , user.getGroupIds ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Role r : userRoles ) { if ( ( r.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) { if ( org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.debugFormat ( "LoginAdminUser: User logged to admin using role {0}" , r.getname ( ) ) ; } return true ; } } return false ; }

Target:
public static boolean isAdminUser ( org.ovirt.engine.core.common.businessentities.DbUser user ) { java.util.List < org.ovirt.engine.core.common.businessentities.Role > userRoles = org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.getRoleDAO ( ) . getAllForUserAndGroups ( user.getId ( ) , user.getGroupIds ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Role r : userRoles ) { if ( ( r.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.RoleType.ADMIN ) ) { if ( org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.isDebugEnabled ( ) ) { org.ovirt.engine.core.bll.MultiLevelAdministrationHandler.log.debugFormat ( "LoginAdminUser: User logged to admin using role {0}" , r.getname ( ) ) ; } return true ; } } return false ; }
Source:
public void getVmsRunningOnOrMigratingToVds ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmsRunningOnOrMigratingToVds , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }

Target:
public 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.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( id ) , aQuery ) ; }
Source:
public void testGetNetworkDiskTypeForV41 ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_1 ) ; vm.setClusterId ( org.ovirt.engine.core.vdsbroker.builder.vminfo.VmInfoBuildUtilsTest.CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getSupportedAdditionalClusterFeatures ( false ) ) . when ( clusterFeatureDao ) . getSupportedFeaturesByClusterId ( org.ovirt.engine.core.vdsbroker.builder.vminfo.VmInfoBuildUtilsTest.CLUSTER_ID ) ; org.junit.Assert.assertEquals ( false , underTest.getNetworkDiskType ( vm , StorageType.GLUSTERFS ) . isPresent ( ) ) ; }

Target:
public void testGetNetworkDiskTypeForV41 ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setClusterCompatibilityVersion ( Version.v4_1 ) ; vm.setClusterId ( org.ovirt.engine.core.vdsbroker.builder.vminfo.VmInfoBuildUtilsTest.CLUSTER_ID ) ; org.mockito.Mockito.doReturn ( getSupportedAdditionalClusterFeatures ( false ) ) . when ( clusterFeatureDao ) . getSupportedFeaturesByClusterId ( org.ovirt.engine.core.vdsbroker.builder.vminfo.VmInfoBuildUtilsTest.CLUSTER_ID ) ; org.junit.Assert.assertFalse ( underTest.getNetworkDiskType ( vm , StorageType.GLUSTERFS ) . isPresent ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.hosts = hosts ; clusterGuideModel.UpdateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel clusterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > hosts = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ) ( returnValue ) ) ; clusterGuideModel.hosts = hosts ; clusterGuideModel.updateOptionsNonLocalFS ( ) ; }
Source:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { 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.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getStorageDomainList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { 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.StorageDomain > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainsByStoragePoolId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }
Source:
public org.ovirt.engine.api.model.Event lookupEvent ( java.lang.String id ) { java.lang.Long longId = java.lang.Long.valueOf ( id ) ; for ( org.ovirt.engine.core.common.businessentities.AuditLog auditLog : getBackendCollection ( ) ) { if ( ( auditLog.getaudit_log_id ( ) ) == longId ) return addLinks ( map ( auditLog ) ) ; } return notFound ( ) ; }

Target:
public org.ovirt.engine.api.model.Event lookupEvent ( java.lang.String id ) { try { java.lang.Long longId = java.lang.Long.valueOf ( id ) ; for ( org.ovirt.engine.core.common.businessentities.AuditLog auditLog : getBackendCollection ( ) ) { if ( ( auditLog.getaudit_log_id ( ) ) == longId ) return addLinks ( map ( auditLog ) ) ; } return notFound ( ) ; } catch ( java.lang.NumberFormatException e ) { return notFound ( ) ; } }
Source:
public void getSpecParams ( ) { org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setAction ( VmWatchdogAction.RESET ) ; params.setModel ( VmWatchdogType.i6300esb ) ; org.ovirt.engine.core.bll.UpdateWatchdogCommand command = new org.ovirt.engine.core.bll.UpdateWatchdogCommand ( params ) ; java.util.HashMap < java.lang.String , java.lang.Object > specParams = command.getSpecParams ( ) ; org.junit.Assert.assertNotNull ( specParams ) ; org.junit.Assert.assertEquals ( "i6300esb" , specParams.get ( "model" ) ) ; org.junit.Assert.assertEquals ( "reset" , specParams.get ( "action" ) ) ; }

Target:
public void getSpecParams ( ) { org.ovirt.engine.core.common.action.WatchdogParameters params = new org.ovirt.engine.core.common.action.WatchdogParameters ( ) ; params.setAction ( VmWatchdogAction.RESET ) ; params.setModel ( vmWatchdogType ) ; org.ovirt.engine.core.bll.UpdateWatchdogCommand command = new org.ovirt.engine.core.bll.UpdateWatchdogCommand ( params ) ; java.util.HashMap < java.lang.String , java.lang.Object > specParams = command.getSpecParams ( ) ; org.junit.Assert.assertNotNull ( specParams ) ; org.junit.Assert.assertEquals ( "i6300esb" , specParams.get ( "model" ) ) ; org.junit.Assert.assertEquals ( "reset" , specParams.get ( "action" ) ) ; }
Source:
private static void removeNetworkFromHosts ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.bll.context.CommandContext context , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder builder = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder.class ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( network , nics ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.HostSetupNetworksParametersBuilder.updateParametersSequencing ( parameters ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalMultipleActions ( VdcActionType.PersistentHostSetupNetworks , parameters , context ) ; } }

Target:
private void removeNetworkFromHosts ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.bll.context.CommandContext context , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { java.util.ArrayList < org.ovirt.engine.core.common.action.ActionParametersBase > parameters = removeNetworkParametersBuilder.buildParameters ( network , nics ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.HostSetupNetworksParametersBuilder.updateParametersSequencing ( parameters ) ; backend.runInternalMultipleActions ( ActionType.PersistentHostSetupNetworks , parameters , context ) ; } }
Source:
private void extractBondIfModified ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String bondName ) { if ( ! ( bonds.containsKey ( bondName ) ) ) { bonds.put ( bondName , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ) ; } if ( interfaceWasModified ( iface ) ) { modifiedBonds.put ( bondName , iface ) ; } }

Target:
private boolean networkWasModified ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface ) { org.ovirt.engine.core.common.businessentities.VdsNetworkInterface existingIface = getExistingIfaces ( ) . get ( iface.getName ( ) ) ; if ( existingIface == null ) { return true ; } return ( ( ! ( org.apache.commons.lang.ObjectUtils.equals ( iface.getNetworkName ( ) , existingIface.getNetworkName ( ) ) ) ) || ( ( iface.getBootProtocol ( ) ) != ( existingIface.getBootProtocol ( ) ) ) ) || ( staticBootProtoPropertiesChanged ( iface , existingIface ) ) ; }
Source:
protected java.util.Map < java.lang.String , java.lang.Object > initDeviceStructure ( ) { java.util.Map < java.lang.String , java.lang.Object > deviceStruct = new java.util.HashMap < > ( ) ; deviceStruct.put ( VdsProperties.balloonEnabled , getParameters ( ) . isEnableBalloon ( ) ) ; deviceStruct.put ( VdsProperties.ksmEnabled , getParameters ( ) . isEnableKsm ( ) ) ; return deviceStruct ; }

Target:
protected java.util.Map < java.lang.String , java.lang.Object > initDeviceStructure ( ) { java.util.Map < java.lang.String , java.lang.Object > deviceStruct = new java.util.HashMap < > ( ) ; deviceStruct.put ( VdsProperties.balloonEnabled , getParameters ( ) . isEnableBalloon ( ) ) ; deviceStruct.put ( VdsProperties.ksmEnabled , getParameters ( ) . isEnableKsm ( ) ) ; deviceStruct.put ( VdsProperties.ksmMergeAcrossNodes , getParameters ( ) . isKsmMergeAcrossNumaNodes ( ) ) ; return deviceStruct ; }
Source:
public void qosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosValuesTest ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.common.businessentities.network.HostNetworkQos qos ) { mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; iface.setQosOverridden ( true ) ; mockExistingIfaces ( iface ) ; iface.setQos ( qos ) ; return createHelper ( createParametersForNics ( iface ) , Version.v3_4 ) ; }
Source:
public void validateVmInPreview ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmForSpace ( ) ; initVmDiskImage ( false ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.when ( snapshotsValidator.vmNotInPreview ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_FAILED_VM_IN_PREVIEW ) ; }

Target:
public void passDiscardSupportedForDestSdMoveOp ( ) { initializeCommand ( new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) , VmEntityType.VM ) ; mockPassDiscardSupportedForDestSd ( ValidationResult.VALID , ImageOperation.Move ) ; org.junit.Assert.assertTrue ( command.validatePassDiscardSupportedForDestinationStorageDomain ( ) ) ; }
Source:
public void run ( ) { this . isRunning = true ; while ( this . isRunning ) { select ( ) ; try { this . scheduler.performPendingOperations ( ) ; } catch ( java.lang.Exception e ) { org.ovirt.vdsm.jsonrpc.client.reactors.Reactor.LOG.error ( "Exception occured during running scheduled task" , e ) ; } processChannels ( ) ; } }

Target:
public void run ( ) { this . isRunning = true ; while ( this . isRunning ) { select ( ) ; try { this . scheduler.performPendingOperations ( ) ; } catch ( java.lang.Exception e ) { org.ovirt.vdsm.jsonrpc.client.utils.JsonUtils.logException ( org.ovirt.vdsm.jsonrpc.client.reactors.Reactor.LOG , "Exception occured during running scheduled task" , e ) ; } processChannels ( ) ; } }
Source:
public void setUsePatternFly ( final boolean use ) { this . usePatternFly = use ; if ( use ) { setContentWidgetStyleName ( PatternflyConstants.FORM_CONTROL ) ; addLabelStyleName ( "label col-sm-2 col-md-2 control-label" ) ; addContentWidgetContainerStyleName ( "col-sm-10 col-md-10" ) ; wrapperPanel.getElement ( ) . addClassName ( PatternflyConstants.FORM_GROUP ) ; wrapperPanel.getElement ( ) . removeClassName ( style.wrapper ( ) ) ; contentWidgetContainer.asWidget ( ) . removeStyleName ( style.contentWidget ( ) ) ; } }

Target:
public void removeWrapperStyleName ( java.lang.String styleName ) { wrapperPanel.removeStyleName ( styleName ) ; }