auphong2707/dl4se-code-review-dataset huggingface dataset:
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:
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 ) { return org.ovirt.engine.core.bll.tasks.TaskManagerUtil.createAsyncTask ( this , asyncTaskCreationInfo , parentCommand ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.NetworkAttachment incoming , org.ovirt.engine.api.model.NetworkAttachment entity ) { boolean overrideConfiguration = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentResource.OVERRIDE_CONFIGURATION , true , false ) ; org.ovirt.engine.api.model.NetworkAttachment attachment = map ( incoming , entity ) ; attachment.setOverrideConfiguration ( overrideConfiguration ) ; org.ovirt.engine.core.common.action.NetworkAttachmentParameters params = new org.ovirt.engine.core.common.action.NetworkAttachmentParameters ( parent.getHostId ( ) , attachment ) ; return params ; }

Target:
public org.ovirt.engine.core.common.action.VdcActionParametersBase getParameters ( org.ovirt.engine.api.model.NetworkAttachment incoming , org.ovirt.engine.api.model.NetworkAttachment entity ) { boolean overrideConfiguration = org.ovirt.engine.api.restapi.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.AbstractBackendNetworkAttachmentResource.OVERRIDE_CONFIGURATION , true , false ) ; org.ovirt.engine.api.model.NetworkAttachment attachment = map ( incoming , entity ) ; attachment.setOverrideConfiguration ( overrideConfiguration ) ; org.ovirt.engine.core.common.action.NetworkAttachmentParameters params = new org.ovirt.engine.core.common.action.NetworkAttachmentParameters ( parent.getHostId ( ) , attachment ) ; return params ; }
Source:
public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > siblingVlanInterfaces = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( source ) ) ; if ( ( siblingVlanInterfaces.size ( ) ) > 0 ) { return true ; } return false ; }

Target:
public boolean hasSpiceSupport ( int osId , org.ovirt.engine.core.compat.Version version ) { for ( org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.businessentities.GraphicsType , org.ovirt.engine.core.common.businessentities.DisplayType > graphicsDisplayPair : getGraphicsAndDisplays ( osId , version ) ) { if ( ( graphicsDisplayPair.getFirst ( ) ) == ( org.ovirt.engine.core.common.businessentities.GraphicsType.SPICE ) ) { return true ; } } return false ; }
Source:
public void testNoMemoryPciPassthroughSuccess ( ) { cmd.getParameters ( ) . setSaveMemory ( false ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ) . when ( vmValidator ) . vmNotHavingPciPassthroughDevices ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.junit.Assert.assertTrue ( cmd.validate ( ) ) ; org.junit.Assert.assertThat ( cmd.getReturnValue ( ) . getValidationMessages ( ) , org.hamcrest.Matchers.is ( org.hamcrest.Matchers.empty ( ) ) ) ; }

Target:
public void testNoMemoryPciPassthroughSuccess ( ) { cmd.getParameters ( ) . setSaveMemory ( false ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_VM_HAS_ATTACHED_PCI_HOST_DEVICES ) ) . when ( vmValidator ) . vmNotHavingPciPassthroughDevices ( ) ; org.mockito.Mockito.doReturn ( org.ovirt.engine.core.bll.snapshots.CreateAllSnapshotsFromVmCommandTest.getEmptyDiskList ( ) ) . when ( cmd ) . getDisksList ( ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateSuccess ( cmd ) ; }
Source:
public void getVmDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId , boolean isRefresh ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source != null ) { return source ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.IdQueryParameters params = new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllDisksByVmId , params , aQuery ) ; }

Target:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.Map < java.lang.String , java.lang.String > > aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void testTypedViewCache ( ) throws java.lang.Exception { java.io.File file = writeConf ( ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString view1 = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString.class ) ; org.junit.Assert.assertNotNull ( view1 ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString view2 = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString.class ) ; org.junit.Assert.assertNotNull ( view2 ) ; org.junit.Assert.assertTrue ( ( view1 == view2 ) ) ; }

