class java.lang.ApplicationShutdownHooks
minor version: 0
major version: 59
flags: flags: (0x0020) ACC_SUPER
this_class: java.lang.ApplicationShutdownHooks
super_class: java.lang.Object
{
private static java.util.IdentityHashMap<java.lang.Thread, java.lang.Thread> hooks;
descriptor: Ljava/util/IdentityHashMap;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Signature: Ljava/util/IdentityHashMap<Ljava/lang/Thread;Ljava/lang/Thread;>;
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=4, locals=0, args_size=0
0: iconst_1
1: iconst_0
2: new java.lang.ApplicationShutdownHooks$1
dup
invokespecial java.lang.ApplicationShutdownHooks$1.<init>:()V
3: invokestatic java.lang.Shutdown.add:(IZLjava/lang/Runnable;)V
4: new java.util.IdentityHashMap
dup
invokespecial java.util.IdentityHashMap.<init>:()V
putstatic java.lang.ApplicationShutdownHooks.hooks:Ljava/util/IdentityHashMap;
5: goto 8
StackMap locals:
StackMap stack: java.lang.IllegalStateException
6: pop
7: aconst_null
putstatic java.lang.ApplicationShutdownHooks.hooks:Ljava/util/IdentityHashMap;
8: StackMap locals:
StackMap stack:
return
LocalVariableTable:
Start End Slot Name Signature
Exception table:
from to target type
0 5 6 Class java.lang.IllegalStateException
private void <init>();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/lang/ApplicationShutdownHooks;
static synchronized void add(java.lang.Thread);
descriptor: (Ljava/lang/Thread;)V
flags: (0x0028) ACC_STATIC, ACC_SYNCHRONIZED
Code:
stack=3, locals=1, args_size=1
start local 0 0: getstatic java.lang.ApplicationShutdownHooks.hooks:Ljava/util/IdentityHashMap;
ifnonnull 2
1: new java.lang.IllegalStateException
dup
ldc "Shutdown in progress"
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
invokevirtual java.lang.Thread.isAlive:()Z
ifeq 4
3: new java.lang.IllegalArgumentException
dup
ldc "Hook already running"
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
4: StackMap locals:
StackMap stack:
getstatic java.lang.ApplicationShutdownHooks.hooks:Ljava/util/IdentityHashMap;
aload 0
invokevirtual java.util.IdentityHashMap.containsKey:(Ljava/lang/Object;)Z
ifeq 6
5: new java.lang.IllegalArgumentException
dup
ldc "Hook previously registered"
invokespecial java.lang.IllegalArgumentException.<init>:(Ljava/lang/String;)V
athrow
6: StackMap locals:
StackMap stack:
getstatic java.lang.ApplicationShutdownHooks.hooks:Ljava/util/IdentityHashMap;
aload 0
aload 0
invokevirtual java.util.IdentityHashMap.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
7: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 8 0 hook Ljava/lang/Thread;
MethodParameters:
Name Flags
hook
static synchronized boolean remove(java.lang.Thread);
descriptor: (Ljava/lang/Thread;)Z
flags: (0x0028) ACC_STATIC, ACC_SYNCHRONIZED
Code:
stack=3, locals=1, args_size=1
start local 0 0: getstatic java.lang.ApplicationShutdownHooks.hooks:Ljava/util/IdentityHashMap;
ifnonnull 2
1: new java.lang.IllegalStateException
dup
ldc "Shutdown in progress"
invokespecial java.lang.IllegalStateException.<init>:(Ljava/lang/String;)V
athrow
2: StackMap locals:
StackMap stack:
aload 0
ifnonnull 4
3: new java.lang.NullPointerException
dup
invokespecial java.lang.NullPointerException.<init>:()V
athrow
4: StackMap locals:
StackMap stack:
getstatic java.lang.ApplicationShutdownHooks.hooks:Ljava/util/IdentityHashMap;
aload 0
invokevirtual java.util.IdentityHashMap.remove:(Ljava/lang/Object;)Ljava/lang/Object;
ifnull 5
iconst_1
ireturn
StackMap locals:
StackMap stack:
5: iconst_0
ireturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 hook Ljava/lang/Thread;
MethodParameters:
Name Flags
hook
static void runHooks();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=3, args_size=0
0: ldc Ljava/lang/ApplicationShutdownHooks;
dup
astore 1
monitorenter
1: getstatic java.lang.ApplicationShutdownHooks.hooks:Ljava/util/IdentityHashMap;
invokevirtual java.util.IdentityHashMap.keySet:()Ljava/util/Set;
astore 0
start local 0 2: aconst_null
putstatic java.lang.ApplicationShutdownHooks.hooks:Ljava/util/IdentityHashMap;
3: aload 1
monitorexit
4: goto 7
end local 0 StackMap locals: top java.lang.Class
StackMap stack: java.lang.Throwable
5: aload 1
monitorexit
6: athrow
start local 0 7: StackMap locals: java.util.Collection
StackMap stack:
aload 0
invokeinterface java.util.Collection.iterator:()Ljava/util/Iterator;
astore 2
goto 10
StackMap locals: java.util.Collection top java.util.Iterator
StackMap stack:
8: aload 2
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast java.lang.Thread
astore 1
start local 1 9: aload 1
invokevirtual java.lang.Thread.start:()V
end local 1 10: StackMap locals:
StackMap stack:
aload 2
invokeinterface java.util.Iterator.hasNext:()Z
ifne 8
11: aload 0
invokeinterface java.util.Collection.iterator:()Ljava/util/Iterator;
astore 2
goto 17
StackMap locals:
StackMap stack:
12: aload 2
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast java.lang.Thread
astore 1
start local 1 13: StackMap locals: java.util.Collection java.lang.Thread java.util.Iterator
StackMap stack:
aload 1
invokevirtual java.lang.Thread.join:()V
14: goto 17
15: StackMap locals:
StackMap stack: java.lang.InterruptedException
pop
16: goto 13
end local 1 17: StackMap locals: java.util.Collection top java.util.Iterator
StackMap stack:
aload 2
invokeinterface java.util.Iterator.hasNext:()Z
ifne 12
18: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
2 5 0 threads Ljava/util/Collection<Ljava/lang/Thread;>;
7 19 0 threads Ljava/util/Collection<Ljava/lang/Thread;>;
9 10 1 hook Ljava/lang/Thread;
13 17 1 hook Ljava/lang/Thread;
Exception table:
from to target type
1 4 5 any
5 6 5 any
13 14 15 Class java.lang.InterruptedException
}
SourceFile: "ApplicationShutdownHooks.java"
NestMembers:
java.lang.ApplicationShutdownHooks$1
InnerClasses:
java.lang.ApplicationShutdownHooks$1