auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.providers.NeutronAgentModel model ) { driver.edit ( model ) ; mappings.setExplanation ( org.ovirt.engine.ui.webadmin.widget.provider.NeutronAgentWidget.templates.italicText ( model.getInterfaceMappingsExplanation ( ) . getEntity ( ) ) ) ; model.getInterfaceMappingsExplanation ( ) . getEntityChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener ( ) { @ java.lang.Override public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { mappings.setExplanation ( org.ovirt.engine.ui.webadmin.widget.provider.NeutronAgentWidget.templates.italicText ( model.getInterfaceMappingsExplanation ( ) . getEntity ( ) ) ) ; } } ) ; }

Target:
public void edit ( final org.ovirt.engine.ui.uicommonweb.models.providers.NeutronAgentModel model ) { driver.edit ( model ) ; mappings.setExplanation ( org.ovirt.engine.ui.webadmin.widget.provider.NeutronAgentWidget.templates.italicText ( model.getInterfaceMappingsExplanation ( ) . getEntity ( ) ) ) ; model.getInterfaceMappingsExplanation ( ) . getEntityChangedEvent ( ) . addListener ( new org.ovirt.engine.ui.uicompat.IEventListener < org.ovirt.engine.ui.uicompat.EventArgs > ( ) { @ java.lang.Override 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 ) { mappings.setExplanation ( org.ovirt.engine.ui.webadmin.widget.provider.NeutronAgentWidget.templates.italicText ( model.getInterfaceMappingsExplanation ( ) . getEntity ( ) ) ) ; } } ) ; }
Source:
public void testStorageDomainVmLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_ID ) ; vm.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; vm.getStorageDomain ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; vm = org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( setUpUriExpectations ( ) , vm ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_VM_HREF , vm.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_HREF , vm.getStorageDomain ( ) . getHref ( ) ) ; }

Target:
public void testStorageDomainVmLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.VM_ID ) ; vm.setStorageDomain ( new org.ovirt.engine.api.model.StorageDomain ( ) ) ; vm.getStorageDomain ( ) . setId ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_ID ) ; vm = org.ovirt.engine.api.restapi.util.LinkHelper.addLinks ( vm ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_VM_HREF , vm.getHref ( ) ) ; assertEquals ( org.ovirt.engine.api.restapi.util.LinkHelperTest.STORAGE_DOMAIN_HREF , vm.getStorageDomain ( ) . getHref ( ) ) ; }
Source:
public void testParseHugeRange ( ) { java.lang.String start = "00:1a:4a:01:00:00" ; java.lang.String end = "00:FF:FF:FF:FF:FF" ; final long expectedStart = org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( start ) ; final long expectedEnd = ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( start ) ) + ( java.lang.Integer.MAX_VALUE ) ; testRange ( start , end , expectedStart , expectedEnd ) ; }

Target:
public void testParseHugeRange ( ) { java.lang.String start = "00:1a:4a:01:00:00" ; java.lang.String end = "00:FF:FF:FF:FF:FF" ; final long expectedStart = org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( start ) ; final long expectedEnd = ( ( org.ovirt.engine.core.utils.MacAddressRangeUtils.macToLong ( start ) ) + ( java.lang.Integer.MAX_VALUE ) ) - 1 ; testRange ( start , end , expectedStart , expectedEnd ) ; }
Source:
private void remove ( ) { if ( ( getWindow ( ) ) != null ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vnics = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VmTemplate > pair = ( ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VmTemplate > ) ( item ) ) ; vnics.add ( pair.getFirst ( ) ) ; } org.ovirt.engine.ui.uicommonweb.models.vms.RemoveVmTemplateInterfaceModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.RemoveVmTemplateInterfaceModel ( this , vnics , true ) ; setWindow ( model ) ; }

Target:
private void remove ( ) { if ( ( getWindow ( ) ) != null ) { return ; } java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > vnics = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.utils.PairQueryable < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface , org.ovirt.engine.core.common.businessentities.VmTemplate > pair : getSelectedItems ( ) ) { vnics.add ( pair.getFirst ( ) ) ; } org.ovirt.engine.ui.uicommonweb.models.vms.RemoveVmTemplateInterfaceModel model = new org.ovirt.engine.ui.uicommonweb.models.vms.RemoveVmTemplateInterfaceModel ( this , vnics , true ) ; setWindow ( model ) ; }
Source:
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.Tags > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tags : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ) ( source ) ) ) { if ( ( tags.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { ret.add ( tags ) ; } } return ret ; } return new org.ovirt.engine.core.common.businessentities.Tags ( ) ; }

