auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterSwiftServices ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { setItems ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > ) ( returnValue ) ) ) ; updateActionAvailability ( ) ; } } ) , getEntity ( ) . getId ( ) ) ; }

Target:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterSwiftServices ( new org.ovirt.engine.ui.uicommonweb.models.gluster.AsyncQuery ( new org.ovirt.engine.ui.frontend.AsyncCallback < java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > > ( ) { @ java.lang.Override public void onSuccess ( java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService > returnValue ) { setItems ( returnValue ) ; updateActionAvailability ( ) ; } } ) , getEntity ( ) . getId ( ) ) ; }
Source:
public void setup ( ) { executor = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.pm.HostFenceActionExecutor ( fencedHost , new org.ovirt.engine.core.common.businessentities.FencingPolicy ( ) ) ) ; org.mockito.Mockito.doReturn ( agentExecutor1 ) . doReturn ( agentExecutor2 ) . when ( executor ) . createFenceActionExecutor ( org.mockito.ArgumentMatchers.any ( java.util.List.class ) ) ; }

Target:
public void setup ( ) { executor = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.pm.HostFenceActionExecutor ( fencedHost , new org.ovirt.engine.core.common.businessentities.FencingPolicy ( ) ) ) ; org.mockito.Mockito.doReturn ( agentExecutor1 ) . doReturn ( agentExecutor2 ) . when ( executor ) . createFenceActionExecutor ( org.mockito.ArgumentMatchers.anyList ( ) ) ; }
Source:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "rollbackOnFailure" , isRollbackOnFailure ( ) ) . append ( "conectivityTimeout" , getConectivityTimeout ( ) ) . append ( "hostNetworkQosSupported" , getHostNetworkQosSupported ( ) ) . append ( "networks" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getNetworks ( ) , "\t\t" ) ) . append ( "removedNetworks" , getRemovedNetworks ( ) ) . append ( "bonds" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getBonds ( ) , "\t\t" ) ) . append ( "removedBonds" , getBonds ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.utils.ToStringBuilder appendAttributes ( org.ovirt.engine.core.common.utils.ToStringBuilder tsb ) { return super . appendAttributes ( tsb ) . append ( "rollbackOnFailure" , isRollbackOnFailure ( ) ) . append ( "connectivityTimeout" , getConnectivityTimeout ( ) ) . append ( "hostNetworkQosSupported" , getHostNetworkQosSupported ( ) ) . append ( "networks" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getNetworks ( ) , "\t\t" ) ) . append ( "removedNetworks" , getRemovedNetworks ( ) ) . append ( "bonds" , org.ovirt.engine.core.common.businessentities.Entities.collectionToString ( getBonds ( ) , "\t\t" ) ) . append ( "removedBonds" , getBonds ( ) ) ; }
Source:
public void update ( int index , org.ovirt.engine.core.common.businessentities.Quota quota , java.lang.String value ) { transitionHandler.handlePlaceTransition ( true ) ; }

Target:
public void update ( int index , org.ovirt.engine.core.common.businessentities.Quota quota , java.lang.String value ) { java.util.Map < java.lang.String , java.lang.String > parameters = new java.util.HashMap < > ( ) ; parameters.put ( FragmentParams.NAME.getName ( ) , quota.getName ( ) ) ; parameters.put ( FragmentParams.DATACENTER.getName ( ) , quota.getStoragePoolName ( ) ) ; getPlaceTransitionHandler ( ) . handlePlaceTransition ( WebAdminApplicationPlaces.quotaClusterSubTabPlace , parameters ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc getVGList ( ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getLVMVolumeGroups" ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vglist" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.VGListReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc getExternalVmFromOva ( java.lang.String ovaPath ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.getExternalVmFromOva" ) . withParameter ( "ova_path" , ovaPath ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "vmList" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( response ) ; }
Source:
protected boolean validateFreeSpace ( org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > snapshots = getAllImageSnapshots ( diskImage ) ; diskImage.getSnapshots ( ) . addAll ( snapshots ) ; } return validate ( storageDomainValidator.hasSpaceForClonedDisks ( disksList ) ) ; }

Target:
protected boolean validateFreeSpace ( org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList ) { for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage diskImage : disksList ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > snapshots = getAllImageSnapshots ( diskImage ) ; diskImage.getSnapshots ( ) . addAll ( snapshots ) ; } return validate ( storageDomainValidator.hasSpaceForClonedDisks ( disksList ) ) ; }
Source:
public static void GetDiskMaxSize ( 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.MaxBlockDiskSize , org.ovirt.engine.core.common.config.Config.DefaultConfigurationVersion ) , aQuery ) ; }

