<commit_before>package org.wahlzeit.model;

public abstract class AbstractCoordinate implements Coordinate {
    public static final double EPSILON = 0.0000001;

    @Override
    public boolean isEqual(Coordinate other) {
        return Math.abs(getDistance(other)) < EPSILON;
    }

    @Override
    public double getDistance(Coordinate other) {
        double dx = asCartesianX() - other.asCartesianX();
        double dy = asCartesianY() - other.asCartesianY();
        double dz = asCartesianZ() - other.asCartesianZ();
        return Math.sqrt(dx * dx + dy * dy + dz * dz);
    }
}<commit_msg>added checks for null in AbstractCoordinate<commit_after>package org.wahlzeit.model;

public abstract class AbstractCoordinate implements Coordinate {
    public static final double EPSILON = 0.0000001;

    @Override
    public boolean isEqual(Coordinate other) {
        assertNotNull(other);
        return Math.abs(getDistance(other)) < EPSILON;
    }

    @Override
    public double getDistance(Coordinate other) {
        assertNotNull(other);
        double dx = asCartesianX() - other.asCartesianX();
        double dy = asCartesianY() - other.asCartesianY();
        double dz = asCartesianZ() - other.asCartesianZ();
        return Math.sqrt(dx * dx + dy * dy + dz * dz);
    }

    private void assertNotNull(Coordinate other) throws IllegalArgumentException {
        if(other == null) {
            throw new IllegalArgumentException("other must not be null");
        }
    }
}
{'fraction_non_alphanumeric': 0.09584450402144772, 'fraction_numerical': 0.010723860589812333, 'mean_word_length': 3.002680965147453, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3629485', 'n_tokens_mistral': 432, 'n_tokens_neox': 411, 'n_words': 114}