<commit_before>package com.github.crehn.pantarhei.data;

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

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

@Converter(autoApply = true)
public class InstantConverter implements AttributeConverter<Instant, Date> {

    @Override
    public Date convertToDatabaseColumn(Instant instant) {
        return Date.from(instant);
    }

    @Override
    public Instant convertToEntityAttribute(Date value) {
        return value.toInstant();
    }
}<commit_msg>fixed NPE<commit_after>package com.github.crehn.pantarhei.data;

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

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;

@Converter(autoApply = true)
public class InstantConverter implements AttributeConverter<Instant, Date> {

    @Override
    public Date convertToDatabaseColumn(Instant instant) {
        if (instant == null)
            return null;
        return Date.from(instant);
    }

    @Override
    public Instant convertToEntityAttribute(Date value) {
        if (value == null)
            return null;
        return value.toInstant();
    }
}
{'fraction_non_alphanumeric': 0.08858603066439523, 'fraction_numerical': 0.0, 'mean_word_length': 3.7379032258064515, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '7151153', 'n_tokens_mistral': 332, 'n_tokens_neox': 321, 'n_words': 75}