auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean validateFreeSpace ( org.ovirt.engine.core.bll.validator.StorageDomainValidator storageDomainValidator , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > disksList ) { return validate ( storageDomainValidator.hasSpaceForNewDisks ( disksList ) ) ; }

Target:
protected boolean validateSpaceRequirements ( ) { for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > > sdImageEntry : storageToDisksMap.entrySet ( ) ) { org.ovirt.engine.core.common.businessentities.StorageDomain destStorageDomain = destStorages.get ( sdImageEntry.getKey ( ) ) ; java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > disksList = sdImageEntry.getValue ( ) ; org.ovirt.engine.core.bll.validator.storage.StorageDomainValidator storageDomainValidator = createStorageDomainValidator ( destStorageDomain ) ; if ( ( ! ( validateDomainsThreshold ( storageDomainValidator ) ) ) || ( ! ( validateFreeSpace ( storageDomainValidator , disksList ) ) ) ) { return false ; } } return true ; }
Source:
public static org.ovirt.engine.api.model.VmPool map ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.api.model.VmPool template ) { org.ovirt.engine.api.model.VmPool model = ( template != null ) ? template : new org.ovirt.engine.api.model.VmPool ( ) ; org.ovirt.engine.core.common.businessentities.VM vmModel = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.core.common.businessentities.VM ) ( null ) ) ) ; vmModel.setCluster ( null ) ; vmModel.setTemplate ( null ) ; vmModel.setVmPool ( null ) ; model.setVm ( vmModel ) ; return model ; }

Target:
public static org.ovirt.engine.api.model.VmPool map ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.api.model.VmPool template ) { org.ovirt.engine.api.model.VmPool model = ( template != null ) ? template : new org.ovirt.engine.api.model.VmPool ( ) ; org.ovirt.engine.api.restapi.types.Vm vmModel = org.ovirt.engine.api.restapi.types.VmMapper.map ( vm , ( ( org.ovirt.engine.api.restapi.types.Vm ) ( null ) ) ) ; vmModel.setCluster ( null ) ; vmModel.setTemplate ( null ) ; vmModel.setVmPool ( null ) ; model.setVm ( vmModel ) ; return model ; }
Source:
public void testRemoveForcedIncomplete ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveVds , org.ovirt.engine.core.common.action.RemoveVdsParameters.class , new java.lang.String [ ] { "VdsId" , "ForceAction" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.FALSE } , true , true ) ) ; org.ovirt.engine.api.model.Action action = new org.ovirt.engine.api.model.Action ( ) ; verifyRemove ( resource.remove ( action ) ) ; }

Target:
public void testRemoveForced ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 1 ) ; javax.ws.rs.core.UriInfo uriInfo = setUpActionExpectations ( VdcActionType.RemoveVds , org.ovirt.engine.core.common.action.RemoveVdsParameters.class , new java.lang.String [ ] { "VdsId" , "ForceAction" } , new java.lang.Object [ ] { GUIDS [ 0 ] , java.lang.Boolean.TRUE } , true , true , false ) ; uriInfo = addMatrixParameterExpectations ( uriInfo , BackendHostResource.FORCE , java.lang.Boolean.TRUE.toString ( ) ) ; setUriInfo ( uriInfo ) ; control.replay ( ) ; verifyRemove ( resource.remove ( ) ) ; }
Source:
public void networkExists ( ) { simulateClusterExists ( ) ; org.mockito.Mockito.when ( mockNetworkDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getNetwork ( ) ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( param.getNetworkCluster ( ) . getId ( ) ) ) . thenReturn ( param.getNetworkCluster ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( underTest , EngineMessage.NETWORK_ALREADY_ATTACHED_TO_CLUSTER ) ; }

Target:
public void networkExists ( ) { simulateClusterExists ( ) ; org.mockito.Mockito.when ( mockNetworkDao.get ( org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getNetwork ( ) ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( param.getNetworkCluster ( ) . getId ( ) ) ) . thenReturn ( param.getNetworkCluster ( ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( underTest , EngineMessage.NETWORK_ALREADY_ATTACHED_TO_CLUSTER ) ; }
Source:
private java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > getTemplateDisks ( org.ovirt.engine.core.compat.Guid templateId ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.DiskImage > templatesDisksMap = 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 di : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( getEntity ( java.util.List.class , VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , "Disks" ) ) ) ) { templatesDisksMap.put ( di.getId ( ) , di ) ; } return templatesDisksMap ; }

Target:
private java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > getTemplateDisks ( org.ovirt.engine.core.compat.Guid templateId ) { java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > templatesDisksMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage di : ( ( java.util.List < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( getEntity ( java.util.List.class , VdcQueryType.GetVmTemplatesDisks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( templateId ) , "Disks" ) ) ) ) { templatesDisksMap.put ( di.getId ( ) , di ) ; } return templatesDisksMap ; }
Source:
protected org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData getCurrentIrsProxyData ( ) { if ( ! ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.containsKey ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.getParameters ( ) . getStoragePoolId ( ) ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.put ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.getParameters ( ) . getStoragePoolId ( ) , new org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.IrsProxyData ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.getParameters ( ) . getStoragePoolId ( ) ) ) ; } return org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.getParameters ( ) . getStoragePoolId ( ) ) ; }

