<commit_before>package org.grails.msgpack

import org.grails.msgpack.template.builder.GrailsDomainModelTemplateBuilderSelector;
import org.grails.msgpack.template.builder.GroovyBeansTemplateBuilderSelector
import org.msgpack.MessagePack
import org.grails.msgpack.template.EntityFieldReaderFactory;
import org.grails.msgpack.template.GroovyBeansFieldEntryReader
import org.msgpack.template.builder.BeansBuildContext
import org.msgpack.template.builder.BuildContextBase
import org.msgpack.template.builder.BuildContextFactory
import org.msgpack.template.builder.BuilderSelectorRegistry
import org.msgpack.template.builder.JavassistTemplateBuilder

@Singleton
class GroovyBeansRegister {

    private GroovyBeansRegister(){
        def registory = BuilderSelectorRegistry.getInstance()

        if(!registory.contains("GrailsDomainModelTemplateBuilderSelector")){
            registory.insert(0, new GrailsDomainModelTemplateBuilderSelector(
                    new JavassistTemplateBuilder(
                        EntityFieldReaderFactory.getGrailsDomainModelFieldEntryReader(),
                    new BuildContextFactory() {<commit_msg>fixes the wrong selector name<commit_after>package org.grails.msgpack

import org.grails.msgpack.template.builder.GrailsDomainModelTemplateBuilderSelector;
import org.grails.msgpack.template.builder.GroovyBeansTemplateBuilderSelector
import org.msgpack.MessagePack
import org.grails.msgpack.template.EntityFieldReaderFactory;
import org.grails.msgpack.template.GroovyBeansFieldEntryReader
import org.msgpack.template.builder.BeansBuildContext
import org.msgpack.template.builder.BuildContextBase
import org.msgpack.template.builder.BuildContextFactory
import org.msgpack.template.builder.BuilderSelectorRegistry
import org.msgpack.template.builder.JavassistTemplateBuilder

@Singleton
class GroovyBeansRegister {

    private GroovyBeansRegister(){
        def registory = BuilderSelectorRegistry.getInstance()

        if(!registory.contains(GrailsDomainModelTemplateBuilderSelector.NAME)){
            registory.insert(0, new GrailsDomainModelTemplateBuilderSelector(
                    new JavassistTemplateBuilder(
                        EntityFieldReaderFactory.getGrailsDomainModelFieldEntryReader(),
                    new BuildContextFactory() {
{'fraction_non_alphanumeric': 0.06672481465329264, 'fraction_numerical': 0.0008722197993894462, 'mean_word_length': 5.036842105263158, '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': '977269', 'n_tokens_mistral': 607, 'n_tokens_neox': 572, 'n_words': 82}