<commit_before>package corewar.pit;

public abstract class PitNotification {

	private final int line;
	private final String cause;
	private final String context;
	private final String message;

	protected PitNotification(int line, String cause, String context, String message) {
		this.line = line;
		this.cause = cause;
		this.context = context;
		this.message = message;
	}

	@Override
	public String toString() {
		StringBuilder stringBuilder = new StringBuilder("{\"line\":")
			.append(line != -1 ? line : 0)
			.append(",\"msg\":\"")
			.append(secureString(message));

		if (!cause.isEmpty()) {
			stringBuilder.append(". Caused by '")
				.append(secureString(cause))
				.append("'");
			if (!context.isEmpty()) {
				stringBuilder.append(" in '")
					.append(secureString(context))
					.append("'");
			}
		}

		return stringBuilder
			.append("\"}")
			.toString();
	}

	private static String secureString(String str) {
		return str.replace("\"", "\\\"");
	}
}<commit_msg>Fixed tabs not being stringified correctly<commit_after>package corewar.pit;

public abstract class PitNotification {

	private final int line;
	private final String cause;
	private final String context;
	private final String message;

	protected PitNotification(int line, String cause, String context, String message) {
		this.line = line;
		this.cause = cause;
		this.context = context;
		this.message = message;
	}

	@Override
	public String toString() {
		StringBuilder stringBuilder = new StringBuilder("{\"line\":")
			.append(line != -1 ? line : 0)
			.append(",\"msg\":\"")
			.append(secureString(message));

		if (!cause.isEmpty()) {
			stringBuilder.append(". Caused by '")
				.append(secureString(cause))
				.append("'");
			if (!context.isEmpty()) {
				stringBuilder.append(" in '")
					.append(secureString(context))
					.append("'");
			}
		}

		return stringBuilder
			.append("\"}")
			.toString();
	}

	private static String secureString(String str) {
		return str.replace("\"", "\\\"")
			.replaceAll("\\s+", " ");
	}
}
{'fraction_non_alphanumeric': 0.16017742730409068, 'fraction_numerical': 0.001971414489896501, 'mean_word_length': 3.624145785876993, 'pattern_counts': {'":': 4, '<': 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': '5555385', 'n_tokens_mistral': 720, 'n_tokens_neox': 607, 'n_words': 160}