Target:
public java.util.List < org.ovirt.engine.core.common.businessentities.Tags > convert ( java.lang.Object source ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ret = new java.util.ArrayList < > ( ) ; for ( org.ovirt.engine.core.common.businessentities.Tags tags : ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Tags > ) ( source ) ) ) { if ( ( tags.getType ( ) ) == ( org.ovirt.engine.core.common.businessentities.TagsType.GeneralTag ) ) { ret.add ( tags ) ; } } return ret ; } return new java.util.ArrayList < > ( ) ; }
Source:
public void setup ( ) { org.ovirt.engine.core.common.config.IConfigUtilsInterface configUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ; org.mockito.Mockito.when ( configUtils.GetValue ( ConfigValues.AdUserPassword , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( new java.util.HashMap < java.lang.String , java.lang.String > ( ) ) ; org.mockito.Mockito.when ( configUtils.GetValue ( ConfigValues.AdUserName , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( "" ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( configUtils ) ; }

Target:
public void setup ( ) { org.ovirt.engine.core.common.config.IConfigUtilsInterface configUtils = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.config.IConfigUtilsInterface.class ) ; org.mockito.Mockito.when ( configUtils.getValue ( ConfigValues.AdUserPassword , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( new java.util.HashMap < java.lang.String , java.lang.String > ( ) ) ; org.mockito.Mockito.when ( configUtils.getValue ( ConfigValues.AdUserName , ConfigCommon.defaultConfigurationVersion ) ) . thenReturn ( "" ) ; org.ovirt.engine.core.common.config.Config.setConfigUtils ( configUtils ) ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.DiskImage object ) { boolean isBoot = object.getDiskVmElements ( ) . iterator ( ) . next ( ) . isBoot ( ) ; return isBoot ? getDefaultImage ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.storage.DiskImage object ) { boolean isBoot = ( ! ( object.getDiskVmElements ( ) . isEmpty ( ) ) ) && ( object.getDiskVmElements ( ) . iterator ( ) . next ( ) . isBoot ( ) ) ; return isBoot ? getDefaultImage ( ) : null ; }
Source:
public org.ovirt.engine.core.dao.StoragePoolDAO getStoragePoolDAO ( ) { final org.ovirt.engine.core.dao.StoragePoolDAO s = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; final org.ovirt.engine.core.common.businessentities.storage_pool p = new org.ovirt.engine.core.common.businessentities.storage_pool ( ) ; p.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; org.mockito.Mockito.when ( s.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ) . thenReturn ( p ) ; org.mockito.Mockito.when ( s.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ) . thenReturn ( null ) ; return s ; }

Target:
public org.ovirt.engine.core.dao.StoragePoolDAO getStoragePoolDAO ( ) { final org.ovirt.engine.core.dao.StoragePoolDAO s = org.mockito.Mockito.mock ( org.ovirt.engine.core.dao.StoragePoolDAO.class ) ; final org.ovirt.engine.core.common.businessentities.StoragePool p = new org.ovirt.engine.core.common.businessentities.StoragePool ( ) ; p.setId ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ; org.mockito.Mockito.when ( s.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID ) ) . thenReturn ( p ) ; org.mockito.Mockito.when ( s.get ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ) . thenReturn ( null ) ; return s ; }
Source:
public void setVmsWithvNumaNodeList ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsWithvNumaNodeList ) { if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( vm.getId ( ) ) ) { vmsWithvNumaNodeList.add ( vm ) ; } else { org.ovirt.engine.core.common.businessentities.VM removeVm = null ; for ( org.ovirt.engine.core.common.businessentities.VM iterVm : vmsWithvNumaNodeList ) { if ( iterVm.getId ( ) . equals ( vm.getId ( ) ) ) { removeVm = iterVm ; break ; } } vmsWithvNumaNodeList.remove ( removeVm ) ; vmsWithvNumaNodeList.add ( vm ) ; } super . setVmsWithvNumaNodeList ( vmsWithvNumaNodeList ) ; }

Target:
public void setVmsWithvNumaNodeList ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > vmsWithvNumaNodeList ) { super . setVmsWithvNumaNodeList ( vmsWithvNumaNodeList ) ; if ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( vm.getId ( ) ) ) { vmsWithvNumaNodeList.add ( vm ) ; } else { org.ovirt.engine.core.common.businessentities.VM removeVm = null ; for ( org.ovirt.engine.core.common.businessentities.VM iterVm : vmsWithvNumaNodeList ) { if ( iterVm.getId ( ) . equals ( vm.getId ( ) ) ) { removeVm = iterVm ; break ; } } vmsWithvNumaNodeList.remove ( removeVm ) ; vmsWithvNumaNodeList.add ( vm ) ; } }
Source:
public void poll ( ) { if ( vdsManager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = getVmsFetcher ( ) ; long fetchTime = java.lang.System.nanoTime ( ) ; if ( fetcher.fetch ( ) ) { getVmsMonitoring ( fetchTime ) . perform ( fetcher.getChangedVms ( ) ) ; processDevices ( fetcher.getVdsmVms ( ) . stream ( ) . map ( VmInternalData :: getVmDynamic ) , fetchTime ) ; } else { org.ovirt.engine.core.vdsbroker.PollVmStatsRefresher.log.info ( "Failed to fetch vms info for host '{}' - skipping VMs monitoring." , vdsManager.getVdsName ( ) ) ; } } }

Target:
public void poll ( ) { if ( vdsManager.isMonitoringNeeded ( ) ) { org.ovirt.engine.core.vdsbroker.VmsListFetcher fetcher = getVmsFetcher ( ) ; long fetchTime = java.lang.System.nanoTime ( ) ; if ( fetcher.fetch ( ) ) { getVmsMonitoring ( ) . perform ( fetcher.getChangedVms ( ) , fetchTime ) ; processDevices ( fetcher.getVdsmVms ( ) . stream ( ) . map ( VmInternalData :: getVmDynamic ) , fetchTime ) ; } else { org.ovirt.engine.core.vdsbroker.PollVmStatsRefresher.log.info ( "Failed to fetch vms info for host '{}' - skipping VMs monitoring." , vdsManager.getVdsName ( ) ) ; } } }
Source:
public static boolean isMemoryToBeHotplugged ( org.ovirt.engine.core.common.businessentities.VM source , org.ovirt.engine.core.common.businessentities.VM destination , boolean memoryUnplugSupported ) { return ( ( source.getMemSizeMb ( ) ) < ( destination.getMemSizeMb ( ) ) ) || ( memoryUnplugSupported && ( ( source.getMemSizeMb ( ) ) > ( destination.getMemSizeMb ( ) ) ) ) ; }

Target:
public static boolean isMemoryToBeHotplugged ( org.ovirt.engine.core.common.businessentities.VM source , org.ovirt.engine.core.common.businessentities.VM destination ) { return ( source.getMemSizeMb ( ) ) < ( destination.getMemSizeMb ( ) ) ; }
Source:
private void prepareMocks ( org.ovirt.engine.core.bll.gluster.StopGlusterVolumeCommand command ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( command ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( command ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( stoppedVolumeId ) ) . when ( volumeDao ) . getById ( stoppedVolumeId ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( startedVolumeId ) ) . when ( volumeDao ) . getById ( startedVolumeId ) ; }

Target:
public void prepareMocks ( ) { org.mockito.Mockito.doReturn ( volumeDao ) . when ( cmd ) . getGlusterVolumeDao ( ) ; org.mockito.Mockito.doReturn ( getVds ( VDSStatus.Up ) ) . when ( cmd ) . getUpServer ( ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( stoppedVolumeId ) ) . when ( volumeDao ) . getById ( stoppedVolumeId ) ; org.mockito.Mockito.doReturn ( getGlusterVolume ( startedVolumeId ) ) . when ( volumeDao ) . getById ( startedVolumeId ) ; }
Source:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( availableDiskSize ) == null ? 0 : availableDiskSize.hashCode ( ) ) ; result = ( prime * result ) + ( ( id ) == null ? 0 : id.hashCode ( ) ) ; result = ( prime * result ) + ( ( usedDiskSize ) == null ? 0 : usedDiskSize.hashCode ( ) ) ; return result ; }

