auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void extractBondSlave ( java.util.Map < java.lang.String , java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > > bondSlaves , org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String bondName ) { java.util.List < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > value = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ; value.add ( iface ) ; if ( bondSlaves.containsKey ( bondName ) ) { value.addAll ( bondSlaves.get ( bondName ) ) ; } bondSlaves.put ( bondName , value ) ; }

Target:
private void extractBondIfModified ( org.ovirt.engine.core.common.businessentities.VdsNetworkInterface iface , java.lang.String bondName ) { if ( ! ( bonds.containsKey ( bondName ) ) ) { bonds.put ( bondName , new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VdsNetworkInterface > ( ) ) ; } if ( interfaceWasModified ( iface ) ) { modifiedBonds.put ( bondName , iface ) ; } }
Source:
private static boolean isHostStatusOff ( org.ovirt.engine.core.common.vdscommands.VDSReturnValue returnValue ) { java.lang.String OFF = "off" ; boolean result = false ; if ( ( returnValue != null ) && ( ( returnValue.getReturnValue ( ) ) != null ) ) { org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue value = ( ( org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue ) ( returnValue.getReturnValue ( ) ) ) ; result = value.getStatus ( ) . equalsIgnoreCase ( OFF ) ; } return result ; }

Target:
protected boolean validateNetworkProviderProperties ( org.ovirt.engine.core.compat.Guid providerId , java.lang.String networkMappings ) { org.ovirt.engine.core.bll.provider.NetworkProviderValidator validator = new org.ovirt.engine.core.bll.provider.NetworkProviderValidator ( org.ovirt.engine.core.bll.VdsCommand.getProviderDao ( ) . get ( providerId ) ) ; return ( ( ( validate ( validator.providerIsSet ( ) ) ) && ( validate ( validator.providerTypeValid ( ) ) ) ) && ( validate ( validator.networkMappingsProvided ( networkMappings ) ) ) ) && ( validate ( validator.messagingBrokerProvided ( ) ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc getExternalVmList ( java.lang.String uri , java.lang.String username , java.lang.String password ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMs ( uri , username , password ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( 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.VMListReturnForXmlRpc getExternalVmList ( java.lang.String uri , java.lang.String username , java.lang.String password , java.util.List < java.lang.String > vmsNames ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getExternalVMs ( uri , username , password , vmsNames ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.VMListReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private org.ovirt.engine.core.bll.context.CompensationContext createCompensationContext ( org.ovirt.engine.core.compat.TransactionScopeOption transactionScopeOption , boolean forceCompensation ) { if ( ( transactionScopeOption == ( org.ovirt.engine.core.compat.TransactionScopeOption.Suppress ) ) && ( ! forceCompensation ) ) { return org.ovirt.engine.core.bll.context.NoOpCompensationContext.getInstance ( ) ; } org.ovirt.engine.core.bll.context.DefaultCompensationContext defaultContext = new org.ovirt.engine.core.bll.context.DefaultCompensationContext ( ) ; defaultContext.setCommandId ( commandId ) ; defaultContext.setCommandType ( getClass ( ) . getName ( ) ) ; defaultContext.setBusinessEntitySnapshotDAO ( getBusinessEntitySnapshotDAO ( ) ) ; defaultContext.setSnapshotSerializer ( org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) ) ; return defaultContext ; }

Target:
protected org.ovirt.engine.core.bll.context.DefaultCompensationContext createDefaultCompensationContext ( org.ovirt.engine.core.compat.Guid commandId ) { org.ovirt.engine.core.bll.context.DefaultCompensationContext defaultContext = new org.ovirt.engine.core.bll.context.DefaultCompensationContext ( ) ; defaultContext.setCommandId ( commandId ) ; defaultContext.setCommandType ( getClass ( ) . getName ( ) ) ; defaultContext.setBusinessEntitySnapshotDao ( getBusinessEntitySnapshotDao ( ) ) ; defaultContext.setSnapshotSerializer ( org.ovirt.engine.core.utils.SerializationFactory.getSerializer ( ) ) ; return defaultContext ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object result ) { this . stopProgress ( ) ; final java.util.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > features = ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ) ( result ) ) ; updateAddtionClusterFeatureList ( features , features ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { this . stopProgress ( ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > clusterFeatures = ( ( java.util.Set < org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature > ) ( returnValue ) ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.AdditionalFeature > featuresEnabled = new java.util.HashSet < org.ovirt.engine.core.common.businessentities.AdditionalFeature > ( ) ; for ( org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature feature : clusterFeatures ) { if ( feature.isEnabled ( ) ) { featuresEnabled.add ( feature.getFeature ( ) ) ; } } updateAddtionClusterFeatureList ( features , featuresEnabled ) ; }
Source:
public void getAllErrata ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Erratum > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetErrataForSystem , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getExternalProviderComputeResourceList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.Provider provider ) { 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.ExternalComputeResource > ( ) ; } return source ; } } ; org.ovirt.engine.core.common.queries.ProviderQueryParameters params = new org.ovirt.engine.core.common.queries.ProviderQueryParameters ( ) ; params.setProvider ( provider ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetComputeResourceFromExternalProvider , params , aQuery ) ; }
Source:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , T value , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < T > valueUpdater ) { super . onBrowserEvent ( context , parent , value , event , valueUpdater ) ; com.google.gwt.dom.client.EventTarget eventTarget = event.getEventTarget ( ) ; if ( ! ( com.google.gwt.dom.client.Element.is ( eventTarget ) ) ) { return ; } if ( BrowserEvents.CLICK.equals ( event.getType ( ) ) ) { onClick ( value ) ; } }

Target:
public void onBrowserEvent ( org.ovirt.engine.ui.common.widget.table.cell.Context context , com.google.gwt.dom.client.Element parent , C value , com.google.gwt.safehtml.shared.SafeHtml tooltipContent , com.google.gwt.dom.client.NativeEvent event , com.google.gwt.cell.client.ValueUpdater < C > valueUpdater ) { super . onBrowserEvent ( context , parent , value , tooltipContent , event , valueUpdater ) ; com.google.gwt.dom.client.EventTarget eventTarget = event.getEventTarget ( ) ; if ( ! ( com.google.gwt.dom.client.Element.is ( eventTarget ) ) ) { return ; } if ( BrowserEvents.CLICK.equals ( event.getType ( ) ) ) { onClick ( value ) ; } }
Source:
public java.lang.String getValue ( java.lang.Object object ) { return ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . getVm ( ) . getName ( ) ; }

Target:
public java.lang.String getValue ( java.lang.Object object ) { java.lang.String originalName = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . getName ( ) ; java.lang.String givenName = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.ImportVmData ) ( object ) ) . getVm ( ) . getName ( ) ; return originalName.equals ( givenName ) ? givenName : ( ( givenName + " (" ) + originalName ) + ")" ; }
Source:
public static void loadDbFacadeConfig ( ) { org.ovirt.engine.core.utils.EngineLocalConfig config = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) ; try { org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.connectionTimeout = config.getInteger ( "ENGINE_DB_CONNECTION_TIMEOUT" ) ; org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.checkInterval = config.getInteger ( "ENGINE_DB_CHECK_INTERVAL" ) ; } catch ( java.lang.Exception exception ) { org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.log.warn ( ( "Can't load connection checking parameters of DB facade, " + "will continue using the default values." ) , exception ) ; } }

Target:
public static void loadDbFacadeConfig ( ) { org.ovirt.engine.core.utils.EngineLocalConfig config = org.ovirt.engine.core.utils.EngineLocalConfig.getInstance ( ) ; try { org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.connectionTimeout = config.getInteger ( "ENGINE_DB_CONNECTION_TIMEOUT" ) ; org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.checkInterval = config.getInteger ( "ENGINE_DB_CHECK_INTERVAL" ) ; } catch ( java.lang.Exception exception ) { org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.log.warn ( ( "Can't load connection checking parameters of DB facade, " + "will continue using the default values. Error: {}" ) , exception.getMessage ( ) ) ; org.ovirt.engine.core.dal.dbbroker.DbFacadeLocator.log.debug ( "Exception" , exception ) ; } }
Source:
public static java.lang.Integer getMaxMemorySizeInMb ( org.ovirt.engine.core.common.businessentities.VmOsType osType , java.lang.String clusterVersion ) { if ( ( ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.Other ) ) || ( osType == ( org.ovirt.engine.core.common.businessentities.VmOsType.OtherLinux ) ) ) || ( osType.name ( ) . toLowerCase ( ) . endsWith ( org.ovirt.engine.core.bll.validator.VmValidationUtils.X64BIT ) ) ) { return org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VM64BitMaxMemorySizeInMB , clusterVersion ) ; } return org.ovirt.engine.core.common.config.Config.< java.lang.Integer > GetValue ( ConfigValues.VM32BitMaxMemorySizeInMB ) ; }