Target:
protected org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData getCurrentIrsProxyData ( ) { if ( ! ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.containsKey ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.getParameters ( ) . getStoragePoolId ( ) ) ) ) { org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.put ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.getParameters ( ) . getStoragePoolId ( ) , new org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.getParameters ( ) . getStoragePoolId ( ) ) ) ; } return org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand._irsProxyData.get ( org.ovirt.engine.core.vdsbroker.irsbroker.IrsBrokerCommand.getParameters ( ) . getStoragePoolId ( ) ) ; }
Source:
public void testUpdateReadOnlyPropertyOnChange ( ) { final org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; parameters.getDiskInfo ( ) . setReadOnly ( true ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; org.ovirt.engine.core.common.businessentities.VmDevice device = createVmDevice ( diskImageGuid , vmId ) ; initializeCommand ( parameters ) ; command.executeVmCommand ( ) ; device.setIsReadOnly ( true ) ; org.mockito.Mockito.verify ( vmDeviceDAO , org.mockito.Mockito.times ( 1 ) ) . update ( device ) ; }

Target:
public void testOnlyDiskAliasChangedMetaDataShouldBeUpdated ( ) { final org.ovirt.engine.core.common.action.UpdateVmDiskParameters parameters = createParameters ( ) ; org.mockito.Mockito.when ( diskDao.get ( diskImageGuid ) ) . thenReturn ( createDiskImage ( ) ) ; parameters.getDiskInfo ( ) . setDiskAlias ( "New Disk Alias" ) ; initializeCommand ( parameters ) ; mockVdsCommandSetVolumeDescription ( ) ; command.executeVmCommand ( ) ; org.mockito.Mockito.verify ( command , org.mockito.Mockito.times ( 1 ) ) . runVdsCommand ( org.mockito.Matchers.eq ( VDSCommandType.SetVolumeDescription ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.vdscommands.SetVolumeDescriptionVDSCommandParameters.class ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.SelectedItemChangedEventDefinition ) ) && ( sender == ( getNetwork ( ) ) ) ) { Network_SelectedItemChanged ( null ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { super . eventRaised ( ev , sender , args ) ; if ( ( ev.matchesDefinition ( ListModel.selectedItemChangedEventDefinition ) ) && ( sender == ( getNetwork ( ) ) ) ) { Network_SelectedItemChanged ( null ) ; } }
Source:
public void testAllowsRhel6InRhel7 ( ) { org.ovirt.engine.core.vdsbroker.VirtMonitoringStrategyTest.mcr.mockConfigValue ( ConfigValues.CheckMixedRhelVersions , Version.v3_5 , false ) ; org.ovirt.engine.core.common.businessentities.VDS vds = createBaseVds ( ) ; vdsFromDb.setHostOs ( "RHEL - 7Server - 1.el7" ) ; vds.setHostOs ( "RHEL - 6Server - 6.5.0.1.el6" ) ; virtStrategy.processSoftwareCapabilities ( vds ) ; org.junit.Assert.assertTrue ( vds.getStatus ( ) . equals ( VDSStatus.Up ) ) ; }

Target:
public void testAllowRhel7InRhel6 ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = createBaseVds ( ) ; vdsFromDb.setHostOs ( "RHEL - 6Server - 6.5.0.1.el6" ) ; vds.setHostOs ( "RHEL - 7Server - 1.el7" ) ; vdsGroup.setClusterPolicyId ( ClusterPolicy.UPGRADE_POLICY_GUID ) ; virtStrategy.processSoftwareCapabilities ( vds ) ; org.junit.Assert.assertFalse ( vds.getStatus ( ) . equals ( VDSStatus.NonOperational ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotCreate ( java.lang.String volumeName , java.lang.String snapshotName , java.lang.String description , boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotCreate ( volumeName , snapshotName , description , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeSnapshotDelete ( java.lang.String volumeName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeSnapshotDelete ( volumeName ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
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.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "SearchString" . equals ( pcArgs.PropertyName ) ) { updateViewSearchString ( ) ; } else if ( "SearchStringPrefix" . equals ( pcArgs.PropertyName ) ) { updateViewSearchStringPrefix ( ) ; } else if ( "HasSearchStringPrefix" . equals ( pcArgs.PropertyName ) ) { updateViewHasSearchStringPrefix ( ) ; } else if ( "HasSelectedTags" . equals ( pcArgs.PropertyName ) ) { updateViewHasSelectedTags ( ) ; } }

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.uicompat.PropertyChangedEventArgs pcArgs = ( ( org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs ) ( args ) ) ; if ( "SearchString" . equals ( pcArgs.propertyName ) ) { updateViewSearchString ( ) ; } else if ( "SearchStringPrefix" . equals ( pcArgs.propertyName ) ) { updateViewSearchStringPrefix ( ) ; } else if ( "HasSearchStringPrefix" . equals ( pcArgs.propertyName ) ) { updateViewHasSearchStringPrefix ( ) ; } else if ( "HasSelectedTags" . equals ( pcArgs.propertyName ) ) { updateViewHasSelectedTags ( ) ; } }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { hostsModel.stopProgress ( ) ; boolean isAllCanDoPassed = true ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { isAllCanDoPassed = isAllCanDoPassed && ( returnValueBase.getCanDoAction ( ) ) ; if ( ! isAllCanDoPassed ) { break ; } } if ( isAllCanDoPassed ) { cancel ( ) ; } }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { hostsModel.stopProgress ( ) ; boolean isAllValidatePassed = true ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase : result.getReturnValue ( ) ) { isAllValidatePassed = returnValueBase.isValid ( ) ; if ( ! isAllValidatePassed ) { break ; } } if ( isAllValidatePassed ) { cancel ( ) ; } }
Source:
protected void setUpEntityQueryExpectations ( int times , int index , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetDiskProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , ( notFound ? null : getEntity ( index ) ) ) ; } }

Target:
protected void setUpEntityQueryExpectations ( int times , int index , boolean notFound ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( QueryType.GetDiskProfileById , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ index ] } , ( notFound ? null : getEntity ( index ) ) ) ; } }
Source:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.getStaticData ( ) . setDomain ( "domain_name" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; org.ovirt.engine.core.utils.ovf.OvfManagerTest.initInterfaces ( vm ) ; return vm ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VM createVM ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setName ( "test-vm" ) ; vm.setOrigin ( OriginType.OVIRT ) ; vm.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; vm.setVmDescription ( "test-description" ) ; vm.getStaticData ( ) . setDomain ( "domain_name" ) ; vm.setTimeZone ( "Israel Standard Time" ) ; vm.setDbGeneration ( 2L ) ; vm.setSingleQxlPci ( false ) ; org.ovirt.engine.core.utils.ovf.OvfManagerTest.initInterfaces ( vm ) ; return vm ; }
Source:
protected void updateVirtioScsiAvailability ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; boolean isVirtioScsiEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.VirtIoScsiEnabled , cluster.getcompatibility_version ( ) . getValue ( ) ) ) ) ; getModel ( ) . getIsVirtioScsiEnabled ( ) . setIsAvailable ( isVirtioScsiEnabled ) ; }

