harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r405425 - /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Stack.java
Date Tue, 09 May 2006 13:20:48 GMT
Author: tellison
Date: Tue May  9 06:20:31 2006
New Revision: 405425

URL: http://svn.apache.org/viewcvs?rev=405425&view=rev
Log:
Generics uplift for Stack

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Stack.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Stack.java
URL: http://svn.apache.org/viewcvs/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Stack.java?rev=405425&r1=405424&r2=405425&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Stack.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/util/Stack.java
Tue May  9 06:20:31 2006
@@ -21,7 +21,7 @@
  * represents a stack of objects. It enables users to pop and push onto the
  * stack, including null objects. There is no limit to the size of the stack
  */
-public class Stack extends Vector {
+public class Stack<E> extends Vector<E> {
 	
 	private static final long serialVersionUID = 1224463164541339165L;
 
@@ -49,7 +49,7 @@
 	 *                when empty() is true
 	 * @see #pop
 	 */
-	public synchronized Object peek() {
+	public synchronized E peek() {
 		try {
 			return elementData[elementCount - 1];
 		} catch (IndexOutOfBoundsException e) {
@@ -66,10 +66,10 @@
 	 * @see #peek
 	 * @see #push
 	 */
-	public synchronized Object pop() {
+	public synchronized E pop() {
 		try {
 			int index = elementCount - 1;
-			Object obj = elementData[index];
+			E obj = elementData[index];
 			removeElementAt(index);
 			return obj;
 		} catch (IndexOutOfBoundsException e) {
@@ -88,7 +88,7 @@
 	 * @see #peek
 	 * @see #pop
 	 */
-	public synchronized Object push(Object object) {
+	public synchronized E push(E object) {
 		addElement(object);
 		return object;
 	}



Mime
View raw message