Target:
public static void GetLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
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.hasIpv4PrimaryAddressSet ( ) ) ) ) || ( ( ipConfiguration.getIpv4PrimaryAddress ( ) . getBootProtocol ( ) ) == ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol.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:
private boolean validBootProtocolForRoleNetwork ( ) { if ( ! ( isRoleNetwork ( ) ) ) { return true ; } org.ovirt.engine.core.common.businessentities.network.IpConfiguration ipConfiguration = attachment.getIpConfiguration ( ) ; if ( ipConfiguration == null ) { return false ; } if ( getNetworkCluster ( ) . isMigration ( ) ) { return hasBootProtocol ( ipConfiguration ) ; } return hasIpv4BootProtocol ( ipConfiguration ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.reportsWebappDeployed ) { getView ( ) . updateReportsPanel ( getModel ( ) . getUrl ( ) , getModel ( ) . getParams ( ) ) ; } else { checkUpdateReportsPanel ( getModel ( ) . getUrl ( ) , getModel ( ) . getParams ( ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( org.ovirt.engine.ui.webadmin.section.main.presenter.tab.MainTabReportsPresenter.reportsWebappDeployed ) && ( ( getModel ( ) . getUri ( ) ) != null ) ) { getView ( ) . updateReportsPanel ( getModel ( ) . getUrl ( ) , getModel ( ) . getParams ( ) ) ; } }
Source:
public static boolean setDiskAlias ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , org.ovirt.engine.core.common.businessentities.VM vm ) { if ( disk != null ) { java.lang.String vmName = "" ; int count = 1 ; if ( vm != null ) { vmName = vm.getvm_name ( ) ; count = ( vm.getDiskMapCount ( ) ) + 1 ; } disk.setDiskAlias ( org.ovirt.engine.core.bll.ImagesHandler.getSuggestedDiskAlias ( disk , vmName , count ) ) ; return true ; } else { org.ovirt.engine.core.bll.ImagesHandler.log.errorFormat ( "Disk object is null" ) ; return false ; } }

Target:
public static boolean setDiskAlias ( org.ovirt.engine.core.common.businessentities.BaseDisk disk , org.ovirt.engine.core.common.businessentities.VM vm ) { if ( disk == null ) { org.ovirt.engine.core.bll.ImagesHandler.log.errorFormat ( "Disk object is null" ) ; return false ; } java.lang.String vmName = "" ; int count = 1 ; if ( vm != null ) { vmName = vm.getVmName ( ) ; count = ( vm.getDiskMapCount ( ) ) + 1 ; } disk.setDiskAlias ( org.ovirt.engine.core.bll.ImagesHandler.getSuggestedDiskAlias ( disk , vmName , count ) ) ; return true ; }
Source:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { if ( vetoRemoveWidget ( item , value , widget ) ) { return ; } doRemoveItem ( item , value , widget ) ; }

Target:
public void onClick ( com.google.gwt.event.dom.client.ClickEvent event ) { V widget = item.getSecond ( ) ; getEntry ( widget ) . removeLastButton ( ) ; org.ovirt.engine.core.common.utils.Pair < T , V > item = addGhostEntry ( ) ; onAdd ( item.getFirst ( ) , item.getSecond ( ) ) ; }
Source:
protected void executeQueryCommand ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = getVmDeviceDao ( ) . getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.GetWatchdogQuery.getParameters ( ) . getId ( ) , VmDeviceGeneralType.WATCHDOG ) ; if ( ( vmDevices != null ) && ( ! ( vmDevices.isEmpty ( ) ) ) ) { setReturnValue ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.VmWatchdog ( vmDevices.get ( 0 ) ) ) ) ; } else { org.ovirt.engine.core.bll.GetWatchdogQuery.setReturnValue ( java.util.Collections.emptyList ( ) ) ; } }