Target:
protected void updateVirtioScsiAvailability ( ) { org.ovirt.engine.core.common.businessentities.VDSGroup cluster = getModel ( ) . getSelectedCluster ( ) ; boolean isVirtioScsiEnabled = ( ( java.lang.Boolean ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getConfigValuePreConverted ( ConfigurationValues.VirtIoScsiEnabled , cluster.getCompatibilityVersion ( ) . getValue ( ) ) ) ) ; getModel ( ) . getIsVirtioScsiEnabled ( ) . setIsAvailable ( isVirtioScsiEnabled ) ; }
Source:
private org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction getRequiredAction ( ) { if ( ( requiredAction ) == null ) { if ( ( ! ( oldIface.isPlugged ( ) ) ) && ( getInterface ( ) . isPlugged ( ) ) ) { requiredAction = org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.PLUG ; } else if ( ( oldIface.isPlugged ( ) ) && ( ! ( getInterface ( ) . isPlugged ( ) ) ) ) { requiredAction = org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UNPLUG ; } else if ( ( liveActionRequired ( ) ) && ( properiesRequiringVmUpdateDeviceWereUpdated ( ) ) ) { requiredAction = org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ; } } return requiredAction ; }

Target:
private boolean liveActionRequired ( ) { return ( ( oldIface.isPlugged ( ) ) && ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . isPlugged ( ) ) ) && ( ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getVm ( ) . getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VMStatus.Up ) ) ; }
Source:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }

Target:
public static void getClusterNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllNetworksByClusterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , aQuery ) ; }
Source:
protected void syncSearch ( ) { if ( ( getEntity ( ) ) == null ) { return ; } org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . getGlusterVolumeGeoRepStatusForMasterVolume ( 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 ) { java.util.List < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > geoRepSessions = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ) ( returnValue ) ) ; java.util.Collections.sort ( geoRepSessions , new org.ovirt.engine.ui.uicommonweb.Linq.GlusterVolumeGeoRepSessionComparer ( ) ) ; setItems ( geoRepSessions ) ; } } ) , getEntity ( ) . getId ( ) ) ; }

Target:
protected void selectedItemsChanged ( ) { super . selectedItemsChanged ( ) ; updateActionAvailability ( getEntity ( ) ) ; }
Source:
public static final org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getInterfaceColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.EnumColumn < org.ovirt.engine.core.common.businessentities.Disk , org.ovirt.engine.core.common.businessentities.DiskInterface > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.DiskInterface getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return object.getDiskInterface ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }

Target:
public static final org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > getInterfaceColumn ( java.lang.String sortBy ) { org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.Disk > column = new org.ovirt.engine.ui.common.widget.table.column.AbstractEnumColumn < org.ovirt.engine.core.common.businessentities.Disk , org.ovirt.engine.core.common.businessentities.DiskInterface > ( ) { @ java.lang.Override protected org.ovirt.engine.core.common.businessentities.DiskInterface getRawValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return object.getDiskInterface ( ) ; } } ; return org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.makeSortable ( column , sortBy ) ; }
Source:
public void setdisplay_ip ( java.lang.String value ) { if ( ( host.getConsoleAddress ( ) ) != null ) { super . setdisplay_ip ( host.getConsoleAddress ( ) ) ; } else if ( value.startsWith ( "0" ) ) { super . setdisplay_ip ( host.getHostName ( ) ) ; } else { super . setdisplay_ip ( value ) ; } }

Target:
public void setDisplayIp ( java.lang.String value ) { if ( ( host.getConsoleAddress ( ) ) != null ) { super . setDisplayIp ( host.getConsoleAddress ( ) ) ; } else if ( value.startsWith ( "0" ) ) { super . setDisplayIp ( host.getHostName ( ) ) ; } else { super . setDisplayIp ( value ) ; } }
Source:
public void testSetStatusForRequiredNetworkPresentOnHost ( ) { networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; testSetStatusForRequiredNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME ) ; org.mockito.Mockito.verify ( networkClusterDao , org.mockito.Mockito.never ( ) ) . updateStatus ( org.mockito.ArgumentMatchers.same ( networkCluster ) ) ; org.junit.Assert.assertThat ( networkCluster.getStatus ( ) , org.hamcrest.Matchers.is ( NetworkStatus.OPERATIONAL ) ) ; }

Target:
public void testSetStatusForRequiredNetworksAbsentOnHost ( ) { networkCluster.setStatus ( NetworkStatus.OPERATIONAL ) ; final java.util.List < org.ovirt.engine.core.common.businessentities.network.Network > networks = java.util.Arrays.asList ( createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID1 , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME1 ) , createNetwork ( org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_ID2 , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME2 ) ) ; testSetStatusForRequiredNetwork ( networks , org.ovirt.engine.core.bll.network.cluster.NetworkClusterHelperTest.NETWORK_NAME2 ) ; org.mockito.Mockito.verify ( networkClusterDao ) . updateStatus ( org.mockito.ArgumentMatchers.same ( networkCluster ) ) ; org.junit.Assert.assertThat ( networkCluster.getStatus ( ) , org.hamcrest.Matchers.is ( NetworkStatus.NON_OPERATIONAL ) ) ; }
Source:
public void testCreateManagementNetworkIfRequiredFailedOnSetupNetworks ( ) { host.setActiveNic ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.NIC_NAME ) ; final org.ovirt.engine.core.bll.network.NetworkConfigurator spiedUnderTest = org.mockito.Mockito.spy ( underTest ) ; org.mockito.Mockito.doReturn ( backend ) . when ( spiedUnderTest ) . getBackend ( ) ; org.mockito.Mockito.when ( backend.runInternalAction ( org.mockito.ArgumentMatchers.eq ( VdcActionType.HostSetupNetworks ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.HostSetupNetworksParameters.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.bll.context.CommandContext.class ) ) ) . thenReturn ( createReturnValue ( false ) ) ; verifyAuditLoggableBaseFilledProperly ( spiedUnderTest , AuditLogType.SETUP_NETWORK_FAILED_FOR_MANAGEMENT_NETWORK_CONFIGURATION ) ; }

