101 |
* We can't use "this", because a subclass may override equals/hashCode |
* We can't use "this", because a subclass may override equals/hashCode |
102 |
* and we need to use object identity for the map. |
* and we need to use object identity for the map. |
103 |
*/ |
*/ |
104 |
final Key key = new Key(); |
final Key key = new Key(this); |
105 |
|
|
106 |
class Key |
static class Key |
107 |
{ |
{ |
108 |
|
private ThreadLocal outer; |
109 |
|
|
110 |
|
Key(ThreadLocal outer) |
111 |
|
{ |
112 |
|
this.outer = outer; |
113 |
|
} |
114 |
|
|
115 |
ThreadLocal get() |
ThreadLocal get() |
116 |
{ |
{ |
117 |
return ThreadLocal.this; |
return outer; |
118 |
} |
} |
119 |
} |
} |
120 |
|
|