Target:
public static java.lang.Integer getMaxMemorySizeInMb ( int osId , org.ovirt.engine.core.compat.Version clusterVersion ) { return org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . get ( org.ovirt.engine.core.common.osinfo.OsRepository.class ) . getMaximumRam ( osId , clusterVersion ) ; }
Source:
private void alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String reason ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getTargetVdsID ( ) ) ; alert.addCustomValue ( "Reason" , reason ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.Alert ( alert , logType ) ; }

Target:
private void alert ( org.ovirt.engine.core.common.AuditLogType logType , java.lang.String reason ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase alert = new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase ( ) ; alert.setVdsId ( org.ovirt.engine.core.vdsbroker.vdsbroker.FenceVdsVDSCommand.getParameters ( ) . getTargetVdsID ( ) ) ; alert.addCustomValue ( "Reason" , reason ) ; org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector.Alert ( alert , logType , auditLogDirector ) ; }
Source:
protected java.lang.Object runPublicQuery ( org.ovirt.engine.core.common.queries.QueryType queryType , org.ovirt.engine.core.common.queries.QueryParametersBase queryParams , java.lang.String sessionId ) { initQueryParams ( queryParams , sessionId ) ; org.ovirt.engine.core.common.queries.VdcQueryReturnValue result = backend.runPublicQuery ( queryType , queryParams ) ; return ( result != null ) && ( result.getSucceeded ( ) ) ? result.getReturnValue ( ) : null ; }

