<commit_before>/*
 * Copyright 2014 satrapu.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ro.satrapu.churchmanagement.ui.messages;

import org.slf4j.Logger;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ResourceBundle;

/**
 * Displays localized {@link FacesMessage} instances.
 *
 * @author satrapu
 */
public class Messages implements Serializable {
    private static final long serialVersionUID = 1L;
    private static final String MESSAGE_KEY_NOT_FOUND = "???{0}???";
    private ResourceBundle resourceBundle;
    private FacesContext facesContext;
    private Logger logger;

    @Inject
    public Messages(@NotNull ResourceBundle resourceBundle,
                    @NotNull FacesContext facesContext,
                    @NotNull Logger logger) {
        this.resourceBundle = resourceBundle;
        this.facesContext = facesContext;
        this.logger = logger;
    }

    public void addInfo(String messageKey, Object... arguments) {<commit_msg>Fixed class comment in order to clarify the purpose of the former.<commit_after>/*
 * Copyright 2014 satrapu.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package ro.satrapu.churchmanagement.ui.messages;

import org.slf4j.Logger;

import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.ResourceBundle;

/**
 * Adds localized {@link FacesMessage} instances to the current JSF context.
 *
 * @author satrapu
 */
public class Messages implements Serializable {
    private static final long serialVersionUID = 1L;
    private static final String MESSAGE_KEY_NOT_FOUND = "???{0}???";
    private ResourceBundle resourceBundle;
    private FacesContext facesContext;
    private Logger logger;

    @Inject
    public Messages(@NotNull ResourceBundle resourceBundle,
                    @NotNull FacesContext facesContext,
                    @NotNull Logger logger) {
        this.resourceBundle = resourceBundle;
        this.facesContext = facesContext;
        this.logger = logger;
    }

    public void addInfo(String messageKey, Object... arguments) {
{'fraction_non_alphanumeric': 0.07837995337995338, 'fraction_numerical': 0.00641025641025641, 'mean_word_length': 3.6771117166212535, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '4670490', 'n_tokens_mistral': 898, 'n_tokens_neox': 873, 'n_words': 328}