<commit_before>package com.sgrailways.giftidea;

import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.*;
import android.widget.EditText;
import android.widget.TextView;
import com.google.inject.Inject;
import com.sgrailways.R;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.joda.time.format.ISODateTimeFormat;
import roboguice.fragment.RoboFragment;
import roboguice.inject.InjectResource;
import roboguice.inject.InjectView;

public class EditIdeaFragment extends RoboFragment {
    @Inject Database database;
    @InjectView(R.id.idea) EditText idea;
    @InjectView(R.id.recipient) TextView recipient;
    @InjectResource(R.string.no_idea_message) String noIdeaMessage;
    boolean hasAppropriateLength = false;
    private long ideaId;

    @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_edit_idea, container, false);
    }

    @Override public void onResume() {
        super.onResume();
        Bundle extras = getActivity().getIntent().getExtras();
        ideaId = extras.getLong("ideaId", -1L);
        SQLiteDatabase rdb = database.getReadableDatabase();
        Cursor cursor = rdb.query(Database.IdeasTable.TABLE_NAME, new String[]{Database.IdeasTable._ID, Database.IdeasTable.IDEA}, Database.IdeasTable._ID + "=?", new String[]{String.valueOf(ideaId)}, null, null, null, "1");
        cursor.moveToFirst();
        idea.setText(cursor.getString(1));
        cursor.close();
        idea.addTextChangedListener(new TextWatcher() {
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
            }

            public void onTextChanged(CharSequence s, int start, int before, int count) {<commit_msg>fixed bug where no editing happens<commit_after>package com.sgrailways.giftidea;

import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.view.*;
import android.widget.EditText;
import android.widget.TextView;
import com.google.inject.Inject;
import com.sgrailways.R;
import org.apache.commons.lang3.StringUtils;
import org.joda.time.DateTime;
import org.joda.time.format.ISODateTimeFormat;
import roboguice.fragment.RoboFragment;
import roboguice.inject.InjectResource;
import roboguice.inject.InjectView;

public class EditIdeaFragment extends RoboFragment {
    @Inject Database database;
    @InjectView(R.id.idea) EditText idea;
    @InjectView(R.id.recipient) TextView recipient;
    @InjectResource(R.string.no_idea_message) String noIdeaMessage;
    boolean hasAppropriateLength = false;
    private long ideaId;

    @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_edit_idea, container, false);
    }

    @Override public void onResume() {
        super.onResume();
        Bundle extras = getActivity().getIntent().getExtras();
        ideaId = extras.getLong("ideaId", -1L);
        SQLiteDatabase rdb = database.getReadableDatabase();
        Cursor cursor = rdb.query(Database.IdeasTable.TABLE_NAME, new String[]{Database.IdeasTable._ID, Database.IdeasTable.IDEA}, Database.IdeasTable._ID + "=?", new String[]{String.valueOf(ideaId)}, null, null, null, "1");
        cursor.moveToFirst();
        idea.setText(cursor.getString(1));
        hasAppropriateLength = StringUtils.isNotEmpty(idea.getText().toString());
        cursor.close();
        idea.addTextChangedListener(new TextWatcher() {
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
            }

            public void onTextChanged(CharSequence s, int start, int before, int count) {
{'fraction_non_alphanumeric': 0.10514651563654272, 'fraction_numerical': 0.0019699581383895593, 'mean_word_length': 4.373015873015873, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3400270', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1170, 'n_words': 255}