public class jdk.internal.jline.console.history.FileHistory extends jdk.internal.jline.console.history.MemoryHistory implements jdk.internal.jline.console.history.PersistentHistory, java.io.Flushable
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: jdk.internal.jline.console.history.FileHistory
super_class: jdk.internal.jline.console.history.MemoryHistory
{
private final java.io.File file;
descriptor: Ljava/io/File;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
public void <init>(java.io.File);
descriptor: (Ljava/io/File;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 0
invokespecial jdk.internal.jline.console.history.MemoryHistory.<init>:()V
1: aload 0
aload 1
invokestatic jdk.internal.jline.internal.Preconditions.checkNotNull:(Ljava/lang/Object;)Ljava/lang/Object;
checkcast java.io.File
putfield jdk.internal.jline.console.history.FileHistory.file:Ljava/io/File;
2: aload 0
aload 1
invokevirtual jdk.internal.jline.console.history.FileHistory.load:(Ljava/io/File;)V
3: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 this Ljdk/internal/jline/console/history/FileHistory;
0 4 1 file Ljava/io/File;
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
file final
public java.io.File getFile();
descriptor: ()Ljava/io/File;
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
getfield jdk.internal.jline.console.history.FileHistory.file:Ljava/io/File;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Ljdk/internal/jline/console/history/FileHistory;
public void load(java.io.File);
descriptor: (Ljava/io/File;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=2, args_size=2
start local 0 start local 1 0: aload 1
invokestatic jdk.internal.jline.internal.Preconditions.checkNotNull:(Ljava/lang/Object;)Ljava/lang/Object;
pop
1: aload 1
invokevirtual java.io.File.exists:()Z
ifeq 4
iconst_2
anewarray java.lang.Object
dup
iconst_0
2: ldc "Loading history from: "
aastore
dup
iconst_1
aload 1
aastore
invokestatic jdk.internal.jline.internal.Log.trace:([Ljava/lang/Object;)V
3: aload 0
new java.io.FileReader
dup
aload 1
invokespecial java.io.FileReader.<init>:(Ljava/io/File;)V
invokevirtual jdk.internal.jline.console.history.FileHistory.load:(Ljava/io/Reader;)V
4: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Ljdk/internal/jline/console/history/FileHistory;
0 5 1 file Ljava/io/File;
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
file final
public void load(java.io.InputStream);
descriptor: (Ljava/io/InputStream;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=2, args_size=2
start local 0 start local 1 0: aload 1
invokestatic jdk.internal.jline.internal.Preconditions.checkNotNull:(Ljava/lang/Object;)Ljava/lang/Object;
pop
1: aload 0
new java.io.InputStreamReader
dup
aload 1
invokespecial java.io.InputStreamReader.<init>:(Ljava/io/InputStream;)V
invokevirtual jdk.internal.jline.console.history.FileHistory.load:(Ljava/io/Reader;)V
2: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Ljdk/internal/jline/console/history/FileHistory;
0 3 1 input Ljava/io/InputStream;
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
input final
public void load(java.io.Reader);
descriptor: (Ljava/io/Reader;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=4, args_size=2
start local 0 start local 1 0: aload 1
invokestatic jdk.internal.jline.internal.Preconditions.checkNotNull:(Ljava/lang/Object;)Ljava/lang/Object;
pop
1: new java.io.BufferedReader
dup
aload 1
invokespecial java.io.BufferedReader.<init>:(Ljava/io/Reader;)V
astore 2
start local 2 2: goto 4
start local 3 3: StackMap locals: java.io.BufferedReader java.lang.String
StackMap stack:
aload 0
aload 3
invokevirtual jdk.internal.jline.console.history.FileHistory.internalAdd:(Ljava/lang/CharSequence;)V
end local 3 4: StackMap locals:
StackMap stack:
aload 2
invokevirtual java.io.BufferedReader.readLine:()Ljava/lang/String;
dup
astore 3
start local 3 5: ifnonnull 3
6: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Ljdk/internal/jline/console/history/FileHistory;
0 7 1 reader Ljava/io/Reader;
2 7 2 input Ljava/io/BufferedReader;
3 4 3 item Ljava/lang/String;
5 7 3 item Ljava/lang/String;
Exceptions:
throws java.io.IOException
MethodParameters:
Name Flags
reader final
public void flush();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=7, locals=5, args_size=1
start local 0 0: iconst_1
anewarray java.lang.Object
dup
iconst_0
1: ldc "Flushing history"
aastore
invokestatic jdk.internal.jline.internal.Log.trace:([Ljava/lang/Object;)V
2: aload 0
getfield jdk.internal.jline.console.history.FileHistory.file:Ljava/io/File;
invokevirtual java.io.File.exists:()Z
ifne 8
3: aload 0
getfield jdk.internal.jline.console.history.FileHistory.file:Ljava/io/File;
invokevirtual java.io.File.getParentFile:()Ljava/io/File;
astore 1
start local 1 4: aload 1
invokevirtual java.io.File.exists:()Z
ifne 6
aload 1
invokevirtual java.io.File.mkdirs:()Z
ifne 6
iconst_2
anewarray java.lang.Object
dup
iconst_0
5: ldc "Failed to create directory: "
aastore
dup
iconst_1
aload 1
aastore
invokestatic jdk.internal.jline.internal.Log.warn:([Ljava/lang/Object;)V
6: StackMap locals: java.io.File
StackMap stack:
aload 0
getfield jdk.internal.jline.console.history.FileHistory.file:Ljava/io/File;
invokevirtual java.io.File.createNewFile:()Z
ifne 8
iconst_2
anewarray java.lang.Object
dup
iconst_0
7: ldc "Failed to create file: "
aastore
dup
iconst_1
aload 0
getfield jdk.internal.jline.console.history.FileHistory.file:Ljava/io/File;
aastore
invokestatic jdk.internal.jline.internal.Log.warn:([Ljava/lang/Object;)V
end local 1 8: StackMap locals:
StackMap stack:
new java.io.PrintStream
dup
new java.io.BufferedOutputStream
dup
new java.io.FileOutputStream
dup
aload 0
getfield jdk.internal.jline.console.history.FileHistory.file:Ljava/io/File;
invokespecial java.io.FileOutputStream.<init>:(Ljava/io/File;)V
invokespecial java.io.BufferedOutputStream.<init>:(Ljava/io/OutputStream;)V
invokespecial java.io.PrintStream.<init>:(Ljava/io/OutputStream;)V
astore 1
start local 1 9: aload 0
invokevirtual jdk.internal.jline.console.history.FileHistory.iterator:()Ljava/util/Iterator;
astore 3
goto 12
StackMap locals: jdk.internal.jline.console.history.FileHistory java.io.PrintStream top java.util.Iterator
StackMap stack:
10: aload 3
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast jdk.internal.jline.console.history.History$Entry
astore 2
start local 2 11: aload 1
aload 2
invokeinterface jdk.internal.jline.console.history.History$Entry.value:()Ljava/lang/CharSequence;
invokevirtual java.io.PrintStream.println:(Ljava/lang/Object;)V
end local 2 12: StackMap locals:
StackMap stack:
aload 3
invokeinterface java.util.Iterator.hasNext:()Z
ifne 10
13: goto 17
14: StackMap locals: jdk.internal.jline.console.history.FileHistory java.io.PrintStream
StackMap stack: java.lang.Throwable
astore 4
15: aload 1
invokevirtual java.io.PrintStream.close:()V
16: aload 4
athrow
17: StackMap locals:
StackMap stack:
aload 1
invokevirtual java.io.PrintStream.close:()V
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 18 0 this Ljdk/internal/jline/console/history/FileHistory;
4 8 1 dir Ljava/io/File;
9 18 1 out Ljava/io/PrintStream;
11 12 2 entry Ljdk/internal/jline/console/history/History$Entry;
Exception table:
from to target type
9 14 14 any
Exceptions:
throws java.io.IOException
public void purge();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=4, locals=1, args_size=1
start local 0 0: iconst_1
anewarray java.lang.Object
dup
iconst_0
1: ldc "Purging history"
aastore
invokestatic jdk.internal.jline.internal.Log.trace:([Ljava/lang/Object;)V
2: aload 0
invokevirtual jdk.internal.jline.console.history.FileHistory.clear:()V
3: aload 0
getfield jdk.internal.jline.console.history.FileHistory.file:Ljava/io/File;
invokevirtual java.io.File.delete:()Z
ifne 5
iconst_2
anewarray java.lang.Object
dup
iconst_0
4: ldc "Failed to delete history file: "
aastore
dup
iconst_1
aload 0
getfield jdk.internal.jline.console.history.FileHistory.file:Ljava/io/File;
aastore
invokestatic jdk.internal.jline.internal.Log.warn:([Ljava/lang/Object;)V
StackMap locals:
StackMap stack:
5: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 this Ljdk/internal/jline/console/history/FileHistory;
Exceptions:
throws java.io.IOException
}
SourceFile: "FileHistory.java"
InnerClasses:
public abstract Entry = jdk.internal.jline.console.history.History$Entry of jdk.internal.jline.console.history.History