auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public final com.google.gwt.safehtml.shared.SafeHtml getValue ( org.ovirt.engine.ui.uicommonweb.models.storage.LunModel object ) { org.ovirt.engine.ui.common.widget.table.cell.ScrollableTextCell.CellTemplate template = com.google.gwt.core.client.GWT.create ( ScrollableTextCell.CellTemplate.class ) ; java.lang.String color = "" ; if ( object != null ) { if ( object.getIsGrayedOut ( ) ) { color = "gray" ; } else if ( ! ( object.getIsAccessible ( ) ) ) { color = "orange" ; } else { color = "black" ; } } return template.input ( getRawValue ( object ) , ( "color:" + color ) ) ; }

Target:
public final com.google.gwt.safehtml.shared.SafeHtml getValue ( org.ovirt.engine.ui.uicommonweb.models.storage.LunModel object ) { org.ovirt.engine.ui.common.widget.table.cell.ScrollableTextCell.CellTemplate template = com.google.gwt.core.client.GWT.create ( ScrollableTextCell.CellTemplate.class ) ; java.lang.String color = "" ; if ( object != null ) { if ( object.getIsGrayedOut ( ) ) { color = "gray" ; } else if ( ! ( object.getIsAccessible ( ) ) ) { color = "orange" ; } else { color = "black" ; } } return template.input ( getRawValue ( object ) , ( "color:" + color ) , com.google.gwt.user.client.DOM.createUniqueId ( ) ) ; }
Source:
public void run ( ) { try { waitForTasksToBeCleared ( ) ; executeDeactivateCommnad ( false ) ; } catch ( java.lang.Exception e ) { setSucceeded ( false ) ; log.error ( "Error when attempting to deactivate storage domain {0}" , getStorageDomainId ( ) , e ) ; compensate ( ) ; } }

Target:
public void run ( ) { try { waitForTasksToBeCleared ( ) ; executeDeactivateCommnad ( false ) ; ctx.resetCompensation ( ) ; } catch ( java.lang.Exception e ) { setSucceeded ( false ) ; log.error ( "Error when attempting to deactivate storage domain {}" , getStorageDomainId ( ) , e ) ; compensate ( ) ; } }
Source:
public void testInterfaceAlreadyLabeledWithWhenInterfaceIsLabeledBySameLabel ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setLabels ( java.util.Collections.singleton ( "labelA" ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceAlreadyLabeledWith ( "labelA" ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( VdcBllMessages.INTERFACE_ALREADY_LABELED ) ) ; }

Target:
public void testInterfaceAlreadyLabeledWithWhenInterfaceIsLabeledBySameLabel ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface vdsNetworkInterface = createVdsNetworkInterfaceWithName ( ) ; vdsNetworkInterface.setLabels ( java.util.Collections.singleton ( "labelA" ) ) ; org.junit.Assert.assertThat ( new org.ovirt.engine.core.bll.validator.HostInterfaceValidator ( vdsNetworkInterface ) . interfaceAlreadyLabeledWith ( "labelA" ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.INTERFACE_ALREADY_LABELED ) ) ; }
Source:
private boolean isEditConsoleEnabled ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { if ( ( ! ( item.getIsPool ( ) ) ) && ( ( consoleUtils.determineDefaultProtocol ( item ) ) != null ) ) { return true ; } return false ; }

Target:
private boolean isEditConsoleEnabled ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel item ) { if ( ( ( ! ( item.getIsPool ( ) ) ) && ( ( consoleUtils.determineDefaultProtocol ( item ) ) != null ) ) && ( item.getStatus ( ) . equals ( VMStatus.Up ) ) ) { return true ; } return false ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.Cancel ( ) ; vmListModel.setGuideContext ( returnValueBase.getActionReturnValue ( ) ) ; vmListModel.UpdateActionAvailability ( ) ; vmListModel.getGuideCommand ( ) . Execute ( ) ; } }

