<commit_before>package com.ford.messi.sms;

import com.ford.messi.applink.AppLinkApplication;

import android.database.Cursor;
import android.net.Uri;
import android.provider.ContactsContract.PhoneLookup;
import android.util.Log;

public class Message {
	
	private final String TAG = this.getClass().getSimpleName();
	
	private String sender;
	private String title;
	private String body;
	private int currentIndex;
	
	public Message() {		
	}
	
	public Message(String sender, String body, int currentIndex) {
		this.sender = sender;
		setTitle(sender);
		this.body = body;
		this.currentIndex = currentIndex;
	}
	
	public String getSender() {
		return sender;
	}
	
	public void setSender(String sender) {
		this.sender = sender;
	}
	
	public String getTitle() {
		return title;
	}

	public void setTitle(String sender) {
		Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(sender));
		Log.d(TAG, "uri: " + uri);
		Cursor c = AppLinkApplication.getApplication().getContentResolver().query(uri, 
				new String[]{PhoneLookup.DISPLAY_NAME}, null, null, null);		
		if (c != null) {
			while (c.moveToNext()) {
		        title = c.getString(0);
			}
		} else {
			title = sender;
		}
		Log.d(TAG, "Msg title: " + getTitle());
	}
	
	public String getBody() {
		return body;
	}

	public void setBody(String body) {
		this.body = body;
	}<commit_msg>Fixed bug - when sender is unknown number, "Null" may be displayed on screen.<commit_after>package com.ford.messi.sms;

import com.ford.messi.applink.AppLinkApplication;

import android.database.Cursor;
import android.net.Uri;
import android.provider.ContactsContract.PhoneLookup;
import android.util.Log;

public class Message {
	
	private final String TAG = this.getClass().getSimpleName();
	
	private String sender;
	private String title;
	private String body;
	private int currentIndex;
	
	public Message() {		
	}
	
	public Message(String sender, String body, int currentIndex) {
		this.sender = sender;
		setTitle(sender);
		this.body = body;
		this.currentIndex = currentIndex;
	}
	
	public String getSender() {
		return sender;
	}
	
	public void setSender(String sender) {
		this.sender = sender;
	}
	
	public String getTitle() {
		return title;
	}

	public void setTitle(String sender) {
		Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(sender));
		Log.d(TAG, "uri: " + uri);
		Cursor c = AppLinkApplication.getApplication().getContentResolver().query(uri, 
				new String[]{PhoneLookup.DISPLAY_NAME}, null, null, null);		
		if (c != null) {
			while (c.moveToNext()) {
		        title = c.getString(0);
			}
		} else {
			title = sender;
		}
		if (title == null) {
			title = sender;
		}
		Log.d(TAG, "Msg title: " + getTitle());
	}
	
	public String getBody() {
		return body;
	}

	public void setBody(String body) {
		this.body = body;
	}
{'fraction_non_alphanumeric': 0.12077464788732395, 'fraction_numerical': 0.0007042253521126761, 'mean_word_length': 3.782828282828283, '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': '6870010', 'n_tokens_mistral': 1017, 'n_tokens_neox': 907, 'n_words': 233}