<commit_before>package net.pdp7.v2f.core;

import java.sql.SQLException;

import javax.sql.DataSource;

import org.jooq.DSLContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.thymeleaf.spring4.view.ThymeleafViewResolver;

import schemacrawler.schema.Catalog;
import schemacrawler.schemacrawler.SchemaCrawlerException;
import schemacrawler.schemacrawler.SchemaCrawlerOptions;
import schemacrawler.utility.SchemaCrawlerUtility;

@Configuration
public class DefaultConfiguration {

	@Bean
	public Router router() {
		return new Router(listHandler(), detailHandler());
	}

	@Bean
	public ListHandler listHandler() {
		return new ListHandler(dslContext, viewResolver, localeResolver(), catalog());
	}

	@Bean
	public DetailHandler detailHandler() {
		return new DetailHandler(dslContext, viewResolver, localeResolver(), catalog());
	}

	@Bean
	public SaveHandler saveHandler() {
		return new SaveHandler(dslContext);
	}

	@Bean
	public LocaleResolver localeResolver() {
		return new LocaleResolver();
	}

	@Bean
	public Object dummyCircular() {
		listHandler().setRouter(router());
		detailHandler().setRouter(router());
		return new Object();
	}

	@Bean
	public Catalog catalog() {
		try {
			SchemaCrawlerOptions options = new SchemaCrawlerOptions();
			options.setSchemaInclusionRule(s -> s.equals("v2f"));
			return SchemaCrawlerUtility.getCatalog(dataSource.getConnection(), options);
		} catch (SchemaCrawlerException | SQLException e) {
			throw new RuntimeException(e);
		}
	}

	@Autowired
	protected DataSource dataSource;

	@Autowired
	protected DSLContext dslContext;

	@Autowired
	protected ThymeleafViewResolver viewResolver;
}<commit_msg>Add FIXME about hardcoded schema name<commit_after>package net.pdp7.v2f.core;

import java.sql.SQLException;

import javax.sql.DataSource;

import org.jooq.DSLContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.thymeleaf.spring4.view.ThymeleafViewResolver;

import schemacrawler.schema.Catalog;
import schemacrawler.schemacrawler.SchemaCrawlerException;
import schemacrawler.schemacrawler.SchemaCrawlerOptions;
import schemacrawler.utility.SchemaCrawlerUtility;

@Configuration
public class DefaultConfiguration {

	@Bean
	public Router router() {
		return new Router(listHandler(), detailHandler());
	}

	@Bean
	public ListHandler listHandler() {
		return new ListHandler(dslContext, viewResolver, localeResolver(), catalog());
	}

	@Bean
	public DetailHandler detailHandler() {
		return new DetailHandler(dslContext, viewResolver, localeResolver(), catalog());
	}

	@Bean
	public SaveHandler saveHandler() {
		return new SaveHandler(dslContext);
	}

	@Bean
	public LocaleResolver localeResolver() {
		return new LocaleResolver();
	}

	@Bean
	public Object dummyCircular() {
		listHandler().setRouter(router());
		detailHandler().setRouter(router());
		return new Object();
	}

	@Bean
	public Catalog catalog() {
		try {
			SchemaCrawlerOptions options = new SchemaCrawlerOptions();
			// FIXME: configurable schema
			options.setSchemaInclusionRule(s -> s.equals("v2f"));
			return SchemaCrawlerUtility.getCatalog(dataSource.getConnection(), options);
		} catch (SchemaCrawlerException | SQLException e) {
			throw new RuntimeException(e);
		}
	}

	@Autowired
	protected DataSource dataSource;

	@Autowired
	protected DSLContext dslContext;

	@Autowired
	protected ThymeleafViewResolver viewResolver;
}
{'fraction_non_alphanumeric': 0.09920307776861775, 'fraction_numerical': 0.0021984061555372354, 'mean_word_length': 6.040618955512572, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6816507', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1089, 'n_words': 232}