Target:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel vmListModel = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.VmListModel ) ( result.getState ( ) ) ) ; vmListModel.getWindow ( ) . StopProgress ( ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValueBase = result.getReturnValue ( ) ; if ( ( returnValueBase != null ) && ( returnValueBase.getSucceeded ( ) ) ) { vmListModel.cancel ( ) ; vmListModel.setGuideContext ( returnValueBase.getActionReturnValue ( ) ) ; vmListModel.UpdateActionAvailability ( ) ; vmListModel.getGuideCommand ( ) . Execute ( ) ; } }
Source:
public static void IsCustomPropertiesAvailable ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportCustomProperties ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void GetGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.RunQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void testVmTagLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Tag tag = new org.ovirt.engine.api.model.Tag ( ) ; tag.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.TAG_ID ) ; tag.setVm ( new org.ovirt.engine.api.model.VM ( ) ) ; tag.getVm ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , tag ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_TAG_HREF , tag.getHref ( ) ) ; }

Target:
public void testVmTagLinks ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Tag tag = new org.ovirt.engine.api.model.Tag ( ) ; tag.setId ( org.ovirt.engine.api.common.util.LinkHelperTest.TAG_ID ) ; tag.setVm ( new org.ovirt.engine.api.model.Vm ( ) ) ; tag.getVm ( ) . setId ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_ID ) ; org.ovirt.engine.api.utils.LinkHelper.addLinks ( setUpUriExpectations ( ) , tag ) ; assertEquals ( org.ovirt.engine.api.common.util.LinkHelperTest.VM_TAG_HREF , tag.getHref ( ) ) ; }
Source:
public static void GetLowUtilizationForPowerSave ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.LowUtilizationForPowerSave ) , aQuery ) ; }

Target:
public static void GetLocalFSPath ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.RhevhLocalFSPath ) , aQuery ) ; }
Source:
public void networkQosDoesntExist ( ) throws java.lang.Exception { org.mockito.Mockito.when ( vnicProfile.getNetworkQosId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkQosDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertThat ( validator.networkQosExistsOrNull ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_EXISTS ) ) ; }

Target:
public void networkQosDoesntExist ( ) throws java.lang.Exception { org.mockito.Mockito.when ( vnicProfile.getNetworkQosId ( ) ) . thenReturn ( org.ovirt.engine.core.bll.validator.VnicProfileValidatorTest.DEFAULT_GUID ) ; org.mockito.Mockito.when ( networkQosDao.get ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( null ) ; org.junit.Assert.assertThat ( validator.networkQosExistsOrNull ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NETWORK_QOS_NOT_EXISTS ) ) ; }
Source:
public static void GetVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { 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.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.GetVmConfigurationBySnapshotQueryParams ( snapshotSourceId ) , aQuery ) ; }

Target:
public static void GetAllAttachableDisks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Disk > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllAttachableDisks , new org.ovirt.engine.core.common.queries.GetAllAttachableDisks ( storagePoolId ) , aQuery ) ; }
Source:
public void customPropertiesBadInput ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; java.util.Map < java.lang.String , java.lang.String > customProperties = new java.util.HashMap < > ( ) ; customProperties.put ( "foo" , "b@r" ) ; iface.setCustomProperties ( customProperties ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , Version.v3_5 ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_BAD_INPUT , network.getName ( ) ) ; }

Target:
public void customPropertiesNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_NOT_SUPPORTED , network.getName ( ) ) ; }
Source:
public static void getClusterDesktopMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getClusterServerMemoryOverCommit ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Integer ) ( source ) ) . intValue ( ) : 0 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommitForServers , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private java.lang.String getEmulatedMachineOfHostInCluster ( org.ovirt.engine.core.common.businessentities.VDS vds ) { java.util.Set < java.lang.String > emulatedMachinesLookup = new java.util.HashSet ( java.util.Arrays.asList ( vds.getSupportedEmulatedMachines ( ) . split ( "," ) ) ) ; return org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > getValue ( ConfigValues.ClusterEmulatedMachines , org.ovirt.engine.core.bll.UpdateVdsGroupCommand.getParameters ( ) . getVdsGroup ( ) . getCompatibilityVersion ( ) . getValue ( ) ) . stream ( ) . filter ( emulatedMachinesLookup :: contains ) . findFirst ( ) . orElse ( null ) ; }