Target:
protected java.lang.Object runPublicQuery ( org.ovirt.engine.core.common.queries.QueryType queryType , org.ovirt.engine.core.common.queries.QueryParametersBase queryParams , java.lang.String sessionId ) { initQueryParams ( queryParams , sessionId ) ; org.ovirt.engine.core.common.queries.QueryReturnValue result = backend.runPublicQuery ( queryType , queryParams ) ; return ( result != null ) && ( result.getSucceeded ( ) ) ? result.getReturnValue ( ) : null ; }
Source:
public java.lang.Void runInTransaction ( ) { buildChildCommandInfos ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > entry : childCommandInfoMap.entrySet ( ) ) { org.ovirt.engine.core.bll.CommandBase < ? > command = getBackendCommandObjectsHandler ( ) . createAction ( entry.getValue ( ) . getFirst ( ) , entry.getValue ( ) . getSecond ( ) ) ; command.insertAsyncTaskPlaceHolders ( ) ; childCommandsMap.put ( entry.getKey ( ) , command ) ; } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { buildChildCommandInfos ( ) ; for ( java.util.Map.Entry < org.ovirt.engine.core.compat.Guid , org.ovirt.engine.core.common.utils.Pair < org.ovirt.engine.core.common.action.VdcActionType , org.ovirt.engine.core.common.action.VdcActionParametersBase > > entry : childCommandInfoMap.entrySet ( ) ) { org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.utils.BackendUtils.getBackendCommandObjectsHandler ( log ) . createAction ( entry.getValue ( ) . getFirst ( ) , entry.getValue ( ) . getSecond ( ) , context ) ; command.insertAsyncTaskPlaceHolders ( ) ; childCommandsMap.put ( entry.getKey ( ) , command ) ; } return null ; }
Source:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.RemoveCpuProfile , org.ovirt.engine.core.common.action.CpuProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
protected void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpEntityQueryExpectations ( 2 , 0 , false ) ; setUriInfo ( setUpActionExpectations ( ActionType.RemoveCpuProfile , org.ovirt.engine.core.common.action.CpuProfileParameters.class , new java.lang.String [ ] { } , new java.lang.Object [ ] { } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
private void setCookie ( final javax.servlet.http.HttpServletResponse response , final javax.servlet.ServletContext servletContext , final java.util.Locale userLocale ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.LocaleFilter.LOCALE , userLocale.toString ( ) ) ; cookie.setPath ( servletContext.getContextPath ( ) ) ; cookie.setMaxAge ( java.lang.Integer.MAX_VALUE ) ; response.addCookie ( cookie ) ; }

Target:
private void setCookie ( final javax.servlet.http.HttpServletResponse response , final javax.servlet.ServletContext servletContext , final java.util.Locale userLocale ) { javax.servlet.http.Cookie cookie = new javax.servlet.http.Cookie ( org.ovirt.engine.core.utils.servlet.LocaleFilter.LOCALE , userLocale.toString ( ) ) ; cookie.setPath ( org.ovirt.engine.core.utils.servlet.LocaleFilter.ROOT_PATH ) ; cookie.setMaxAge ( java.lang.Integer.MAX_VALUE ) ; response.addCookie ( cookie ) ; }
Source:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmId ( ) ) != null ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return null ; }

