<commit_before>package com.oklab.gitjourney.adapters;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.oklab.gitjourney.R;
import com.oklab.gitjourney.data.FeedDataEntry;
import com.oklab.gitjourney.utils.Utils;
import com.squareup.picasso.Picasso;

import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

/**
 * Created by olgakuklina on 2017-01-15.
 */

public class FeedListAdapter extends RecyclerView.Adapter<FeedListAdapter.FeedListViewHolder> {

    private static final String TAG = FeedListAdapter.class.getSimpleName();
    private final ArrayList<FeedDataEntry> feedDataEntryList = new ArrayList<>(1000);
    private final Context context;

    public FeedListAdapter(Context context) {
        this.context = context;
    }

    @Override
    public FeedListAdapter.FeedListViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View v = LayoutInflater.from(context).inflate(R.layout.feeds_list_item, parent, false);
        return new FeedListViewHolder(v);
    }

    @Override
    public void onBindViewHolder(FeedListAdapter.FeedListViewHolder holder, int position) {
        FeedDataEntry entry = feedDataEntryList.get(position);
        holder.populateFeedViewData(entry);
    }

    @Override
    public int getItemCount() {
        return feedDataEntryList.size();
    }

    public void add(List<FeedDataEntry> entryList) {
        feedDataEntryList.addAll(entryList);
        notifyDataSetChanged();
    }

    public void resetAllData() {<commit_msg>- fixed FeedListAdapter add() method to process empty feedDataEntryList<commit_after>package com.oklab.gitjourney.adapters;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.text.Html;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.oklab.gitjourney.R;
import com.oklab.gitjourney.data.FeedDataEntry;
import com.oklab.gitjourney.utils.Utils;
import com.squareup.picasso.Picasso;

import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;

/**
 * Created by olgakuklina on 2017-01-15.
 */

public class FeedListAdapter extends RecyclerView.Adapter<FeedListAdapter.FeedListViewHolder> {

    private static final String TAG = FeedListAdapter.class.getSimpleName();
    private final ArrayList<FeedDataEntry> feedDataEntryList = new ArrayList<>(1000);
    private final Context context;

    public FeedListAdapter(Context context) {
        this.context = context;
    }

    @Override
    public FeedListAdapter.FeedListViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View v = LayoutInflater.from(context).inflate(R.layout.feeds_list_item, parent, false);
        return new FeedListViewHolder(v);
    }

    @Override
    public void onBindViewHolder(FeedListAdapter.FeedListViewHolder holder, int position) {
        FeedDataEntry entry = feedDataEntryList.get(position);
        holder.populateFeedViewData(entry);
    }

    @Override
    public int getItemCount() {
        return feedDataEntryList.size();
    }

    public void add(List<FeedDataEntry> entryList) {
        if(entryList == null || entryList.isEmpty()) {
            Log.v(TAG, "feedDataEntryList is empty");
           return;
        }
        feedDataEntryList.addAll(entryList);
        notifyDataSetChanged();
    }

    public void resetAllData() {
{'fraction_non_alphanumeric': 0.0928438414471934, 'fraction_numerical': 0.006916733173716414, 'mean_word_length': 4.115646258503402, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '3020806', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1063, 'n_words': 230}