Target:
public void testTypedViewCache ( ) throws java.lang.Exception { java.io.File file = writeConf ( ) ; org.ovirt.engine.core.extensions.mgr.Configuration config = org.ovirt.engine.core.extensions.mgr.Configuration.loadFile ( file ) ; org.junit.Assert.assertNotNull ( config ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString view1 = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString.class ) ; org.junit.Assert.assertNotNull ( view1 ) ; org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString view2 = config.getView ( org.ovirt.engine.core.extensions.mgr.ConfigurationTest.TypedString.class ) ; org.junit.Assert.assertNotNull ( view2 ) ; org.junit.Assert.assertSame ( view1 , view2 ) ; }
Source:
private void updateActionAvailability ( ) { java.util.List items = ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItem ( ) ) != null ) ) ? getSelectedItems ( ) : new java.util.ArrayList ( ) ; getEditQuotaCommand ( ) . setIsExecutionAllowed ( ( ( items.size ( ) ) == 1 ) ) ; getRemoveQuotaCommand ( ) . setIsExecutionAllowed ( ( ( items.size ( ) ) > 0 ) ) ; getCloneQuotaCommand ( ) . setIsExecutionAllowed ( ( ( items.size ( ) ) == 1 ) ) ; }

Target:
private void updateActionAvailability ( ) { java.util.List items = ( ( ( getSelectedItems ( ) ) != null ) && ( ( getSelectedItem ( ) ) != null ) ) ? getSelectedItems ( ) : new java.util.ArrayList ( ) ; getEditCommand ( ) . setIsExecutionAllowed ( ( ( items.size ( ) ) == 1 ) ) ; getRemoveCommand ( ) . setIsExecutionAllowed ( ( ( items.size ( ) ) > 0 ) ) ; getCloneCommand ( ) . setIsExecutionAllowed ( ( ( items.size ( ) ) == 1 ) ) ; }
Source:
private void executeFenceVdsManuallyAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( true ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( vdsId ) ; fenceVdsManuallyParams.setSessionId ( sessionId ) ; fenceVdsManuallyParams.setParentCommand ( VdcActionType.RestartVds ) ; runInternalAction ( VdcActionType.FenceVdsManualy , fenceVdsManuallyParams , org.ovirt.engine.core.bll.pm.RestartVdsCommand.getContext ( ) ) ; }

Target:
private void executeFenceVdsManuallyAction ( final org.ovirt.engine.core.compat.Guid vdsId , java.lang.String sessionId ) { org.ovirt.engine.core.common.action.FenceVdsManualyParameters fenceVdsManuallyParams = new org.ovirt.engine.core.common.action.FenceVdsManualyParameters ( true ) ; fenceVdsManuallyParams.setStoragePoolId ( org.ovirt.engine.core.bll.pm.RestartVdsCommand.getVds ( ) . getStoragePoolId ( ) ) ; fenceVdsManuallyParams.setVdsId ( vdsId ) ; fenceVdsManuallyParams.setSessionId ( sessionId ) ; fenceVdsManuallyParams.setParentCommand ( ActionType.RestartVds ) ; runInternalAction ( ActionType.FenceVdsManualy , fenceVdsManuallyParams , org.ovirt.engine.core.bll.pm.RestartVdsCommand.getContext ( ) ) ; }
Source:
private void CacheFencingAgentsOptionTypes ( ) { java.lang.String localfencingOptionTypes = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.VdsFenceOptionTypes ) ; java.lang.String [ ] types = localfencingOptionTypes.split ( org.ovirt.engine.core.compat.StringHelper.quote ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.COMMA ) , ( - 1 ) ) ; for ( java.lang.String entry : types ) { java.lang.String [ ] optionKeyVal = entry.split ( org.ovirt.engine.core.compat.StringHelper.quote ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.EQUAL ) , ( - 1 ) ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionTypes.put ( optionKeyVal [ 0 ] , optionKeyVal [ 1 ] ) ; } }

