<commit_before>package com.example.sakydpozrux.githubusers.ui.users;

import android.app.SearchManager;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.example.sakydpozrux.githubusers.R;
import com.example.sakydpozrux.githubusers.app.GitHubUsersApp;
import com.example.sakydpozrux.githubusers.model.User;
import com.example.sakydpozrux.githubusers.ui.user.UserDetailActivity;
import com.example.sakydpozrux.githubusers.ui.user.UserDetailFragment;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

import butterknife.BindView;
import butterknife.ButterKnife;

public class UserListActivity extends AppCompatActivity
    implements UsersRecyclerViewAdapter.OnItemClickListener, UserListPresenter.View {
    @Inject UserListPresenter mPresenter;
    @Inject SearchManager mSearchManager;

    @BindView(R.id.rv_list) RecyclerView mRecyclerView;
    @BindView(R.id.progress_bar) ProgressBar mProgressBar;

    private UsersRecyclerViewAdapter mAdapter;
    private boolean mTwoPane;

    private static final String KEY_USERS_LIST = "KEY_USERS_LIST";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_list);

        ((GitHubUsersApp)getApplication()).getAppComponent().inject(this);
        ButterKnife.bind(this);

        List<User> users;
        if (savedInstanceState == null) {
            users = new ArrayList<>();
        } else {
            users = savedInstanceState.getParcelableArrayList(KEY_USERS_LIST);
        }

        setupRecyclerView(users);

        mPresenter.setView(this);

        if (findViewById(R.id.container_user_detail) != null) {
            mTwoPane = true;
        } else {
            mTwoPane = false;
        }
    }

    private void setupRecyclerView(List<User> users) {
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
        mAdapter = new UsersRecyclerViewAdapter(users, this);
        mRecyclerView.setAdapter(mAdapter);
    }

    @Override
    public void onItemClick(User item) {
        launchUserDetail(item);
    }
<commit_msg>Fix bug with rotation in UserListActivity<commit_after>package com.example.sakydpozrux.githubusers.ui.users;

import android.app.SearchManager;
import android.content.Intent;
import android.os.Bundle;
import android.os.Parcelable;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SearchView;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.example.sakydpozrux.githubusers.R;
import com.example.sakydpozrux.githubusers.app.GitHubUsersApp;
import com.example.sakydpozrux.githubusers.model.User;
import com.example.sakydpozrux.githubusers.ui.user.UserDetailActivity;
import com.example.sakydpozrux.githubusers.ui.user.UserDetailFragment;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

import butterknife.BindView;
import butterknife.ButterKnife;

public class UserListActivity extends AppCompatActivity
    implements UsersRecyclerViewAdapter.OnItemClickListener, UserListPresenter.View {
    @Inject UserListPresenter mPresenter;
    @Inject SearchManager mSearchManager;

    @BindView(R.id.rv_list) RecyclerView mRecyclerView;
    @BindView(R.id.progress_bar) ProgressBar mProgressBar;

    private UsersRecyclerViewAdapter mAdapter;
    private boolean mTwoPane;

    private static final String KEY_USERS_LIST = "KEY_USERS_LIST";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_list);

        ((GitHubUsersApp)getApplication()).getAppComponent().inject(this);
        ButterKnife.bind(this);

        List<User> users;
        if (savedInstanceState == null) {
            users = new ArrayList<>();
        } else {
            users = savedInstanceState.getParcelableArrayList(KEY_USERS_LIST);
        }

        setupRecyclerView(users);

        mPresenter.setView(this);

        if (findViewById(R.id.container_user_detail) != null) {
            mTwoPane = true;
        } else {
            mTwoPane = false;
        }
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        List<User> users = mAdapter.getUsers();
        ArrayList<Parcelable> parcelableArrayList = new ArrayList<Parcelable>(users);
        outState.putParcelableArrayList(KEY_USERS_LIST, parcelableArrayList);
        super.onSaveInstanceState(outState);
    }

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
        List<User> users = savedInstanceState.getParcelableArrayList(KEY_USERS_LIST);
        showUsers(users);
    }

    private void setupRecyclerView(List<User> users) {
        mRecyclerView.setLayoutManager(new LinearLayoutManager(this));
        mAdapter = new UsersRecyclerViewAdapter(users, this);
        mRecyclerView.setAdapter(mAdapter);
    }

    @Override
    public void onItemClick(User item) {
        launchUserDetail(item);
    }

{'fraction_non_alphanumeric': 0.08944077804793331, 'fraction_numerical': 0.0013893713094824591, 'mean_word_length': 4.038495188101487, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '6016251', 'n_tokens_mistral': 1741, 'n_tokens_neox': 1673, 'n_words': 286}