Target:
public int hashCode ( ) { final int prime = 31 ; int result = 1 ; result = ( prime * result ) + ( ( id ) == null ? 0 : id.hashCode ( ) ) ; result = ( prime * result ) + ( ( availableDiskSize ) == null ? 0 : availableDiskSize.hashCode ( ) ) ; result = ( prime * result ) + ( ( usedDiskSize ) == null ? 0 : usedDiskSize.hashCode ( ) ) ; return result ; }
Source:
public void enableNewAddtionalFeatureWhenHostSupports ( ) { createCommandWithAddtionalFeature ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; allQueriesForVms ( ) ; clusterHasVds ( ) ; org.mockito.Mockito.when ( hostFeatureDao.getSupportedHostFeaturesByHostId ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singleton ( "TEST_FEATURE" ) ) ; initAndAssertValidation ( true ) ; }

Target:
public void enableNewAddtionalFeatureWhenHostSupports ( ) { createCommandWithAddtionalFeature ( ) ; org.mockito.Mockito.when ( clusterDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( org.ovirt.engine.core.bll.UpdateClusterCommandTest.createClusterWithNoCpuName ( ) ) ; cpuExists ( ) ; cpuFlagsNotMissing ( ) ; clusterHasVds ( ) ; org.mockito.Mockito.when ( hostFeatureDao.getSupportedHostFeaturesByHostId ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( java.util.Collections.singleton ( "TEST_FEATURE" ) ) ; initAndAssertValidation ( true ) ; }
Source:
private static java.lang.String encrypt ( java.lang.String source , java.security.cert.Certificate cert ) throws java.io.UnsupportedEncodingException , java.security.GeneralSecurityException { java.lang.String result = null ; byte [ ] cipherbytes = source.trim ( ) . getBytes ( "UTF-8" ) ; javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( org.ovirt.engine.core.engineencryptutils.EncryptionUtils.algo ) ; rsa.init ( javax.crypto.Cipher.ENCRYPT_MODE , cert.getPublicKey ( ) ) ; byte [ ] cipher = rsa.doFinal ( cipherbytes ) ; result = org.apache.commons.codec.binary.Base64.encodeBase64String ( cipher ) ; return result ; }

Target:
private static java.lang.String encrypt ( java.lang.String source , java.security.cert.Certificate cert ) throws java.io.UnsupportedEncodingException , java.security.GeneralSecurityException { javax.crypto.Cipher rsa = javax.crypto.Cipher.getInstance ( org.ovirt.engine.core.engineencryptutils.EncryptionUtils.algo ) ; rsa.init ( javax.crypto.Cipher.ENCRYPT_MODE , cert.getPublicKey ( ) ) ; return org.apache.commons.codec.binary.Base64.encodeBase64String ( rsa.doFinal ( source.trim ( ) . getBytes ( "UTF-8" ) ) ) ; }
Source:
public java.lang.String changeCaseDisplay ( java.lang.String text ) { return ( text.substring ( 0 , 1 ) . toUpperCase ( ) ) + ( ( ( text.substring ( 0 , 0 ) ) + ( text.substring ( ( 0 + 1 ) ) ) ) . toLowerCase ( ) ) ; }

Target:
public java.lang.String changeCaseDisplay ( java.lang.String text ) { return ( text.substring ( 0 , 1 ) . toUpperCase ( ) ) + ( text.substring ( 1 ) . toLowerCase ( ) ) ; }
Source:
public void OnSuccess ( java.lang.Object listModel , java.lang.Object returnValue ) { cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; isLinkStateChangeable = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.NetworkLinkingSupported , cluster.getcompatibility_version ( ) . getValue ( ) ) ) ) ; UpdateActionAvailability ( ) ; }