Target:
private java.lang.String getEmulatedMachineOfHostInCluster ( org.ovirt.engine.core.common.businessentities.VDS vds ) { java.util.Set < java.lang.String > emulatedMachinesLookup = new java.util.HashSet ( java.util.Arrays.asList ( vds.getSupportedEmulatedMachines ( ) . split ( "," ) ) ) ; return org.ovirt.engine.core.common.config.Config.< java.util.List < java.lang.String > > getValue ( ConfigValues.ClusterEmulatedMachines , org.ovirt.engine.core.bll.UpdateClusterCommand.getParameters ( ) . getCluster ( ) . getCompatibilityVersion ( ) . getValue ( ) ) . stream ( ) . filter ( emulatedMachinesLookup :: contains ) . findFirst ( ) . orElse ( null ) ; }
Source:
private void doTestBadAddBookmark ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { "Bookmark.Name" , "Bookmark.Value" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ 0 ] } , canDo , success ) ) ; try { collection.add ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddBookmark ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddBookmark , org.ovirt.engine.core.common.action.BookmarksOperationParameters.class , new java.lang.String [ ] { "Bookmark.Name" , "Bookmark.Value" } , new java.lang.Object [ ] { NAMES [ 0 ] , org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.VALUES [ 0 ] } , valid , success ) ) ; try { collection.add ( org.ovirt.engine.api.restapi.resource.BackendBookmarksResourceTest.getModel ( 0 ) ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public void canDoActionVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }

Target:
public void canDoActionVmIsNotDown ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move ) ; initSnapshotValidator ( ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; initSrcStorageDomain ( ) ; initDestStorageDomain ( StorageType.NFS ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDAO ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_VM_IS_NOT_DOWN.toString ( ) ) ) ; }
Source:
public void update ( org.ovirt.engine.core.common.businessentities.AuditLog event ) { getCallsHandler ( ) . executeModification ( "UpdateAuditLog" , getSqlMapper ( event ) ) ; }

Target:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource getExternalEventSqlMapper ( org.ovirt.engine.core.common.businessentities.AuditLog event ) { return getSqlMapper ( event ) . addValue ( "origin" , event.getOrigin ( ) ) . addValue ( "custom_event_id" , event.getCustomEventId ( ) ) . addValue ( "event_flood_in_sec" , event.getEventFloodInSec ( ) ) . addValue ( "custom_data" , event.getCustomData ( ) ) ; }
Source:
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 ) ; }

Target:
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 ) ; }
Source:
protected void ExecuteVDSCommand ( ) { try { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxyData = org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getCurrentIrsProxyData ( ) ; switch ( org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getParameters ( ) . getReconstructMarkAction ( ) ) { case ClearJobs : proxyData.clearPoolTimers ( ) ; break ; case ClearCache : proxyData.clearCache ( ) ; break ; default : break ; } } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.log.error ( ( "Could not change timers for pool " + ( org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ) , e ) ; } org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getVDSReturnValue ( ) . setSucceeded ( true ) ; }

Target:
protected void executeVDSCommand ( ) { try { org.ovirt.engine.core.vdsbroker.irsbroker.IrsProxyData proxyData = org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getCurrentIrsProxyData ( ) ; switch ( org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getParameters ( ) . getReconstructMarkAction ( ) ) { case ClearJobs : proxyData.clearPoolTimers ( ) ; break ; case ClearCache : proxyData.clearCache ( ) ; break ; default : break ; } } catch ( java.lang.Exception e ) { org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.log.error ( ( "Could not change timers for pool " + ( org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getParameters ( ) . getStoragePoolId ( ) ) ) , e ) ; } org.ovirt.engine.core.vdsbroker.irsbroker.MarkPoolInReconstructModeVDSCommand.getVDSReturnValue ( ) . setSucceeded ( true ) ; }
Source:
public void getClusterGlusterServices ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , null , null , false ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }
Source:
private boolean canRemoveNics ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; if ( VMStatus.Down.equals ( vm.getStatus ( ) ) ) { return true ; } java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > Cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : nics ) { if ( nic.isPlugged ( ) ) { return false ; } } return true ; }