Target:
protected java.util.Map < java.lang.String , org.ovirt.engine.core.common.utils.Pair < java.lang.String , java.lang.String > > getExclusiveLocks ( ) { if ( ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getParameters ( ) . isLockVm ( ) ) && ( ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmId ( ) ) != null ) ) { return java.util.Collections.singletonMap ( org.ovirt.engine.core.bll.UpdateVmVersionCommand.getVmId ( ) . toString ( ) , org.ovirt.engine.core.bll.LockMessagesMatchUtil.makeLockingPair ( LockingGroup.VM , EngineMessage.ACTION_TYPE_FAILED_OBJECT_LOCKED ) ) ; } return null ; }
Source:
public void customPropertiesNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_NOT_SUPPORTED , network.getName ( ) ) ; }

Target:
public void customPropertiesNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createManagementNetwork ( ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setCustomProperties ( createCustomProperties ( ) ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) ) ; validateAndExpectViolation ( helper , EngineMessage.ACTION_TYPE_FAILED_NETWORK_CUSTOM_PROPERTIES_NOT_SUPPORTED , network.getName ( ) ) ; }
Source:
private void addHostsToCluster ( ) { org.ovirt.engine.core.common.businessentities.VDS host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList < > ( ) ; hosts.add ( host ) ; org.mockito.Mockito.when ( vdsDao.getAllForStoragePool ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( hosts ) ; }

Target:
private void addHostsToCluster ( ) { org.ovirt.engine.core.common.businessentities.VDS host = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hosts = new java.util.ArrayList < > ( ) ; hosts.add ( host ) ; org.mockito.Mockito.when ( vdsDao.getAllForStoragePool ( org.mockito.ArgumentMatchers.any ( ) ) ) . thenReturn ( hosts ) ; }
Source:
private void executeActionInTransactionScope ( ) { if ( ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.registerRollbackHandler ( this ) ; } if ( ! ( executeWithoutTransaction ( ) ) ) { if ( ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) == null ) { cancelTasks ( ) ; } org.ovirt.engine.core.utils.transaction.TransactionSupport.setRollbackOnly ( ) ; } }

Target:
protected void registerRollbackHandler ( org.ovirt.engine.core.utils.transaction.TransactionCompletionListener transactionCompletionListener ) { if ( ( org.ovirt.engine.core.utils.transaction.TransactionSupport.current ( ) ) != null ) { org.ovirt.engine.core.utils.transaction.TransactionSupport.registerRollbackHandler ( transactionCompletionListener ) ; } }
Source:
private void postInitTemplate ( java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > templates ) { java.util.List < org.ovirt.engine.core.common.businessentities.VmTemplate > baseTemplates = filterNotBaseTemplates ( templates ) ; org.ovirt.engine.core.common.businessentities.VmTemplate prevBaseTemplate = getModel ( ) . getBaseTemplate ( ) . getSelectedItem ( ) ; getModel ( ) . getBaseTemplate ( ) . setItems ( baseTemplates ) ; getModel ( ) . getBaseTemplate ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.Linq.firstOrDefault ( baseTemplates , new org.ovirt.engine.ui.uicommonweb.Linq.TemplatePredicate ( ( prevBaseTemplate != null ? prevBaseTemplate.getId ( ) : org.ovirt.engine.core.compat.Guid.Empty ) ) ) ) ; updateIsDisksAvailable ( ) ; }

Target:
public void templateWithVersion_SelectedItemChanged ( ) { org.ovirt.engine.ui.uicommonweb.models.templates.TemplateWithVersion selectedTemplateWithVersion = getModel ( ) . getTemplateWithVersion ( ) . getSelectedItem ( ) ; if ( selectedTemplateWithVersion != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate selectedTemplate = selectedTemplateWithVersion.getTemplateVersion ( ) ; selectedTemplateChanged ( selectedTemplate ) ; } }
Source:
private void initEditors ( ) { statusEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabelEditor ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer ( ) , new org.ovirt.engine.ui.common.widget.parser.EntityModelParser ( ) ) ; clientsTable = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable < org.ovirt.engine.ui.uicommonweb.models.ListModel > ( false , true ) ; memoryPoolsTable = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable < org.ovirt.engine.ui.uicommonweb.models.ListModel > ( false , true ) ; }

