<commit_before>package info.justaway;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;
import android.view.KeyEvent;
import android.widget.CheckBox;
import android.widget.ListView;

import java.util.ArrayList;

import info.justaway.adapter.SubscribeUserListAdapter;
import info.justaway.task.UserListsLoader;
import twitter4j.ResponseList;
import twitter4j.UserList;

public class ChooseUserListsActivity extends FragmentActivity implements
        LoaderManager.LoaderCallbacks<ResponseList<UserList>> {

    private SubscribeUserListAdapter mAdapter;

    // private ArrayList<Integer> lists = new ArrayList<Integer>();

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

        ListView listView = (ListView) findViewById(R.id.list);

        mAdapter = new SubscribeUserListAdapter(this, R.layout.row_subscribe_user_list);

        listView.setAdapter(mAdapter);

        // registerForContextMenu(listView);

        // listView.setOnItemClickListener(new AdapterView.OnItemClickListener()
        // {
        // @Override
        // public void onItemClick(AdapterView<?> parent, View view, int
        // position, long id) {
        // view.showContextMenu();
        // }
        // });

        getSupportLoaderManager().initLoader(0, null, this);
    }

    @Override
    public Loader<ResponseList<UserList>> onCreateLoader(int arg0, Bundle arg1) {
        return new UserListsLoader(this);
    }

    @Override
    public void onLoadFinished(Loader<ResponseList<UserList>> arg0, ResponseList<UserList> userLists) {
        if (userLists != null && mAdapter != null) {
            for (UserList userList : userLists) {
                mAdapter.add(userList);
            }
        }
    }

    @Override
    public void onLoaderReset(Loader<ResponseList<UserList>> arg0) {
    }

    /**
     * finish前に色々セットしておく、ここでセットした値は onActivityResult で取れる
     */
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {

            ArrayList<Integer> lists = new ArrayList<Integer>();

            // 有効なチェックボックスからリストIDを取得
            ListView listView = (ListView) findViewById(R.id.list);
            int count = listView.getChildCount();
            for (int i = 0; i < count; i++) {
                CheckBox checkbox = (CheckBox) listView.getChildAt(i);
                if (checkbox.isChecked()) {
                    lists.add((Integer) checkbox.getTag());
                }
            }

            if (lists.size() > 0) {
                Intent data = new Intent();
                Bundle bundle = new Bundle();
                bundle.putIntegerArrayList("lists", lists);
                data.putExtras(bundle);
                setResult(RESULT_OK, data);
            } else {
                setResult(RESULT_CANCELED);
            }
            finish();
        }
        return false;
    }
}
<commit_msg>Guy to remove comment out.<commit_after>package info.justaway;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.LoaderManager;
import android.support.v4.content.Loader;
import android.view.KeyEvent;
import android.widget.CheckBox;
import android.widget.ListView;

import java.util.ArrayList;

import info.justaway.adapter.SubscribeUserListAdapter;
import info.justaway.task.UserListsLoader;
import twitter4j.ResponseList;
import twitter4j.UserList;

public class ChooseUserListsActivity extends FragmentActivity implements
        LoaderManager.LoaderCallbacks<ResponseList<UserList>> {

    private SubscribeUserListAdapter mAdapter;

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

        ListView listView = (ListView) findViewById(R.id.list);

        mAdapter = new SubscribeUserListAdapter(this, R.layout.row_subscribe_user_list);

        listView.setAdapter(mAdapter);

        getSupportLoaderManager().initLoader(0, null, this);
    }

    @Override
    public Loader<ResponseList<UserList>> onCreateLoader(int arg0, Bundle arg1) {
        return new UserListsLoader(this);
    }

    @Override
    public void onLoadFinished(Loader<ResponseList<UserList>> arg0, ResponseList<UserList> userLists) {
        if (userLists != null && mAdapter != null) {
            for (UserList userList : userLists) {
                mAdapter.add(userList);
            }
        }
    }

    @Override
    public void onLoaderReset(Loader<ResponseList<UserList>> arg0) {
    }

    /**
     * finish前に色々セットしておく、ここでセットした値は onActivityResult で取れる
     */
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK) {

            ArrayList<Integer> lists = new ArrayList<Integer>();

            // 有効なチェックボックスからリストIDを取得
            ListView listView = (ListView) findViewById(R.id.list);
            int count = listView.getChildCount();
            for (int i = 0; i < count; i++) {
                CheckBox checkbox = (CheckBox) listView.getChildAt(i);
                if (checkbox != null && checkbox.isChecked()) {
                    lists.add((Integer) checkbox.getTag());
                }
            }

            if (lists.size() > 0) {
                Intent data = new Intent();
                Bundle bundle = new Bundle();
                bundle.putIntegerArrayList("lists", lists);
                data.putExtras(bundle);
                setResult(RESULT_OK, data);
            } else {
                setResult(RESULT_CANCELED);
            }
            finish();
        }
        return false;
    }
}

{'fraction_non_alphanumeric': 0.10013440860215053, 'fraction_numerical': 0.004032258064516129, 'mean_word_length': 2.4955960070463887, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, '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': '970014', 'n_tokens_mistral': 1749, 'n_tokens_neox': 1626, 'n_words': 326}