auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void InitSpmPriorities ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.GetMaxSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabHostView view = ( ( org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabHostView ) ( target ) ) ; view.maxSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; InitSpmPriorities1 ( ) ; } } ) ) ; }

Target:
private void InitSpmPriorities ( ) { org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getMaxSpmPriority ( new org.ovirt.engine.ui.frontend.AsyncQuery ( this , new org.ovirt.engine.ui.frontend.INewAsyncCallback ( ) { @ java.lang.Override public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabHostView view = ( ( org.ovirt.engine.ui.webadmin.section.main.view.tab.MainTabHostView ) ( target ) ) ; view.maxSpmPriority = ( ( java.lang.Integer ) ( returnValue ) ) ; InitSpmPriorities1 ( ) ; } } ) ) ; }
Source:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.VdcActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , java.util.ArrayList < org.ovirt.engine.core.compat.Guid > asyncTasks , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncStatuses ) { java.lang.String uri = ( ( ( "datacenters/" + ( org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID ) ) + "/storagedomains/" ) + ( org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID ) ) + "/action" ; return setUpActionExpectations ( task , clz , names , values , true , true , null , asyncTasks , asyncStatuses , null , null , uri , true ) ; }

Target:
protected javax.ws.rs.core.UriInfo setUpActionExpectations ( org.ovirt.engine.core.common.action.ActionType task , java.lang.Class < ? extends org.ovirt.engine.core.common.action.VdcActionParametersBase > clz , java.lang.String [ ] names , java.lang.Object [ ] values , java.util.ArrayList < org.ovirt.engine.core.compat.Guid > asyncTasks , java.util.ArrayList < org.ovirt.engine.core.common.businessentities.AsyncTaskStatus > asyncStatuses ) { java.lang.String uri = ( ( ( "datacenters/" + ( org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID ) ) + "/storagedomains/" ) + ( org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID ) ) + "/action" ; return setUpActionExpectations ( task , clz , names , values , true , true , null , asyncTasks , asyncStatuses , null , null , uri , true ) ; }
Source:
public void getHostsForStorageOperation ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , boolean localFsOnly ) { 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.VDS > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public void getTemplateById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid templateId ) { 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.GetVmTemplate , new org.ovirt.engine.core.common.queries.GetVmTemplateParameters ( templateId ) , aQuery ) ; }
Source:
private void OnApproveInternal ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( getSelectedItem ( ) ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.ApproveVds , new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.action.VdcActionParametersBase [ ] { new org.ovirt.engine.core.common.action.ApproveVdsParameters ( vds.getId ( ) ) } ) ) , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }

