<commit_before>package com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.client;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Type;

import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.BitbucketRequestException;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class ClientUtils
{

	static Gson GSON = createGson();
	
	public static final String UTF8 = "UTF-8";

	private static Gson createGson()
	{
		GsonBuilder builder = new GsonBuilder();
		builder.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES);
		return builder.create();
	}

	public static String toJson(Object object)
	{
		return GSON.toJson(object);
	}

	public static <T> T fromJson(String json, Class<T> type)
	{
		return GSON.fromJson(json, type);
	}<commit_msg>BBC-217 - fixed problem with parsing Dates<commit_after>package com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.client;

import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Type;

import com.atlassian.jira.plugins.dvcs.spi.bitbucket.clientlibrary.request.BitbucketRequestException;
import com.google.gson.FieldNamingPolicy;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class ClientUtils
{

	static Gson GSON = createGson();
	
	public static final String UTF8 = "UTF-8";

	private static Gson createGson()
	{
		GsonBuilder builder = new GsonBuilder();
		builder.setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES);
        builder.setDateFormat("yyyy-MM-DD HH:mm:ss"); // to parse 2011-12-21 15:17:37
		return builder.create();
	}

	public static String toJson(Object object)
	{
		return GSON.toJson(object);
	}

	public static <T> T fromJson(String json, Class<T> type)
	{
		return GSON.fromJson(json, type);
	}
{'fraction_non_alphanumeric': 0.10763710917478217, 'fraction_numerical': 0.010763710917478216, 'mean_word_length': 5.276527331189711, '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': '7397697', 'n_tokens_mistral': 692, 'n_tokens_neox': 652, 'n_words': 131}