Target:
private boolean canRemoveNics ( ) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity ( ) ; if ( VMStatus.Down.equals ( vm.getStatus ( ) ) ) { return true ; } java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > nics = ( ( getSelectedItems ( ) ) != null ) ? org.ovirt.engine.ui.uicommonweb.Linq.< org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > cast ( getSelectedItems ( ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface > ( ) ; for ( org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface nic : nics ) { if ( nic.isPlugged ( ) ) { return false ; } } return true ; }
Source:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) , new org.ovirt.engine.ui.uicompat.IFrontendActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult a ) { stopProgress ( a.getState ( ) ) ; cancel ( ) ; } } , this ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.core.common.action.VmManagementParametersBase param = new org.ovirt.engine.core.common.action.VmManagementParametersBase ( gettempVm ( ) ) ; param.setSoundDeviceEnabled ( ( ( java.lang.Boolean ) ( model.getIsSoundcardEnabled ( ) . getEntity ( ) ) ) ) ; param.setConsoleEnabled ( ( ( java.lang.Boolean ) ( model.getIsConsoleDeviceEnabled ( ) . getEntity ( ) ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.UpdateVm , param , new org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModelNetworkAsyncCallbacks.NetworkUpdateFrontendAsyncCallback ( model , defaultNetworkCreatingManager , gettempVm ( ) . getId ( ) ) , this ) ; }
Source:
protected com.google.gwt.user.client.ui.IsWidget createIconPanel ( ) { com.google.gwt.user.client.ui.FlowPanel panel = new com.google.gwt.user.client.ui.FlowPanel ( ) ; panel.addStyleName ( PatternflyConstants.PF_LIST_VIEW_LEFT ) ; org.gwtbootstrap3.client.ui.html.Span iconSpan = new org.gwtbootstrap3.client.ui.html.Span ( ) ; iconSpan.addStyleName ( PatternflyConstants.PFICON ) ; iconSpan.addStyleName ( PatternflyConstants.PFICON_NETWORK ) ; iconSpan.addStyleName ( PatternflyConstants.PF_LIST_VIEW_ICON_SM ) ; panel.add ( iconSpan ) ; return panel ; }

Target:
private com.google.gwt.user.client.ui.IsWidget createLinkStatusPanel ( boolean isLinked ) { org.ovirt.engine.ui.common.widget.uicommon.vm.IconStatusPanel iconStatusPanel = new org.ovirt.engine.ui.common.widget.uicommon.vm.IconStatusPanel ( ( isLinked ? org.gwtbootstrap3.client.ui.constants.IconType.ARROW_CIRCLE_O_UP : org.gwtbootstrap3.client.ui.constants.IconType.ARROW_CIRCLE_O_DOWN ) ) ; iconStatusPanel.addStyleName ( org.ovirt.engine.ui.common.widget.uicommon.vm.DOUBLE_SIZE ) ; iconStatusPanel.getElement ( ) . getStyle ( ) . setColor ( ( isLinked ? GREEN : RED ) ) ; return iconStatusPanel ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult hotUpdatePossible ( ) { if ( ( getRequiredAction ( ) ) == ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ) ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.networkLinking ( version ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.HOT_VM_INTERFACE_UPDATE_IS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.clusterVersion ( ) ) ; } else if ( ( portMirroringEnabled ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.getInterface ( ) . getVnicProfileId ( ) ) ) || ( portMirroringEnabled ( oldIface.getVnicProfileId ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.CANNOT_PERFORM_HOT_UPDATE_WITH_PORT_MIRRORING ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult hotUpdatePossible ( ) { if ( ( getRequiredAction ( ) ) == ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.RequiredAction.UPDATE_VM_DEVICE ) ) { if ( ! ( org.ovirt.engine.core.common.FeatureSupported.networkLinking ( version ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.HOT_VM_INTERFACE_UPDATE_IS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.clusterVersion ( ) ) ; } else if ( ( portMirroringEnabled ( org.ovirt.engine.core.bll.network.vm.UpdateVmInterfaceCommand.UpdateVmNicValidator.getInterface ( ) . getVnicProfileId ( ) ) ) || ( portMirroringEnabled ( oldIface.getVnicProfileId ( ) ) ) ) { return new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.CANNOT_PERFORM_HOT_UPDATE_WITH_PORT_MIRRORING ) ; } } return org.ovirt.engine.core.bll.ValidationResult.VALID ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; if ( ( pools != null ) && ( ( pools.size ( ) ) > 0 ) ) { org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetClusterList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > pools = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( returnValue ) ) ; org.ovirt.engine.core.common.businessentities.StoragePool pool = pools.get ( 0 ) ; if ( pool != null ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getStorageDomainList ( ( ( org.ovirt.engine.ui.frontend.AsyncQuery ) ( model ) ) , pool.getId ( ) ) ; } }
Source:
protected boolean pciAndIdeWithinLimit ( org.ovirt.engine.core.common.businessentities.VmStatic vm , java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > allInterfaces ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > allDisks = org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVmId ( ) ) ; return checkPciAndIdeLimit ( vm.getNumOfMonitors ( ) , allInterfaces , allDisks , org.ovirt.engine.core.bll.utils.VmDeviceUtils.isVirtioScsiControllerAttached ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }

Target:
protected boolean pciAndIdeWithinLimit ( org.ovirt.engine.core.common.businessentities.VmStatic vm , java.util.List < org.ovirt.engine.core.common.businessentities.network.VmNic > allInterfaces ) { java.util.List < org.ovirt.engine.core.common.businessentities.Disk > allDisks = org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getDiskDao ( ) . getAllForVm ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVmId ( ) ) ; return checkPciAndIdeLimit ( vm.getNumOfMonitors ( ) , allInterfaces , allDisks , org.ovirt.engine.core.bll.utils.VmDeviceUtils.isVirtioScsiControllerAttached ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.utils.VmDeviceUtils.hasWatchdog ( org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getVmId ( ) ) , org.ovirt.engine.core.bll.network.vm.AbstractVmInterfaceCommand.getReturnValue ( ) . getCanDoActionMessages ( ) ) ; }
Source:
public void canDoActionPreallocatedSpaceCheckFailsSize ( ) { final int availableSize = 3 ; final int usedSize = 7 ; org.ovirt.engine.core.compat.Guid sdid = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; initializeCommand ( sdid , VolumeType.Preallocated ) ; mockVm ( ) ; mockStorageDomain ( sdid , availableSize , usedSize ) ; mockStoragePoolIsoMap ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_TARGET_STORAGE_DOMAIN.toString ( ) ) ) ; }