Target:
public void onSuccess ( java.lang.Object listModel , java.lang.Object returnValue ) { cluster = ( ( org.ovirt.engine.core.common.businessentities.VDSGroup ) ( returnValue ) ) ; isLinkStateChangeable = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigValuePreConverted ( ConfigurationValues.NetworkLinkingSupported , cluster.getcompatibility_version ( ) . getValue ( ) ) ) ) ; UpdateActionAvailability ( ) ; }
Source:
private com.woorea.openstack.quantum.model.Port updatePort ( com.woorea.openstack.quantum.model.Port port , boolean securityGroupsChanged , boolean hostChanged , java.util.List < java.lang.String > securityGroups , java.lang.String hostId , org.ovirt.engine.core.common.businessentities.network.VmNic nic ) { if ( securityGroupsChanged || hostChanged ) { java.util.List < java.lang.String > modifiedSecurityGroups = ( securityGroupsChanged ) ? securityGroups : port.getSecurityGroups ( ) ; com.woorea.openstack.quantum.model.Port portForUpdate = modifyPortForAllocate ( port , hostId , hostChanged , securityGroupsChanged , modifiedSecurityGroups , nic.getMacAddress ( ) ) ; return getClient ( ) . ports ( ) . update ( portForUpdate ) . execute ( ) ; } return port ; }

Target:
private com.woorea.openstack.quantum.model.Port updatePort ( com.woorea.openstack.quantum.model.Port port , boolean securityGroupsChanged , boolean hostChanged , java.util.List < java.lang.String > securityGroups , java.lang.String hostId , org.ovirt.engine.core.common.businessentities.network.VmNic nic ) { if ( securityGroupsChanged || hostChanged ) { java.util.List < java.lang.String > modifiedSecurityGroups = ( securityGroupsChanged ) ? securityGroups : port.getSecurityGroups ( ) ; com.woorea.openstack.quantum.model.Port portForUpdate = modifyPortForAllocate ( port , hostId , hostChanged , securityGroupsChanged , modifiedSecurityGroups , nic.getMacAddress ( ) ) ; return execute ( getClient ( ) . ports ( ) . update ( portForUpdate ) ) ; } return port ; }
Source:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( bond.getName ( ) , nicId , nicName , message , existingInterfacesMap ) ; }