Target:
private void CacheFencingAgentsOptionTypes ( ) { java.lang.String localfencingOptionTypes = org.ovirt.engine.core.common.config.Config.< java.lang.String > GetValue ( ConfigValues.VdsFenceOptionTypes ) ; java.lang.String [ ] types = localfencingOptionTypes.split ( java.util.regex.Pattern.quote ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.COMMA ) , ( - 1 ) ) ; for ( java.lang.String entry : types ) { java.lang.String [ ] optionKeyVal = entry.split ( java.util.regex.Pattern.quote ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.EQUAL ) , ( - 1 ) ) ; org.ovirt.engine.core.utils.pm.VdsFenceOptions.fencingOptionTypes.put ( optionKeyVal [ 0 ] , optionKeyVal [ 1 ] ) ; } }
Source:
public static void getUserMessageOfTheDayViaPublic ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
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 ) ; }
Source:
public void testReorderMacAddresses ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , control.createMock ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.ReorderVmNics , org.ovirt.engine.core.common.action.VmOperationParameterBase.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; verifyActionResponse ( resource.reorderMacAddresses ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }

Target:
public void testReorderMacAddresses ( ) throws java.lang.Exception { setUpGetEntityExpectations ( VdcQueryType.GetVmByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.ReorderVmNics , org.ovirt.engine.core.common.action.VmOperationParameterBase.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { GUIDS [ 0 ] } ) ) ; verifyActionResponse ( resource.reorderMacAddresses ( new org.ovirt.engine.api.model.Action ( ) ) ) ; }
Source:
public void testOffsetMissingParameter ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { offsetValidateParameters ( vm ) ; fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "status" ) ; } }

Target:
public void testOffsetMissingParameter ( ) throws java.lang.Exception { org.ovirt.engine.api.model.Vm vm = new org.ovirt.engine.api.model.Vm ( ) ; vm.setDescription ( "incomplete" ) ; try { offsetValidateParameters ( vm ) ; org.junit.Assert.fail ( "expected WebApplicationException on incomplete model" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyIncompleteException ( wae , "Vm" , "status" ) ; } }
Source:
public void testUpdate ( ) { existingAdGroup.setname ( existingAdGroup.getname ( ) . toUpperCase ( ) ) ; existingAdGroup.setdomain ( existingAdGroup.getdomain ( ) . toUpperCase ( ) ) ; existingAdGroup.setstatus ( AdRefStatus.Inactive ) ; dao.update ( existingAdGroup ) ; org.ovirt.engine.core.common.businessentities.ad_groups result = dao.get ( existingAdGroup.getid ( ) ) ; assertNotNull ( result ) ; assertEquals ( existingAdGroup , result ) ; }

Target:
public void testUpdate ( ) { existingAdGroup.setname ( existingAdGroup.getname ( ) . toUpperCase ( ) ) ; existingAdGroup.setdomain ( existingAdGroup.getdomain ( ) . toUpperCase ( ) ) ; existingAdGroup.setstatus ( LdapRefStatus.Inactive ) ; dao.update ( existingAdGroup ) ; org.ovirt.engine.core.common.businessentities.LdapGroup result = dao.get ( existingAdGroup.getid ( ) ) ; assertNotNull ( result ) ; assertEquals ( existingAdGroup , result ) ; }
Source:
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 ) ; }

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:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.core.common.businessentities.VmNetworkInterface entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.GetVmByVmIdParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , entity ) ; } }

Target:
protected void setUpGetEntityExpectations ( int times , org.ovirt.engine.core.common.businessentities.network.VmNetworkInterface entity ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVmInterfacesByVmId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID } , entity ) ; } }
Source:
public org.ovirt.engine.ui.common.widget.HasUiCommandClickHandlers addFooterButton ( java.lang.String label , java.lang.String uniqueId ) { org.ovirt.engine.ui.common.widget.AbstractUiCommandButton button = createCommandButton ( label , uniqueId ) ; org.ovirt.engine.ui.common.view.popup.AbstractModelBoundPopupView.asWidget ( ) . addFooterButton ( button ) ; focusableButtons.add ( 0 , button ) ; button.asWidget ( ) . getElement ( ) . setId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , uniqueId ) ) ; return button ; }

