<commit_before>package com.api.access;

import java.util.Date;

public class Token {
    private String token;
    private Date date;

    public Token(String token)
    {
        if (Token.checkToken(token)) {
            this.token = token;
            this.date = new Date();
        }
    }

    public String getToken()
    {
        return this.token;
    }

    public static boolean checkToken(String token)
    {
        String pattern = "^Bearer[\\s].*$";
        return token == null || token.matches(pattern);
    }
}<commit_msg>SO > Api.access > fix null token error<commit_after>package com.api.access;

import java.util.Date;

public class Token {
    private String token;
    private Date date;

    public Token(String token)
    {
        if (Token.checkToken(token)) {
            this.token = token;
            this.date = new Date();
        }
    }

    public String getToken()
    {
        return this.token;
    }

    public static boolean checkToken(String token)
    {
        String pattern = "^Bearer[\\s].*$";
        return token != null && token.matches(pattern);
    }
}
{'fraction_non_alphanumeric': 0.11472448057813911, 'fraction_numerical': 0.0, 'mean_word_length': 2.019073569482289, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '6946488', 'n_tokens_mistral': 330, 'n_tokens_neox': 319, 'n_words': 85}