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

import java.io.Serializable;
import java.util.ArrayList;

public class UserList implements Serializable
{
	private static final long serialVersionUID = -654637474874722866L;
	public static ArrayList<User> users = new ArrayList<User>();
	protected transient ArrayList<Listener> listeners = null;
	
	public UserList() {
		listeners = new ArrayList<Listener>();
	}
	
	//returns true if UserName in users
	public boolean authenticateUser(String UserName){
		for (int i = 0; i < users.size(); ++i){
			if (users.get(i).getUserName() .equals(UserName)){
				return true;
			}
		}
			return false;
		
	}

	public void addUser(String string) throws AlreadyExistsException{
		for (int i = 0; i < users.size(); i++ ) {
			if (users.get(i).getUserName().equals(string)) { 
				throw new AlreadyExistsException();
			}
		}
		users.add(new User(string));	
		notifyListeners();
	}
	
	public int size() {
		return users.size();
	}
	
    public boolean contains(String string){
    	boolean contains = false;
    	for (int i = 0; i < users.size(); i++ ) {
			contains = users.get(i).getUserName().equals(string);
    	}
    	return contains;
    }
	
	public void remove(int i){
		users.remove(i);
		notifyListeners();
	}
	
	public User getUser(String username) {
		for (int i = 0; i < users.size(); ++i){
			if (users.get(i).getUserName() .equals(username));
			return users.get(i);
		}
		throw new RuntimeException();
		}
	
	public void editUserName(String string1, String string2) {
		users.get(users.indexOf(string1)).setUserName(string2);
		
	}
	public void removeUser(String string){
		for (int i = 0; i < users.size(); ++i){
			if (users.get(i).getUserName() .equals(string)){
				users.remove(i);
			}
		}
		}
	
	public ArrayList<User> getUsers() {
		return users;
	}
	
	public User get(int i) {
		return users.get(i);
	}
	
	private ArrayList<Listener> getListeners() {
		if (listeners == null) {
			listeners = new ArrayList<Listener>();
		}
		return listeners;
	}

	public void addListener(Listener listener) {
		getListeners().add(listener);		
	}

	public void removeListener(Listener listener) {
		getListeners().remove(listener);
	}

	public void notifyListeners() {
		for (Listener listener : listeners) {
			listener.update();
		}
	}

	
}
<commit_msg>added a comment in the Userlist. nothing special<commit_after>package ca.ualberta.cs.cmput301w15t12;

import java.io.Serializable;
import java.util.ArrayList;

public class UserList implements Serializable
{
	private static final long serialVersionUID = -654637474874722866L;
	public static ArrayList<User> users = new ArrayList<User>();
	protected transient ArrayList<Listener> listeners = null;
	
	public UserList() {
		listeners = new ArrayList<Listener>();
	}
	
	//returns true if UserName in users
	public boolean authenticateUser(String UserName){
		for (int i = 0; i < users.size(); ++i){
			if (users.get(i).getUserName() .equals(UserName)){
				return true;
			}
		}
			return false;
		
	}
	//add user by string
	public void addUser(String string) throws AlreadyExistsException{
		for (int i = 0; i < users.size(); i++ ) {
			if (users.get(i).getUserName().equals(string)) { 
				throw new AlreadyExistsException();
			}
		}
		users.add(new User(string));	
		notifyListeners();
	}
	
	public int size() {
		return users.size();
	}
	
    public boolean contains(String string){
    	boolean contains = false;
    	for (int i = 0; i < users.size(); i++ ) {
			contains = users.get(i).getUserName().equals(string);
    	}
    	return contains;
    }
	
	public void remove(int i){
		users.remove(i);
		notifyListeners();
	}
	
	public User getUser(String username) {
		for (int i = 0; i < users.size(); ++i){
			if (users.get(i).getUserName() .equals(username));
			return users.get(i);
		}
		throw new RuntimeException();
		}
	
	public void editUserName(String string1, String string2) {
		users.get(users.indexOf(string1)).setUserName(string2);
		
	}
	public void removeUser(String string){
		for (int i = 0; i < users.size(); ++i){
			if (users.get(i).getUserName() .equals(string)){
				users.remove(i);
			}
		}
		}
	
	public ArrayList<User> getUsers() {
		return users;
	}
	
	public User get(int i) {
		return users.get(i);
	}
	
	private ArrayList<Listener> getListeners() {
		if (listeners == null) {
			listeners = new ArrayList<Listener>();
		}
		return listeners;
	}

	public void addListener(Listener listener) {
		getListeners().add(listener);		
	}

	public void removeListener(Listener listener) {
		getListeners().remove(listener);
	}

	public void notifyListeners() {
		for (Listener listener : listeners) {
			listener.update();
		}
	}

	
}

{'fraction_non_alphanumeric': 0.13700686106346482, 'fraction_numerical': 0.014579759862778732, 'mean_word_length': 3.66966966966967, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 17, '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': '4891591', 'n_tokens_mistral': 1722, 'n_tokens_neox': 1506, 'n_words': 387}