<commit_before>package com.novoda.sqliteprovider.demo.ui;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

import com.novoda.sqliteprovider.demo.R;
import com.novoda.sqliteprovider.demo.domain.Firework;
import com.novoda.sqliteprovider.demo.domain.Shop;
import com.novoda.sqliteprovider.demo.ui.base.NovodaActivity;
import com.novoda.sqliteprovider.demo.ui.util.FromXML;

import java.util.List;

public class FindFireworksFromOneShopActivity extends NovodaActivity {

	private EditText primaryKeyEditText;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_find_firework_from_one_shop);
		
		primaryKeyEditText = (EditText) findViewById(R.id.find_fireworks_from_one_shop_input_shop_primary_key);
	}
	
	@FromXML
	public void onFindShopFireworks(View button){
		if(userHasEnteredSomething()){
			try {
				int primaryKey = getPrimaryKey();

				List<Firework> fireworks = getApp().getFireworkReader().getFireworksForShop(primaryKey);
				
				Shop shop = new Shop("not implemented", "not implemented", fireworks);
				
				view(shop);
			} catch (NumberFormatException e) {
				Toast.makeText(this, "Primary Key should be an int", Toast.LENGTH_SHORT).show();
			}
		}
	}

	private boolean userHasEnteredSomething() {
		return !TextUtils.isEmpty(primaryKeyEditText.getText());
	}
	
	private int getPrimaryKey() throws NumberFormatException {
		return Integer.parseInt(primaryKeyEditText.getText().toString());
	}
	
	private void view(Shop shop) {
		Intent intent = new Intent(this, ViewShopActivity.class);
		intent.putExtra(ViewShopActivity.EXTRA_SHOP, shop);
		startActivity(intent);
	}
}<commit_msg>More self explanatory text for one2many example<commit_after>package com.novoda.sqliteprovider.demo.ui;

import android.content.Intent;
import android.os.Bundle;
import android.text.TextUtils;
import android.view.View;
import android.widget.EditText;
import android.widget.Toast;

import com.novoda.sqliteprovider.demo.R;
import com.novoda.sqliteprovider.demo.domain.Firework;
import com.novoda.sqliteprovider.demo.domain.Shop;
import com.novoda.sqliteprovider.demo.ui.base.NovodaActivity;
import com.novoda.sqliteprovider.demo.ui.util.FromXML;

import java.util.List;

public class FindFireworksFromOneShopActivity extends NovodaActivity {

	private EditText primaryKeyEditText;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_find_firework_from_one_shop);
		
		primaryKeyEditText = (EditText) findViewById(R.id.find_fireworks_from_one_shop_input_shop_primary_key);
	}
	
	@FromXML
	public void onFindShopFireworks(View button){
		if(userHasEnteredSomething()){
			try {
				int primaryKey = getPrimaryKey();

				List<Firework> fireworks = getApp().getFireworkReader().getFireworksForShop(primaryKey);
				
				Shop shop = new Shop("", "Below are the Fireworks with shop primary key: "+ primaryKey, fireworks);
				
				view(shop);
			} catch (NumberFormatException e) {
				Toast.makeText(this, "Primary Key should be an int", Toast.LENGTH_SHORT).show();
			}
		}
	}

	private boolean userHasEnteredSomething() {
		return !TextUtils.isEmpty(primaryKeyEditText.getText());
	}
	
	private int getPrimaryKey() throws NumberFormatException {
		return Integer.parseInt(primaryKeyEditText.getText().toString());
	}
	
	private void view(Shop shop) {
		Intent intent = new Intent(this, ViewShopActivity.class);
		intent.putExtra(ViewShopActivity.EXTRA_SHOP, shop);
		startActivity(intent);
	}
}
{'fraction_non_alphanumeric': 0.10235580828594638, 'fraction_numerical': 0.00027078256160303275, 'mean_word_length': 5.620071684587813, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '422227', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1136, 'n_words': 214}