public final class java.io.Console implements java.io.Flushable
minor version: 0
major version: 59
flags: flags: (0x0031) ACC_PUBLIC, ACC_FINAL, ACC_SUPER
this_class: java.io.Console
super_class: java.lang.Object
{
private java.lang.Object readLock;
descriptor: Ljava/lang/Object;
flags: (0x0002) ACC_PRIVATE
private java.lang.Object writeLock;
descriptor: Ljava/lang/Object;
flags: (0x0002) ACC_PRIVATE
private java.io.Reader reader;
descriptor: Ljava/io/Reader;
flags: (0x0002) ACC_PRIVATE
private java.io.Writer out;
descriptor: Ljava/io/Writer;
flags: (0x0002) ACC_PRIVATE
private java.io.PrintWriter pw;
descriptor: Ljava/io/PrintWriter;
flags: (0x0002) ACC_PRIVATE
private java.util.Formatter formatter;
descriptor: Ljava/util/Formatter;
flags: (0x0002) ACC_PRIVATE
private java.nio.charset.Charset cs;
descriptor: Ljava/nio/charset/Charset;
flags: (0x0002) ACC_PRIVATE
private char[] rcb;
descriptor: [C
flags: (0x0002) ACC_PRIVATE
private boolean restoreEcho;
descriptor: Z
flags: (0x0002) ACC_PRIVATE
private boolean shutdownHookInstalled;
descriptor: Z
flags: (0x0002) ACC_PRIVATE
private static java.io.Console cons;
descriptor: Ljava/io/Console;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
static final boolean $assertionsDisabled;
descriptor: Z
flags: (0x1018) ACC_STATIC, ACC_FINAL, ACC_SYNTHETIC
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=2, locals=0, args_size=0
0: ldc Ljava/io/Console;
invokevirtual java.lang.Class.desiredAssertionStatus:()Z
ifne 1
iconst_1
goto 2
StackMap locals:
StackMap stack:
1: iconst_0
StackMap locals:
StackMap stack: int
2: putstatic java.io.Console.$assertionsDisabled:Z
3: new java.io.Console$1
dup
invokespecial java.io.Console$1.<init>:()V
invokestatic jdk.internal.misc.SharedSecrets.setJavaIOAccess:(Ljdk/internal/misc/JavaIOAccess;)V
4: return
LocalVariableTable:
Start End Slot Name Signature
public java.io.PrintWriter writer();
descriptor: ()Ljava/io/PrintWriter;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield java.io.Console.pw:Ljava/io/PrintWriter;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/io/Console;
public java.io.Reader reader();
descriptor: ()Ljava/io/Reader;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield java.io.Console.reader:Ljava/io/Reader;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/io/Console;
public java.io.Console format(java.lang.String, java.lang.Object[]);
descriptor: (Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/Console;
flags: (0x0081) ACC_PUBLIC, ACC_VARARGS
Code:
stack=3, locals=3, args_size=3
start local 0 start local 1 start local 2 0: aload 0
getfield java.io.Console.formatter:Ljava/util/Formatter;
aload 1
aload 2
invokevirtual java.util.Formatter.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/util/Formatter;
invokevirtual java.util.Formatter.flush:()V
1: aload 0
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Ljava/io/Console;
0 2 1 fmt Ljava/lang/String;
0 2 2 args [Ljava/lang/Object;
MethodParameters:
Name Flags
fmt
args
public java.io.Console printf(java.lang.String, java.lang.Object[]);
descriptor: (Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/Console;
flags: (0x0081) ACC_PUBLIC, ACC_VARARGS
Code:
stack=3, locals=3, args_size=3
start local 0 start local 1 start local 2 0: aload 0
aload 1
aload 2
invokevirtual java.io.Console.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/Console;
areturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/io/Console;
0 1 1 format Ljava/lang/String;
0 1 2 args [Ljava/lang/Object;
MethodParameters:
Name Flags
format
args
public java.lang.String readLine(java.lang.String, java.lang.Object[]);
descriptor: (Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
flags: (0x0081) ACC_PUBLIC, ACC_VARARGS
Code:
stack=3, locals=7, args_size=3
start local 0 start local 1 start local 2 0: aconst_null
astore 3
start local 3 1: aload 0
getfield java.io.Console.writeLock:Ljava/lang/Object;
dup
astore 4
monitorenter
2: aload 0
getfield java.io.Console.readLock:Ljava/lang/Object;
dup
astore 5
monitorenter
3: aload 1
invokevirtual java.lang.String.isEmpty:()Z
ifne 5
4: aload 0
getfield java.io.Console.pw:Ljava/io/PrintWriter;
aload 1
aload 2
invokevirtual java.io.PrintWriter.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/PrintWriter;
pop
5: StackMap locals: java.lang.String java.lang.Object java.lang.Object
StackMap stack:
aload 0
iconst_0
invokevirtual java.io.Console.readline:(Z)[C
astore 6
start local 6 6: aload 6
ifnull 11
7: new java.lang.String
dup
aload 6
invokespecial java.lang.String.<init>:([C)V
astore 3
end local 6 8: goto 11
StackMap locals:
StackMap stack: java.io.IOException
9: astore 6
start local 6 10: new java.io.IOError
dup
aload 6
invokespecial java.io.IOError.<init>:(Ljava/lang/Throwable;)V
athrow
end local 6 11: StackMap locals:
StackMap stack:
aload 5
monitorexit
12: goto 15
StackMap locals:
StackMap stack: java.lang.Throwable
13: aload 5
monitorexit
14: athrow
15: StackMap locals:
StackMap stack:
aload 4
monitorexit
16: goto 19
StackMap locals:
StackMap stack: java.lang.Throwable
17: aload 4
monitorexit
18: athrow
19: StackMap locals:
StackMap stack:
aload 3
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 20 0 this Ljava/io/Console;
0 20 1 fmt Ljava/lang/String;
0 20 2 args [Ljava/lang/Object;
1 20 3 line Ljava/lang/String;
6 8 6 ca [C
10 11 6 x Ljava/io/IOException;
Exception table:
from to target type
5 8 9 Class java.io.IOException
3 12 13 any
13 14 13 any
2 16 17 any
17 18 17 any
MethodParameters:
Name Flags
fmt
args
public java.lang.String readLine();
descriptor: ()Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
ldc ""
iconst_0
anewarray java.lang.Object
invokevirtual java.io.Console.readLine:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/io/Console;
public char[] readPassword(java.lang.String, java.lang.Object[]);
descriptor: (Ljava/lang/String;[Ljava/lang/Object;)[C
flags: (0x0081) ACC_PUBLIC, ACC_VARARGS
Code:
stack=3, locals=10, args_size=3
start local 0 start local 1 start local 2 0: aconst_null
astore 3
start local 3 1: aload 0
getfield java.io.Console.writeLock:Ljava/lang/Object;
dup
astore 4
monitorenter
2: aload 0
getfield java.io.Console.readLock:Ljava/lang/Object;
dup
astore 5
monitorenter
3: aload 0
invokevirtual java.io.Console.installShutdownHook:()V
4: aload 0
iconst_0
invokestatic java.io.Console.echo:(Z)Z
putfield java.io.Console.restoreEcho:Z
5: goto 8
StackMap locals: java.io.Console java.lang.String java.lang.Object[] char[] java.lang.Object java.lang.Object
StackMap stack: java.io.IOException
6: astore 6
start local 6 7: new java.io.IOError
dup
aload 6
invokespecial java.io.IOError.<init>:(Ljava/lang/Throwable;)V
athrow
end local 6 8: StackMap locals:
StackMap stack:
aconst_null
astore 6
start local 6 9: aload 1
invokevirtual java.lang.String.isEmpty:()Z
ifne 11
10: aload 0
getfield java.io.Console.pw:Ljava/io/PrintWriter;
aload 1
aload 2
invokevirtual java.io.PrintWriter.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/PrintWriter;
pop
11: StackMap locals: java.io.IOError
StackMap stack:
aload 0
iconst_1
invokevirtual java.io.Console.readline:(Z)[C
astore 3
12: goto 35
StackMap locals:
StackMap stack: java.io.IOException
13: astore 7
start local 7 14: new java.io.IOError
dup
aload 7
invokespecial java.io.IOError.<init>:(Ljava/lang/Throwable;)V
astore 6
end local 7 15: aload 0
getfield java.io.Console.restoreEcho:Z
ifeq 22
16: aload 0
iconst_1
invokestatic java.io.Console.echo:(Z)Z
putfield java.io.Console.restoreEcho:Z
17: goto 22
StackMap locals:
StackMap stack: java.io.IOException
18: astore 9
start local 9 19: aload 6
ifnonnull 21
20: new java.io.IOError
dup
aload 9
invokespecial java.io.IOError.<init>:(Ljava/lang/Throwable;)V
astore 6
goto 22
21: StackMap locals: java.io.Console java.lang.String java.lang.Object[] char[] java.lang.Object java.lang.Object java.io.IOError top top java.io.IOException
StackMap stack:
aload 6
aload 9
invokevirtual java.io.IOError.addSuppressed:(Ljava/lang/Throwable;)V
end local 9 22: StackMap locals: java.io.Console java.lang.String java.lang.Object[] char[] java.lang.Object java.lang.Object java.io.IOError
StackMap stack:
aload 6
ifnull 44
23: aload 6
athrow
24: StackMap locals:
StackMap stack: java.lang.Throwable
astore 8
25: aload 0
getfield java.io.Console.restoreEcho:Z
ifeq 32
26: aload 0
iconst_1
invokestatic java.io.Console.echo:(Z)Z
putfield java.io.Console.restoreEcho:Z
27: goto 32
StackMap locals: java.io.Console java.lang.String java.lang.Object[] char[] java.lang.Object java.lang.Object java.io.IOError top java.lang.Throwable
StackMap stack: java.io.IOException
28: astore 9
start local 9 29: aload 6
ifnonnull 31
30: new java.io.IOError
dup
aload 9
invokespecial java.io.IOError.<init>:(Ljava/lang/Throwable;)V
astore 6
goto 32
31: StackMap locals: java.io.IOException
StackMap stack:
aload 6
aload 9
invokevirtual java.io.IOError.addSuppressed:(Ljava/lang/Throwable;)V
end local 9 32: StackMap locals:
StackMap stack:
aload 6
ifnull 34
33: aload 6
athrow
34: StackMap locals:
StackMap stack:
aload 8
athrow
35: StackMap locals: java.io.Console java.lang.String java.lang.Object[] char[] java.lang.Object java.lang.Object java.io.IOError
StackMap stack:
aload 0
getfield java.io.Console.restoreEcho:Z
ifeq 42
36: aload 0
iconst_1
invokestatic java.io.Console.echo:(Z)Z
putfield java.io.Console.restoreEcho:Z
37: goto 42
StackMap locals:
StackMap stack: java.io.IOException
38: astore 9
start local 9 39: aload 6
ifnonnull 41
40: new java.io.IOError
dup
aload 9
invokespecial java.io.IOError.<init>:(Ljava/lang/Throwable;)V
astore 6
goto 42
41: StackMap locals: java.io.Console java.lang.String java.lang.Object[] char[] java.lang.Object java.lang.Object java.io.IOError top top java.io.IOException
StackMap stack:
aload 6
aload 9
invokevirtual java.io.IOError.addSuppressed:(Ljava/lang/Throwable;)V
end local 9 42: StackMap locals: java.io.Console java.lang.String java.lang.Object[] char[] java.lang.Object java.lang.Object java.io.IOError
StackMap stack:
aload 6
ifnull 44
43: aload 6
athrow
44: StackMap locals:
StackMap stack:
aload 0
getfield java.io.Console.pw:Ljava/io/PrintWriter;
invokevirtual java.io.PrintWriter.println:()V
end local 6 45: aload 5
monitorexit
46: goto 49
StackMap locals: java.io.Console java.lang.String java.lang.Object[] char[] java.lang.Object java.lang.Object
StackMap stack: java.lang.Throwable
47: aload 5
monitorexit
48: athrow
49: StackMap locals:
StackMap stack:
aload 4
monitorexit
50: goto 53
StackMap locals:
StackMap stack: java.lang.Throwable
51: aload 4
monitorexit
52: athrow
53: StackMap locals:
StackMap stack:
aload 3
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 54 0 this Ljava/io/Console;
0 54 1 fmt Ljava/lang/String;
0 54 2 args [Ljava/lang/Object;
1 54 3 passwd [C
7 8 6 x Ljava/io/IOException;
9 45 6 ioe Ljava/io/IOError;
14 15 7 x Ljava/io/IOException;
19 22 9 x Ljava/io/IOException;
29 32 9 x Ljava/io/IOException;
39 42 9 x Ljava/io/IOException;
Exception table:
from to target type
4 5 6 Class java.io.IOException
9 12 13 Class java.io.IOException
15 17 18 Class java.io.IOException
9 15 24 any
25 27 28 Class java.io.IOException
35 37 38 Class java.io.IOException
3 46 47 any
47 48 47 any
2 50 51 any
51 52 51 any
MethodParameters:
Name Flags
fmt
args
private void installShutdownHook();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=6, locals=1, args_size=1
start local 0 0: aload 0
getfield java.io.Console.shutdownHookInstalled:Z
ifeq 2
1: return
2: StackMap locals:
StackMap stack:
invokestatic jdk.internal.misc.SharedSecrets.getJavaLangAccess:()Ljdk/internal/misc/JavaLangAccess;
3: iconst_0
4: iconst_0
5: new java.io.Console$2
dup
aload 0
invokespecial java.io.Console$2.<init>:(Ljava/io/Console;)V
6: invokeinterface jdk.internal.misc.JavaLangAccess.registerShutdownHook:(IZLjava/lang/Runnable;)V
7: goto 9
StackMap locals:
StackMap stack: java.lang.IllegalStateException
8: pop
9: StackMap locals:
StackMap stack:
aload 0
iconst_1
putfield java.io.Console.shutdownHookInstalled:Z
10: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 11 0 this Ljava/io/Console;
Exception table:
from to target type
2 7 8 Class java.lang.IllegalStateException
public char[] readPassword();
descriptor: ()[C
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
ldc ""
iconst_0
anewarray java.lang.Object
invokevirtual java.io.Console.readPassword:(Ljava/lang/String;[Ljava/lang/Object;)[C
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljava/io/Console;
public void flush();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield java.io.Console.pw:Ljava/io/PrintWriter;
invokevirtual java.io.PrintWriter.flush:()V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Ljava/io/Console;
private static native java.lang.String encoding();
descriptor: ()Ljava/lang/String;
flags: (0x010a) ACC_PRIVATE, ACC_STATIC, ACC_NATIVE
private static native boolean echo(boolean);
descriptor: (Z)Z
flags: (0x010a) ACC_PRIVATE, ACC_STATIC, ACC_NATIVE
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
on
private char[] readline(boolean);
descriptor: (Z)[C
flags: (0x0002) ACC_PRIVATE
Code:
stack=5, locals=4, args_size=2
start local 0 start local 1 0: aload 0
getfield java.io.Console.reader:Ljava/io/Reader;
aload 0
getfield java.io.Console.rcb:[C
iconst_0
aload 0
getfield java.io.Console.rcb:[C
arraylength
invokevirtual java.io.Reader.read:([CII)I
istore 2
start local 2 1: iload 2
ifge 3
2: aconst_null
areturn
3: StackMap locals: int
StackMap stack:
aload 0
getfield java.io.Console.rcb:[C
iload 2
iconst_1
isub
caload
bipush 13
if_icmpne 5
4: iinc 2 -1
goto 9
5: StackMap locals:
StackMap stack:
aload 0
getfield java.io.Console.rcb:[C
iload 2
iconst_1
isub
caload
bipush 10
if_icmpne 9
6: iinc 2 -1
7: iload 2
ifle 9
aload 0
getfield java.io.Console.rcb:[C
iload 2
iconst_1
isub
caload
bipush 13
if_icmpne 9
8: iinc 2 -1
9: StackMap locals:
StackMap stack:
iload 2
newarray 5
astore 3
start local 3 10: iload 2
ifle 14
11: aload 0
getfield java.io.Console.rcb:[C
iconst_0
aload 3
iconst_0
iload 2
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
12: iload 1
ifeq 14
13: aload 0
getfield java.io.Console.rcb:[C
iconst_0
iload 2
bipush 32
invokestatic java.util.Arrays.fill:([CIIC)V
14: StackMap locals: char[]
StackMap stack:
aload 3
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 15 0 this Ljava/io/Console;
0 15 1 zeroOut Z
1 15 2 len I
10 15 3 b [C
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
zeroOut
private char[] grow();
descriptor: ()[C
flags: (0x0002) ACC_PRIVATE
Code:
stack=5, locals=2, args_size=1
start local 0 0: getstatic java.io.Console.$assertionsDisabled:Z
ifne 1
aload 0
getfield java.io.Console.readLock:Ljava/lang/Object;
invokestatic java.lang.Thread.holdsLock:(Ljava/lang/Object;)Z
ifne 1
new java.lang.AssertionError
dup
invokespecial java.lang.AssertionError.<init>:()V
athrow
1: StackMap locals:
StackMap stack:
aload 0
getfield java.io.Console.rcb:[C
arraylength
iconst_2
imul
newarray 5
astore 1
start local 1 2: aload 0
getfield java.io.Console.rcb:[C
iconst_0
aload 1
iconst_0
aload 0
getfield java.io.Console.rcb:[C
arraylength
invokestatic java.lang.System.arraycopy:(Ljava/lang/Object;ILjava/lang/Object;II)V
3: aload 0
aload 1
putfield java.io.Console.rcb:[C
4: aload 0
getfield java.io.Console.rcb:[C
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Ljava/io/Console;
2 5 1 t [C
private static native boolean istty();
descriptor: ()Z
flags: (0x010a) ACC_PRIVATE, ACC_STATIC, ACC_NATIVE
private void <init>();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=7, locals=2, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: aload 0
new java.lang.Object
dup
invokespecial java.lang.Object.<init>:()V
putfield java.io.Console.readLock:Ljava/lang/Object;
2: aload 0
new java.lang.Object
dup
invokespecial java.lang.Object.<init>:()V
putfield java.io.Console.writeLock:Ljava/lang/Object;
3: invokestatic java.io.Console.encoding:()Ljava/lang/String;
astore 1
start local 1 4: aload 1
ifnull 8
5: aload 0
aload 1
invokestatic java.nio.charset.Charset.forName:(Ljava/lang/String;)Ljava/nio/charset/Charset;
putfield java.io.Console.cs:Ljava/nio/charset/Charset;
6: goto 8
StackMap locals: java.io.Console java.lang.String
StackMap stack: java.lang.Exception
7: pop
8: StackMap locals:
StackMap stack:
aload 0
getfield java.io.Console.cs:Ljava/nio/charset/Charset;
ifnonnull 10
9: aload 0
invokestatic java.nio.charset.Charset.defaultCharset:()Ljava/nio/charset/Charset;
putfield java.io.Console.cs:Ljava/nio/charset/Charset;
10: StackMap locals:
StackMap stack:
aload 0
11: new java.io.FileOutputStream
dup
getstatic java.io.FileDescriptor.out:Ljava/io/FileDescriptor;
invokespecial java.io.FileOutputStream.<init>:(Ljava/io/FileDescriptor;)V
12: aload 0
getfield java.io.Console.writeLock:Ljava/lang/Object;
13: aload 0
getfield java.io.Console.cs:Ljava/nio/charset/Charset;
14: invokestatic sun.nio.cs.StreamEncoder.forOutputStreamWriter:(Ljava/io/OutputStream;Ljava/lang/Object;Ljava/nio/charset/Charset;)Lsun/nio/cs/StreamEncoder;
putfield java.io.Console.out:Ljava/io/Writer;
15: aload 0
new java.io.Console$3
dup
aload 0
aload 0
getfield java.io.Console.out:Ljava/io/Writer;
iconst_1
invokespecial java.io.Console$3.<init>:(Ljava/io/Console;Ljava/io/Writer;Z)V
putfield java.io.Console.pw:Ljava/io/PrintWriter;
16: aload 0
new java.util.Formatter
dup
aload 0
getfield java.io.Console.out:Ljava/io/Writer;
invokespecial java.util.Formatter.<init>:(Ljava/lang/Appendable;)V
putfield java.io.Console.formatter:Ljava/util/Formatter;
17: aload 0
new java.io.Console$LineReader
dup
aload 0
18: new java.io.FileInputStream
dup
getstatic java.io.FileDescriptor.in:Ljava/io/FileDescriptor;
invokespecial java.io.FileInputStream.<init>:(Ljava/io/FileDescriptor;)V
19: aload 0
getfield java.io.Console.readLock:Ljava/lang/Object;
20: aload 0
getfield java.io.Console.cs:Ljava/nio/charset/Charset;
21: invokestatic sun.nio.cs.StreamDecoder.forInputStreamReader:(Ljava/io/InputStream;Ljava/lang/Object;Ljava/nio/charset/Charset;)Lsun/nio/cs/StreamDecoder;
invokespecial java.io.Console$LineReader.<init>:(Ljava/io/Console;Ljava/io/Reader;)V
putfield java.io.Console.reader:Ljava/io/Reader;
22: aload 0
sipush 1024
newarray 5
putfield java.io.Console.rcb:[C
23: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 24 0 this Ljava/io/Console;
4 24 1 csname Ljava/lang/String;
Exception table:
from to target type
5 6 7 Class java.lang.Exception
}
SourceFile: "Console.java"
NestMembers:
java.io.Console$1 java.io.Console$2 java.io.Console$3 java.io.Console$LineReader
InnerClasses:
java.io.Console$1
java.io.Console$2
java.io.Console$3
LineReader = java.io.Console$LineReader of java.io.Console