Target:
private org.ovirt.engine.core.bll.ValidationResult validateCoherentNicIdentification ( org.ovirt.engine.core.common.businessentities.network.Bond bond ) { org.ovirt.engine.core.compat.Guid nicId = bond.getId ( ) ; java.lang.String nicName = bond.getName ( ) ; org.ovirt.engine.core.common.errors.EngineMessage message = org.ovirt.engine.core.common.errors.EngineMessage.BOND_REFERENCES_NICS_INCOHERENTLY ; return hostSetupNetworksValidatorHelper.validateCoherentIdentification ( nicName , nicId , nicName , message , existingInterfacesMap ) ; }
Source:
protected org.ovirt.engine.api.model.NIC populate ( org.ovirt.engine.api.model.NIC model , org.ovirt.engine.core.common.businessentities.VmNetworkInterface entity ) { org.ovirt.engine.core.common.businessentities.network network = findNetwork ( model ) ; model.getNetwork ( ) . setId ( network.getId ( ) . toString ( ) ) ; model.getNetwork ( ) . setName ( null ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.NIC populate ( org.ovirt.engine.api.model.NIC model , org.ovirt.engine.core.common.businessentities.VmNetworkInterface entity ) { org.ovirt.engine.core.common.businessentities.Network network = findNetwork ( model ) ; model.getNetwork ( ) . setId ( network.getId ( ) . toString ( ) ) ; model.getNetwork ( ) . setName ( null ) ; return model ; }
Source:
public void executeCommand ( ) { setUpMocksForUpdate ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity.class ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_UPDATED , cmd.getAuditLogTypeValue ( ) ) ; }

Target:
public void executeCommand ( ) { setUpMocksForUpdate ( ) ; mockBackend ( true , null ) ; cmd.executeCommand ( ) ; org.mockito.Mockito.verify ( hooksDao , org.mockito.Mockito.times ( 1 ) ) . updateGlusterHook ( org.mockito.ArgumentMatchers.any ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.GLUSTER_HOOK_UPDATED , cmd.getAuditLogTypeValue ( ) ) ; }
Source:
protected java.util.Set < org.ovirt.engine.core.common.utils.ExternalId > getExcludeUsers ( ) { java.util.Set < org.ovirt.engine.core.common.utils.ExternalId > excludeUsers = new java.util.HashSet < org.ovirt.engine.core.common.utils.ExternalId > ( ) ; if ( ( getExcludeItems ( ) ) != null ) { for ( java.lang.Object item : getExcludeItems ( ) ) { org.ovirt.engine.core.common.businessentities.DbUser a = ( ( org.ovirt.engine.core.common.businessentities.DbUser ) ( item ) ) ; excludeUsers.add ( a.getExternalId ( ) ) ; } } return excludeUsers ; }

Target:
protected java.util.Set < java.lang.String > getExcludeUsers ( ) { java.util.Set < java.lang.String > excludeUsers = new java.util.HashSet < java.lang.String > ( ) ; if ( ( getExcludeItems ( ) ) != null ) { for ( java.lang.Object item : getExcludeItems ( ) ) { org.ovirt.engine.core.common.businessentities.DbUser a = ( ( org.ovirt.engine.core.common.businessentities.DbUser ) ( item ) ) ; excludeUsers.add ( a.getExternalId ( ) ) ; } } return excludeUsers ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > pmOptions = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; getPmSecondaryPort ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmPortKey ) ) ; getPmSecondarySlot ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSlotKey ) ) ; getPmSecondarySecure ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSecureKey ) ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > pmOptions = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; getPmSecondaryPort ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmPortKey ) ) ; getPmSecondarySlot ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSlotKey ) ) ; getPmSecondarySecure ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSecureKey ) ) ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( ( succeeded ? ( ( org.ovirt.engine.core.compat.Guid ) ( retVal.getActionReturnValue ( ) ) ) : null ) , succeeded ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result1 ) { org.ovirt.engine.core.common.action.VdcReturnValueBase retVal = result1.getReturnValue ( ) ; boolean succeeded = false ; if ( ( retVal != null ) && ( retVal.getSucceeded ( ) ) ) { succeeded = true ; } postSaveAction ( ( succeeded ? ( ( org.ovirt.engine.core.common.businessentities.network.Network ) ( retVal.getActionReturnValue ( ) ) ) : null ) , succeeded ) ; }
Source:
private void initializeItems ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getIsoStorageModels ( ) ; items.addAll ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getExportStorageModels ( ) ) ; items.addAll ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getFileDataStorageModels ( ) ) ; items.addAll ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getImportBlockDataStorageModels ( ) ) ; getModel ( ) . setItems ( items ) ; }

