<commit_before>package org.scy.common.web.session;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.client.RestOperations;

import javax.servlet.http.HttpServletRequest;

/**
 * Session 管理类
 * Created by shicy on 2017/9/3
 */
public final class SessionManager {

    // 用户唯一编号，一个客户端一个编号
    public final static ThreadLocal<String> uuid = new ThreadLocal<String>();

    // 用户登录信息
    public final static ThreadLocal<String> token = new ThreadLocal<String>();

    // Token 属性名称
    public final static String TOKEN_KEY = "token";

    @Autowired
    private RestOperations restOperations;

    private static SessionManager sessionManager;

    /**
     * 构造方法，
     * 单例，请通过 Session.getInstance() 获取实例
     */
    private SessionManager() {
        // do nothing
    }

    /**
     * 获取 Session 管理实例
     * @return
     */
    public static SessionManager getInstance() {
        if (sessionManager == null) {
            synchronized (sessionManager) {<commit_msg>SessionManager修改<commit_after>package org.scy.common.web.session;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.client.RestOperations;

import javax.servlet.http.HttpServletRequest;

/**
 * Session 管理类
 * Created by shicy on 2017/9/3
 */
public final class SessionManager {

    // 用户唯一编号，一个客户端一个编号
    public final static ThreadLocal<String> uuid = new ThreadLocal<String>();

    // 用户登录信息
    public final static ThreadLocal<String> token = new ThreadLocal<String>();

    // Token 属性名称
    public final static String TOKEN_KEY = "token";

    @Autowired
    private RestOperations restOperations;

    private static SessionManager sessionManager;

    /**
     * 构造方法，
     * 单例，请通过 Session.getInstance() 获取实例
     */
    private SessionManager() {
        // do nothing
    }

    /**
     * 获取 Session 管理实例
     * @return
     */
    public static SessionManager getInstance() {
        if (sessionManager == null) {
            synchronized (SessionManager.class) {
{'fraction_non_alphanumeric': 0.09877149877149877, 'fraction_numerical': 0.005896805896805897, 'mean_word_length': 2.945736434108527, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5661833', 'n_tokens_mistral': 624, 'n_tokens_neox': 652, 'n_words': 144}