<commit_before>package de.stephanlindauer.criticalmaps.model;

import android.support.annotation.NonNull;

import org.json.JSONException;
import org.json.JSONObject;
import org.osmdroid.util.GeoPoint;

import java.util.Date;

import de.stephanlindauer.criticalmaps.utils.DateUtils;

public class OwnLocationModel {

    public static final int MAX_LOCATION_AGE = 30 * 1000; //30 seconds
    private static final float ACCURACY_PRECISE_THRESHOLD = 50.0f; //meters

    public GeoPoint ownLocation;
    private boolean isLocationPrecise;
    private long timeOfFix;

    public void setLocation(@NonNull GeoPoint location, float accuracy, long time) {
        ownLocation = location;
        isLocationPrecise = accuracy < ACCURACY_PRECISE_THRESHOLD;
        timeOfFix = time;
    }

    public boolean hasPreciseLocation() {
        return (ownLocation != null) && isLocationPrecise;
    }

    public boolean isLocationFresh() {
        return DateUtils.isNotLongerAgoThen(new Date(timeOfFix), 0, 30);
    }

    @NonNull
    public JSONObject getLocationJson() {
        JSONObject locationObject = new JSONObject();
        try {
            locationObject.put("longitude", Integer.toString((int)(ownLocation.getLongitude() * 1000000.0D)));
            locationObject.put("latitude", Integer.toString((int)(ownLocation.getLatitude() * 1000000.0D)));
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return locationObject;
    }
}<commit_msg>OwnLocationModel: minor style changes<commit_after>package de.stephanlindauer.criticalmaps.model;

import android.support.annotation.NonNull;

import org.json.JSONException;
import org.json.JSONObject;
import org.osmdroid.util.GeoPoint;

import java.util.Date;

import de.stephanlindauer.criticalmaps.utils.DateUtils;

public class OwnLocationModel {

    public static final int MAX_LOCATION_AGE = 30 * 1000; //30 seconds
    private static final float ACCURACY_PRECISE_THRESHOLD = 50.0f; //meters

    public GeoPoint ownLocation;
    private boolean isLocationPrecise;
    private long timeOfFix;

    public void setLocation(@NonNull GeoPoint location, float accuracy, long timestamp) {
        ownLocation = location;
        isLocationPrecise = accuracy < ACCURACY_PRECISE_THRESHOLD;
        timeOfFix = timestamp;
    }

    public boolean hasPreciseLocation() {
        return ownLocation != null && isLocationPrecise;
    }

    public boolean isLocationFresh() {
        return DateUtils.isNotLongerAgoThen(new Date(timeOfFix), 0, 30);
    }

    @NonNull
    public JSONObject getLocationJson() {
        JSONObject locationObject = new JSONObject();
        try {
            locationObject.put("longitude", Integer.toString((int)(ownLocation.getLongitude() * 1000000.0D)));
            locationObject.put("latitude", Integer.toString((int)(ownLocation.getLatitude() * 1000000.0D)));
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return locationObject;
    }
}
{'fraction_non_alphanumeric': 0.0925183700734803, 'fraction_numerical': 0.02004008016032064, 'mean_word_length': 3.4304733727810652, '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': '1795781', 'n_tokens_mistral': 925, 'n_tokens_neox': 843, 'n_words': 191}