Target:
private void initializeItems ( ) { java.util.List < org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel > items = org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getFileDataStorageModels ( ) ; items.addAll ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getImportBlockDataStorageModels ( ) ) ; items.addAll ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getIsoStorageModels ( ) ) ; items.addAll ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getExportStorageModels ( ) ) ; getModel ( ) . setItems ( items ) ; }
Source:
protected void updateDetailsAvailability ( ) { super . updateDetailsAvailability ( ) ; if ( ( getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = ( ( org.ovirt.engine.core.common.businessentities.StoragePool ) ( getSelectedItem ( ) ) ) ; quotaListModel.setIsAvailable ( ( ( storagePool.getQuotaEnforcementType ( ) ) != ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) ) ; updateIscsiBondListAvailability ( storagePool ) ; } }

Target:
protected void updateDetailsAvailability ( ) { super . updateDetailsAvailability ( ) ; if ( ( getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.StoragePool storagePool = getSelectedItem ( ) ; quotaListModel.setIsAvailable ( ( ( storagePool.getQuotaEnforcementType ( ) ) != ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) ) ; updateIscsiBondListAvailability ( storagePool ) ; } }
Source:
private void endCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { removeImageFromDB ( ) ; } else { org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map_id ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.RemoveImageCommand.UnLockImage ( ) ; } org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }

Target:
private void endCommand ( ) { if ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getRemoveFromDB ( ) ) { removeImageFromDB ( ) ; } else { org.ovirt.engine.core.bll.RemoveImageCommand.getImageStorageDomainMapDao ( ) . remove ( new org.ovirt.engine.core.common.businessentities.image_storage_domain_map_id ( org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getImageId ( ) , org.ovirt.engine.core.bll.RemoveImageCommand.getParameters ( ) . getStorageDomainId ( ) ) ) ; org.ovirt.engine.core.bll.RemoveImageCommand.UnLockImage ( ) ; } org.ovirt.engine.core.bll.RemoveImageCommand.setSucceeded ( true ) ; }
Source:
public int setTabIndexes ( int nextTabIndex ) { nameEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; descriptionEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; clusterEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; nextTabIndex = disksAllocationView.setTabIndexes ( nextTabIndex ) ; quotaEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; isTemplatePublicEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; return nextTabIndex ; }

Target:
public int setTabIndexes ( int nextTabIndex ) { nameEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; descriptionEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; clusterEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; quotaEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; nextTabIndex = disksAllocationView.setTabIndexes ( nextTabIndex ) ; isTemplatePublicEditor.setTabIndex ( ( nextTabIndex ++ ) ) ; return nextTabIndex ; }
Source:
void initCheckBoxEditors ( ) { attachFloppyEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; attachIsoEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; runAsStatelessEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; runAndPauseEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; useAlternateCredentialsEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; cloudInitEnabledEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }

Target:
void initCheckBoxEditors ( ) { attachFloppyEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; attachIsoEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; runAsStatelessEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; runAndPauseEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; useAlternateCredentialsEditor = new org.ovirt.engine.ui.common.widget.editor.EntityModelCheckBoxEditor ( org.ovirt.engine.ui.common.widget.Align.RIGHT ) ; }
Source:
public org.ovirt.engine.core.common.action.CustomPropertiesForVdsNetworkInterface add ( java.lang.String name , java.util.Map < java.lang.String , java.lang.String > customProperties ) { java.util.Objects.requireNonNull ( name ) ; if ( ( customProperties == null ) || ( customProperties.isEmpty ( ) ) ) { return this ; } this . customProperties.put ( name , customProperties ) ; return this ; }

Target:
public org.ovirt.engine.core.common.action.CustomPropertiesForVdsNetworkInterface add ( java.lang.String name , java.util.Map < java.lang.String , java.lang.String > customProperties ) { java.util.Objects.requireNonNull ( name ) ; if ( customProperties == null ) { customProperties = new java.util.HashMap < > ( ) ; } this . customProperties.put ( name , customProperties ) ; return this ; }
Source:
public static java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > getDiskImagesByIdMap ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > result = null ; if ( diskImages != null ) { result = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskImages ) { result.put ( diskImage.getImageId ( ) , diskImage ) ; } } return result ; }

Target:
public static java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > getDiskImagesByIdMap ( java.util.Collection < org.ovirt.engine.core.common.businessentities.DiskImage > diskImages ) { java.util.Map < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > result = new java.util.HashMap < > ( ) ; if ( diskImages != null ) { for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : diskImages ) { result.put ( diskImage.getImageId ( ) , diskImage ) ; } } return result ; }
Source:
protected boolean canMigrateVm ( org.ovirt.engine.core.compat.Guid vmGuid , java.util.List < java.lang.String > reasons ) { if ( ( org.ovirt.engine.core.bll.InternalMigrateVmCommand.getVm ( ) . getMigrationSupport ( ) ) == ( org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE ) ) { return super . canMigrateVm ( vmGuid , reasons ) ; } else { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NON_MIGRTABLE ) ; } }