Target:
public void testCreateManagementNetworkIfRequiredFailedOnSetupNetworks ( ) { host.setActiveNic ( org.ovirt.engine.core.bll.network.NetworkConfiguratorTest.NIC_NAME ) ; final org.ovirt.engine.core.bll.network.NetworkConfigurator spiedUnderTest = org.mockito.Mockito.spy ( underTest ) ; org.mockito.Mockito.doReturn ( backend ) . when ( spiedUnderTest ) . getBackend ( ) ; org.mockito.Mockito.when ( backend.runInternalAction ( org.mockito.ArgumentMatchers.eq ( ActionType.HostSetupNetworks ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.common.action.HostSetupNetworksParameters.class ) , org.mockito.ArgumentMatchers.any ( org.ovirt.engine.core.bll.context.CommandContext.class ) ) ) . thenReturn ( createReturnValue ( false ) ) ; verifyAuditLoggableBaseFilledProperly ( spiedUnderTest , AuditLogType.SETUP_NETWORK_FAILED_FOR_MANAGEMENT_NETWORK_CONFIGURATION ) ; }
Source:
public void prepareParams ( ) { parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.AddStorageServerConnectionCommand < org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase > ( parameters ) ) ; org.mockito.Mockito.doReturn ( storageConnDao ) . when ( command ) . getStorageConnDao ( ) ; }

Target:
public void prepareParams ( ) { parameters = new org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase ( ) ; parameters.setVdsId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.storage.AddStorageServerConnectionCommand < org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase > ( parameters ) ) ; org.mockito.Mockito.doReturn ( storageConnDao ) . when ( command ) . getStorageConnDao ( ) ; org.mockito.Mockito.doReturn ( storageDomainDao ) . when ( command ) . getStorageDomainDao ( ) ; }
Source:
public static void getDataCenterList ( 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 new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( "DataCenter: sortby name" , org.ovirt.engine.core.common.interfaces.SearchType.StoragePool ) , aQuery ) ; }

Target:
public static void getVmNextRunConfiguration ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmNextRunConfiguration , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public void canDoActionFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , VdcBllMessages.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }

Target:
public void canDoActionFailsWhenGlusterHostHasVolumes ( ) throws java.lang.Exception { command = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.RemoveVdsCommand < org.ovirt.engine.core.common.action.RemoveVdsParameters > ( new org.ovirt.engine.core.common.action.RemoveVdsParameters ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , false ) ) ) ; prepareMocks ( ) ; mockVdsWithStatus ( VDSStatus.Maintenance ) ; mockVdsDynamic ( ) ; mockVmsPinnedToHost ( java.util.Collections.< java.lang.String > emptyList ( ) ) ; mockIsGlusterEnabled ( true ) ; mockHasVolumeOnServer ( true ) ; org.ovirt.engine.core.bll.CanDoActionTestUtils.runAndAssertCanDoActionFailure ( command , EngineMessage.VDS_CANNOT_REMOVE_HOST_HAVING_GLUSTER_VOLUME ) ; }
Source:
private void onShutdown ( ) { final org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel ) ( getWindow ( ) ) ) ; onPowerAction ( VdcActionType.ShutdownVm , new org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.PowerActionParametersFactory < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.action.VdcActionParametersBase createActionParameters ( org.ovirt.engine.core.common.businessentities.VM vm ) { return new org.ovirt.engine.core.common.action.ShutdownVmParameters ( vm.getId ( ) , true , model.getReason ( ) . getEntity ( ) ) ; } } ) ; }