Target:
protected void executeQueryCommand ( ) { final java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > vmDevices = vmDeviceDao.getVmDeviceByVmIdAndType ( org.ovirt.engine.core.bll.GetWatchdogQuery.getParameters ( ) . getId ( ) , VmDeviceGeneralType.WATCHDOG ) ; if ( ( vmDevices != null ) && ( ! ( vmDevices.isEmpty ( ) ) ) ) { setReturnValue ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.VmWatchdog ( vmDevices.get ( 0 ) ) ) ) ; } else { org.ovirt.engine.core.bll.GetWatchdogQuery.setReturnValue ( java.util.Collections.emptyList ( ) ) ; } }
Source:
public void addAllocateNewMacAddress ( ) { org.ovirt.engine.core.common.businessentities.network.VmNic iface = createNewInterface ( ) ; java.lang.String newMac = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( macPoolManager.allocateNewMac ( ) ) . thenReturn ( newMac ) ; vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , true , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.VERSION_3_2 ) ; org.junit.Assert.assertEquals ( newMac , iface.getMacAddress ( ) ) ; }

Target:
public void addAllocateNewMacAddress ( ) { org.ovirt.engine.core.common.businessentities.network.VmNic iface = createNewInterface ( ) ; java.lang.String newMac = org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextString ( 10 ) ; org.mockito.Mockito.when ( macPoolManager.allocateNewMac ( ) ) . thenReturn ( newMac ) ; vmInterfaceManager.add ( iface , org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) , true , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.OS_ID , org.ovirt.engine.core.bll.network.VmInterfaceManagerTest.VERSION_3_2 ) ; org.junit.Assert.assertEquals ( newMac , iface.getMacAddress ( ) ) ; }
Source:
public static void GetMaxVmPriority ( 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 ) { if ( source == null ) { return 100 ; } return ( ( java.lang.Integer ) ( source ) ) . intValue ( ) ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPriorityMaxValue , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public static void getMaxVmPriority ( 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 ) { if ( source == null ) { return 100 ; } return source ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.VmPriorityMaxValue , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
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 ) ; }

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 ) ; bindConstant ( ) . annotatedWith ( org.ovirt.engine.ui.common.system.ClientStorageKeyPrefix.class ) . to ( org.ovirt.engine.ui.userportal.gin.SystemModule.CLIENT_STORAGE_KEY_PREFIX ) ; 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:
org.codehaus.jackson.JsonNode readJsonNode ( java.io.File file ) { org.codehaus.jackson.JsonNode node = null ; try { node = mapper.readValue ( file , org.codehaus.jackson.JsonNode.class ) ; } catch ( java.io.IOException e ) { org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginDataManager.logger.warn ( ( ( "Cannot read/parse JSON file [" + ( file.getAbsolutePath ( ) ) ) + "]" ) , e ) ; } return node ; }

Target:
org.codehaus.jackson.JsonNode readJsonNode ( java.io.File file ) { org.codehaus.jackson.JsonNode node = null ; try { node = mapper.readValue ( file , org.codehaus.jackson.JsonNode.class ) ; } catch ( java.io.IOException e ) { org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginDataManager.log.warn ( "Cannot read/parse JSON file '{}': {}" , file.getAbsolutePath ( ) , e.getMessage ( ) ) ; org.ovirt.engine.ui.frontend.server.gwt.plugin.PluginDataManager.log.debug ( "Exception" , e ) ; } return node ; }
Source:
private void performImageDbOperations ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { removeImageFromDB ( ) ; } else { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( getParameters ( ) . getImageId ( ) , getParameters ( ) . getStorageDomainId ( ) ) ) ; unLockImage ( ) ; return null ; } } ) ; } }