Target:
public void canDoActionMaxBlockDiskSizeCheckSucceeds ( ) { org.ovirt.engine.core.compat.Guid storageId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.ovirt.engine.core.common.action.AddDiskParameters parameters = org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createParameters ( ) ; parameters.setDiskInfo ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.createDiskImage ( org.ovirt.engine.core.bll.AddDiskToVmCommandTest.MAX_BLOCK_SIZE ) ) ; initializeCommand ( storageId , parameters ) ; mockVm ( ) ; mockStorageDomain ( storageId , StorageType.ISCSI ) ; mockStoragePoolIsoMap ( ) ; mockInterfaceList ( ) ; runAndAssertCanDoActionSuccess ( ) ; }
Source:
public void canDoActionDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.canDoAction ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getCanDoActionMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }

Target:
public void validateDiskIsLocked ( ) throws java.lang.Exception { initializeCommand ( ImageOperation.Move , new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ) ; initVmDiskImage ( false ) ; mockGetVmsListForDisk ( ) ; command.getImage ( ) . setImageStatus ( ImageStatus.LOCKED ) ; org.mockito.Mockito.doReturn ( vmDeviceDao ) . when ( command ) . getVmDeviceDao ( ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.ACTION_TYPE_FAILED_DISKS_LOCKED.toString ( ) ) ) ; }
Source:
protected void updateDataProvider ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > items ) { if ( ( currentItems ) == null ) { currentItems = items ; super . updateDataProvider ( items ) ; } else if ( itemsChanged ( items , currentItems ) ) { for ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel itemModel : currentItems ) { itemModel.clearReferences ( ) ; } super . updateDataProvider ( items ) ; } else { org.ovirt.engine.ui.userportal.uicommon.model.AbstractUserPortalListProvider.retainSelectedItems ( ) ; } currentItems = items ; }

Target:
protected void updateDataProvider ( java.util.List < org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel > items ) { if ( ( currentItems ) == null ) { currentItems = items ; super . updateDataProvider ( items ) ; } else if ( ( forceUpdate ) || ( itemsChanged ( items , currentItems ) ) ) { clearReferences ( ) ; super . updateDataProvider ( items ) ; } else { org.ovirt.engine.ui.userportal.uicommon.model.AbstractUserPortalListProvider.retainSelectedItems ( ) ; } forceUpdate = false ; currentItems = items ; }
Source:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = new org.ovirt.engine.core.common.businessentities.network.Bond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , null , false , false ) ; }

