<commit_before>package com.rollbar;

import com.rollbar.payload.Payload;
import com.rollbar.payload.data.*;
import com.rollbar.payload.data.body.Body;
import com.rollbar.sender.PayloadSender;
import com.rollbar.sender.RollbarResponseHandler;
import com.rollbar.sender.Sender;
import com.rollbar.utilities.ArgumentNullException;
import com.rollbar.utilities.Validate;

import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * The notifier itself. Anything that can be statically set should be set by passed in through the constructor.
 * Anything that needs to be dynamically determined should be configured by subclassing and overriding the `getXXX`
 * methods.
 * There are
 */
public class Rollbar {
    private String accessToken;
    private String environment;
    private String codeVersion;
    private String platform;
    private String language;
    private String framework;
    private String context;
    private Request request;
    private Person person;
    private Server server;
    private Map<String, Object> custom;
    private Notifier notifier;
    private RollbarResponseHandler responseHandler;
    private PayloadFilter filter;
    private PayloadTransform transform;
    private Sender sender;

    /**
     * Construct a notifier defaults for everything including Sender.
     * Caution: default sender is slow and blocking. Consider providing a Sender overload.
     * @param accessToken not nullable, the access token to send payloads to
     * @param environment not nullable, the environment to send payloads under
     */
    public Rollbar(String accessToken, String environment) {
        this(accessToken, environment, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
    }

    /**
     * Construct notifier, defaults for everything but Sender.
     * @param accessToken not nullable, the access token to send payloads to
     * @param environment not nullable, the environment to send payloads under
     * @param sender the sender to use. If null uses default: {@link PayloadSender}
     */
    public Rollbar(String accessToken, String environment, Sender sender) {
        this(accessToken, environment, sender, null, null, null, null, null, null, null, null, null, null, null, null, null);
    }

    /**
     * Construct notifier with static values for all configuration options set. Anything left null will use the default
     * value. If appropriate.
     * @param accessToken not nullable, the access token to send payloads to
     * @param environment not nullable, the environment to send payloads under
     * @param sender the sender to use. If null uses default: {@link PayloadSender}
     * @param codeVersion the version of the code currently running. If code checked out on server: `git rev-parse HEAD`
     * @param platform the platform you're running. (JVM version, or similar).
     * @param language the main language you're running ("java" by default, override w/ "clojure", "scala" etc.).
     * @param framework the framework you're using ("Play", "Spring", etc.).
     * @param context a mnemonic for finding the code responsible (e.g. controller name, module name)
     * @param request the HTTP request that triggered this error. Can be set if the IOC container can work per-request.
     * @param person the affected person. Can be set if the IOC container can work per-request.
     * @param server info about this server. This can be statically set.
     * @param custom custom info to send with *every* error. Can be dynamically or statically set.
     * @param notifier information about this notifier. Default {@code new Notifier()} ({@link Notifier}.
     * @param responseHandler what to do with the response. Use this to check for failures and handle some other way.
     * @param filter filter used to determine if you will send payload. Receives *transformed* payload.
     * @param transform alter payload before sending.
     */
    public Rollbar(String accessToken, String environment, Sender sender, String codeVersion, String platform,
                   String language, String framework, String context, Request request, Person person, Server server,
                   Map<String, Object> custom, Notifier notifier, RollbarResponseHandler responseHandler,
                   PayloadFilter filter, PayloadTransform transform) {
        Validate.isNotNullOrWhitespace(accessToken, "accessToken");
        Validate.isNotNullOrWhitespace(environment, "environment");


        this.sender = sender == null ? new PayloadSender() : sender;
        this.accessToken = accessToken;
        this.environment = environment;
        this.codeVersion = codeVersion;
        this.platform = platform;
        this.language = language;
        this.framework = framework == null ? "java" : framework;
        this.context = context;
        this.request = request;
        this.person = person;
        this.server = server;
        this.notifier = notifier == null ? new Notifier() : notifier;<commit_msg>fixes 35: sets language to 'java' if null<commit_after>package com.rollbar;

import com.rollbar.payload.Payload;
import com.rollbar.payload.data.*;
import com.rollbar.payload.data.body.Body;
import com.rollbar.sender.PayloadSender;
import com.rollbar.sender.RollbarResponseHandler;
import com.rollbar.sender.Sender;
import com.rollbar.utilities.ArgumentNullException;
import com.rollbar.utilities.Validate;

import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * The notifier itself. Anything that can be statically set should be set by passed in through the constructor.
 * Anything that needs to be dynamically determined should be configured by subclassing and overriding the `getXXX`
 * methods.
 * There are
 */
public class Rollbar {
    private String accessToken;
    private String environment;
    private String codeVersion;
    private String platform;
    private String language;
    private String framework;
    private String context;
    private Request request;
    private Person person;
    private Server server;
    private Map<String, Object> custom;
    private Notifier notifier;
    private RollbarResponseHandler responseHandler;
    private PayloadFilter filter;
    private PayloadTransform transform;
    private Sender sender;

    /**
     * Construct a notifier defaults for everything including Sender.
     * Caution: default sender is slow and blocking. Consider providing a Sender overload.
     * @param accessToken not nullable, the access token to send payloads to
     * @param environment not nullable, the environment to send payloads under
     */
    public Rollbar(String accessToken, String environment) {
        this(accessToken, environment, null, null, null, null, null, null, null, null, null, null, null, null, null, null);
    }

    /**
     * Construct notifier, defaults for everything but Sender.
     * @param accessToken not nullable, the access token to send payloads to
     * @param environment not nullable, the environment to send payloads under
     * @param sender the sender to use. If null uses default: {@link PayloadSender}
     */
    public Rollbar(String accessToken, String environment, Sender sender) {
        this(accessToken, environment, sender, null, null, null, null, null, null, null, null, null, null, null, null, null);
    }

    /**
     * Construct notifier with static values for all configuration options set. Anything left null will use the default
     * value. If appropriate.
     * @param accessToken not nullable, the access token to send payloads to
     * @param environment not nullable, the environment to send payloads under
     * @param sender the sender to use. If null uses default: {@link PayloadSender}
     * @param codeVersion the version of the code currently running. If code checked out on server: `git rev-parse HEAD`
     * @param platform the platform you're running. (JVM version, or similar).
     * @param language the main language you're running ("java" by default, override w/ "clojure", "scala" etc.).
     * @param framework the framework you're using ("Play", "Spring", etc.).
     * @param context a mnemonic for finding the code responsible (e.g. controller name, module name)
     * @param request the HTTP request that triggered this error. Can be set if the IOC container can work per-request.
     * @param person the affected person. Can be set if the IOC container can work per-request.
     * @param server info about this server. This can be statically set.
     * @param custom custom info to send with *every* error. Can be dynamically or statically set.
     * @param notifier information about this notifier. Default {@code new Notifier()} ({@link Notifier}.
     * @param responseHandler what to do with the response. Use this to check for failures and handle some other way.
     * @param filter filter used to determine if you will send payload. Receives *transformed* payload.
     * @param transform alter payload before sending.
     */
    public Rollbar(String accessToken, String environment, Sender sender, String codeVersion, String platform,
                   String language, String framework, String context, Request request, Person person, Server server,
                   Map<String, Object> custom, Notifier notifier, RollbarResponseHandler responseHandler,
                   PayloadFilter filter, PayloadTransform transform) {
        Validate.isNotNullOrWhitespace(accessToken, "accessToken");
        Validate.isNotNullOrWhitespace(environment, "environment");


        this.sender = sender == null ? new PayloadSender() : sender;
        this.accessToken = accessToken;
        this.environment = environment;
        this.codeVersion = codeVersion;
        this.platform = platform;
        this.language = language == null ? "java" : language;
        this.framework = framework;
        this.context = context;
        this.request = request;
        this.person = person;
        this.server = server;
        this.notifier = notifier == null ? new Notifier() : notifier;
{'fraction_non_alphanumeric': 0.07506675897537335, 'fraction_numerical': 0.00019780437147660964, 'mean_word_length': 3.4195804195804196, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4815270', 'n_tokens_mistral': 2518, 'n_tokens_neox': 2476, 'n_words': 1088}