public class org.apache.lucene.util.CloseableThreadLocal<T> implements java.io.Closeable
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: org.apache.lucene.util.CloseableThreadLocal
super_class: java.lang.Object
{
private java.lang.ThreadLocal<java.lang.ref.WeakReference<T>> t;
descriptor: Ljava/lang/ThreadLocal;
flags: (0x0002) ACC_PRIVATE
Signature: Ljava/lang/ThreadLocal<Ljava/lang/ref/WeakReference<TT;>;>;
private java.util.Map<java.lang.Thread, T> hardRefs;
descriptor: Ljava/util/Map;
flags: (0x0002) ACC_PRIVATE
Signature: Ljava/util/Map<Ljava/lang/Thread;TT;>;
private static int PURGE_MULTIPLIER;
descriptor: I
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
private final java.util.concurrent.atomic.AtomicInteger countUntilPurge;
descriptor: Ljava/util/concurrent/atomic/AtomicInteger;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: bipush 20
putstatic org.apache.lucene.util.CloseableThreadLocal.PURGE_MULTIPLIER:I
return
LocalVariableTable:
Start End Slot Name Signature
public void <init>();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
new java.lang.ThreadLocal
dup
invokespecial java.lang.ThreadLocal.<init>:()V
putfield org.apache.lucene.util.CloseableThreadLocal.t:Ljava/lang/ThreadLocal;
2: aload 0
new java.util.WeakHashMap
dup
invokespecial java.util.WeakHashMap.<init>:()V
putfield org.apache.lucene.util.CloseableThreadLocal.hardRefs:Ljava/util/Map;
3: aload 0
new java.util.concurrent.atomic.AtomicInteger
dup
getstatic org.apache.lucene.util.CloseableThreadLocal.PURGE_MULTIPLIER:I
invokespecial java.util.concurrent.atomic.AtomicInteger.<init>:(I)V
putfield org.apache.lucene.util.CloseableThreadLocal.countUntilPurge:Ljava/util/concurrent/atomic/AtomicInteger;
4: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lorg/apache/lucene/util/CloseableThreadLocal<TT;>;
protected T initialValue();
descriptor: ()Ljava/lang/Object;
flags: (0x0004) ACC_PROTECTED
Code:
stack=1, locals=1, args_size=1
start local 0 0: aconst_null
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lorg/apache/lucene/util/CloseableThreadLocal<TT;>;
Signature: ()TT;
public T get();
descriptor: ()Ljava/lang/Object;
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=3, args_size=1
start local 0 0: aload 0
getfield org.apache.lucene.util.CloseableThreadLocal.t:Ljava/lang/ThreadLocal;
invokevirtual java.lang.ThreadLocal.get:()Ljava/lang/Object;
checkcast java.lang.ref.WeakReference
astore 1
start local 1 1: aload 1
ifnonnull 7
2: aload 0
invokevirtual org.apache.lucene.util.CloseableThreadLocal.initialValue:()Ljava/lang/Object;
astore 2
start local 2 3: aload 2
ifnull 6
4: aload 0
aload 2
invokevirtual org.apache.lucene.util.CloseableThreadLocal.set:(Ljava/lang/Object;)V
5: aload 2
areturn
6: StackMap locals: java.lang.ref.WeakReference java.lang.Object
StackMap stack:
aconst_null
areturn
end local 2 7: StackMap locals:
StackMap stack:
aload 0
invokevirtual org.apache.lucene.util.CloseableThreadLocal.maybePurge:()V
8: aload 1
invokevirtual java.lang.ref.WeakReference.get:()Ljava/lang/Object;
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 this Lorg/apache/lucene/util/CloseableThreadLocal<TT;>;
1 9 1 weakRef Ljava/lang/ref/WeakReference<TT;>;
3 7 2 iv TT;
Signature: ()TT;
public void set();
descriptor: (Ljava/lang/Object;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=3, args_size=2
start local 0 start local 1 0: aload 0
getfield org.apache.lucene.util.CloseableThreadLocal.t:Ljava/lang/ThreadLocal;
new java.lang.ref.WeakReference
dup
aload 1
invokespecial java.lang.ref.WeakReference.<init>:(Ljava/lang/Object;)V
invokevirtual java.lang.ThreadLocal.set:(Ljava/lang/Object;)V
1: aload 0
getfield org.apache.lucene.util.CloseableThreadLocal.hardRefs:Ljava/util/Map;
dup
astore 2
monitorenter
2: aload 0
getfield org.apache.lucene.util.CloseableThreadLocal.hardRefs:Ljava/util/Map;
invokestatic java.lang.Thread.currentThread:()Ljava/lang/Thread;
aload 1
invokeinterface java.util.Map.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
3: aload 0
invokevirtual org.apache.lucene.util.CloseableThreadLocal.maybePurge:()V
4: aload 2
monitorexit
5: goto 8
StackMap locals: org.apache.lucene.util.CloseableThreadLocal java.lang.Object java.util.Map
StackMap stack: java.lang.Throwable
6: aload 2
monitorexit
7: athrow
8: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 9 0 this Lorg/apache/lucene/util/CloseableThreadLocal<TT;>;
0 9 1 object TT;
Exception table:
from to target type
2 5 6 any
6 7 6 any
Signature: (TT;)V
MethodParameters:
Name Flags
object
private void maybePurge();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield org.apache.lucene.util.CloseableThreadLocal.countUntilPurge:Ljava/util/concurrent/atomic/AtomicInteger;
invokevirtual java.util.concurrent.atomic.AtomicInteger.getAndDecrement:()I
ifne 2
1: aload 0
invokevirtual org.apache.lucene.util.CloseableThreadLocal.purge:()V
2: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lorg/apache/lucene/util/CloseableThreadLocal<TT;>;
private void purge();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=5, args_size=1
start local 0 0: aload 0
getfield org.apache.lucene.util.CloseableThreadLocal.hardRefs:Ljava/util/Map;
dup
astore 1
monitorenter
1: iconst_0
istore 2
start local 2 2: aload 0
getfield org.apache.lucene.util.CloseableThreadLocal.hardRefs:Ljava/util/Map;
invokeinterface java.util.Map.keySet:()Ljava/util/Set;
invokeinterface java.util.Set.iterator:()Ljava/util/Iterator;
astore 3
start local 3 3: goto 9
4: StackMap locals: java.util.Map int java.util.Iterator
StackMap stack:
aload 3
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast java.lang.Thread
astore 4
start local 4 5: aload 4
invokevirtual java.lang.Thread.isAlive:()Z
ifne 8
6: aload 3
invokeinterface java.util.Iterator.remove:()V
7: goto 9
8: StackMap locals: java.lang.Thread
StackMap stack:
iinc 2 1
end local 4 9: StackMap locals:
StackMap stack:
aload 3
invokeinterface java.util.Iterator.hasNext:()Z
ifne 4
end local 3 10: iconst_1
iload 2
iadd
getstatic org.apache.lucene.util.CloseableThreadLocal.PURGE_MULTIPLIER:I
imul
istore 3
start local 3 11: iload 3
ifgt 13
12: ldc 1000000
istore 3
13: StackMap locals: org.apache.lucene.util.CloseableThreadLocal java.util.Map int int
StackMap stack:
aload 0
getfield org.apache.lucene.util.CloseableThreadLocal.countUntilPurge:Ljava/util/concurrent/atomic/AtomicInteger;
iload 3
invokevirtual java.util.concurrent.atomic.AtomicInteger.set:(I)V
end local 3 end local 2 14: aload 1
monitorexit
15: goto 18
StackMap locals: org.apache.lucene.util.CloseableThreadLocal java.util.Map
StackMap stack: java.lang.Throwable
16: aload 1
monitorexit
17: athrow
18: StackMap locals:
StackMap stack:
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 19 0 this Lorg/apache/lucene/util/CloseableThreadLocal<TT;>;
2 14 2 stillAliveCount I
3 10 3 it Ljava/util/Iterator<Ljava/lang/Thread;>;
5 9 4 t Ljava/lang/Thread;
11 14 3 nextCount I
Exception table:
from to target type
1 15 16 any
16 17 16 any
public void close();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
aconst_null
putfield org.apache.lucene.util.CloseableThreadLocal.hardRefs:Ljava/util/Map;
1: aload 0
getfield org.apache.lucene.util.CloseableThreadLocal.t:Ljava/lang/ThreadLocal;
ifnull 3
2: aload 0
getfield org.apache.lucene.util.CloseableThreadLocal.t:Ljava/lang/ThreadLocal;
invokevirtual java.lang.ThreadLocal.remove:()V
3: StackMap locals:
StackMap stack:
aload 0
aconst_null
putfield org.apache.lucene.util.CloseableThreadLocal.t:Ljava/lang/ThreadLocal;
4: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lorg/apache/lucene/util/CloseableThreadLocal<TT;>;
}
Signature: <T:Ljava/lang/Object;>Ljava/lang/Object;Ljava/io/Closeable;
SourceFile: "CloseableThreadLocal.java"