<commit_before>package nl.tudelft.watchdog.util;

import java.lang.reflect.Type;
import java.util.Date;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

/**
 * A class that initializes the GSON factory with our custom types and returns
 * instances of GSON objects.
 */
public class GSONUtil {

	/** The {@link GsonBuilder} for building the intervals. */
	private static GsonBuilder gsonBuilder;

	static {
		gsonBuilder = new GsonBuilder().registerTypeAdapter(Date.class,
				new DateSerializer()).registerTypeAdapter(Date.class,
				new DateDeserializer());
	}

	/**
	 * Get an instance of a GSON parser.
	 * 
	 * @return An initialized GSON object.
	 */
	public static Gson gson() {
		return gsonBuilder.create();
	}

	/** A JSon serializer for Date. */
	private static class DateSerializer implements JsonSerializer<Date> {

		@Override
		public JsonElement serialize(Date date, Type type,
				JsonSerializationContext context) {
			return new JsonPrimitive(date.getTime());
		}
	}

	/** A JSon de-serializer for Date. */
	private static class DateDeserializer implements JsonDeserializer<Date> {
		@Override
		public Date deserialize(JsonElement json, Type typeOfT,
				JsonDeserializationContext context) throws JsonParseException {
			return json == null ? null : new Date(json.getAsLong());
		}
	};
}
<commit_msg>Stylistic fixes<commit_after>package nl.tudelft.watchdog.util;

import java.lang.reflect.Type;
import java.util.Date;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonParseException;
import com.google.gson.JsonPrimitive;
import com.google.gson.JsonSerializationContext;
import com.google.gson.JsonSerializer;

/**
 * A class that initializes the GSON factory with our custom types and returns
 * instances of GSON objects.
 */
public final class GSONUtil {

	/** The {@link GsonBuilder} for building the intervals. */
	private static GsonBuilder gsonBuilder;

	static {
		gsonBuilder = new GsonBuilder().registerTypeAdapter(Date.class,
				new DateSerializer()).registerTypeAdapter(Date.class,
				new DateDeserializer());
	}

	/** Get an instance of a GSON parser. */
	public static Gson gson() {
		return gsonBuilder.create();
	}

	/** A JSon serializer for Date. */
	private static class DateSerializer implements JsonSerializer<Date> {

		@Override
		public JsonElement serialize(Date date, Type type,
				JsonSerializationContext context) {
			return new JsonPrimitive(date.getTime());
		}
	}

	/** A JSon de-serializer for Date. */
	private static class DateDeserializer implements JsonDeserializer<Date> {
		@Override
		public Date deserialize(JsonElement json, Type typeOfT,
				JsonDeserializationContext context) throws JsonParseException {
			return (json == null) ? null : new Date(json.getAsLong());
		}
	};
}

{'fraction_non_alphanumeric': 0.09873104302073661, 'fraction_numerical': 0.0, 'mean_word_length': 4.601386481802426, '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': '6810134', 'n_tokens_mistral': 1023, 'n_tokens_neox': 965, 'n_words': 261}