Target:
private void initEditors ( ) { statusEditor = new org.ovirt.engine.ui.common.widget.editor.generic.EntityModelLabelEditor < org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus > ( new org.ovirt.engine.ui.common.widget.renderer.EnumRenderer < org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus > ( ) , new com.google.gwt.text.shared.Parser < org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus > ( ) { @ java.lang.Override public org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus parse ( java.lang.CharSequence text ) throws java.text.ParseException { return org.ovirt.engine.core.common.businessentities.gluster.GlusterStatus.valueOf ( text.toString ( ) . toUpperCase ( ) ) ; } } ) ; clientsTable = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable < org.ovirt.engine.ui.uicommonweb.models.ListModel > ( false , true ) ; memoryPoolsTable = new org.ovirt.engine.ui.common.widget.editor.EntityModelCellTable < org.ovirt.engine.ui.uicommonweb.models.ListModel > ( false , true ) ; }
Source:
protected org.ovirt.engine.api.model.DataCenter populate ( org.ovirt.engine.api.model.DataCenter model , org.ovirt.engine.core.common.businessentities.storage_pool entity ) { org.ovirt.engine.core.common.queries.GetAvailableStoragePoolVersionsParameters parameters = new org.ovirt.engine.core.common.queries.GetAvailableStoragePoolVersionsParameters ( ) ; parameters.setStoragePoolId ( new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) ; model.setSupportedVersions ( getMapper ( java.util.List.class , org.ovirt.engine.api.model.SupportedVersions.class ) . map ( getEntity ( java.util.ArrayList.class , VdcQueryType.GetAvailableStoragePoolVersions , parameters , model.getId ( ) ) , null ) ) ; return model ; }

Target:
protected org.ovirt.engine.api.model.DataCenter deprecatedPopulate ( org.ovirt.engine.api.model.DataCenter model , org.ovirt.engine.core.common.businessentities.storage_pool entity ) { org.ovirt.engine.core.common.queries.GetAvailableStoragePoolVersionsParameters parameters = new org.ovirt.engine.core.common.queries.GetAvailableStoragePoolVersionsParameters ( ) ; parameters.setStoragePoolId ( new org.ovirt.engine.core.compat.Guid ( model.getId ( ) ) ) ; model.setSupportedVersions ( getMapper ( java.util.List.class , org.ovirt.engine.api.model.SupportedVersions.class ) . map ( getEntity ( java.util.ArrayList.class , VdcQueryType.GetAvailableStoragePoolVersions , parameters , model.getId ( ) ) , null ) ) ; return model ; }
Source:
protected void mockOsRepository ( ) { org.ovirt.engine.core.common.utils.SimpleDependecyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.ovirt.engine.core.bll.VmHandler.init ( ) ; org.mockito.Mockito.when ( osRepository.isWindows ( 0 ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.isCpuSupported ( org.mockito.Matchers.anyInt ( ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) , org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( true ) ; }

Target:
protected void mockOsRepository ( ) { org.ovirt.engine.core.common.utils.SimpleDependencyInjector.getInstance ( ) . bind ( org.ovirt.engine.core.common.osinfo.OsRepository.class , osRepository ) ; org.ovirt.engine.core.bll.VmHandler.init ( ) ; org.mockito.Mockito.when ( osRepository.isWindows ( 0 ) ) . thenReturn ( true ) ; org.mockito.Mockito.when ( osRepository.isCpuSupported ( org.mockito.Matchers.anyInt ( ) , org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Version.class ) , org.mockito.Matchers.anyString ( ) ) ) . thenReturn ( true ) ; }
Source:
public void testDifferentCluster ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "5" ) ; hostedEngine.setVmMemSizeMb ( 7000 ) ; hostedEngine.setClusterId ( Guid.SYSTEM ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.Assert.assertEquals ( 5 , result.size ( ) ) ; }

Target:
public void testDifferentCluster ( ) { parameters.put ( PolicyUnitParameter.HE_SPARES_COUNT.getDbName ( ) , "5" ) ; hostedEngine.setVmMemSizeMb ( 7000 ) ; hostedEngine.setClusterId ( Guid.SYSTEM ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > result = policyUnit.filter ( cluster , hosts , vm , parameters , messages ) ; org.junit.jupiter.api.Assertions.assertEquals ( 5 , result.size ( ) ) ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allNics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( returnValue2 ) ) ; this . allNics = allNics ; queryFreeBonds ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValueObj ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue returnValue = ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValueObj ) ) ; java.lang.Object returnValue2 = returnValue.getReturnValue ( ) ; this . allNics = ( ( java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ) ( returnValue2 ) ) ; queryNetworkAttachments ( ) ; }
Source:
public java.lang.Integer getmem_shared_percent ( ) { java.lang.Long shared = mVdsStatistics.getmem_shared ( ) ; java.lang.Integer physical = mVdsDynamic.getphysical_mem_mb ( ) ; if ( ( ( shared == null ) || ( physical == null ) ) || ( physical == 0 ) ) { return 0 ; } return ( ( int ) ( shared * 100 ) ) / physical ; }