Target:
public void Activate ( ) { java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > list = new java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > ( ) ; for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.VDS vds = ( ( org.ovirt.engine.core.common.businessentities.VDS ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.VdsActionParameters ( vds.getId ( ) ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.ActivateVds , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void Executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = org.ovirt.engine.core.bll.gluster.SyncStorageDevicesCommand.getCluster ( ) ; if ( ! ( cluster.supportsGlusterService ( ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_PROVISIONING_NOT_SUPPORTED_BY_CLUSTER ) ; } if ( ! ( org.ovirt.engine.core.bll.gluster.SyncStorageDevicesCommand.getParameters ( ) . isForceAction ( ) ) ) { org.ovirt.engine.core.bll.validator.HostValidator validator = new org.ovirt.engine.core.bll.validator.HostValidator ( org.ovirt.engine.core.bll.gluster.SyncStorageDevicesCommand.getVds ( ) ) ; return validate ( validator.isUp ( ) ) ; } return true ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.common.businessentities.Cluster cluster = org.ovirt.engine.core.bll.gluster.SyncStorageDevicesCommand.getCluster ( ) ; if ( ! ( cluster.supportsGlusterService ( ) ) ) { return failValidation ( EngineMessage.ACTION_TYPE_FAILED_STORAGE_PROVISIONING_NOT_SUPPORTED_BY_CLUSTER ) ; } if ( ! ( org.ovirt.engine.core.bll.gluster.SyncStorageDevicesCommand.getParameters ( ) . isForceAction ( ) ) ) { org.ovirt.engine.core.bll.validator.HostValidator validator = org.ovirt.engine.core.bll.validator.HostValidator.createInstance ( org.ovirt.engine.core.bll.gluster.SyncStorageDevicesCommand.getVds ( ) ) ; return validate ( validator.isUp ( ) ) ; } return true ; }
Source:
public final void freeMacs ( java.util.List < java.lang.String > macs ) { java.util.List < java.lang.String > macsToRelease = filterOutUnusedMacs ( macs ) ; if ( ! ( macsToRelease.isEmpty ( ) ) ) { getStrategyForMacRelease ( ) . releaseMacsOnCommit ( macsToRelease ) ; } }

Target:
public final void freeMacs ( java.util.List < java.lang.String > macs ) { java.util.List < java.lang.String > macsToRelease = filterOutUnusedMacs ( macs ) ; if ( macsToRelease.isEmpty ( ) ) { org.ovirt.engine.core.bll.network.macpool.TransactionalMacPoolDecorator.log.warn ( "Trying to release MACs using empty collection as parameter." ) ; } else { org.ovirt.engine.core.bll.network.macpool.TransactionalMacPoolDecorator.TransactionalStrategyState strategyForMacRelease = getStrategyForMacRelease ( ) ; org.ovirt.engine.core.bll.network.macpool.TransactionalMacPoolDecorator.log.debug ( "Using as release strategy" , strategyForMacRelease ) ; strategyForMacRelease.releaseMacsOnCommit ( macsToRelease ) ; } }
Source:
public void rollback ( ) { log.error ( "Transaction rolled-back for command '{}'." , this . getClass ( ) . getName ( ) ) ; try { if ( isQuotaDependant ( ) ) { rollbackQuota ( ) ; } } catch ( java.lang.NullPointerException e ) { log.error ( "RollbackQuota: failed (may be because quota is disabled)" , e ) ; } cancelTasks ( ) ; }

Target:
protected org.ovirt.engine.core.common.vdscommands.VDSReturnValue runVdsCommand ( org.ovirt.engine.core.common.vdscommands.VDSCommandType commandType , org.ovirt.engine.core.common.vdscommands.VDSParametersBase parameters ) throws org.ovirt.engine.core.common.errors.EngineException { return getVdsBroker ( ) . runVdsCommand ( commandType , parameters ) ; }
Source:
public void isVmNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ! ( ( ( java.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmWithSameNameExist , new org.ovirt.engine.core.common.queries.NameQueryParameters ( name ) , aQuery ) ; }

Target:
public void isTemplateNameUnique ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String templateName , 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.lang.Boolean ) ( source ) ) . booleanValue ( ) ) : false ; } } ; org.ovirt.engine.core.common.queries.NameQueryParameters params = new org.ovirt.engine.core.common.queries.NameQueryParameters ( templateName ) ; params.setDatacenterId ( datacenterId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.IsVmTemlateWithSameNameExist , params , aQuery ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionResume ( java.lang.String volumeName , java.lang.String slaveHostName , java.lang.String slaveVolumeName , boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeGeoRepSessionResume ( volumeName , slaveHostName , slaveVolumeName , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc glusterVolumeGeoRepSessionCreate ( java.lang.String volumeName , java.lang.String remoteHost , java.lang.String remoteVolumeName , java.lang.String userName , java.lang.Boolean force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.glusterVolumeGeoRepSessionCreate ( volumeName , remoteHost , remoteVolumeName , userName , force ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
public void testNeedToProcessHardwareCapsFalse ( ) { org.ovirt.engine.core.common.businessentities.VDS oldVds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; oldVds.setvds_group_id ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; oldVds.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; oldVds.setcpu_flags ( "flag1" ) ; org.ovirt.engine.core.common.businessentities.VDS newVds = oldVds.clone ( ) ; org.junit.Assert.assertFalse ( virtStrategy.processHardwareCapabilitiesNeeded ( oldVds , newVds ) ) ; }

Target:
public void testNeedToProcessHardwareCapsFalse ( ) { org.ovirt.engine.core.common.businessentities.VDS oldVds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; oldVds.setVdsGroupId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; oldVds.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; oldVds.setCpuFlags ( "flag1" ) ; org.ovirt.engine.core.common.businessentities.VDS newVds = oldVds.clone ( ) ; org.junit.Assert.assertFalse ( virtStrategy.processHardwareCapabilitiesNeeded ( oldVds , newVds ) ) ; }
Source:
protected org.ovirt.engine.api.model.VM setUpStatisticalExpectations ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmStatistics stats = control.createMock ( org.ovirt.engine.core.common.businessentities.VmStatistics.class ) ; org.ovirt.engine.api.model.VM entity = control.createMock ( org.ovirt.engine.api.model.VM.class ) ; org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.setUpStatisticalEntityExpectations ( entity , stats ) ; setUpGetEntityExpectations ( 1 , false , entity ) ; control.replay ( ) ; return entity ; }

Target:
protected org.ovirt.engine.api.model.VM setUpStatisticalExpectations ( ) throws java.lang.Exception { org.ovirt.engine.api.model.VM entity = new org.ovirt.engine.api.model.VM ( ) ; org.ovirt.engine.api.restapi.resource.BackendVmsResourceTest.setUpStatisticalEntityExpectations ( entity , entity.getStatisticsData ( ) ) ; setUpGetEntityExpectations ( 1 , false , entity ) ; control.replay ( ) ; return entity ; }
Source:
private void doTestNetworkIpAddressWasSameAsHostnameAndChangedForBootProtocol ( org.ovirt.engine.core.common.businessentities.network.Ipv4BootProtocol bootProtocol ) { org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpConfiguration ( bootProtocol , null , null ) ; org.ovirt.engine.core.bll.validator.NetworkAttachmentValidator validator = createNetworkAttachmentValidator ( attachment ) ; org.ovirt.engine.core.bll.ValidationResult actual = validator.networkIpAddressWasSameAsHostnameAndChanged ( null ) ; org.junit.Assert.assertThat ( actual , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }

Target:
public void testBootProtocolSetForRoleNetworkWhenBootProtocolIsDhcp ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment attachment = createNetworkAttachmentWithIpv4Configuration ( Ipv4BootProtocol.DHCP , null , null ) ; attachment.setNetworkId ( network.getId ( ) ) ; doTestBootProtocolSetForRoleNetworkWhenNullValuedIpConfiguration ( true , false , false , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) , network , attachment ) ; }
Source:
public static void serialize ( com.google.gwt.user.client.rpc.SerializationStreamWriter writer , org.ovirt.engine.core.aaa.DirectoryGroup group ) throws com.google.gwt.user.client.rpc.SerializationException { writer.writeObject ( group.getDirectory ( ) . getName ( ) ) ; writer.writeObject ( group.getId ( ) ) ; writer.writeString ( group.getName ( ) ) ; }

Target:
public static void serialize ( com.google.gwt.user.client.rpc.SerializationStreamWriter writer , org.ovirt.engine.core.aaa.DirectoryGroup group ) throws com.google.gwt.user.client.rpc.SerializationException { writer.writeObject ( group.getDirectoryName ( ) ) ; writer.writeObject ( group.getId ( ) ) ; writer.writeString ( group.getName ( ) ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.VM createVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic dynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.common.businessentities.VmStatic stat = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; stat.setvmt_guid ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; stat.setvm_name ( "testVm" ) ; stat.setpriority ( 1 ) ; vm.setStaticData ( stat ) ; vm.setDynamicData ( dynamic ) ; return vm ; }

Target:
private static org.ovirt.engine.core.common.businessentities.VM createVm ( ) { org.ovirt.engine.core.common.businessentities.VM vm = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.ovirt.engine.core.common.businessentities.VmDynamic dynamic = new org.ovirt.engine.core.common.businessentities.VmDynamic ( ) ; org.ovirt.engine.core.common.businessentities.VmStatic stat = new org.ovirt.engine.core.common.businessentities.VmStatic ( ) ; stat.setVmtGuid ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; stat.setVmName ( "testVm" ) ; stat.setPriority ( 1 ) ; vm.setStaticData ( stat ) ; vm.setDynamicData ( dynamic ) ; return vm ; }
Source:
public void validateFailedWrongPlugStatus ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeDiskWrongPlug ( false ) ; org.junit.Assert.assertFalse ( command.validate ( ) ) ; org.junit.Assert.assertTrue ( command.getReturnValue ( ) . getValidationMessages ( ) . contains ( EngineMessage.HOT_UNPLUG_DISK_IS_NOT_PLUGGED.toString ( ) ) ) ; }

Target:
public void validateFailedWrongPlugStatus ( ) throws java.lang.Exception { mockVmStatusUp ( ) ; mockInterfaceList ( ) ; cretaeDiskWrongPlug ( false ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.HOT_UNPLUG_DISK_IS_NOT_PLUGGED ) ; }
Source:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid dcId ) { 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.VnicProfileView > ( ) ; } return source ; } } ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }

Target:
public void getAllProvidersByType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ProviderType providerType ) { 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.Provider > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllProviders , new org.ovirt.engine.core.common.queries.GetAllProvidersParameters ( providerType ) , aQuery ) ; }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator validator = new org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator ( vmDao , networkDao , getDeletedProvider ( ) ) ; return ( ( validate ( validator.providerIsSet ( ) ) ) && ( validate ( validator.providerNetworksNotUsed ( ) ) ) ) && ( validateRemoveProvider ( ) ) ; }

Target:
protected boolean validate ( ) { org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator validator = new org.ovirt.engine.core.bll.provider.RemoveProviderCommand.RemoveProviderValidator ( vmDao , networkDao , clusterDao , getDeletedProvider ( ) ) ; return ( ( ( validate ( validator.providerIsSet ( ) ) ) && ( validate ( validator.providerNetworksNotUsed ( ) ) ) ) && ( validate ( validator.providerIsNoDefaultProvider ( ) ) ) ) && ( validateRemoveProvider ( ) ) ; }
Source:
public 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 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.MaxVdsMemOverCommit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }

Target:
public void getDataCenterMaxNameLength ( 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 ) ) : 1 ; } } ; getConfigFromCache ( new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.StoragePoolNameSizeLimit , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
void initTable ( ) { getTable ( ) . enableColumnResizing ( ) ; org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.VmTemplate > nameColumn = new org.ovirt.engine.ui.common.widget.table.column.AbstractTextColumn < org.ovirt.engine.core.common.businessentities.VmTemplate > ( ) { @ java.lang.Override public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VmTemplate object ) { return object.getName ( ) ; } } ; nameColumn.makeSortable ( ) ; getTable ( ) . addColumn ( nameColumn , org.ovirt.engine.ui.webadmin.section.main.view.tab.profile.SubTabVnicProfileTemplateView.constants.nameTemplate ( ) , "300px" ) ; }