Target:
private void removeImageMapping ( ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.executeInNewTransaction ( new org.ovirt.engine.core.utils.transaction.TransactionMethod < java.lang.Void > ( ) { @ java.lang.Override public java.lang.Void runInTransaction ( ) { getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.ImageStorageDomainMapId ( getParameters ( ) . getImageId ( ) , getParameters ( ) . getStorageDomainId ( ) ) ) ; unLockImage ( ) ; return null ; } } ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMetadataDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( org.ovirt.engine.core.bll.memory.MemoryUtils.METADATA_SIZE_IN_BYTES ) ; image.setVolumeType ( VolumeType.Sparse ) ; image.setvolumeFormat ( VolumeFormat.COW ) ; image.setDiskInterface ( DiskInterface.VirtIO ) ; return image ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createMetadataDisk ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; image.setSize ( org.ovirt.engine.core.bll.memory.MemoryUtils.METADATA_SIZE_IN_BYTES ) ; image.setVolumeType ( VolumeType.Preallocated ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; image.setDiskInterface ( DiskInterface.VirtIO ) ; return image ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.ui.uicommonweb.models.vms.register.CANCEL_COMMAND.equals ( command.getName ( ) ) ) { closeDialog ( ) ; } else if ( org.ovirt.engine.ui.uicommonweb.models.vms.register.VnicProfileMappingModel.OK_COMMAND.equals ( command.getName ( ) ) ) { mergeShownRows ( ) ; closeDialog ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( org.ovirt.engine.ui.uicommonweb.models.vms.register.CANCEL_COMMAND.equals ( command.getName ( ) ) ) { closeDialog ( ) ; } else if ( org.ovirt.engine.ui.uicommonweb.models.vms.register.VnicProfileMappingModel.OK_COMMAND.equals ( command.getName ( ) ) ) { mergeShownRows ( ) ; originModel.setVnicMappingChangeConfirmed ( true ) ; closeDialog ( ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster CloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; obj.setStatus ( instance.getStatus ( ) ) ; obj.setDisplay ( instance.isDisplay ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; return obj ; }

Target:
private static org.ovirt.engine.core.common.businessentities.network.NetworkCluster CloneNetworkCluster ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster instance ) { org.ovirt.engine.core.common.businessentities.network.NetworkCluster obj = new org.ovirt.engine.core.common.businessentities.network.NetworkCluster ( ) ; obj.setStatus ( instance.getStatus ( ) ) ; obj.setDisplay ( instance.isDisplay ( ) ) ; obj.setRequired ( instance.isRequired ( ) ) ; obj.setMigration ( instance.isMigration ( ) ) ; return obj ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.lang.Iterable < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qos = ( ( java.lang.Iterable < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( returnValue ) ) ; getQos ( ) . setItems ( qos ) ; getQos ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.findNetworkQosById ( qos , getNetwork ( ) . getQosId ( ) ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > qos = ( ( java.util.Collection < org.ovirt.engine.core.common.businessentities.network.NetworkQoS > ) ( returnValue ) ) ; getQos ( ) . setItems ( qos ) ; getQos ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.findNetworkQosById ( qos , getNetwork ( ) . getQosId ( ) ) ) ; }
Source:
public void testZeroLatency ( ) { java.lang.String doubleValue = "0" ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_write_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setMockForTesting ( diskData ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > disks = vdsBrokerObjectsBuilder.buildVmDiskStatistics ( xml ) ; org.junit.Assert.assertEquals ( new java.lang.Double ( "0" ) , disks.get ( 0 ) . getWriteLatency ( ) ) ; }

Target:
public void testZeroLatency ( ) { java.lang.String doubleValue = "0" ; java.util.Map < java.lang.String , java.lang.Object > diskData = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setDiskData ( ) ; diskData.put ( VdsProperties.vm_disk_write_latency , doubleValue ) ; java.util.Map < java.lang.String , java.lang.Object > xml = org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerObjectsBuilderTest.setMockForTesting ( diskData ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImageDynamic > disks = vdsBrokerObjectsBuilder.buildVmDiskStatistics ( xml ) ; org.junit.jupiter.api.Assertions.assertEquals ( new java.lang.Double ( "0" ) , disks.get ( 0 ) . getWriteLatency ( ) ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = super . hashCode ( ) ; result = ( prime * result ) + ( ( getPluginType ( ) ) == null ? 0 : getPluginType ( ) . hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = super . hashCode ( ) ; result = ( prime * result ) + ( ( getPluginType ( ) ) == null ? 0 : getPluginType ( ) . hashCode ( ) ) ; result = ( prime * result ) + ( ( getAgentConfiguration ( ) ) == null ? 0 : getAgentConfiguration ( ) . hashCode ( ) ) ; return result ; }
Source:
private void assertGetResult ( org.ovirt.engine.core.common.businessentities.StorageDomain result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingDomain , result ) ; org.junit.Assert.assertEquals ( "Wrong committed disk size" , 8 , result.getCommittedDiskSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong actual disk size" , 4 , result.getActualImagesSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong metadata device" , FixturesTool.LUN_ID_OF_DOMAIN_METADATA , result.getMetadataDevice ( ) ) ; org.junit.Assert.assertEquals ( "Wrong shared status" , StorageDomainSharedStatus.Active , result.getStorageDomainSharedStatus ( ) ) ; }

Target:
private void assertGetResult ( org.ovirt.engine.core.common.businessentities.StorageDomain result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertEquals ( existingDomain , result ) ; org.junit.Assert.assertEquals ( "Wrong committed disk size" , 8 , result.getCommittedDiskSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong actual disk size" , 4 , result.getActualImagesSize ( ) ) ; org.junit.Assert.assertEquals ( "Wrong first metadata device" , FixturesTool.LUN_ID_OF_DOMAIN_METADATA , result.getFirstMetadataDevice ( ) ) ; org.junit.Assert.assertEquals ( "Wrong vg metadata device" , FixturesTool.LUN_ID_OF_DOMAIN_VG_METADATA , result.getVgMetadataDevice ( ) ) ; org.junit.Assert.assertEquals ( "Wrong shared status" , StorageDomainSharedStatus.Active , result.getStorageDomainSharedStatus ( ) ) ; }
Source:
public void getVmTemplatesByBaseTemplateId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid baseTemplate ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesByBaseTemplateId , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( baseTemplate ) , asyncQuery ) ; }

Target:
public void getUnusedBricksFromServer ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid hostId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters parameters = new org.ovirt.engine.core.common.queries.IdQueryParameters ( hostId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetUnusedGlusterBricks , parameters , asyncQuery ) ; }
Source:
protected void onReveal ( ) { super . onReveal ( ) ; if ( hasSelection ( ) ) { clearSelection ( ) ; } else { updateLayout ( ) ; } org.ovirt.engine.ui.userportal.section.main.presenter.AbstractSideTabWithDetailsPresenter.getView ( ) . getTable ( ) . resetScrollPosition ( ) ; }

Target:
protected void onReveal ( ) { super . onReveal ( ) ; org.ovirt.engine.ui.userportal.section.main.presenter.AbstractSideTabWithDetailsPresenter.getView ( ) . getTable ( ) . setLoadingState ( LoadingState.LOADING ) ; if ( hasSelection ( ) ) { clearSelection ( ) ; } else { updateLayout ( ) ; } org.ovirt.engine.ui.userportal.section.main.presenter.AbstractSideTabWithDetailsPresenter.getView ( ) . getTable ( ) . resetScrollPosition ( ) ; }
Source:
private void applyNetworkChangesToHosts ( ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand < T > . SyncNetworkParametersBuilder builder = new SyncNetworkParametersBuilder ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getBackend ( ) . runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , parameters ) ; } }

Target:
private void applyNetworkChangesToHosts ( ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand < T > . SyncNetworkParametersBuilder builder = new SyncNetworkParametersBuilder ( ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getNetwork ( ) , getOldNetwork ( ) ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.dc.UpdateNetworkCommand.getBackend ( ) . runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , parameters ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.core.compat.Event ev , java.lang.Object sender , org.ovirt.engine.core.compat.EventArgs args ) { org.ovirt.engine.ui.frontend.FrontendFailureEventArgs failureArgs = ( ( org.ovirt.engine.ui.frontend.FrontendFailureEventArgs ) ( args ) ) ; if ( ( failureArgs.getMessage ( ) ) != null ) { errorPopupManager.show ( org.ovirt.engine.ui.common.uicommon.FrontendFailureEventListener.MESSAGES.uiCommonFrontendFailure ( org.ovirt.engine.ui.common.uicommon.ErrorMessageFormatter.formatMessage ( failureArgs.getMessage ( ) ) ) ) ; } else if ( ( failureArgs.getMessages ( ) ) != null ) { errorPopupManager.show ( org.ovirt.engine.ui.common.uicommon.FrontendFailureEventListener.MESSAGES.uiCommonFrontendFailure ( org.ovirt.engine.ui.common.uicommon.ErrorMessageFormatter.formatMessages ( failureArgs.getMessages ( ) ) ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { org.ovirt.engine.ui.frontend.FrontendFailureEventArgs failureArgs = ( ( org.ovirt.engine.ui.frontend.FrontendFailureEventArgs ) ( args ) ) ; if ( ( failureArgs.getMessage ( ) ) != null ) { errorPopupManager.show ( messages.uiCommonRunActionFailed ( org.ovirt.engine.ui.common.uicommon.ErrorMessageFormatter.formatMessage ( failureArgs.getMessage ( ) ) ) ) ; } else if ( ( failureArgs.getMessages ( ) ) != null ) { errorPopupManager.show ( messages.uiCommonRunActionFailed ( org.ovirt.engine.ui.common.uicommon.ErrorMessageFormatter.formatMessages ( failureArgs.getMessages ( ) ) ) ) ; } }
Source:
public void runMixedActionFlowAllSucceed ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.action.UiAction > actions = runActionFlow ( ActionType.parallel , ActionType.next , ActionType.parallel ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState flowState = actions.get ( 0 ) . getActionFlowState ( ) ; verifyRunActionAndExecuteCallbacksRandomly ( true , flowState , 2 ) ; verifyRunActionAndExecuteCallbacksRandomly ( true , flowState , 4 , 2 ) ; assertFinishedWithNoErrors ( actions ) ; }

Target:
public void runMixedActionFlowAllSucceed ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.action.UiAction > actions = runActionFlow ( UiActionBaseTest.ActionType.parallel , UiActionBaseTest.ActionType.next , UiActionBaseTest.ActionType.parallel ) ; org.ovirt.engine.ui.uicommonweb.action.UiAction.ActionFlowState flowState = actions.get ( 0 ) . getActionFlowState ( ) ; verifyRunActionAndExecuteCallbacksRandomly ( true , flowState , 2 ) ; verifyRunActionAndExecuteCallbacksRandomly ( true , flowState , 4 , 2 ) ; assertFinishedWithNoErrors ( actions ) ; }
Source:
private void initAdvancedParameterExpanders ( ) { authenticationExpander.initWithContent ( authenticationExpanderContent.getElement ( ) ) ; networkExpander.initWithContent ( networkExpanderContent.getElement ( ) ) ; customScriptExpander.initWithContent ( customScriptExpanderContent.getElement ( ) ) ; }

Target:
private void initAdvancedParameterExpanders ( ) { authenticationExpander.initWithContent ( authenticationExpanderContent.getElement ( ) ) ; networkExpander.initWithContent ( networkExpanderContent.getElement ( ) ) ; customScriptExpander.initWithContent ( customScriptExpanderContent.getElement ( ) ) ; sysprepScriptExpander.initWithContent ( sysprepScriptExpanderContent.getElement ( ) ) ; }
Source:
public static void getDataCenterListByName ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "DataCenter: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void getClusterListByName ( 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 ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }
Source:
java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.EntityModel > getClustersTableItems ( ) { org.ovirt.engine.ui.uicommonweb.models.ListModel tableModel = clustersTable.flush ( ) ; return ( tableModel != null ) && ( ( tableModel.getItems ( ) ) != null ) ? tableModel.getItems ( ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.EntityModel > ( ) ; }

Target:
void refreshClustersTable ( ) { clustersTable.asEditor ( ) . edit ( clustersTable.asEditor ( ) . flush ( ) ) ; }
Source:
public void testValidateVmMigrating ( ) { prepareForVmValidatorTests ( ) ; cmd.getVm ( ) . setStatus ( VMStatus.MigratingTo ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP ) ; }

Target:
public void testValidateVmMigrating ( ) { prepareForVmValidatorTests ( ) ; org.mockito.Mockito.doReturn ( ValidationResult.VALID ) . when ( snapshotValidator ) . vmSnapshotDisksNotDuringMerge ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ; cmd.getVm ( ) . setStatus ( VMStatus.MigratingTo ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( cmd , EngineMessage.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN_OR_UP ) ; }
Source:
private void PostInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.FirstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.NGuid.Empty ) ) ) ) ; UpdateIsDisksAvailable ( ) ; }

Target:
private void PostInitTemplate ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { org.ovirt.engine.core.common.businessentities.VmTemplate oldTemplate = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; getModel ( ) . getTemplate ( ) . setItems ( templates ) ; getModel ( ) . getTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( templates , ( oldTemplate != null ? new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( oldTemplate.getId ( ) ) : new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( org.ovirt.engine.core.compat.NGuid.Empty ) ) ) ) ; UpdateIsDisksAvailable ( ) ; }
Source:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.ConvertVmCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; try { addImportedDevices ( readVmFromOvf ( getOvfOfConvertedVm ( ) ) ) ; org.ovirt.engine.core.bll.ConvertVmCommand.setSucceeded ( true ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.ovirt.engine.core.bll.ConvertVmCommand.log.info ( "failed to add devices to converted vm" ) ; removeVm ( ) ; } finally { deleteV2VJob ( ) ; } }

Target:
protected void endSuccessfully ( ) { org.ovirt.engine.core.bll.ConvertVmCommand.getReturnValue ( ) . setEndActionTryAgain ( false ) ; try { org.ovirt.engine.core.common.businessentities.VM vm = readVmFromOvf ( getOvfOfConvertedVm ( ) ) ; updateBootDiskFlag ( vm ) ; addImportedDevices ( vm ) ; org.ovirt.engine.core.bll.ConvertVmCommand.setSucceeded ( true ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { org.ovirt.engine.core.bll.ConvertVmCommand.log.info ( "failed to add devices to converted vm" ) ; removeVm ( ) ; } finally { deleteV2VJob ( ) ; } }
Source:
public org.ovirt.engine.sdk.decorators.HostPermission add ( org.ovirt.engine.sdk.decorators.Permission permission ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; return getProxy ( ) . add ( url , permission , org.ovirt.engine.sdk.entities.Permission.class , org.ovirt.engine.sdk.decorators.HostPermission.class ) ; }

Target:
public org.ovirt.engine.sdk.decorators.HostPermission add ( org.ovirt.engine.sdk.decorators.Permission permission ) throws java.io.IOException , org.apache.http.client.ClientProtocolException , org.ovirt.engine.sdk.exceptions.ServerException { java.lang.String url = ( ( this . parent.getHref ( ) ) + ( SLASH ) ) + ( getName ( ) ) ; java.util.List < org.apache.http.Header > headers = new org.ovirt.engine.sdk.utils.HttpHeaderBuilder ( ) . build ( ) ; url = new org.ovirt.engine.sdk.utils.UrlBuilder ( url ) . build ( ) ; return getProxy ( ) . add ( url , permission , org.ovirt.engine.sdk.entities.Permission.class , org.ovirt.engine.sdk.decorators.HostPermission.class , headers ) ; }
Source:
public java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > getPermissionCheckSubjects ( ) { java.util.List < org.ovirt.engine.core.bll.utils.PermissionSubject > permissionList = new java.util.ArrayList < > ( ) ; permissionList.add ( new org.ovirt.engine.core.bll.utils.PermissionSubject ( org.ovirt.engine.core.bll.AbstractGraphicsDeviceCommand.getParameters ( ) . getDev ( ) . getVmId ( ) , ( org.ovirt.engine.core.bll.AbstractGraphicsDeviceCommand.getParameters ( ) . isVm ( ) ? org.ovirt.engine.core.common.VdcObjectType.VM : org.ovirt.engine.core.common.VdcObjectType.VmTemplate ) , org.ovirt.engine.core.bll.AbstractGraphicsDeviceCommand.getActionType ( ) . getActionGroup ( ) ) ) ; return permissionList ; }

Target:
protected org.ovirt.engine.core.compat.Guid getVmBaseId ( ) { return org.ovirt.engine.core.bll.AbstractGraphicsDeviceCommand.getParameters ( ) . getDev ( ) . getVmId ( ) ; }
Source:
private void vmNotHavingPassthroughVnicsCommon ( org.ovirt.engine.core.compat.Guid vmId , int numOfPassthroughVnic , int numOfRegularVnics ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vnics = new java.util.ArrayList < > ( ) ; for ( int i = 0 ; i < numOfPassthroughVnic ; ++ i ) { vnics.add ( mockVnic ( true ) ) ; } for ( int i = 0 ; i < numOfRegularVnics ; ++ i ) { vnics.add ( mockVnic ( false ) ) ; } org.mockito.Mockito.when ( vmNetworkInterfaceDao.getAllForVm ( vmId ) ) . thenReturn ( vnics ) ; }

Target:
private void mockVnics ( java.util.stream.Stream < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vnics ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vNics = vnics.collect ( java.util.stream.Collectors.toList ( ) ) ; org.mockito.Mockito.when ( vmNetworkInterfaceDao.getAllForVm ( vm.getId ( ) ) ) . thenReturn ( vNics ) ; }
Source:
protected boolean validateNumberOfNics ( ) { if ( org.ovirt.engine.core.common.config.Config.< java.lang.Boolean > GetValue ( ConfigValues.LimitNumberOfNetworkInterfaces , getVdsGroup ( ) . getcompatibility_version ( ) . toString ( ) ) ) { if ( ! ( org.ovirt.engine.core.bll.VmCommand.validateNumberOfNics ( getParameters ( ) . getVm ( ) . getInterfaces ( ) , null ) ) ) { return failCanDoAction ( VdcBllMessages.NETWORK_INTERFACE_EXITED_MAX_INTERFACES ) ; } } return true ; }

Target:
protected void updateImage ( org.ovirt.engine.core.common.businessentities.DiskImage disk ) { getImageDao ( ) . update ( disk.getImage ( ) ) ; }
Source:
private org.ovirt.engine.core.config.entity.ConfigKey getConfigKey ( java.lang.String key ) { org.ovirt.engine.core.config.entity.ConfigKey ckReturn = null ; ckReturn = configKeyFactory.generateByPropertiesKey ( key ) ; if ( ( ckReturn == null ) || ( ( ckReturn.getKey ( ) ) == null ) ) { ckReturn = null ; org.ovirt.engine.core.config.EngineConfigLogic.log.debug ( ( ( "getConfigKey: Unable to fetch the value of " + key ) + "." ) ) ; } return ckReturn ; }

Target:
private org.ovirt.engine.core.config.entity.ConfigKey getConfigKey ( java.lang.String key ) { org.ovirt.engine.core.config.entity.ConfigKey ckReturn = null ; ckReturn = configKeyFactory.generateByPropertiesKey ( key ) ; if ( ( ckReturn == null ) || ( ( ckReturn.getKey ( ) ) == null ) ) { ckReturn = null ; org.ovirt.engine.core.config.EngineConfigLogic.log.debug ( "getConfigKey: Unable to fetch the value of {}." , key ) ; } return ckReturn ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult hotUpdatePossible ( ) { if ( ( getRequiredAction ( ) ) == ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ) ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.networkLinking ( version ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOT_VM_INTERFACE_UPDATE_IS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.clusterVersion ( ) ) ; } else if ( nic.isPortMirroring ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.CANNOT_PERFOM_HOT_UPDATE_WITH_PORT_MIRRORING ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult hotUpdatePossible ( ) { if ( ( getRequiredAction ( ) ) == ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ) ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.networkLinking ( version ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOT_VM_INTERFACE_UPDATE_IS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.clusterVersion ( ) ) ; } else if ( getVnicProfile ( ) . isPortMirroring ( ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.CANNOT_PERFOM_HOT_UPDATE_WITH_PORT_MIRRORING ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicsResourceTest.VM_ID } , getEntityList ( ) , failure ) ; } }

Target:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( QueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicsResourceTest.VM_ID } , getEntityList ( ) , failure ) ; } }
Source:
public void canDoActionShareableDiskVolumeFormatSucceeds ( ) { org.ovirt.engine.core.common.businessentities.DiskImage image = org.ovirt.engine.core.bll.AddDiskCommandTest.createShareableDiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( image ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId , Version.v3_1 ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; runAndAssertCanDoActionSuccess ( ) ; }

Target:
public void canDoActionShareableDiskVolumeFormatSucceeds ( ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.AddDiskCommandTest.createShareableDiskImage ( ) ; image.setvolumeFormat ( VolumeFormat.RAW ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskCommandTest.createParameters ( ) ; parameters.setDiskInfo ( image ) ; org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId , Version.v3_1 ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; mockMaxPciSlots ( ) ; runAndAssertCanDoActionSuccess ( ) ; }