<commit_before>package com.krishagni.catissueplus.core.common.util;

import java.io.IOException;
import java.time.Instant;
import java.util.Date;

import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;
import org.codehaus.jackson.map.DeserializationContext;
import org.codehaus.jackson.map.deser.std.UntypedObjectDeserializer;


public class JsonDateDeserializer extends UntypedObjectDeserializer {
	private Log logger = LogFactory.getLog(JsonDateDeserializer.class);

	@Override
	public Object deserialize(JsonParser p, DeserializationContext ctxt)
	throws IOException {
		Object ret;

		if (p.getCurrentToken() == JsonToken.VALUE_STRING) {
			try {
				ret = DateUtils.parseDate(p.getText(), "yyyy-MM-dd");
			} catch (Exception e) {
				try {
					ret = Date.from(Instant.parse(p.getText()));
				} catch (Exception e1) {
					ret = super.deserialize(p, ctxt);
				}
			}
		} else if (p.getCurrentToken() == JsonToken.VALUE_NUMBER_INT) {
			try {
				ret = new Date(p.getIntValue());
			} catch (Exception e) {
				ret = super.deserialize(p, ctxt);
			}
		} else {
			ret = super.deserialize(p, ctxt);
		}

		logger.info("Input date " + p.getText() + " deserialized to " + ret);
		return ret;
	}
}<commit_msg>OPSMN-3854: Deserialised the time since UNIX epoch into long type that can further be used for creating date objects.<commit_after>package com.krishagni.catissueplus.core.common.util;

import java.io.IOException;
import java.time.Instant;
import java.util.Date;

import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;
import org.codehaus.jackson.map.DeserializationContext;
import org.codehaus.jackson.map.deser.std.UntypedObjectDeserializer;


public class JsonDateDeserializer extends UntypedObjectDeserializer {
	private Log logger = LogFactory.getLog(JsonDateDeserializer.class);

	@Override
	public Object deserialize(JsonParser p, DeserializationContext ctxt)
	throws IOException {
		Object ret;

		if (p.getCurrentToken() == JsonToken.VALUE_STRING) {
			try {
				ret = DateUtils.parseDate(p.getText(), "yyyy-MM-dd");
			} catch (Exception e) {
				try {
					ret = Date.from(Instant.parse(p.getText()));
				} catch (Exception e1) {
					ret = super.deserialize(p, ctxt);
				}
			}
		} else if (p.getCurrentToken() == JsonToken.VALUE_NUMBER_INT) {
			try {
				ret = new Date(p.getLongValue());
			} catch (Exception e) {
				ret = super.deserialize(p, ctxt);
			}
		} else {
			ret = super.deserialize(p, ctxt);
		}

		logger.info("Input date " + p.getText() + " deserialized to " + ret);
		return ret;
	}
}
{'fraction_non_alphanumeric': 0.12275765036932818, 'fraction_numerical': 0.0028139289482940555, 'mean_word_length': 4.19926873857404, 'pattern_counts': {'":': 0, '<': 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': '5531000', 'n_tokens_mistral': 1043, 'n_tokens_neox': 934, 'n_words': 192}