Target:
public java.lang.String getValue ( org.ovirt.engine.core.common.businessentities.VmTemplate object ) { return java.lang.String.valueOf ( object.getTemplateVersionNumber ( ) ) ; }
Source:
private void getVlanParentInterface ( org.ovirt.engine.core.compat.Guid vdsID , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface , 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 ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVlanParent , new org.ovirt.engine.core.common.queries.InterfaceAndIdQueryParameters ( vdsID , iface ) , aQuery ) ; }

Target:
public void getStorageConnectionsByDataCenterIdAndStorageType ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storagePoolId , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { 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.GetConnectionsByDataCenterAndStorageTypeParameters params = new org.ovirt.engine.core.common.queries.GetConnectionsByDataCenterAndStorageTypeParameters ( storagePoolId , storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetConnectionsByDataCenterAndStorageType , params , aQuery ) ; }
Source:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = loadStoragePoolIsoMap ( ) ; changeDomainStatusWithCompensation ( map , StorageDomainStatus.Unknown , StorageDomainStatus.Locked , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCompensationContext ( ) ) ; if ( shouldPerformOvfUpdate ( ) ) { org.ovirt.engine.core.common.action.ProcessOvfUpdateForStoragePoolParameters parameters = new org.ovirt.engine.core.common.action.ProcessOvfUpdateForStoragePoolParameters ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getStoragePoolId ( ) ) ; parameters.setUpdateStorage ( false ) ; runInternalAction ( VdcActionType.ProcessOvfUpdateForStoragePool , parameters , null ) ; runInternalActionWithTasksContext ( VdcActionType.ProcessOvfUpdateForStorageDomain , createProcessOvfUpdateForDomainParams ( ) , null ) ; } if ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.noAsyncOperations ( ) ) { executeDeactivateCommand ( ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }

Target:
protected void executeCommand ( ) { org.ovirt.engine.core.common.businessentities.StoragePoolIsoMap map = loadStoragePoolIsoMap ( ) ; changeDomainStatusWithCompensation ( map , StorageDomainStatus.Unknown , StorageDomainStatus.Locked , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getCompensationContext ( ) ) ; if ( shouldPerformOvfUpdate ( ) ) { org.ovirt.engine.core.common.action.StoragePoolParametersBase parameters = new org.ovirt.engine.core.common.action.StoragePoolParametersBase ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getStoragePoolId ( ) ) ; runInternalAction ( ActionType.ProcessOvfUpdateForStoragePool , parameters , null ) ; runInternalAction ( ActionType.UpdateOvfStoreForStorageDomain , createUpdateOvfStoreParams ( ) , org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.getContext ( ) ) ; } if ( org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.noAsyncOperations ( ) ) { executeDeactivateCommand ( ) ; } org.ovirt.engine.core.bll.storage.domain.DeactivateStorageDomainWithOvfUpdateCommand.setSucceeded ( true ) ; }
Source:
public void testGetIncludeStatistics ( ) throws java.lang.Exception { try { accepts.add ( "application/xml; detail=statistics" ) ; setUriInfo ( setUpBasicUriExpectations ( ) ) ; setAllContentHeaderExpectation ( ) ; setUpEntityQueryExpectations ( 1 ) ; setGetVmQueryExpectations ( 1 ) ; setGetNetworksQueryExpectations ( 1 ) ; setGetGuestAgentQueryExpectations ( 1 ) ; control.replay ( ) ; org.ovirt.engine.api.model.NIC nic = resource.get ( ) ; assertTrue ( nic.isSetStatistics ( ) ) ; org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.verifyModelSpecific ( nic , 1 ) ; verifyLinks ( nic ) ; } finally { accepts.clear ( ) ; } }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( 2 ) ; setAllContentHeaderExpectation ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" , "Interface.Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.AbstractBackendNicsResourceTest.PARENT_ID , GUIDS [ 1 ] } , true , true ) ) ; org.ovirt.engine.api.model.NIC nic = resource.update ( getNic ( false ) ) ; assertNotNull ( nic ) ; }
Source:
private void fillDisksToParameters ( ) { for ( org.ovirt.engine.core.common.businessentities.Disk image : getDiskImagesFromConfiguration ( ) ) { diskInfoDestinationMap.put ( image.getId ( ) , ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( image ) ) ) ; } org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . setDiskInfoDestinationMap ( diskInfoDestinationMap ) ; }

