<commit_before>package ru.org.linux.site;

import java.io.Serializable;
import java.net.URLEncoder;
import java.sql.*;
import java.util.Date;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.danga.MemCached.MemCachedClient;
import org.apache.commons.codec.binary.Base64;

import ru.org.linux.util.StringUtil;

public class User implements Serializable {
  private static final int ANONYMOUS_LEVEL_SCORE = 50;

  private String nick;
  private final int id;
  private boolean canmod;
  private boolean candel;
  private boolean anonymous;
  private boolean corrector;
  private final boolean blocked;
  private final String password;
  private final int score;
  private final int maxScore;
  private final String photo;

  private final boolean activated;
  public static final int CORRECTOR_SCORE = 100;
  private static final int BLOCK_SCORE = 400;

  private static final int CACHE_MILLIS = 300*1000;

  public static final int LORCODE_SCORE = 100;

  private User(Connection con, String name) throws SQLException, UserNotFoundException {
    if (name == null) {
      throw new NullPointerException();
    }
    nick = name;

    PreparedStatement st = con.prepareStatement("SELECT id,candel,canmod,corrector,passwd,blocked,score,max_score,activated,photo FROM users where nick=?");
    st.setString(1, name);

    ResultSet rs = st.executeQuery();

    if (!rs.next()) {
      throw new UserNotFoundException(name);
    }

    id = rs.getInt("id");
    canmod = rs.getBoolean("canmod");
    candel = rs.getBoolean("candel");
    corrector = rs.getBoolean("corrector");
    activated = rs.getBoolean("activated");
    blocked = rs.getBoolean("blocked");
    score = rs.getInt("score");
    maxScore = rs.getInt("max_score");
    String pwd = rs.getString("passwd");
    if (pwd == null) {
      pwd = "";
    }
    anonymous = "".equals(pwd);<commit_msg>bbcode for all registred users (score>50)<commit_after>package ru.org.linux.site;

import java.io.Serializable;
import java.net.URLEncoder;
import java.sql.*;
import java.util.Date;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.danga.MemCached.MemCachedClient;
import org.apache.commons.codec.binary.Base64;

import ru.org.linux.util.StringUtil;

public class User implements Serializable {
  private static final int ANONYMOUS_LEVEL_SCORE = 50;

  private String nick;
  private final int id;
  private boolean canmod;
  private boolean candel;
  private boolean anonymous;
  private boolean corrector;
  private final boolean blocked;
  private final String password;
  private final int score;
  private final int maxScore;
  private final String photo;

  private final boolean activated;
  public static final int CORRECTOR_SCORE = 100;
  private static final int BLOCK_SCORE = 400;

  private static final int CACHE_MILLIS = 300*1000;

  public static final int LORCODE_SCORE = 50;

  private User(Connection con, String name) throws SQLException, UserNotFoundException {
    if (name == null) {
      throw new NullPointerException();
    }
    nick = name;

    PreparedStatement st = con.prepareStatement("SELECT id,candel,canmod,corrector,passwd,blocked,score,max_score,activated,photo FROM users where nick=?");
    st.setString(1, name);

    ResultSet rs = st.executeQuery();

    if (!rs.next()) {
      throw new UserNotFoundException(name);
    }

    id = rs.getInt("id");
    canmod = rs.getBoolean("canmod");
    candel = rs.getBoolean("candel");
    corrector = rs.getBoolean("corrector");
    activated = rs.getBoolean("activated");
    blocked = rs.getBoolean("blocked");
    score = rs.getInt("score");
    maxScore = rs.getInt("max_score");
    String pwd = rs.getString("passwd");
    if (pwd == null) {
      pwd = "";
    }
    anonymous = "".equals(pwd);
{'fraction_non_alphanumeric': 0.10616525965720133, 'fraction_numerical': 0.011000255819902788, 'mean_word_length': 4.091145833333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '6936986', 'n_tokens_mistral': 1231, 'n_tokens_neox': 1174, 'n_words': 322}