Target:
public org.ovirt.engine.ui.common.widget.HasUiCommandClickHandlers addFooterButton ( java.lang.String label , java.lang.String uniqueId , boolean isPrimary ) { org.ovirt.engine.ui.common.widget.UiCommandButton button = createCommandButton ( label , uniqueId ) ; org.ovirt.engine.ui.common.view.popup.AbstractModelBoundPopupView.asWidget ( ) . addFooterButton ( button ) ; focusableButtons.add ( 0 , button ) ; button.asWidget ( ) . getElement ( ) . setId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , uniqueId ) ) ; if ( isPrimary ) { button.setAsPrimary ( ) ; } return button ; }
Source:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpUriExpectations ( null ) ) ; setUpQueryExpectations ( "" ) ; java.util.List < org.ovirt.engine.api.model.Disk > disks = getCollection ( ) ; assertTrue ( disks.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( disks ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testListIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpUriExpectations ( null ) ) ; setUpQueryExpectations ( "" ) ; java.util.List < org.ovirt.engine.api.model.Disk > disks = getCollection ( ) ; org.junit.Assert.assertTrue ( disks.get ( 0 ) . isSetStatistics ( ) ) ; verifyCollection ( disks ) ; } finally { accepts.clear ( ) ; } }
Source:
public void setCpus ( int totalCpus , int usedPercentage ) { java.lang.String totalCpusString = messages.numaTotalCpus ( totalCpus ) ; totalLabel.setTitle ( totalCpusString ) ; totalLabel.setText ( totalCpusString ) ; java.lang.String percentageUsed = messages.numaPercentUsed ( usedPercentage ) ; percentageLabel.setTitle ( percentageUsed ) ; percentageLabel.setText ( percentageUsed ) ; }

Target:
public void setCpus ( int totalCpus , int usedPercentage ) { java.lang.String totalCpusString = org.ovirt.engine.ui.common.view.popup.numa.CpuSummaryPanel.messages.numaTotalCpus ( totalCpus ) ; totalLabel.setText ( totalCpusString ) ; java.lang.String percentageUsed = org.ovirt.engine.ui.common.view.popup.numa.CpuSummaryPanel.messages.numaPercentUsed ( usedPercentage ) ; percentageLabel.setText ( percentageUsed ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc extendImageTransferSession ( java.lang.String ticketId , long expiration ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.extendImageTransferSession ( ticketId , expiration ) ; 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.OneMapReturnForXmlRpc get_image_transfer_session_stats ( java.lang.String ticketId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.get_image_transfer_session_stats ( ticketId ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.OneMapReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.OneMapReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public java.lang.Object convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( returnValue == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.migration.MigrationPolicy > ( ) ; } return returnValue ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleQueryAsyncResult result ) { for ( int i = 0 ; i < ( result.getReturnValues ( ) . size ( ) ) ; i ++ ) { final java.util.List < org.ovirt.engine.core.common.businessentities.ServerCpu > cpus = result.getReturnValues ( ) . get ( i ) . getReturnValue ( ) ; final org.ovirt.engine.core.compat.Version version = ( ( org.ovirt.engine.core.common.queries.GetAllServerCpuListParameters ) ( result.getParameters ( ) . get ( i ) ) ) . getVersion ( ) ; initCpuMapForVersion ( version , cpus ) ; } }
Source:
public void getVdsWithVm ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setrun_on_vds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid vdsId = null ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 , v.getId ( ) ) ; }

Target:
public void getVdsWithVm ( ) { final org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase b = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.TestAuditLogableBase ( ) ; final org.ovirt.engine.core.common.businessentities.VDS vds = null ; final org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; vm.setRunOnVds ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 ) ; final org.ovirt.engine.core.compat.Guid vdsId = null ; b.setVds ( vds ) ; b.setVdsId ( vdsId ) ; b.setVm ( vm ) ; final org.ovirt.engine.core.common.businessentities.VDS v = b.getVds ( ) ; org.junit.Assert.assertEquals ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBaseTest.GUID2 , v.getId ( ) ) ; }
Source:
private void override_EntityChanged ( org.ovirt.engine.ui.uicompat.EventArgs e ) { boolean isChangeable = ( ( java.lang.Boolean ) ( getOverride ( ) . getEntity ( ) ) ) ; getVersion ( ) . setIsChangable ( isChangeable ) ; getRetransmissions ( ) . setIsChangable ( isChangeable ) ; getTimeout ( ) . setIsChangable ( isChangeable ) ; }

