<commit_before>package com.vaguehope.onosendai.ui.pref;

import android.content.Context;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Spinner;

import com.vaguehope.onosendai.R;
import com.vaguehope.onosendai.config.Account;
import com.vaguehope.onosendai.config.AccountProvider;

class AccountDialog {

	private final String id;
	private final Account initialValue;

	private final ArrayAdapter<AccountProvider> actAccountTypeAdaptor;
	private final LinearLayout llParent;
	private final Spinner spnAccountType;
	private final EditText txtUsername;
	private final EditText txtPassword;
	private final CheckBox chkDelete;

	public AccountDialog (final Context context, final String id) {
		this(context, id, null);
	}

	public AccountDialog (final Context context, final Account initialValue) {
		this(context, initialValue != null ? initialValue.getId() : null, initialValue);
	}

	private AccountDialog (final Context context, final String id, final Account initialValue) {
		if (id == null) throw new IllegalArgumentException("ID may not be null.");
		if (initialValue != null && initialValue.getId() != id) throw new IllegalStateException("ID and initialValue ID do not match.");

		this.id = id;
		this.initialValue = initialValue;

		this.actAccountTypeAdaptor = new ArrayAdapter<AccountProvider>(context, R.layout.accounttypelistrow);
		this.actAccountTypeAdaptor.add(AccountProvider.SUCCESSWHALE);
		// TODO include other account types.

		this.llParent = new LinearLayout(context);
		this.llParent.setOrientation(LinearLayout.VERTICAL);

		this.spnAccountType = new Spinner(context);
		this.spnAccountType.setAdapter(this.actAccountTypeAdaptor);<commit_msg>Fix str comp using ==.<commit_after>package com.vaguehope.onosendai.ui.pref;

import android.content.Context;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Spinner;

import com.vaguehope.onosendai.R;
import com.vaguehope.onosendai.config.Account;
import com.vaguehope.onosendai.config.AccountProvider;

class AccountDialog {

	private final String id;
	private final Account initialValue;

	private final ArrayAdapter<AccountProvider> actAccountTypeAdaptor;
	private final LinearLayout llParent;
	private final Spinner spnAccountType;
	private final EditText txtUsername;
	private final EditText txtPassword;
	private final CheckBox chkDelete;

	public AccountDialog (final Context context, final String id) {
		this(context, id, null);
	}

	public AccountDialog (final Context context, final Account initialValue) {
		this(context, initialValue != null ? initialValue.getId() : null, initialValue);
	}

	private AccountDialog (final Context context, final String id, final Account initialValue) {
		if (id == null) throw new IllegalArgumentException("ID may not be null.");
		if (initialValue != null && !id.equals(initialValue.getId())) throw new IllegalStateException("ID and initialValue ID do not match.");

		this.id = id;
		this.initialValue = initialValue;

		this.actAccountTypeAdaptor = new ArrayAdapter<AccountProvider>(context, R.layout.accounttypelistrow);
		this.actAccountTypeAdaptor.add(AccountProvider.SUCCESSWHALE);
		// TODO include other account types.

		this.llParent = new LinearLayout(context);
		this.llParent.setOrientation(LinearLayout.VERTICAL);

		this.spnAccountType = new Spinner(context);
		this.spnAccountType.setAdapter(this.actAccountTypeAdaptor);
{'fraction_non_alphanumeric': 0.0896551724137931, 'fraction_numerical': 0.0, 'mean_word_length': 5.933078393881453, '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': '7249372', 'n_tokens_mistral': 1077, 'n_tokens_neox': 1014, 'n_words': 278}