<commit_before>package de.unibremen.opensores.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 * Provisional LoginController to show usage of log4j logging.
 */

@ManagedBean
@SessionScoped
public class LoginController {

    /**
     * @todo
     */
    private static Logger log = LogManager.getLogger(LoginController.class);

    private String email;
    private String password;

    /**
     * @todo
     */
    public final String login() {
        log.error("login called");
        if (validate()) {
            log.debug("login succeeded");
            FacesMessage msg = new FacesMessage("Login success");
            FacesContext.getCurrentInstance().addMessage(null, msg);
            return "/index.xhtml";
        } else {
            log.debug("login failed");
            FacesMessage msg = new FacesMessage("Login failed");
            msg.setSeverity(FacesMessage.SEVERITY_ERROR);
            FacesContext.getCurrentInstance().addMessage(null, msg);
            return "/index.xhtml?faces-redirect=true";
        }
    }

    /**
     * @todo
     */
    private boolean validate() {
        return (email == null || password == null);
    }

    /* Getters and Setters */

    /**
     * @todo
     */
    public final String getEmail() {
        return email;
    }

    /**
     * @todo
     */
    public final void setEmail(final String mail) {
        this.email = mail;
    }

    /**
     * @todo
     */
    public final String getPassword() {
        return password;
    }

    /**
     * @todo
     */
    public final void setPassword(final String pw) {
        this.password = pw;
    }
}<commit_msg>Fix checkstyle violations in LoginController<commit_after>package de.unibremen.opensores.controller;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;

/**
 * Provisional LoginController to show usage of log4j logging.
 */

@ManagedBean
@SessionScoped
public class LoginController {
    /**
     * @todo.
     */
    private static Logger log = LogManager.getLogger(LoginController.class);

    /**
     * @todo.
     */
    private String email;

    /**
     * @todo.
     */
    private String password;

    /**
     * @todo.
     */
    public final String login() {
        log.error("login called");
        if (validate()) {
            log.debug("login succeeded");
            FacesMessage msg = new FacesMessage("Login success");
            FacesContext.getCurrentInstance().addMessage(null, msg);
            return "/index.xhtml";
        } else {
            log.debug("login failed");
            FacesMessage msg = new FacesMessage("Login failed");
            msg.setSeverity(FacesMessage.SEVERITY_ERROR);
            FacesContext.getCurrentInstance().addMessage(null, msg);
            return "/index.xhtml?faces-redirect=true";
        }
    }

    /**
     * @todo.
     */
    private boolean validate() {
        return (email == null || password == null);
    }

    /**
     * @todo.
     */
    public final String getEmail() {
        return email;
    }

    /**
     * @todo.
     */
    public final void setEmail(final String mail) {
        this.email = mail;
    }

    /**
     * @todo.
     */
    public final String getPassword() {
        return password;
    }

    /**
     * @todo.
     */
    public final void setPassword(final String pw) {
        this.password = pw;
    }
}
{'fraction_non_alphanumeric': 0.12078577117069286, 'fraction_numerical': 0.0015927794000530925, 'mean_word_length': 2.1140495867768596, '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': '6203395', 'n_tokens_mistral': 1099, 'n_tokens_neox': 1079, 'n_words': 235}