Target:
public java.lang.Integer getMemSharedPercent ( ) { java.lang.Long shared = mVdsStatistics.getmem_shared ( ) ; java.lang.Integer physical = mVdsDynamic.getphysical_mem_mb ( ) ; if ( ( ( shared == null ) || ( physical == null ) ) || ( physical == 0 ) ) { return 0 ; } return ( ( int ) ( shared * 100 ) ) / physical ; }
Source:
public void convertValidPropertiesToString ( ) { org.ovirt.engine.core.common.utils.customprop.CustomPropertiesUtils utils = new org.ovirt.engine.core.common.utils.customprop.CustomPropertiesUtils ( ) ; java.util.Map < java.lang.String , java.lang.String > propMap = new java.util.LinkedHashMap < > ( ) ; propMap.put ( "speed" , "1024" ) ; propMap.put ( "duplex" , "half" ) ; propMap.put ( "debug" , null ) ; propMap.put ( "verbose" , "" ) ; java.lang.String propStr = utils.convertProperties ( propMap ) ; org.junit.Assert.assertEquals ( "speed=1024;duplex=half;debug=;verbose=" , propStr ) ; }

Target:
public void convertValidPropertiesToString ( ) { org.ovirt.engine.core.common.utils.customprop.CustomPropertiesUtils utils = new org.ovirt.engine.core.common.utils.customprop.CustomPropertiesUtils ( ) ; java.util.Map < java.lang.String , java.lang.String > propMap = new java.util.LinkedHashMap < > ( ) ; propMap.put ( "speed" , "1024" ) ; propMap.put ( "duplex" , "half" ) ; propMap.put ( "debug" , null ) ; propMap.put ( "verbose" , "" ) ; java.lang.String propStr = utils.convertProperties ( propMap ) ; org.junit.jupiter.api.Assertions.assertEquals ( "speed=1024;duplex=half;debug=;verbose=" , propStr ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.irsbroker.FileStatsReturnForXmlRpc getIsoList ( java.lang.String spUUID ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "StoragePool.getIsoList" ) . withParameter ( "storagepoolID" , spUUID ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "isolist" ) . withResponseType ( java.lang.Object [ ] . class ) ; return new org.ovirt.engine.core.vdsbroker.irsbroker.FileStatsReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneMapReturnForXmlRpc get_image_transfer_session_stats ( java.lang.String ticketId ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "Host.get_image_transfer_session_stats" ) . withParameter ( "ticketUUID" , ticketId ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) . withResponseKey ( "statsMap" ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.OneMapReturnForXmlRpc ( response ) ; }
Source:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource getQuotaVdsGroupParameterMap ( org.ovirt.engine.core.compat.Guid quotaId , org.ovirt.engine.core.common.businessentities.QuotaVdsGroup quotaVdsGroup ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource vdsGroupQuotaParameterMap = createQuotaIdParameterMapper ( quotaVdsGroup.getQuotaVdsGroupId ( ) ) . addValue ( "quota_id" , quotaId ) . addValue ( "vds_group_id" , quotaVdsGroup.getVdsGroupId ( ) ) . addValue ( "storage_id" , null ) . addValue ( "storage_size_gb" , null ) . addValue ( "virtual_cpu" , quotaVdsGroup.getVirtualCpu ( ) ) . addValue ( "mem_size_mb" , quotaVdsGroup.getMemSizeMB ( ) ) ; return vdsGroupQuotaParameterMap ; }

Target:
private org.springframework.jdbc.core.namedparam.MapSqlParameterSource getQuotaClusterParameterMap ( org.ovirt.engine.core.compat.Guid quotaId , org.ovirt.engine.core.common.businessentities.QuotaCluster quotaCluster ) { org.springframework.jdbc.core.namedparam.MapSqlParameterSource clusterQuotaParameterMap = createQuotaIdParameterMapper ( quotaCluster.getQuotaClusterId ( ) ) . addValue ( "quota_id" , quotaId ) . addValue ( "cluster_id" , quotaCluster.getClusterId ( ) ) . addValue ( "storage_id" , null ) . addValue ( "storage_size_gb" , null ) . addValue ( "virtual_cpu" , quotaCluster.getVirtualCpu ( ) ) . addValue ( "mem_size_mb" , quotaCluster.getMemSizeMB ( ) ) ; return clusterQuotaParameterMap ; }
Source:
private void start ( ) { if ( ( getSelectedItems ( ) ) == null ) { return ; } 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.gluster.GlusterVolumeEntity volume = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeActionParameters ( volume.getId ( ) , false ) ) ; } org.ovirt.engine.ui.frontend.Frontend.RunMultipleAction ( VdcActionType.StartGlusterVolume , list ) ; }