Target:
protected boolean canMigrateVm ( org.ovirt.engine.core.common.businessentities.VM vm ) { if ( ( vm.getMigrationSupport ( ) ) == ( org.ovirt.engine.core.common.businessentities.MigrationSupport.MIGRATABLE ) ) { return super . canMigrateVm ( vm ) ; } return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NON_MIGRTABLE ) ; }
Source:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult Validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = super . Validate ( value ) ; if ( ! ( result.getSuccess ( ) ) ) { result.getReasons ( ) . add ( getAlreadyAssignedClonedNameMessage ( ) ) ; } return result ; }

Target:
public org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validate ( java.lang.Object value ) { org.ovirt.engine.ui.uicommonweb.validation.ValidationResult result = super . validate ( value ) ; if ( ! ( result.getSuccess ( ) ) ) { result.getReasons ( ) . add ( getAlreadyAssignedClonedNameMessage ( ) ) ; } return result ; }
Source:
private void executeFenceVdsManuallyAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.RestartVdsCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( vdsId ) ; fenceVdsManuallyParams.setSessionId ( sessionId ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , getContext ( ) ) ; }

Target:
private void executeFenceVdsManuallyAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( false ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.RestartVdsCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( vdsId ) ; fenceVdsManuallyParams.setSessionId ( sessionId ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , org.ovirt.engine.core.bll.RestartVdsCommand.getContext ( ) ) ; }
Source:
public void validateSpaceNotWithinThreshold ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > command = setupCanAddVmTests ( 0 , 0 ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( command ) . createStorageDomainValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.junit.Assert.assertFalse ( command.validateSpaceRequirements ( ) ) ; }

Target:
public void validateSpaceNotWithinThreshold ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > command = setupCanAddVmTests ( 0 ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( command ) . createStorageDomainValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.junit.Assert.assertFalse ( command.validateSpaceRequirements ( ) ) ; }
Source:
private boolean prestartVm ( org.ovirt.engine.core.compat.Guid vmGuid ) { boolean prestartVmSucceeded = false ; if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachNonPrestartedVmToUser ( vmGuid ) ) { org.ovirt.engine.core.common.businessentities.VM vmToPrestart = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmGuid ) ; if ( runVmAsStateless ( vmToPrestart ) ) { prestartVmSucceeded = true ; } } return prestartVmSucceeded ; }

Target:
private boolean prestartVm ( org.ovirt.engine.core.compat.Guid vmGuid ) { if ( org.ovirt.engine.core.bll.VmPoolCommandBase.canAttachNonPrestartedVmToUser ( vmGuid ) ) { org.ovirt.engine.core.common.businessentities.VM vmToPrestart = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getVmDao ( ) . get ( vmGuid ) ; return runVmAsStateless ( vmToPrestart ) ; } return false ; }
Source:
protected void logToAudit ( ) { if ( isPolicyResetMessage ( org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerCommand.getReturnStatus ( ) . message ) ) { return ; } org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( vds.getId ( ) ) ; auditLogableBase.setVds ( vds ) ; auditLogableBase.addCustomValue ( "message" , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerCommand.getReturnStatus ( ) . message ) ; auditLogDirector.log ( auditLogableBase , AuditLogType.VDS_BROKER_COMMAND_FAILURE ) ; }

