<commit_before>package pl.warsjawa.android2.model.gmapsapi;

import android.util.Pair;

import com.google.android.gms.maps.model.LatLng;

import java.util.HashMap;

import javax.inject.Inject;
import javax.inject.Singleton;

import pl.warsjawa.android2.event.EventBus;
import pl.warsjawa.android2.model.gmapsapi.nearby.NearbyPlacesList;
import pl.warsjawa.android2.rest.GoogleClient;
import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;

@Singleton
public class GmapsModel {

    private final EventBus bus;
    private final GoogleClient googleClient;
    private HashMap<LatLng, NearbyPlacesList> nearbyPlacesMap;

    @Inject
    public GmapsModel(EventBus bus, GoogleClient googleClient) {
        this.bus = bus;
        this.googleClient = googleClient;
        this.nearbyPlacesMap = new HashMap<LatLng, NearbyPlacesList>();
    }

    public void requestNearbyPlacesList(final LatLng position) {
        NearbyPlacesList nearbyPlacesList = nearbyPlacesMap.get(position);
        if (nearbyPlacesList == null) {
            Callback<NearbyPlacesList> groupListCallback = new Callback<NearbyPlacesList>() {
                @Override
                public void success(NearbyPlacesList nearbyPlaces, Response response) {
                    nearbyPlacesMap.put(position, nearbyPlaces);
                    bus.post(new Pair<LatLng,NearbyPlacesList>(position, nearbyPlaces));
                }
                @Override
                public void failure(RetrofitError error) {
                }
            };
            googleClient.requestNearbyPlaces(position, 500, groupListCallback);
        }
    }

    public NearbyPlacesList getNearbyPlacesList(LatLng position) {
        return nearbyPlacesMap.get(position);
    }
}<commit_msg>Better data publishing, list still bugged.<commit_after>package pl.warsjawa.android2.model.gmapsapi;

import android.util.Pair;

import com.google.android.gms.maps.model.LatLng;

import java.util.HashMap;

import javax.inject.Inject;
import javax.inject.Singleton;

import pl.warsjawa.android2.event.EventBus;
import pl.warsjawa.android2.model.gmapsapi.nearby.NearbyPlacesList;
import pl.warsjawa.android2.rest.GoogleClient;
import retrofit.Callback;
import retrofit.RetrofitError;
import retrofit.client.Response;

@Singleton
public class GmapsModel {

    private final EventBus bus;
    private final GoogleClient googleClient;
    private HashMap<LatLng, NearbyPlacesList> nearbyPlacesMap;

    @Inject
    public GmapsModel(EventBus bus, GoogleClient googleClient) {
        this.bus = bus;
        this.googleClient = googleClient;
        this.nearbyPlacesMap = new HashMap<LatLng, NearbyPlacesList>();
    }

    public void requestNearbyPlacesList(final LatLng position) {
        NearbyPlacesList nearbyPlacesList = nearbyPlacesMap.get(position);
        if (nearbyPlacesList == null) {
            Callback<NearbyPlacesList> groupListCallback = new Callback<NearbyPlacesList>() {
                @Override
                public void success(NearbyPlacesList nearbyPlaces, Response response) {
                    nearbyPlacesMap.put(position, nearbyPlaces);
                    bus.post(new Pair<LatLng,NearbyPlacesList>(position, nearbyPlaces));
                }
                @Override
                public void failure(RetrofitError error) {
                }
            };
            googleClient.requestNearbyPlaces(position, 500, groupListCallback);
        }
        else {
            bus.post(new Pair<LatLng,NearbyPlacesList>(position, nearbyPlacesList));
        }
    }

    public NearbyPlacesList getNearbyPlacesList(LatLng position) {
        return nearbyPlacesMap.get(position);
    }
}
{'fraction_non_alphanumeric': 0.08205128205128205, 'fraction_numerical': 0.003778677462887989, 'mean_word_length': 3.037037037037037, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '6651262', 'n_tokens_mistral': 1124, 'n_tokens_neox': 1071, 'n_words': 199}