You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by te...@apache.org on 2006/05/26 17:44:25 UTC
svn commit: r409683 - in
/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/java/lang:
InheritableThreadLocal.java ThreadLocal.java
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);
}
}