Target:
protected org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] getClonedNameValidators ( java.lang.Object object ) { final int maxClonedNameLength = getMaxClonedNameLength ( object ) ; return new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.LengthValidation ( maxClonedNameLength ) , new org.ovirt.engine.ui.uicommonweb.validation.I18NNameValidation ( ) { @ java.lang.Override protected java.lang.String composeMessage ( ) { return org.ovirt.engine.ui.uicompat.ConstantsManager.getInstance ( ) . getMessages ( ) . nameMustConataionOnlyAlphanumericChars ( maxClonedNameLength ) ; } } , new org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel.UniqueClonedNameValidator ( assignedVmNames ) } ; }
Source:
protected java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > getVmInterfaces ( ) { if ( ( _vmInterfaces ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > vmNetworkInterfaces = org.ovirt.engine.core.bll.AddVmCommand.getVmNicDao ( ) . getAllForTemplate ( org.ovirt.engine.core.bll.AddVmCommand.getVmTemplate ( ) . getId ( ) ) ; _vmInterfaces = ( vmNetworkInterfaces == null ) ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNic > ( ) : vmNetworkInterfaces ; } return _vmInterfaces ; }

Target:
protected java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > getVmInterfaces ( ) { if ( ( _vmInterfaces ) == null ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > vmNetworkInterfaces = org.ovirt.engine.core.bll.AddVmCommand.getVmNicDao ( ) . getAllForTemplate ( vmInterfacesSourceId ) ; _vmInterfaces = ( vmNetworkInterfaces == null ) ? new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNic > ( ) : vmNetworkInterfaces ; } return _vmInterfaces ; }
Source:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsedByRunningVm ( ) { java.lang.String networkName = getNetworkName ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterAttachment : getClusterAttachments ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vms = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVmStaticDAO ( ) . getAllByGroupAndNetworkName ( clusterAttachment.getClusterId ( ) , networkName ) ; if ( ( vms.size ( ) ) > 0 ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_INTERFACE_IN_USE_BY_VM ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
protected org.ovirt.engine.core.bll.ValidationResult networkNotUsedByVms ( ) { java.lang.String networkName = getNetworkName ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkCluster clusterAttachment : getClusterAttachments ( ) ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmStatic > vms = org.ovirt.engine.core.bll.network.dc.NetworkCommon.getVmStaticDAO ( ) . getAllByGroupAndNetworkName ( clusterAttachment.getClusterId ( ) , networkName ) ; if ( ( vms.size ( ) ) > 0 ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.dal.VdcBllMessages.NETWORK_INTERFACE_IN_USE_BY_VM ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
private void updateStaticFields ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { name = vmStatic.getName ( ) ; origin = vmStatic.getOrigin ( ) ; autoStart = vmStatic.isAutoStartup ( ) ; memSizeMb = vmStatic.getMemSizeMb ( ) ; minAllocatedMem = vmStatic.getMinAllocatedMem ( ) ; numOfCpus = vmStatic.getNumOfCpus ( ) ; clusterCompatibilityVersion = clusterDao.get ( vmStatic.getClusterId ( ) ) . getCompatibilityVersion ( ) ; }

Target:
private void updateStaticFields ( org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { name = vmStatic.getName ( ) ; origin = vmStatic.getOrigin ( ) ; autoStart = vmStatic.isAutoStartup ( ) ; memSizeMb = vmStatic.getMemSizeMb ( ) ; minAllocatedMem = vmStatic.getMinAllocatedMem ( ) ; numOfCpus = vmStatic.getNumOfCpus ( ) ; clusterCompatibilityVersion = clusterDao.get ( vmStatic.getClusterId ( ) ) . getCompatibilityVersion ( ) ; leaseStorageDomainId = vmStatic.getLeaseStorageDomainId ( ) ; }
Source:
protected org.ovirt.engine.api.model.Network getEntity ( int index ) { org.ovirt.engine.api.model.Network entity = org.mockito.Mockito.mock ( org.ovirt.engine.api.model.Network.class ) ; org.mockito.Mockito.when ( entity.getId ( ) ) . thenReturn ( GUIDS [ index ] ) ; org.mockito.Mockito.when ( entity.getName ( ) ) . thenReturn ( NAMES [ index ] ) ; org.mockito.Mockito.when ( entity.getDescription ( ) ) . thenReturn ( DESCRIPTIONS [ index ] ) ; return entity ; }

Target:
protected void setUpEntityQueryExpectations ( int times , java.lang.Object failure ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetNetworksByIscsiBondId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendIscsiBondNetworksResourceTest.ISCSI_BOND_ID } , getEntityList ( ) , failure ) ; } }
Source:
protected < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.interfaces.SearchType searchType , java.lang.String constraint ) { try { org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( constraint , searchType ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { backendFailure ( result.getExceptionString ( ) ) ; } return castQueryResultToEntity ( clz , result , constraint ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , false ) ; } }

Target:
protected < T > T getEntity ( java.lang.Class < T > clz , org.ovirt.engine.core.common.interfaces.SearchType searchType , java.lang.String constraint ) { try { org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = runQuery ( VdcQueryType.Search , createSearchParameters ( searchType , constraint ) ) ; if ( ! ( result.getSucceeded ( ) ) ) { backendFailure ( result.getExceptionString ( ) ) ; } return castQueryResultToEntity ( clz , result , constraint ) ; } catch ( java.lang.Exception e ) { return handleError ( clz , e , false ) ; } }
Source:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel vmSnapshotListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel snapshotModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( vmSnapshotListModel.getWindow ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; vmSnapshotListModel.PostNew ( disks ) ; snapshotModel.StopProgress ( ) ; }

Target:
public void OnSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel vmSnapshotListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmSnapshotListModel ) ( target ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel snapshotModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.SnapshotModel ) ( vmSnapshotListModel.getWindow ( ) ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > disks = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( returnValue ) ) ; vmSnapshotListModel.PostNew ( disks ) ; snapshotModel.sendWarningForNonExportableDisks ( disks ) ; snapshotModel.StopProgress ( ) ; }
Source:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getSucceeded ( ) ) { if ( ( oldIface.isLinked ( ) ) != ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . isLinked ( ) ) ) { org.ovirt.engine.core.common.AuditLogType customValue = ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . isLinked ( ) ) ? org.ovirt.engine.core.common.AuditLogType.NETWORK_UPDATE_VM_INTERFACE_LINK_UP : org.ovirt.engine.core.common.AuditLogType.NETWORK_UPDATE_VM_INTERFACE_LINK_DOWN ; addCustomValue ( "LinkState" , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessage ( customValue ) ) ; } else { org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.addCustomValue ( "LinkState" , " " ) ; } return org.ovirt.engine.core.common.AuditLogType.NETWORK_UPDATE_VM_INTERFACE ; } return org.ovirt.engine.core.common.AuditLogType.NETWORK_UPDATE_VM_INTERFACE_FAILED ; }

