<commit_before>package ca.ualberta.cs.team5geotopics;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;

import com.example.team5geotopics.R;

public class TopLevelActivity extends BrowseActivity implements AView<AModel>{
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.top_level_activity);
		
		//Get the singletons we may need.
		this.application = GeoTopicsApplication.getInstance();
		this.application.setContext(getApplicationContext());
		this.mCache = Cache.getInstance();
		this.myUser = User.getInstance();

		//Construct the model
		this.clm = new CommentListModel();

		// Construct the View
		this.myView = new BrowseView(this, R.layout.comment_list_item,
				clm.getList());
		// Register the view with the model
		this.clm.addView(this.myView);

		// Attach the list view to myView
		browseListView = (ListView) findViewById(R.id.browse_top_level_listView);
		browseListView.setAdapter(myView);
		
		
	}

	@Override
	protected void onResume() {
		handleCommentLoad();
		// Reset the current viewing comment
		myView.notifyDataSetChanged(); // Ensure the view is up to date.
		browseListView
				.setOnItemClickListener(new AdapterView.OnItemClickListener() {
					@Override
					public void onItemClick(AdapterView<?> myView, View view,
							int position, long arg3) {
						CommentModel selected = (CommentModel) browseListView
								.getItemAtPosition(position);
						//Add this to the cache
						//mCache.addToHistory(selected);
						Intent intent = new Intent(TopLevelActivity.this,
								ReplyLevelActivity.class);
						intent.putExtra("ViewingComment",selected);
						startActivity(intent);
					}

				});

		super.onResume();
	}

	@Override
	protected void onPause() {
		super.onPause();
	}
	
	public String getType(){
		return "TopLevel";
	}

	@Override
	public void update(AModel model) {
		myView.notifyDataSetChanged();
	}
}
<commit_msg>All views "Should" update on edit comment<commit_after>package ca.ualberta.cs.team5geotopics;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;

import com.example.team5geotopics.R;

public class TopLevelActivity extends BrowseActivity implements AView<AModel>{
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.top_level_activity);
		
		//Get the singletons we may need.
		this.application = GeoTopicsApplication.getInstance();
		this.application.setContext(getApplicationContext());
		this.mCache = Cache.getInstance();
		this.myUser = User.getInstance();

		//Construct the model
		this.clm = new CommentListModel();

		// Construct the View
		this.myView = new BrowseView(this, R.layout.comment_list_item,
				clm.getList());
		// Register the view with the model
		this.clm.addView(this.myView);

		// Attach the list view to myView
		browseListView = (ListView) findViewById(R.id.browse_top_level_listView);
		browseListView.setAdapter(myView);
		
		// Register with the user
		this.myUser.addView(this);
		
		
	}

	@Override
	protected void onResume() {
		handleCommentLoad();
		// Reset the current viewing comment
		myView.notifyDataSetChanged(); // Ensure the view is up to date.
		browseListView
				.setOnItemClickListener(new AdapterView.OnItemClickListener() {
					@Override
					public void onItemClick(AdapterView<?> myView, View view,
							int position, long arg3) {
						CommentModel selected = (CommentModel) browseListView
								.getItemAtPosition(position);
						//Add this to the cache
						//mCache.addToHistory(selected);
						Intent intent = new Intent(TopLevelActivity.this,
								ReplyLevelActivity.class);
						intent.putExtra("ViewingComment",selected);
						startActivity(intent);
					}

				});

		super.onResume();
	}

	@Override
	protected void onPause() {
		super.onPause();
	}
	
	public String getType(){
		return "TopLevel";
	}

	@Override
	public void update(AModel model) {
		if (model instanceof CommentModel) {
			clm.updateComment((CommentModel)model);
		}
		this.myView.notifyDataSetChanged();
	}
}

{'fraction_non_alphanumeric': 0.10411457149352125, 'fraction_numerical': 0.00136394635144351, 'mean_word_length': 4.080831408775982, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '3404690', 'n_tokens_mistral': 1563, 'n_tokens_neox': 1305, 'n_words': 302}