Target:
protected void logToAudit ( ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase auditLogableBase = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( vds.getId ( ) ) ; auditLogableBase.setVds ( vds ) ; auditLogableBase.addCustomValue ( "message" , org.ovirt.engine.core.vdsbroker.vdsbroker.VdsBrokerCommand.getReturnStatus ( ) . message ) ; auditLogDirector.log ( auditLogableBase , AuditLogType.VDS_BROKER_COMMAND_FAILURE ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnaValue = runVdsCommand ( VDSCommandType.StopRebalanceGlusterVolume , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters ( upServer.getId ( ) , getGlusterVolumeName ( ) ) ) ; setSucceeded ( vdsReturnaValue.getSucceeded ( ) ) ; if ( ! ( getSucceeded ( ) ) ) { handleVdsError ( AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED , vdsReturnaValue.getVdsError ( ) . getMessage ( ) ) ; return ; } endStepJob ( ) ; releaseVolumeLock ( ) ; getReturnValue ( ) . setActionReturnValue ( vdsReturnaValue ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.vdscommands.VDSReturnValue vdsReturnaValue = runVdsCommand ( VDSCommandType.StopRebalanceGlusterVolume , new org.ovirt.engine.core.common.vdscommands.gluster.GlusterVolumeVDSParameters ( upServer.getId ( ) , getGlusterVolumeName ( ) ) ) ; if ( ! ( vdsReturnaValue.getSucceeded ( ) ) ) { handleVdsError ( AuditLogType.GLUSTER_VOLUME_REBALANCE_STOP_FAILED , vdsReturnaValue.getVdsError ( ) . getMessage ( ) ) ; setSucceeded ( false ) ; return ; } endStepJob ( ) ; releaseVolumeLock ( ) ; setSucceeded ( vdsReturnaValue.getSucceeded ( ) ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase executeCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.bll.context.CommandContext cmdContext ) { org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback callback = command.getCallback ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.utils.BackendUtils.getBackendCommandObjectsHandler ( org.ovirt.engine.core.bll.tasks.CommandExecutor.log ) . runAction ( command , ( cmdContext != null ? cmdContext.getExecutionContext ( ) : null ) ) ; updateCommand ( command , result ) ; if ( callback != null ) { callback.executed ( result ) ; } return result ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase executeCommand ( final org.ovirt.engine.core.bll.CommandBase < ? > command , final org.ovirt.engine.core.bll.context.CommandContext cmdContext ) { org.ovirt.engine.core.bll.tasks.interfaces.CommandCallback callback = command.getCallback ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase result = org.ovirt.engine.core.bll.utils.BackendUtils.getBackendCommandObjectsHandler ( org.ovirt.engine.core.bll.tasks.CommandExecutor.log ) . runAction ( command , ( cmdContext != null ? cmdContext.getExecutionContext ( ) : null ) ) ; updateCommand ( command , result ) ; return result ; }
Source:
protected void onAction ( ) { org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel network = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.network.LogicalNetworkModel ) ( item ) ) ; if ( network.isManaged ( ) ) { item.edit ( ) ; } else { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperationFactory.OperationMap operationMap = item.getSetupModel ( ) . commandsFor ( item ) ; final org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand detach = operationMap.get ( NetworkOperation.REMOVE_UNMANAGED_NETWORK ) . get ( 0 ) ; item.getSetupModel ( ) . onOperation ( NetworkOperation.REMOVE_UNMANAGED_NETWORK , detach ) ; } }

Target:
protected void onAction ( ) { if ( item.isManaged ( ) ) { item.edit ( ) ; } else { org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkOperationFactory.OperationMap operationMap = item.getSetupModel ( ) . commandsFor ( item ) ; final org.ovirt.engine.ui.uicommonweb.models.hosts.network.NetworkCommand detach = operationMap.get ( NetworkOperation.REMOVE_UNMANAGED_NETWORK ) . get ( 0 ) ; item.getSetupModel ( ) . onOperation ( NetworkOperation.REMOVE_UNMANAGED_NETWORK , detach ) ; } }
Source:
public static void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ( ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VmDevice > ) ( source ) ) . size ( ) ) > 0 ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void isVirtioScsiEnabledForVm ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void execute ( int iterationId ) { try { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( getStorageDomain ( ) . getStorageType ( ) ) . connectStorageToDomainByVdsId ( getStorageDomain ( ) , getVdss ( ) . get ( iterationId ) . getId ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.storage.ConnectSingleAsyncOperation.log.errorFormat ( "Failed to connect host {0} to storage pool {1}. Exception: {3}" , getVdss ( ) . get ( iterationId ) . getName ( ) , getStoragePool ( ) . getname ( ) , e ) ; } }

Target:
public void execute ( int iterationId ) { try { org.ovirt.engine.core.bll.storage.StorageHelperDirector.getInstance ( ) . getItem ( getStorageDomain ( ) . getStorageType ( ) ) . connectStorageToDomainByVdsId ( getStorageDomain ( ) , getVdss ( ) . get ( iterationId ) . getId ( ) ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.storage.ConnectSingleAsyncOperation.log.errorFormat ( "Failed to connect host {0} to storage pool {1}. Exception: {3}" , getVdss ( ) . get ( iterationId ) . getName ( ) , getStoragePool ( ) . getName ( ) , e ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getClusterPolicyModel ( ) . getEnableTrustedService ( ) . getEntity ( ) ) != null ) && ( ( java.lang.Boolean ) ( getClusterPolicyModel ( ) . getEnableTrustedService ( ) . getEntity ( ) ) ) ) { getEnableGlusterService ( ) . setEntity ( false ) ; getEnableGlusterService ( ) . setIsChangable ( false ) ; } else { getEnableGlusterService ( ) . setIsChangable ( true ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { if ( ( ( getEnableTrustedService ( ) . getEntity ( ) ) != null ) && ( ( java.lang.Boolean ) ( getEnableTrustedService ( ) . getEntity ( ) ) ) ) { getEnableGlusterService ( ) . setEntity ( false ) ; getEnableGlusterService ( ) . setIsChangable ( false ) ; } else { getEnableGlusterService ( ) . setIsChangable ( true ) ; } }