<commit_before>package java.util;


/*
 * Java core library component.
 *
 * Copyright (c) 1997, 1998
 *      Transvirtual Technologies, Inc.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file.
 */
public class Stack
  extends Vector
{
	int topOfStack = 0;

/* Next empty space */
public Stack() {
}

public boolean empty() {
	return isEmpty();
}

public Object peek() {
	if (empty()) throw new EmptyStackException();

	return elementAt(topOfStack-1);
}

public Object pop() {
	if (empty()) throw new EmptyStackException();
	else {
		Object peeked=peek();

		topOfStack--;
		removeElementAt(topOfStack);

		return peeked;
	}
}

public Object push(Object item) {
	addElement(item);
	topOfStack++;

	return item;
}

public int search(Object o) {
	return lastIndexOf(o)+1;
}
}<commit_msg>various fixes by Archie:  fixed search, added synchronization<commit_after>package java.util;

/*
 * Java core library component.
 *
 * Copyright (c) 1997, 1998
 *      Transvirtual Technologies, Inc.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file.
 */
public class Stack
  extends Vector
{

public Stack() {
}

public boolean empty() {
	return isEmpty();
}

public synchronized Object peek() throws EmptyStackException {
	try {
		return elementAt(size() - 1);
	} catch (ArrayIndexOutOfBoundsException _) {
		throw new EmptyStackException();
	}
}

public synchronized Object pop() throws EmptyStackException {
	Object peeked = peek();

	removeElementAt(size() - 1);
	return peeked;
}

public Object push(Object item) {
	addElement(item);
	return item;
}

public synchronized int search(Object o) {
	int index = lastIndexOf(o);

	if (index == -1) {
		return -1;
	}
	return size() - index;
}
}

{'fraction_non_alphanumeric': 0.11527854384997242, 'fraction_numerical': 0.0126861555432984, 'mean_word_length': 3.9427792915531334, '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': '2750184', 'n_tokens_mistral': 613, 'n_tokens_neox': 560, 'n_words': 185}