Target:
public org.ovirt.engine.core.common.AuditLogType getAuditLogTypeValue ( ) { if ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getSucceeded ( ) ) { if ( ( oldIface.isLinked ( ) ) != ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . isLinked ( ) ) ) { org.ovirt.engine.core.common.AuditLogType customValue = ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.getInterface ( ) . isLinked ( ) ) ? org.ovirt.engine.core.common.AuditLogType.NETWORK_UPDATE_VM_INTERFACE_LINK_UP : org.ovirt.engine.core.common.AuditLogType.NETWORK_UPDATE_VM_INTERFACE_LINK_DOWN ; addCustomValue ( "LinkState" , new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . getMessage ( customValue ) ) ; } else { org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.addCustomValue ( "LinkState" , " " ) ; } return org.ovirt.engine.core.common.AuditLogType.NETWORK_UPDATE_VM_INTERFACE ; } return org.ovirt.engine.core.common.AuditLogType.NETWORK_UPDATE_VM_INTERFACE_FAILED ; }
Source:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getDetachCommand ( ) ) ) { Detach ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnDetach" ) ) { OnDetach ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }

Target:
public void executeCommand ( org.ovirt.engine.ui.uicommonweb.UICommand command ) { super . executeCommand ( command ) ; if ( command == ( getDetachCommand ( ) ) ) { detach ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "OnDetach" ) ) { onDetach ( ) ; } if ( org.ovirt.engine.core.compat.StringHelper.stringsEqual ( command.getName ( ) , "Cancel" ) ) { cancel ( ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean isEnabled = bootSequenceModel.getHardDiskOption ( ) . getIsChangable ( ) ; java.lang.String itemName = bootSequenceModel.getHardDiskOption ( ) . getTitle ( ) ; updateItemAvailability ( itemName , isEnabled ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { boolean isEnabled = bootSequenceModel.getCdromOption ( ) . getIsChangable ( ) ; java.lang.String itemName = bootSequenceModel.getCdromOption ( ) . getTitle ( ) ; updateItemAvailability ( itemName , isEnabled ) ; }
Source:
public void setItems ( java.lang.Iterable value ) { if ( value != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > itemList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( value ) ) ; java.util.Collections.sort ( itemList , new org.ovirt.engine.ui.uicommonweb.Linq.VmComparator ( ) ) ; } super . setItems ( value ) ; }

Target:
public void setItems ( java.util.Collection value ) { if ( value != null ) { java.util.List < org.ovirt.engine.core.common.businessentities.VM > itemList = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.VM > ) ( value ) ) ; java.util.Collections.sort ( itemList , new org.ovirt.engine.ui.uicommonweb.Linq.VmComparator ( ) ) ; } super . setItems ( value ) ; }
Source:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , getPrincipalName ( sessionId ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.session.SessionDataContainer.AUTH_RECORD_PARAMETER_NAME , false ) ) ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.session.SessionDataContainer.PRINCIPAL_RECORD_PARAMETER_NAME , false ) ) ) , message , msgArgs ) ; sessionInfoMap.remove ( sessionId ) ; }

