harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r409683 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang: InheritableThreadLocal.java ThreadLocal.java
Date Fri, 26 May 2006 15:44:25 GMT
Author: tellison
Date: Fri May 26 08:44:24 2006
New Revision: 409683

URL: http://svn.apache.org/viewvc?rev=409683&view=rev
Log:
Generics uplift for thread locals.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/InheritableThreadLocal.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/InheritableThreadLocal.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/InheritableThreadLocal.java?rev=409683&r1=409682&r2=409683&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/InheritableThreadLocal.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/InheritableThreadLocal.java
Fri May 26 08:44:24 2006
@@ -25,7 +25,7 @@
  * @see java.lang.ThreadLocal
  */
 
-public class InheritableThreadLocal extends java.lang.ThreadLocal {
+public class InheritableThreadLocal<T> extends ThreadLocal<T> {
 	/**
 	 * Constructs a new InheritableThreadLocal object
 	 */
@@ -38,7 +38,7 @@
 	 * InheritableThreadLocal based on the current value of the same local on
 	 * the creator Thread.
 	 */
-	protected Object childValue(Object parentValue) {
+	protected T childValue(T parentValue) {
 		return parentValue;
 	}
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java?rev=409683&r1=409682&r2=409683&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang/ThreadLocal.java
Fri May 26 08:44:24 2006
@@ -23,7 +23,7 @@
  * 
  * @see java.lang.Thread
  */
-public class ThreadLocal {
+public class ThreadLocal<T> {
 	/**
 	 * Constructs a new ThreadLocal object
 	 */
@@ -35,22 +35,22 @@
 	 * Return the value of this variable under
 	 * <code>Thread.currentThread()</code>
 	 */
-	public Object get() {
-		return Thread.currentThread().getThreadLocal(this);
+	public T get() {
+		return (T)Thread.currentThread().getThreadLocal(this);
 	}
 
 	/**
 	 * Return the initial value of this variable under
 	 * <code>Thread.currentThread()</code>
 	 */
-	protected Object initialValue() {
+	protected T initialValue() {
 		return null;
 	}
 
 	/**
 	 * Set the value of this variable under <code>Thread.currentThread()</code>
 	 */
-	public void set(Object value) {
+	public void set(T value) {
 		Thread.currentThread().setThreadLocal(this, value);
 	}
 }



Mime
View raw message