Target:
private void fillDisksToParameters ( ) { for ( org.ovirt.engine.core.common.businessentities.Disk image : getAdjustedDiskImagesFromConfiguration ( ) ) { diskInfoDestinationMap.put ( image.getId ( ) , ( ( org.ovirt.engine.core.common.businessentities.DiskImage ) ( image ) ) ) ; } org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . setDiskInfoDestinationMap ( diskInfoDestinationMap ) ; }
Source:
protected org.ovirt.engine.core.common.businessentities.VDSGroup getEntity ( int index ) { return org.ovirt.engine.api.restapi.resource.BackendClustersResourceTest.setUpEntityExpectations ( control.createMock ( org.ovirt.engine.core.common.businessentities.VDSGroup.class ) , index ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.VDS getEntity ( int index ) { org.ovirt.engine.core.common.businessentities.VDS vds = org.ovirt.engine.api.restapi.resource.BackendHostsResourceTest.setUpEntityExpectations ( control.createMock ( org.ovirt.engine.core.common.businessentities.VDS.class ) , index ) ; org.ovirt.engine.core.common.businessentities.VdsStatic vdsStatic = control.createMock ( org.ovirt.engine.core.common.businessentities.VdsStatic.class ) ; org.easymock.EasyMock.expect ( vdsStatic.getId ( ) ) . andReturn ( GUIDS [ 2 ] ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( vds.getStaticData ( ) ) . andReturn ( vdsStatic ) . anyTimes ( ) ; return vds ; }
Source:
protected void afterReadResponse ( java.net.HttpURLConnection connection , byte [ ] response ) throws java.lang.Exception { if ( ( ( connection.getResponseCode ( ) ) != ( java.net.HttpURLConnection.HTTP_OK ) ) && ( ( connection.getResponseCode ( ) ) != ( java.net.HttpURLConnection.HTTP_MOVED_TEMP ) ) ) { org.ovirt.engine.core.bll.host.provider.foreman.ForemanErrorWrapper ferr = objectMapper.readValue ( response , org.ovirt.engine.core.bll.host.provider.foreman.ForemanErrorWrapper.class ) ; java.lang.String err = org.apache.commons.lang.StringUtils.join ( ferr.getForemanError ( ) . getFull_messages ( ) , ", " ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , err ) ; } }

Target:
protected void afterReadResponse ( java.net.HttpURLConnection connection , byte [ ] response ) throws java.lang.Exception { if ( ( ( connection.getResponseCode ( ) ) != ( java.net.HttpURLConnection.HTTP_OK ) ) && ( ( connection.getResponseCode ( ) ) != ( java.net.HttpURLConnection.HTTP_MOVED_TEMP ) ) ) { org.ovirt.engine.core.bll.host.provider.foreman.ForemanErrorWrapper ferr = objectMapper.readValue ( response , org.ovirt.engine.core.bll.host.provider.foreman.ForemanErrorWrapper.class ) ; java.lang.String err = org.apache.commons.lang.StringUtils.join ( ferr.getForemanError ( ) . getFullMessages ( ) , ", " ) ; throw new org.ovirt.engine.core.common.errors.EngineException ( org.ovirt.engine.core.common.errors.EngineError.PROVIDER_FAILURE , err ) ; } }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "IsChangable" . equals ( args.propertyName ) ) { boolean value = getIsChangable ( ) ; allowDuplicates.setIsChangable ( value ) ; macRanges.setIsChangable ( value ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( "IsChangable" . equals ( args.propertyName ) ) { boolean value = getIsChangable ( ) ; allowDuplicates.setIsChangeable ( value ) ; macRanges.setIsChangeable ( value ) ; } }
Source:
public void testRemove ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.SHARED_ISO_STORAGE_DOAMIN_FOR_SP2_AND_SP3 , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertNotSame ( true , listOfRepoFiles.isEmpty ( ) ) ; repoFileMetaDataDao.removeRepoDomainFileList ( FixturesTool.SHARED_ISO_STORAGE_DOAMIN_FOR_SP2_AND_SP3 , ImageFileType.ISO ) ; listOfRepoFiles = getActiveIsoDomain ( ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertSame ( true , listOfRepoFiles.isEmpty ( ) ) ; }

Target:
public void testRemove ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.storage.RepoImage > listOfRepoFiles = repoFileMetaDataDao.getRepoListForStorageDomain ( FixturesTool.SHARED_ISO_STORAGE_DOAMIN_FOR_SP2_AND_SP3 , ImageFileType.ISO ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertFalse ( listOfRepoFiles.isEmpty ( ) ) ; repoFileMetaDataDao.removeRepoDomainFileList ( FixturesTool.SHARED_ISO_STORAGE_DOAMIN_FOR_SP2_AND_SP3 , ImageFileType.ISO ) ; listOfRepoFiles = getActiveIsoDomain ( ) ; org.junit.Assert.assertNotNull ( listOfRepoFiles ) ; org.junit.Assert.assertTrue ( listOfRepoFiles.isEmpty ( ) ) ; }
Source:
protected boolean ValidateAdd ( org.ovirt.engine.core.common.EventNotificationMethod eventNotificationMethod , org.ovirt.engine.core.common.businessentities.event_subscriber event_subscriber , org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { java.lang.String tagName = event_subscriber.gettag_name ( ) ; boolean retValue = ValidateNotificationMethod ( eventNotificationMethod , event_subscriber , user ) ; if ( retValue && ( org.apache.commons.lang.StringUtils.isNotEmpty ( tagName ) ) ) { retValue = ValidateTag ( tagName ) ; } return retValue ; }

Target:
protected boolean ValidateAdd ( org.ovirt.engine.core.common.EventNotificationMethod eventNotificationMethod , org.ovirt.engine.core.common.businessentities.EventSubscriber eventSubscriber , org.ovirt.engine.core.common.businessentities.aaa.DbUser user ) { java.lang.String tagName = eventSubscriber.getTagName ( ) ; boolean retValue = ValidateNotificationMethod ( eventNotificationMethod , eventSubscriber , user ) ; if ( retValue && ( org.apache.commons.lang.StringUtils.isNotEmpty ( tagName ) ) ) { retValue = ValidateTag ( tagName ) ; } return retValue ; }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( T value ) { setTitle ( value.getComment ( ) ) ; if ( ( ( value.getComment ( ) ) != null ) && ( ! ( value.getComment ( ) . isEmpty ( ) ) ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.CommentColumn.getApplicationResources ( ) . commentImage ( ) ; } return null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( T value ) { if ( ( ( value != null ) && ( ( value.getComment ( ) ) != null ) ) && ( ! ( value.getComment ( ) . isEmpty ( ) ) ) ) { return org.ovirt.engine.ui.webadmin.widget.table.column.CommentColumn.resources.commentImage ( ) ; } return null ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Event event ) { validateParameters ( event , "origin" , "severity" , "customId" , "description" ) ; return performCreate ( VdcActionType.AddExternalEvent , new org.ovirt.engine.core.common.action.AddExternalEventParameters ( map ( event ) ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < java.lang.Long > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetAuditLogById , org.ovirt.engine.core.common.queries.GetAuditLogByIdParameters.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.Event event ) { validateParameters ( event , "origin" , "severity" , "customId" , "description" ) ; validateEnums ( org.ovirt.engine.api.model.Event.class , event ) ; return performCreate ( VdcActionType.AddExternalEvent , new org.ovirt.engine.core.common.action.AddExternalEventParameters ( map ( event ) ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver < java.lang.Long > ( org.ovirt.engine.core.common.queries.VdcQueryType.GetAuditLogById , org.ovirt.engine.core.common.queries.GetAuditLogByIdParameters.class ) ) ; }
Source:
private < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > boolean nameAndIdIsIncoherent ( org.ovirt.engine.core.compat.Guid nicId , java.lang.String nicName , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { T interfaceById = map.get ( nicId ) ; T interfaceByName = map.get ( nicName ) ; return ! ( java.util.Objects.equals ( interfaceById , interfaceByName ) ) ; }

Target:
private < T extends org.ovirt.engine.core.common.businessentities.BusinessEntity < org.ovirt.engine.core.compat.Guid > & org.ovirt.engine.core.common.businessentities.Nameable > boolean isNameAndIdIncoherent ( org.ovirt.engine.core.compat.Guid id , java.lang.String name , org.ovirt.engine.core.common.businessentities.BusinessEntityMap < T > map ) { T entityById = map.get ( id ) ; T entityByName = map.get ( name ) ; return ! ( java.util.Objects.equals ( entityById , entityByName ) ) ; }
Source:
private void mockConfig ( ) { mcr.mockConfigValue ( ConfigValues.PredefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.UserDefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.InitStorageSparseSizeInGB , 1 ) ; mcr.mockConfigValue ( ConfigValues.VirtIoScsiEnabled , Version.v3_3 , true ) ; mcr.mockConfigValue ( ConfigValues.ValidNumOfMonitors , java.util.Arrays.asList ( "1,2,4" . split ( "," ) ) ) ; }

Target:
private void mockConfig ( ) { mcr.mockConfigValue ( ConfigValues.PredefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.UserDefinedVMProperties , Version.v3_0 , "" ) ; mcr.mockConfigValue ( ConfigValues.InitStorageSparseSizeInGB , 1 ) ; mcr.mockConfigValue ( ConfigValues.VirtIoScsiEnabled , Version.v3_3 , true ) ; mcr.mockConfigValue ( ConfigValues.ValidNumOfMonitors , java.util.Arrays.asList ( "1,2,4" . split ( "," ) ) ) ; mcr.mockConfigValue ( ConfigValues.IsMigrationSupported , Version.v3_3 , org.ovirt.engine.core.bll.AddVmCommandTest.migrationMap ) ; }
Source:
private void doTestBadAddNic ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { PARENT_ID } , canDo , success ) ) ; org.ovirt.engine.api.model.Nic model = getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadAddNic ( boolean canDo , boolean success , java.lang.String detail ) throws java.lang.Exception { setUriInfo ( setUpActionExpectations ( VdcActionType.AddVmInterface , org.ovirt.engine.core.common.action.AddVmInterfaceParameters.class , new java.lang.String [ ] { "VmId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendVmNicsResourceTest.VM_ID } , canDo , success ) ) ; org.ovirt.engine.api.model.Nic model = org.ovirt.engine.api.restapi.resource.BackendVmNicsResourceTest.getModel ( 0 ) ; try { collection.add ( model ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private static int compDigitSequence ( java.lang.String seq1 , java.lang.String seq2 ) { int compRes = ( ( java.lang.Integer ) ( java.lang.Integer.parseInt ( seq1 ) ) ) . compareTo ( java.lang.Integer.parseInt ( seq2 ) ) ; return compRes == 0 ? org.ovirt.engine.core.common.utils.LexoNumericComparator.compNonDigitSequence ( seq1 , seq2 ) : compRes ; }

Target:
private static int compDigitSequence ( java.lang.String seq1 , java.lang.String seq2 ) { int compRes = ( ( java.lang.Integer ) ( java.lang.Integer.parseInt ( seq1 ) ) ) . compareTo ( java.lang.Integer.parseInt ( seq2 ) ) ; return compRes == 0 ? org.ovirt.engine.core.common.businessentities.comparators.LexoNumericComparator.compNonDigitSequence ( seq1 , seq2 ) : compRes ; }
Source:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permissions > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permissions > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void getStorageConnectionById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String id , 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 ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageServerConnections ) ( source ) ) : null ; } } ; org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase params = new org.ovirt.engine.core.common.queries.StorageServerConnectionQueryParametersBase ( id ) ; params.setRefresh ( isRefresh ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageServerConnectionById , params , aQuery ) ; }
Source:
public void setMemoryStats ( long totalMemory , long usedMemory ) { java.lang.String totalMemoryString = messages.numaMemory ( totalMemory ) ; totalLabel.setTitle ( totalMemoryString ) ; totalLabel.setText ( totalMemoryString ) ; java.lang.String usedMemoryString = messages.numaMemoryUsed ( usedMemory ) ; usedLabel.setTitle ( usedMemoryString ) ; usedLabel.setText ( usedMemoryString ) ; }

Target:
public void setMemoryStats ( long totalMemory , long usedMemory ) { java.lang.String totalMemoryString = org.ovirt.engine.ui.common.view.popup.numa.MemorySummaryPanel.messages.numaMemory ( totalMemory ) ; totalLabel.setTitle ( totalMemoryString ) ; totalLabel.setText ( totalMemoryString ) ; java.lang.String usedMemoryString = org.ovirt.engine.ui.common.view.popup.numa.MemorySummaryPanel.messages.numaMemoryUsed ( usedMemory ) ; usedLabel.setTitle ( usedMemoryString ) ; usedLabel.setText ( usedMemoryString ) ; }
Source:
public void setUp ( ) throws java.lang.Exception { super . setUp ( ) ; dao = dbFacade.getDbUserDao ( ) ; vm = FixturesTool.VM_RHEL5_POOL_50 ; existingUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544a" ) ) ; deletableUser = dao.get ( new org.ovirt.engine.core.compat.Guid ( "9bf7c640-b620-456f-a550-0348f366544b" ) ) ; newUser = new org.ovirt.engine.core.common.businessentities.aaa.DbUser ( ) ; newUser.setExternalId ( "0" ) ; newUser.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; newUser.setFirstName ( "Bob" ) ; newUser.setLastName ( "Milqtoste" ) ; newUser.setLoginName ( "newuser" ) ; newUser.setEmail ( "newuser@redhat.com" ) ; newUser.setDomain ( "domain" ) ; newUser.setGroupNames ( new java.util.LinkedList < > ( java.util.Collections.singletonList ( "groups" ) ) ) ; newUser.setNamespace ( "*" ) ; }

Target:
public void testUpdateLastAdminCheckStatus ( ) { org.ovirt.engine.core.common.businessentities.aaa.DbUser nonAdminUser = dbFacade.getDbUserDao ( ) . getByUsernameAndDomain ( "userportal2@testportal.redhat.com" , "testportal.redhat.com" ) ; org.junit.Assert.assertNotNull ( nonAdminUser ) ; org.junit.Assert.assertFalse ( nonAdminUser.isAdmin ( ) ) ; dao.updateLastAdminCheckStatus ( nonAdminUser.getId ( ) ) ; nonAdminUser = dbFacade.getDbUserDao ( ) . get ( nonAdminUser.getId ( ) ) ; org.junit.Assert.assertFalse ( nonAdminUser.isAdmin ( ) ) ; org.ovirt.engine.core.common.businessentities.Permission perms = new org.ovirt.engine.core.common.businessentities.Permission ( ) ; perms.setRoleType ( RoleType.ADMIN ) ; perms.setRoleId ( org.ovirt.engine.core.dao.DbUserDaoTest.ADMIN_ROLE_TYPE_FROM_FIXTURE_ID ) ; perms.setAdElementId ( nonAdminUser.getId ( ) ) ; perms.setObjectId ( org.ovirt.engine.core.dao.DbUserDaoTest.SYSTEM_OBJECT_ID ) ; perms.setObjectType ( VdcObjectType.System ) ; permissionDao.save ( perms ) ; org.junit.Assert.assertNotNull ( permissionDao.get ( perms.getId ( ) ) ) ; dao.updateLastAdminCheckStatus ( nonAdminUser.getId ( ) ) ; nonAdminUser = dao.get ( nonAdminUser.getId ( ) ) ; org.junit.Assert.assertTrue ( nonAdminUser.isAdmin ( ) ) ; }
Source:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createHibernationMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.memory.MemoryUtils.createMemoryDisk ( vm , storageType ) ; image.setDiskAlias ( org.ovirt.engine.core.bll.memory.MemoryUtils.generateHibernationMemoryDiskAlias ( vm.getName ( ) ) ) ; image.setDescription ( org.ovirt.engine.core.bll.memory.MemoryUtils.VM_HIBERNATION_MEMORY_DISK_DESCRIPTION ) ; return image ; }

Target:
public static org.ovirt.engine.core.common.businessentities.storage.DiskImage createHibernationMemoryDisk ( org.ovirt.engine.core.common.businessentities.VM vm , org.ovirt.engine.core.common.businessentities.storage.StorageType storageType , org.ovirt.engine.core.bll.utils.VmOverheadCalculator vmOverheadCalculator ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage image = org.ovirt.engine.core.bll.memory.MemoryUtils.createMemoryDisk ( vm , storageType , vmOverheadCalculator ) ; image.setDiskAlias ( org.ovirt.engine.core.bll.memory.MemoryUtils.generateHibernationMemoryDiskAlias ( vm.getName ( ) ) ) ; image.setDescription ( org.ovirt.engine.core.bll.memory.MemoryUtils.VM_HIBERNATION_MEMORY_DISK_DESCRIPTION ) ; return image ; }
Source:
public void testInputDataOk ( ) { org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery query = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.ConfigureConsoleOptionsQuery ( new org.ovirt.engine.core.common.queries.ConfigureConsoleOptionsParams ( getValidOptions ( GraphicsType.SPICE ) , false ) ) ) ; org.mockito.Mockito.doReturn ( mockVm ( GraphicsType.SPICE ) ) . when ( query ) . getCachedVm ( ) ; org.junit.Assert.assertTrue ( query.validateInputs ( ) ) ; }

Target:
public void testInputDataOk ( ) { org.mockito.Mockito.when ( getQueryParameters ( ) . getOptions ( ) ) . thenReturn ( getValidOptions ( GraphicsType.SPICE ) ) ; org.mockito.Mockito.doReturn ( mockVm ( GraphicsType.SPICE ) ) . when ( getQuery ( ) ) . getCachedVm ( ) ; org.junit.Assert.assertTrue ( getQuery ( ) . validateInputs ( ) ) ; }
Source:
private void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpEntityQueryExpectations ( VdcQueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpEntityQueryExpectations ( VdcQueryType.GetCinderVolumeTypesByStorageDomainId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? java.util.Collections.emptyList ( ) : getCinderVolumeTypes ( ) ) ) ; }

Target:
private void setUpGetEntityExpectations ( boolean notFound ) throws java.lang.Exception { setUpEntityQueryExpectations ( QueryType.GetAllStorageDomains , org.ovirt.engine.core.common.queries.VdcQueryParametersBase.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , getStorageDomains ( ) ) ; setUpEntityQueryExpectations ( QueryType.GetCinderVolumeTypesByStorageDomainId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { GUIDS [ 0 ] } , ( notFound ? java.util.Collections.emptyList ( ) : getCinderVolumeTypes ( ) ) ) ; }