Target:
private void removeSessionImpl ( java.lang.String sessionId , int reason , java.lang.String message , java.lang.Object ... msgArgs ) { org.ovirt.engine.core.aaa.AcctUtils.reportRecords ( reason , getPrincipalName ( sessionId ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.AUTH_RECORD_PARAMETER_NAME , false ) ) ) , ( ( org.ovirt.engine.api.extensions.ExtMap ) ( getData ( sessionId , org.ovirt.engine.core.bll.aaa.SessionDataContainer.PRINCIPAL_RECORD_PARAMETER_NAME , false ) ) ) , message , msgArgs ) ; sessionInfoMap.remove ( sessionId ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.AsyncTasks createAsyncTask ( org.ovirt.engine.core.common.asynctasks.AsyncTaskCreationInfo asyncTaskCreationInfo , org.ovirt.engine.core.common.action.VdcActionType parentCommand ) { org.ovirt.engine.core.common.action.VdcActionParametersBase parentParameters = getParentParameters ( parentCommand ) ; return new org.ovirt.engine.core.common.businessentities.AsyncTasks ( parentCommand , org.ovirt.engine.core.common.businessentities.AsyncTaskResultEnum.success , org.ovirt.engine.core.common.businessentities.AsyncTaskStatusEnum.running , asyncTaskCreationInfo.getVdsmTaskId ( ) , parentParameters , getParameters ( ) , asyncTaskCreationInfo.getStepId ( ) , getCommandId ( ) , parentParameters.getCommandId ( ) , asyncTaskCreationInfo.getStoragePoolID ( ) , asyncTaskCreationInfo.getTaskType ( ) ) ; }

Target:
protected void removeCommand ( ) { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.removeCommand ( getCommandId ( ) ) ; }
Source:
public boolean canBeSelected ( ) { org.ovirt.engine.core.common.businessentities.DisplayType displayType = ( ( getEntity ( ) . getDisplayType ( ) ) != null ) ? getEntity ( ) . getDisplayType ( ) : getEntity ( ) . getDefaultDisplayType ( ) ; boolean hasVmSpiceSupport = java.lang.Boolean.TRUE.equals ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . hasSpiceSupport ( getEntity ( ) . getOs ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ; return ( displayType == ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) && hasVmSpiceSupport ; }

Target:
public boolean canBeSelected ( ) { boolean hasVmSpiceSupport = java.lang.Boolean.TRUE.equals ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . hasSpiceSupport ( getEntity ( ) . getOs ( ) , getEntity ( ) . getVdsGroupCompatibilityVersion ( ) ) ) ; return ( getEntity ( ) . getGraphicsInfos ( ) . containsKey ( GraphicsType.SPICE ) ) && hasVmSpiceSupport ; }
Source:
public void appendCustomValueAppend ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String newVal = "bar" ; final java.lang.String sep = "_" ; b.AddCustomValue ( key , value ) ; b.AppendCustomValue ( key , newVal , sep ) ; final java.lang.String s = b.GetCustomValue ( key ) ; org.junit.Assert.assertEquals ( ( ( value + sep ) + newVal ) , s ) ; }

Target:
public void appendCustomValueAppend ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final java.lang.String key = "foo" ; final java.lang.String value = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.NAME ; final java.lang.String newVal = "bar" ; final java.lang.String sep = "_" ; b.addCustomValue ( key , value ) ; b.appendCustomValue ( key , newVal , sep ) ; final java.lang.String s = b.getCustomValue ( key ) ; org.junit.Assert.assertEquals ( ( ( value + sep ) + newVal ) , s ) ; }