Target:
public void testValidModifiedBondsFailsWhenSlavesValidationFails ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Bond bond = createBond ( ) ; bond.setSlaves ( java.util.Arrays.asList ( "slaveA" , "slaveB" ) ) ; doTestValidModifiedBonds ( bond , ValidationResult.VALID , ValidationResult.VALID , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) , new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.NETWORK_INTERFACE_ATTACHED_TO_NETWORK_CANNOT_BE_SLAVE ) ) ; }
Source:
public static void getRpmVersion ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.ProductRPMVersion ) ; tempVar.setVersion ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }

Target:
public static void isSupportBridgesReportByVDSM ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String version ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) : true ; } } ; org.ovirt.engine.core.common.queries.GetConfigurationValueParameters tempVar = new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.SupportBridgesReportByVDSM ) ; tempVar.setVersion ( version ) ; org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigFromCache ( tempVar , aQuery ) ; }
Source:
public void InitCdImage ( ) { getModel ( ) . getCdImage ( ) . setSelectedItem ( vm.getIsoPath ( ) ) ; boolean hasCd = ! ( org.ovirt.engine.core.compat.StringHelper.isNullOrEmpty ( vm.getIsoPath ( ) ) ) ; getModel ( ) . getCdImage ( ) . setIsChangable ( hasCd ) ; getModel ( ) . getCdAttached ( ) . setEntity ( hasCd ) ; UpdateCdImage ( ) ; }

Target:
public void cluster_SelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateNumOfSockets ( ) ; updateQuotaByCluster ( vm.getQuotaId ( ) , vm.getQuotaName ( ) ) ; updateCpuPinningVisibility ( ) ; }
Source:
private static void assertGetAllForStoragePoolResult ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result , org.ovirt.engine.core.compat.Guid expectedStoragePoolId ) { org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : result ) { org.junit.Assert.assertEquals ( expectedStoragePoolId , domain.getStoragePoolId ( ) ) ; org.junit.Assert.assertEquals ( "Wrong shared status" , StorageDomainSharedStatus.Active , domain.getStorageDomainSharedStatus ( ) ) ; } }

Target:
private static void assertGetAllForStoragePoolResult ( java.util.List < org.ovirt.engine.core.common.businessentities.StorageDomain > result , org.ovirt.engine.core.compat.Guid expectedStoragePoolId ) { org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.StorageDomain domain : result ) { org.junit.jupiter.api.Assertions.assertEquals ( expectedStoragePoolId , domain.getStoragePoolId ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( StorageDomainSharedStatus.Active , domain.getStorageDomainSharedStatus ( ) , "Wrong shared status" ) ; } }
Source:
public com.google.gwt.user.client.ui.Widget resolveValueWidget ( ) { boolean showDefaultValue = ( ( defaultValueCondition ) != null ) && ( defaultValueCondition.showDefaultValue ( ) ) ; return showDefaultValue ? defaultValueLabel : valueWidget ; }

Target:
public com.google.gwt.user.client.ui.Widget resolveValueWidget ( ) { boolean showDefaultValue = ( ( defaultValueCondition ) != null ) && ( defaultValueCondition.showDefaultValue ( ) ) ; com.google.gwt.user.client.ui.Widget resolvedValueWidget = ( showDefaultValue ) ? defaultValueLabel : valueWidget ; boolean showEmptyValue = ( resolvedValueWidget instanceof com.google.gwt.user.client.ui.HasText ) && ( org.ovirt.engine.ui.uicompat.external.StringUtils.isEmpty ( ( ( com.google.gwt.user.client.ui.HasText ) ( resolvedValueWidget ) ) . getText ( ) ) ) ; return showEmptyValue ? emptyValueLabel : resolvedValueWidget ; }
Source:
protected void pollVds ( org.ovirt.engine.core.common.businessentities.VDS vds ) { int retries = 10 ; while ( ( ( retries > 0 ) && ( ( retVal ) == null ) ) && ( ! ( editNetworkThreadFinish ) ) ) { retries -- ; try { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.CollectVdsNetworkDataVDSCommandParameters ( vds ) ) ; } catch ( java.lang.Exception e ) { } } }

