<commit_before>package fr.openwide.core.wicket.more.config.spring;

import org.apache.wicket.protocol.http.WebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import fr.openwide.core.jpa.exception.ServiceException;
import fr.openwide.core.jpa.more.rendering.service.IRendererService;
import fr.openwide.core.wicket.more.link.service.DefaultLinkParameterConversionService;
import fr.openwide.core.wicket.more.link.service.ILinkParameterConversionService;
import fr.openwide.core.wicket.more.notification.service.IHtmlNotificationCssService;
import fr.openwide.core.wicket.more.notification.service.IWicketContextExecutor;
import fr.openwide.core.wicket.more.notification.service.PhlocCssHtmlNotificationCssServiceImpl;
import fr.openwide.core.wicket.more.notification.service.WicketContextExecutorImpl;
import fr.openwide.core.wicket.more.rendering.service.RendererServiceImpl;

@Configuration
@Import({
	WicketMoreServiceConfig.class,
	WicketMoreApplicationPropertyRegistryConfig.class
})
public abstract class AbstractWebappConfig {

	@Bean
	public abstract WebApplication application();
	
	@Bean
	public IWicketContextExecutor wicketContextExecutor(WebApplication defaultApplication) {
		return new WicketContextExecutorImpl(defaultApplication.getName());
	}
	
	@Bean
	public IRendererService rendererService(IWicketContextExecutor wicketContextExecutor) {
		return new RendererServiceImpl(wicketContextExecutor);
	}
	
	@Bean
	public ILinkParameterConversionService linkParameterConversionService() {
		return new DefaultLinkParameterConversionService();
	}
	
	@Bean
	public IHtmlNotificationCssService htmlNotificationCssService() throws ServiceException {<commit_msg>Fixed a circular dependency issue<commit_after>package fr.openwide.core.wicket.more.config.spring;

import org.apache.wicket.protocol.http.WebApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.Lazy;

import fr.openwide.core.jpa.exception.ServiceException;
import fr.openwide.core.jpa.more.rendering.service.IRendererService;
import fr.openwide.core.wicket.more.link.service.DefaultLinkParameterConversionService;
import fr.openwide.core.wicket.more.link.service.ILinkParameterConversionService;
import fr.openwide.core.wicket.more.notification.service.IHtmlNotificationCssService;
import fr.openwide.core.wicket.more.notification.service.IWicketContextExecutor;
import fr.openwide.core.wicket.more.notification.service.PhlocCssHtmlNotificationCssServiceImpl;
import fr.openwide.core.wicket.more.notification.service.WicketContextExecutorImpl;
import fr.openwide.core.wicket.more.rendering.service.RendererServiceImpl;

@Configuration
@Import({
	WicketMoreServiceConfig.class,
	WicketMoreApplicationPropertyRegistryConfig.class
})
public abstract class AbstractWebappConfig {

	@Bean
	public abstract WebApplication application();
	
	@Bean
	// @Lazy on defaultApplication fixes a circular dependency
	public IWicketContextExecutor wicketContextExecutor(@Lazy WebApplication defaultApplication) {
		return new WicketContextExecutorImpl(defaultApplication.getName());
	}
	
	@Bean
	public IRendererService rendererService(IWicketContextExecutor wicketContextExecutor) {
		return new RendererServiceImpl(wicketContextExecutor);
	}
	
	@Bean
	public ILinkParameterConversionService linkParameterConversionService() {
		return new DefaultLinkParameterConversionService();
	}
	
	@Bean
	public IHtmlNotificationCssService htmlNotificationCssService() throws ServiceException {
{'fraction_non_alphanumeric': 0.08039529914529915, 'fraction_numerical': 0.0, 'mean_word_length': 7.937947494033413, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7666789', 'n_tokens_mistral': 1032, 'n_tokens_neox': 1004, 'n_words': 154}