Target:
private void start ( ) { if ( ( getSelectedItems ( ) ) == null ) { return ; } 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.gluster.GlusterVolumeEntity volume = ( ( org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity ) ( item ) ) ; list.add ( new org.ovirt.engine.core.common.action.gluster.GlusterVolumeActionParameters ( volume.getId ( ) , false ) ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runMultipleAction ( VdcActionType.StartGlusterVolume , list ) ; }
Source:
public void networkExists ( ) { simulateVdsGroupExists ( ) ; org.mockito.Mockito.when ( mockNetworkDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getNetwork ( ) ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( param.getNetworkCluster ( ) . getId ( ) ) ) . thenReturn ( param.getNetworkCluster ( ) ) ; assertCanDoActionFailure ( EngineMessage.NETWORK_ALREADY_ATTACHED_TO_CLUSTER.toString ( ) ) ; }

Target:
public void networkExists ( ) { simulateVdsGroupExists ( ) ; org.mockito.Mockito.when ( mockNetworkDao.get ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( getNetwork ( ) ) ; org.mockito.Mockito.when ( mockNetworkClusterDao.get ( param.getNetworkCluster ( ) . getId ( ) ) ) . thenReturn ( param.getNetworkCluster ( ) ) ; assertValidateFailure ( EngineMessage.NETWORK_ALREADY_ATTACHED_TO_CLUSTER.toString ( ) ) ; }
Source:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void getStorageDomainDefaultWipeAfterDelete ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.StorageType storageType ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter < java.lang.Boolean > ( ) { @ java.lang.Override public java.lang.Boolean Convert ( java.lang.Object returnValue , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return ( ( java.lang.Boolean ) ( returnValue ) ) ; } } ; org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters params = new org.ovirt.engine.core.common.queries.GetStorageDomainDefaultWipeAfterDeleteParameters ( storageType ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainDefaultWipeAfterDelete , params , aQuery ) ; }
Source:
private void nameNotChangedOrNotTakenTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.ovirt.engine.core.common.businessentities.network.NetworkQoS otherQos = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; allQos.add ( otherQos ) ; allQos.add ( oldQos ) ; otherQos.setName ( "foo" ) ; oldQos.setName ( "bar" ) ; org.junit.Assert.assertThat ( validator.nameNotChangedOrNotTaken ( ) , matcher ) ; }

Target:
private void nameNotChangedOrNotTakenTest ( org.hamcrest.Matcher < org.ovirt.engine.core.bll.ValidationResult > matcher ) { org.ovirt.engine.core.common.businessentities.network.NetworkQoS otherQos = new org.ovirt.engine.core.common.businessentities.network.NetworkQoS ( ) ; allQos.add ( otherQos ) ; allQos.add ( oldQos ) ; otherQos.setName ( "foo" ) ; oldQos.setName ( "bar" ) ; org.hamcrest.MatcherAssert.assertThat ( validator.nameNotChangedOrNotTaken ( ) , matcher ) ; }
Source:
public com.google.gwt.event.dom.client.HasClickHandlers addRunButton ( org.ovirt.engine.ui.uicommonweb.models.userportal.UserPortalItemModel model , org.ovirt.engine.ui.uicommonweb.UICommand command ) { org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton button = new org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton ( ( model.getIsPool ( ) ? constants.takeVm ( ) : constants.runVm ( ) ) , resources.playIcon ( ) , resources.playDisabledIcon ( ) , style.runButtonAdditionalStyle ( ) ) ; button.setElementId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , "runButton" ) ) ; addButtonToPanel ( button ) ; updateButton ( button , command ) ; return button ; }