Target:
private void override_EntityChanged ( org.ovirt.engine.ui.uicompat.EventArgs e ) { boolean isChangeable = ( ( java.lang.Boolean ) ( getOverride ( ) . getEntity ( ) ) ) ; getVersion ( ) . setIsChangable ( isChangeable ) ; getRetransmissions ( ) . setIsChangable ( isChangeable ) ; getTimeout ( ) . setIsChangable ( isChangeable ) ; getMountOptions ( ) . setIsChangable ( isChangeable ) ; }
Source:
public void OnSuccess ( java.lang.Object model , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel hostModel = ( ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel ) ( model ) ) ; hostModel.postGetPmOptions ( ( ( java.util.ArrayList < java.lang.String > ) ( result ) ) ) ; }

Target:
public void OnSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > pmOptions = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; getPmSecondaryPort ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmPortKey ) ) ; getPmSecondarySlot ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSlotKey ) ) ; getPmSecondarySecure ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSecureKey ) ) ; }
Source:
public static void GetMaxSpmPriority ( 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 ; } } ; aQuery.asyncCallback.OnSuccess ( aQuery.getModel ( ) , 10 ) ; }

Target:
public static void GetVmSnapshotList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid id ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVmSnapshotsByVmId , new org.ovirt.engine.core.common.queries.GetAllVmSnapshotsByVmIdParameters ( id ) , aQuery ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; model.getTemplate ( ) . setItems ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmTemplate > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmTemplate [ ] { template } ) ) ) ; model.getTemplate ( ) . setSelectedItem ( template ) ; model.getTemplate ( ) . setIsChangable ( false ) ; postInitTemplate ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > consoleDevices = ( ( java.util.List < java.lang.String > ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; getModel ( ) . getIsConsoleDeviceEnabled ( ) . setEntity ( ( ! ( consoleDevices.isEmpty ( ) ) ) ) ; }
Source:
protected void perform ( ) { org.ovirt.engine.core.compat.Guid dumpDiskId = createMemoryDumpDisk ( ) ; org.ovirt.engine.core.compat.Guid metadataDiskId = createMemoryMetadataDisk ( ) ; org.ovirt.engine.core.common.businessentities.DiskImage dumpDisk = getDisk ( dumpDiskId ) ; org.ovirt.engine.core.common.businessentities.DiskImage metadataDisk = getDisk ( metadataDiskId ) ; org.ovirt.engine.core.bll.HibernateVmCommand.getSnapshotDAO ( ) . updateHibernationMemory ( org.ovirt.engine.core.bll.HibernateVmCommand.getVmId ( ) , org.ovirt.engine.core.bll.memory.MemoryUtils.createMemoryStateString ( getStorageDomainId ( ) , org.ovirt.engine.core.bll.HibernateVmCommand.getStoragePoolId ( ) , dumpDisk.getId ( ) , dumpDisk.getImageId ( ) , metadataDisk.getId ( ) , metadataDisk.getImageId ( ) ) ) ; org.ovirt.engine.core.bll.HibernateVmCommand.setSucceeded ( true ) ; }

Target:
protected void endWithFailure ( ) { org.ovirt.engine.core.bll.HibernateVmCommand.endActionOnDisks ( ) ; org.ovirt.engine.core.bll.HibernateVmCommand.getSnapshotDao ( ) . removeMemoryFromActiveSnapshot ( org.ovirt.engine.core.bll.HibernateVmCommand.getVmId ( ) ) ; org.ovirt.engine.core.bll.HibernateVmCommand.revertTasks ( ) ; org.ovirt.engine.core.bll.HibernateVmCommand.setSucceeded ( true ) ; }
Source:
private void initConfigurationProperties ( ) throws org.ovirt.engine.core.notifier.NotificationServiceException { daysToKeepHistory = getNonNegativeIntegerProperty ( NotificationProperties.DAYS_TO_KEEP_HISTORY ) ; daysToSendOnStartup = getNonNegativeIntegerProperty ( NotificationProperties.DAYS_TO_SEND_ON_STARTUP ) ; failedQueriesNotificationThreshold = getNonNegativeIntegerProperty ( NotificationProperties.FAILED_QUERIES_NOTIFICATION_THRESHOLD ) ; if ( ( failedQueriesNotificationThreshold ) == 0 ) { failedQueriesNotificationThreshold = 1 ; } notificationMethodsMapper = new org.ovirt.engine.core.notifier.utils.NotificationMethodsMapper ( prop ) ; failedQueriesEventSender = notificationMethodsMapper.getEventSender ( EventNotificationMethods.EMAIL ) ; }

Target:
private void initConfigurationProperties ( ) throws org.ovirt.engine.core.notifier.NotificationServiceException { daysToKeepHistory = getNonNegativeIntegerProperty ( NotificationProperties.DAYS_TO_KEEP_HISTORY ) ; daysToSendOnStartup = getNonNegativeIntegerProperty ( NotificationProperties.DAYS_TO_SEND_ON_STARTUP ) ; failedQueriesNotificationThreshold = getNonNegativeIntegerProperty ( NotificationProperties.FAILED_QUERIES_NOTIFICATION_THRESHOLD ) ; if ( ( failedQueriesNotificationThreshold ) == 0 ) { failedQueriesNotificationThreshold = 1 ; } notificationMethodsMapper = new org.ovirt.engine.core.notifier.utils.NotificationMethodsMapper ( prop ) ; failedQueriesEventSender = notificationMethodsMapper.getEventSender ( EventNotificationMethod.EMAIL ) ; }
Source:
private static void updateTimeZones ( final org.ovirt.engine.core.common.TimeZoneType timeZoneType , final java.lang.Runnable postUpdateTimeZones ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getTimeZoneList ( new org.ovirt.engine.ui.frontend.AsyncQuery ( null , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { java.util.Map < java.lang.String , java.lang.String > timeZones = ( ( java.util.Map < java.lang.String , java.lang.String > ) ( returnValue ) ) ; org.ovirt.engine.ui.uicommonweb.models.vms.TimeZoneModel.cachedTimeZones.put ( timeZoneType , timeZones ) ; org.ovirt.engine.ui.uicommonweb.models.vms.TimeZoneModel.mapListModels ( timeZoneType , timeZones ) ; postUpdateTimeZones.run ( ) ; } } ) , timeZoneType ) ; }

