<commit_before>package jsettlers.newmain.datatypes;

import java.util.List;

import jsettlers.graphics.startscreen.interfaces.IChangingList;
import jsettlers.graphics.startscreen.interfaces.IChangingListListener;

/**
 * This class implements the {@link IChangingList} interface and represents a list that can change and will inform it's listener of this change.
 * 
 * @author <NAME>
 * 
 * @param <T>
 */
public class ChangingList<T> implements IChangingList<T> {

	private List<? extends T> items;
	private IChangingListListener<T> listener;

	public ChangingList() {
	}

	public ChangingList(List<? extends T> items) {
		this.items = items;
	}

	@Override
	public synchronized void setListener(IChangingListListener<T> listener) {
		this.listener = listener;
	}

	@Override
	public List<? extends T> getItems() {
		return items;
	}

	@Override
	public void stop() {
		listener = null;
		items = null;
	}

	public void setList(List<T> items) {
		this.items = items;
		informListener();
	}

	private synchronized void informListener() {
		if (listener != null) {
			listener.listChanged(this);
		}
	}

}<commit_msg>Fixed some multiplayer related issues in graphics.<commit_after>package jsettlers.newmain.datatypes;

import java.util.Collections;
import java.util.List;

import jsettlers.graphics.startscreen.interfaces.IChangingList;
import jsettlers.graphics.startscreen.interfaces.IChangingListListener;

/**
 * This class implements the {@link IChangingList} interface and represents a list that can change and will inform it's listener of this change.
 * 
 * @author <NAME>
 * 
 * @param <T>
 */
public class ChangingList<T> implements IChangingList<T> {

	private List<? extends T> items;
	private IChangingListListener<T> listener;

	public ChangingList() {
		this(Collections.<T>emptyList());
	}

	public ChangingList(List<? extends T> items) {
		setList(items);
	}

	@Override
	public synchronized void setListener(IChangingListListener<T> listener) {
		this.listener = listener;
	}

	@Override
	public List<? extends T> getItems() {
		return items;
	}

	@Override
	public void stop() {
		listener = null;
		items = Collections.emptyList();
	}

	public void setList(List<? extends T> items) {
		if (items == null) {
			throw new NullPointerException();
		}
		this.items = items;
		informListener();
	}

	private synchronized void informListener() {
		if (listener != null) {
			listener.listChanged(this);
		}
	}

}
{'fraction_non_alphanumeric': 0.11005770816158285, 'fraction_numerical': 0.0, 'mean_word_length': 4.515909090909091, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, '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': '2890268', 'n_tokens_mistral': 809, 'n_tokens_neox': 745, 'n_words': 206}