Target:
public com.google.gwt.event.dom.client.HasClickHandlers addRunButton ( ) { org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton button = new org.ovirt.engine.ui.userportal.widget.basic.MainTabBasicListItemActionButton ( null , resources.playIcon ( ) , resources.playDisabledIcon ( ) , style.runButtonAdditionalStyle ( ) ) ; button.setElementId ( org.ovirt.engine.ui.common.utils.ElementIdUtils.createElementId ( elementId , "runButton" ) ) ; this . runButton = button ; addButtonToPanel ( button ) ; return button ; }
Source:
public static 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.RunQuery ( VdcQueryType.GetHostsForStorageOperation , new org.ovirt.engine.core.common.queries.GetHostsForStorageOperationParameters ( storagePoolId , localFsOnly ) , aQuery ) ; }

Target:
public static 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.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 ) ; }
Source:
public java.util.Map < java.lang.String , java.lang.String > getVMProperties ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.VmStatic vmStatic ) { separateCustomPropertiesToUserAndPredefined ( version , vmStatic ) ; java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; getPredefinedProperties ( version , vmStatic , map ) ; getUserDefinedProperties ( version , vmStatic , map ) ; return map ; }

Target:
public java.util.Map < java.lang.String , java.lang.String > getVMProperties ( org.ovirt.engine.core.compat.Version version , org.ovirt.engine.core.common.businessentities.VmBase vmBase ) { separateCustomPropertiesToUserAndPredefined ( version , vmBase ) ; java.util.Map < java.lang.String , java.lang.String > map = new java.util.HashMap < java.lang.String , java.lang.String > ( ) ; getPredefinedProperties ( version , vmBase , map ) ; getUserDefinedProperties ( version , vmBase , map ) ; return map ; }
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:
private void refreshCapabilities ( ) { 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.RefreshHostCapabilities , list , new org.ovirt.engine.ui.uicompat.IFrontendMultipleActionAsyncCallback ( ) { @ java.lang.Override public void executed ( org.ovirt.engine.ui.uicompat.FrontendMultipleActionAsyncResult result ) { } } , null ) ; }
Source:
public void attestationServerNotConfiguredProperly ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AttestationServer , StringUtils.EMPTY ) ; org.mockito.Mockito.when ( cluster.supportsTrustedService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster ) ; org.junit.Assert.assertThat ( validator.attestationServerConfigured ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_GROUP_CANNOT_SET_TRUSTED_ATTESTATION_SERVER_NOT_CONFIGURED ) ) ; }

Target:
public void attestationServerNotConfiguredProperly ( ) { mockConfigRule.mockConfigValue ( ConfigValues.AttestationServer , StringUtils.EMPTY ) ; org.mockito.Mockito.when ( cluster.supportsTrustedService ( ) ) . thenReturn ( true ) ; validator = new org.ovirt.engine.core.bll.validator.ClusterValidator ( dbFacade , cluster , cpuFlagsManagerHandler ) ; org.junit.Assert.assertThat ( validator.attestationServerConfigured ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.VDS_GROUP_CANNOT_SET_TRUSTED_ATTESTATION_SERVER_NOT_CONFIGURED ) ) ; }
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.RunQuery ( VdcQueryType.GetAllNetworks , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dataCenterId ) , aQuery ) ; }

Target:
public static void getVmTemplatesWithPermittedAction ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.common.businessentities.ActionGroup actionGroup ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.TemplateConverter ( ) ; org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters getEntitiesWithPermittedActionParameters = new org.ovirt.engine.core.common.queries.GetEntitiesWithPermittedActionParameters ( ) ; getEntitiesWithPermittedActionParameters.setActionGroup ( actionGroup ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmTemplatesWithPermittedAction , getEntitiesWithPermittedActionParameters , aQuery ) ; }
Source:
protected void setUpGetSystemStatisticsExpectations ( ) { org.ovirt.engine.core.common.queries.VdcQueryReturnValue queryResult = new org.ovirt.engine.core.common.queries.VdcQueryReturnValue ( ) ; org.mockito.Mockito.when ( backend.runQuery ( org.mockito.Mockito.eq ( QueryType.GetSystemStatistics ) , queryParams ( ) ) ) . thenReturn ( queryResult ) ; queryResult.setSucceeded ( true ) ; queryResult.setReturnValue ( setUpStats ( ) ) ; }

Target:
protected void setUpGetSystemStatisticsExpectations ( ) { org.ovirt.engine.core.common.queries.QueryReturnValue queryResult = new org.ovirt.engine.core.common.queries.QueryReturnValue ( ) ; org.mockito.Mockito.when ( backend.runQuery ( org.mockito.Mockito.eq ( QueryType.GetSystemStatistics ) , queryParams ( ) ) ) . thenReturn ( queryResult ) ; queryResult.setSucceeded ( true ) ; queryResult.setReturnValue ( setUpStats ( ) ) ; }