Target:
public java.lang.String getDisplayValue ( ) { if ( isDefault ( ) ) { final java.lang.String defaultTimeZoneKey = ( ( java.lang.String ) ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getConfigValuePreConverted ( timeZoneType.getDefaultTimeZoneConfigurationKey ( ) ) ) ) ; if ( ! ( timeZoneType.getTimeZoneList ( ) . containsKey ( defaultTimeZoneKey ) ) ) { timeZoneKey = timeZoneType.getUltimateFallback ( ) ; } return timeZoneType.getTimeZoneList ( ) . get ( defaultTimeZoneKey ) ; } else { return timeZoneType.getTimeZoneList ( ) . get ( timeZoneKey ) ; } }
Source:
private void assertExecuteActionFailure ( ) { try { underTest.executeCommand ( ) ; } catch ( java.lang.Exception expected ) { } org.junit.Assert.assertFalse ( underTest.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.NETWORK_ATTACH_NETWORK_TO_VDS_GROUP_FAILED , underTest.getAuditLogTypeValue ( ) ) ; }

Target:
private void assertExecuteActionFailure ( ) { try { underTest.executeCommand ( ) ; } catch ( java.lang.Exception expected ) { } org.junit.Assert.assertFalse ( underTest.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( AuditLogType.NETWORK_ATTACH_NETWORK_TO_CLUSTER_FAILED , underTest.getAuditLogTypeValue ( ) ) ; }
Source:
public static void getNetworkList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dataCenterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.Network > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public void getDataCentersByStorageDomain ( 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 ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StoragePool > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStoragePoolsByStorageDomainId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
private void moveVDSToMaintenanceIfNeeded ( ) { if ( ( _vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) { if ( monitoringStrategy.canMoveToMaintenance ( _vds ) ) { _vdsManager.setStatus ( VDSStatus.Maintenance , _vds ) ; _saveVdsDynamic = true ; _saveVdsStatistics = true ; org.ovirt.engine.core.vdsbroker.VdsUpdateRunTimeInfo.log.info ( "Updated vds status from 'Preparing for Maintenance' to 'Maintenance' in database, vds '{}'({})" , _vds.getName ( ) , _vds.getId ( ) ) ; } else { vdsMaintenanceTimeoutOccurred = _vdsManager.isTimeToRetryMaintenance ( ) ; } } }

Target:
private void moveVDSToMaintenanceIfNeeded ( ) { if ( ( _vds.getStatus ( ) ) == ( org.ovirt.engine.core.common.businessentities.VDSStatus.PreparingForMaintenance ) ) { if ( monitoringStrategy.canMoveToMaintenance ( _vds ) ) { _vdsManager.setStatus ( VDSStatus.Maintenance , _vds ) ; _saveVdsDynamic = true ; _saveVdsStatistics = true ; org.ovirt.engine.core.vdsbroker.HostMonitoring.log.info ( "Updated vds status from 'Preparing for Maintenance' to 'Maintenance' in database, vds '{}'({})" , _vds.getName ( ) , _vds.getId ( ) ) ; } else { vdsMaintenanceTimeoutOccurred = _vdsManager.isTimeToRetryMaintenance ( ) ; } } }
Source:
protected void setIconAndFireChangeEvent ( java.lang.String icon ) { final org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault oldPair = getValue ( ) ; setIcon ( icon ) ; smallIconId = null ; final org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault newPair = getValue ( ) ; com.google.gwt.event.logical.shared.ValueChangeEvent.fireIfNotEqual ( this , oldPair , newPair ) ; }

Target:
protected void setIconAndFireChangeEvent ( java.lang.String icon , org.ovirt.engine.ui.uicommonweb.validation.ValidationResult validationResult ) { final org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault oldPair = getValue ( ) ; this . validationResult = validationResult ; smallIconId = null ; setIcon ( icon ) ; final org.ovirt.engine.ui.uicommonweb.models.vms.IconWithOsDefault newPair = getValue ( ) ; com.google.gwt.event.logical.shared.ValueChangeEvent.fireIfNotEqual ( this , oldPair , newPair ) ; }
Source:
private java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > getStorageToDiskMap ( ) { java.util.Map < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > storageToDisksMap = new java.util.HashMap < org.ovirt.engine.core.compat.Guid , java.util.List < org.ovirt.engine.core.common.businessentities.DiskImage > > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : getSourceImages ( ) ) { org.ovirt.engine.core.utils.collections.MultiValueMapUtils.addToMap ( disk.getStorageIds ( ) . get ( 0 ) , disk , storageToDisksMap ) ; } return storageToDisksMap ; }

Target:
protected boolean validateSnapshotType ( ) { org.ovirt.engine.core.common.businessentities.Snapshot snapshot = getSnapshotDao ( ) . get ( org.ovirt.engine.core.bll.RemoveSnapshotCommand.getParameters ( ) . getSnapshotId ( ) ) ; return validate ( createSnapshotValidator ( ) . snapshotTypeSupported ( snapshot , java.util.Collections.singletonList ( Snapshot.SnapshotType.REGULAR ) ) ) ; }
Source:
public java.lang.String render ( T size ) { if ( isUnavailable ( size ) ) { return org.ovirt.engine.ui.common.widget.renderer.DiskSizeRenderer.CONSTANTS.unAvailablePropertyLabel ( ) ; } long sizeInGB = - 1 ; switch ( unit ) { case BYTE : sizeInGB = ( ( long ) ( ( size.longValue ( ) ) / ( java.lang.Math.pow ( 1024 , 3 ) ) ) ) ; break ; case GIGABYTE : sizeInGB = size.longValue ( ) ; break ; } return sizeInGB >= 1 ? sizeInGB + " GB" : "< 1 GB" ; }

Target:
protected boolean isUnavailable ( T size ) { return ( size == null ) || ( ( size.longValue ( ) ) == ( org.ovirt.engine.core.common.constants.StorageConstants.SIZE_IS_NOT_AVAILABLE ) ) ; }
Source:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( p.getvm_count ( ) ) < ( highVdsCountTemp * ( org.ovirt.engine.core.bll.VdsSelector.getEffectiveCpuCores ( p ) ) ) ) && ( ( p.getvm_count ( ) ) >= ( lowVdsCountTemp * ( org.ovirt.engine.core.bll.VdsSelector.getEffectiveCpuCores ( p ) ) ) ) ; }

