<commit_before>package org.wisdom.validation.hibernate;

import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.module.SimpleModule;
import org.apache.felix.ipojo.annotations.*;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.wisdom.api.content.JacksonModuleRepository;

/**
 *
 */
@Component(immediate = true)
@Instantiate
public class HibernateValidatorModule {

    private final Bundle bundle;
    private final SimpleModule module;
    @Requires
    private JacksonModuleRepository repository;

    public HibernateValidatorModule(BundleContext context) {
        bundle = context.getBundle();
        module = new SimpleModule("Hibernate-Validator-Module", version());
        module.addSerializer(new ConstraintViolationSerializer());
    }

    @Validate
    public void start() {
        repository.register(module);
    }

    @Invalidate
    public void stop() {
        repository.unregister(module);
    }

    public Version version() {
        return new Version(bundle.getVersion().getMajor(), bundle.getVersion().getMinor(),
                bundle.getVersion().getMicro(), null, null, null);
    }
}<commit_msg>[TD] major<commit_after>package org.wisdom.validation.hibernate;

import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.module.SimpleModule;
import org.apache.felix.ipojo.annotations.*;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.wisdom.api.content.JacksonModuleRepository;

/**
 *
 */
@Component(immediate = true)
@Instantiate
public class HibernateValidatorModule {

    private final Bundle bundle;
    private final SimpleModule module;
    @Requires
    private JacksonModuleRepository repository;

    public HibernateValidatorModule(BundleContext context) {
        bundle = context.getBundle();
        module = new SimpleModule("Hibernate-Validator-Module", version());
        module.addSerializer(new ConstraintViolationSerializer());
    }

    @Validate
    public void start() {
        repository.register(module);
    }

    @Invalidate
    public void stop() {
        repository.unregister(module);
    }

    public final Version version() {
        return new Version(bundle.getVersion().getMajor(), bundle.getVersion().getMinor(),
                bundle.getVersion().getMicro(), null, null, null);
    }
}
{'fraction_non_alphanumeric': 0.10892333472978634, 'fraction_numerical': 0.0, 'mean_word_length': 3.7664670658682633, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4269799', 'n_tokens_mistral': 671, 'n_tokens_neox': 628, 'n_words': 130}