Target:
protected void pollVds ( org.ovirt.engine.core.common.businessentities.VDS vds ) { int retries = 10 ; while ( ( ( retries > 0 ) && ( ( retVal ) == null ) ) && ( ! ( editNetworkThreadFinish ) ) ) { retries -- ; try { org.ovirt.engine.core.bll.Backend.getInstance ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.CollectVdsNetworkData , new org.ovirt.engine.core.common.vdscommands.VdsIdAndVdsVDSCommandParametersBase ( vds ) ) ; } catch ( java.lang.Exception e ) { } } }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.ConfirmationModel , ? > getConfirmModelPopup ( org.ovirt.engine.ui.uicommonweb.models.providers.ProviderListModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand ) { if ( lastExecutedCommand == ( getModel ( ) . getRemoveCommand ( ) ) ) { return removeConfirmPopupProvider.get ( ) ; } else if ( ( lastExecutedCommand == ( getModel ( ) . getAddCommand ( ) ) ) || ( lastExecutedCommand == ( getModel ( ) . getEditCommand ( ) ) ) ) { return defaultConfirmPopupProvider.get ( ) ; } else { return super . getConfirmModelPopup ( source , lastExecutedCommand ) ; } }
Source:
public void migrationSupported ( ) { org.mockito.Mockito.when ( cluster.getcompatibility_version ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . migrationSupportedForArch ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void migrationSupported ( ) { org.mockito.Mockito.when ( cluster.getCompatibilityVersion ( ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.compat.Version.class ) ) ; validator = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ) ; org.mockito.Mockito.doReturn ( true ) . when ( validator ) . migrationSupportedForArch ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) ; org.junit.Assert.assertThat ( validator.migrationSupported ( org.ovirt.engine.core.utils.RandomUtils.instance ( ) . nextEnum ( org.ovirt.engine.core.common.businessentities.ArchitectureType.class ) ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
protected void postGetHost ( java.lang.String hostName ) { java.lang.StringBuilder configBuilder = new java.lang.StringBuilder ( "[virt-viewer]" ) ; configBuilder.append ( "\ntype=vnc" ) . append ( "\nhost=" ) . append ( hostName ) . append ( "\nport=" ) . append ( getEntity ( ) . getDisplay ( ) . toString ( ) ) . append ( "\npassword=" ) . append ( otp64 ) . append ( "\ntitle=" ) . append ( getTitle ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel.makeConsoleConfigRequest ( "console.vv" , "application/x-virt-viewer; charset=UTF-8" , configBuilder.toString ( ) ) ; }

Target:
protected void postGetHost ( java.lang.String hostName ) { java.lang.StringBuilder configBuilder = new java.lang.StringBuilder ( "[virt-viewer]" ) ; configBuilder.append ( "\ntype=vnc" ) . append ( "\nhost=" ) . append ( hostName ) . append ( "\nport=" ) . append ( getEntity ( ) . getDisplay ( ) . toString ( ) ) . append ( "\npassword=" ) . append ( otp64 ) . append ( "\ndelete-this-file=1" ) . append ( "\ntitle=" ) . append ( getTitle ( ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.ConsoleModel.makeConsoleConfigRequest ( "console.vv" , "application/x-virt-viewer; charset=UTF-8" , configBuilder.toString ( ) ) ; }
Source:
private static void addVideoDevice ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vm.getId ( ) ) , VmDeviceGeneralType.VIDEO , vm.getDefaultDisplayType ( ) . getVmDeviceType ( ) , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getMemExpr ( vm.getNumOfMonitors ( ) ) , true , true , null ) ; }

Target:
private static void addVideoDevice ( org.ovirt.engine.core.common.businessentities.VmBase vm ) { org.ovirt.engine.core.bll.utils.VmDeviceUtils.addManagedDevice ( new org.ovirt.engine.core.common.businessentities.VmDeviceId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) , vm.getId ( ) ) , VmDeviceGeneralType.VIDEO , vm.getDefaultDisplayType ( ) . getVmDeviceType ( ) , org.ovirt.engine.core.bll.utils.VmDeviceUtils.getMemExpr ( vm.getNumOfMonitors ( ) , vm.getSingleQxlPci ( ) ) , true , true , null ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc glusterVolumeGeoRepStatus ( ) { try { java.util.Map < java.lang.String , java.lang.Object > response = vdsServer.glusterVolumeGeoRepStatus ( ) ; return new org.ovirt.engine.core.vdsbroker.gluster.GlusterVolumeGeoRepStatusForXmlRpc ( response ) ; } 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 glusterSnapshotRestore ( java.lang.String snapshotName ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterSnapshotRestore ( snapshotName ) ; 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 ) ; } }