Target:
public boolean eval ( org.ovirt.engine.core.common.businessentities.VDS p ) { return ( ( p.getVmCount ( ) ) < ( highVdsCountTemp * ( org.ovirt.engine.core.bll.VdsSelector.getEffectiveCpuCores ( p ) ) ) ) && ( ( p.getVmCount ( ) ) >= ( lowVdsCountTemp * ( org.ovirt.engine.core.bll.VdsSelector.getEffectiveCpuCores ( p ) ) ) ) ; }
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 getHostFingerprint ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String hostAddress ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHKeyFingerprint , new org.ovirt.engine.core.common.queries.ServerParameters ( hostAddress ) , aQuery ) ; }
Source:
public void OnSuccess ( java.lang.Object model1 , java.lang.Object result ) { org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel clusterModel = ( ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterModel ) ( model1 ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > vmList = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ) ( result ) ) ; if ( ( vmList.size ( ) ) > 0 ) { clusterModel.getEnableOvirtService ( ) . setIsChangable ( false ) ; } else { clusterModel.getEnableOvirtService ( ) . setIsChangable ( true ) ; } }

Target:
public void OnSuccess ( java.lang.Object model1 , java.lang.Object result ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > volumes = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity > ) ( result ) ) ; if ( ( volumes.size ( ) ) > 0 ) { clusterModel.getEnableGlusterService ( ) . setIsChangable ( false ) ; if ( ! isVirtGlusterAllowed ) { clusterModel.getEnableOvirtService ( ) . setIsChangable ( false ) ; } } }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( target ) ) ; org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( returnValue ) ) ; model.getBaseTemplate ( ) . setItems ( java.util.Collections.singletonList ( template ) ) ; model.getBaseTemplate ( ) . setSelectedItem ( template ) ; model.getBaseTemplate ( ) . setIsChangable ( false ) ; }

