<commit_before>package com.mhfs.ipc;

import java.util.Optional;

public class CallFuture<T> {
	
	private static int currentID = 0;

	private int invocationID;
	private boolean finished;
	private Optional<T> result;
	private Method<T> method;
	
	private CallFuture(Method<T> method) {
		this.invocationID = currentID++;
		this.method = method;
	}
	
	public CallFuture() {
		this(null);
	}

	@SuppressWarnings("unchecked")
	void onReturn(Object result) {
		synchronized(this) {
			this.result = Optional.ofNullable((T)result);
			this.finished = true;
		}
	}
	
	int getID() {
		return invocationID;
	}
	
	Method<T> getMethod() {
		return method;
	}
	
	public boolean isFinished() {
		return finished;
	}
	
	public boolean hasResult() {
		return result.isPresent();
	}
	
	public T getResult() {
		return result.get();
	}<commit_msg>Minor Bugfix<commit_after>package com.mhfs.ipc;

import java.util.Optional;

public class CallFuture<T> {
	
	private static int currentID = 0;

	private int invocationID;
	private boolean finished;
	private Optional<T> result;
	private Method<T> method;
	
	private CallFuture(Method<T> method) {
		this.invocationID = currentID++;
		this.method = method;
	}
	
	public CallFuture() {
		this(null);
	}

	@SuppressWarnings("unchecked")
	void onReturn(Object result) {
		synchronized(this) {
			this.result = Optional.ofNullable((T)result);
			this.finished = true;
		}
	}
	
	int getID() {
		return invocationID;
	}
	
	Method<T> getMethod() {
		return method;
	}
	
	public boolean isFinished() {
		return finished;
	}
	
	public boolean hasResult() {
		return result.isPresent();
	}
	
	public T getResult() {
		synchronized(this) {
			return result.get();
		}
	}
{'fraction_non_alphanumeric': 0.12092471843509188, 'fraction_numerical': 0.0011855364552459987, 'mean_word_length': 3.878612716763006, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '1549664', 'n_tokens_mistral': 637, 'n_tokens_neox': 564, 'n_words': 134}