Target:
protected void setReadOnlyTemplateWithVersion ( org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion templateCouple ) { getModel ( ) . getTemplateWithVersion ( ) . setItems ( java.util.Collections.singleton ( templateCouple ) ) ; getModel ( ) . getTemplateWithVersion ( ) . setSelectedItem ( templateCouple ) ; getModel ( ) . getTemplateWithVersion ( ) . setIsChangable ( false ) ; }
Source:
public static void GetDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.Search , searchParams , 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 InitDisks ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > disks = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : vm.getDiskList ( ) ) { disks.add ( org.ovirt.engine.ui.uicommonweb.Linq.DiskToModel ( diskImage ) ) ; } getModel ( ) . setDisks ( disks ) ; getModel ( ) . getDisksAllocationModel ( ) . setIsVolumeFormatAvailable ( true ) ; getModel ( ) . getDisksAllocationModel ( ) . setIsVolumeFormatChangable ( true ) ; UpdateIsDisksAvailable ( ) ; }

Target:
public void InitDisks ( ) { java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > disks = new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel > ( ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage diskImage : vm.getDiskList ( ) ) { disks.add ( org.ovirt.engine.ui.uicommonweb.Linq.diskToModel ( diskImage ) ) ; } getModel ( ) . setDisks ( disks ) ; getModel ( ) . getDisksAllocationModel ( ) . setIsVolumeFormatAvailable ( true ) ; getModel ( ) . getDisksAllocationModel ( ) . setIsVolumeFormatChangable ( true ) ; UpdateIsDisksAvailable ( ) ; }
Source:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) ) == null ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST ) ; return false ; } if ( ! ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) { addCanDoActionMessage ( VdcBllMessages.VM_CANNOT_CANCEL_MIGRATION_WHEN_VM_IS_NOT_MIGRATING ) ; return false ; } return true ; }

Target:
protected boolean canDoAction ( ) { if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) ) == null ) { return failCanDoAction ( VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_EXIST ) ; } if ( ! ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.canRunActionOnNonManagedVm ( ) ) ) { return false ; } if ( ( org.ovirt.engine.core.bll.CancelMigrateVmCommand.getVm ( ) . getStatus ( ) ) != ( org.ovirt.engine.core.common.businessentities.VMStatus.MigratingFrom ) ) { return failCanDoAction ( VdcBllMessages.VM_CANNOT_CANCEL_MIGRATION_WHEN_VM_IS_NOT_MIGRATING ) ; } return true ; }