8159031: jjs throws NoSuchFileException if ~/.jjs.history does not exist

Reviewed-by: sundar, mhaupt
This commit is contained in:
Hannes Wallnöfer 2016-06-08 15:53:22 +02:00
parent 5a190a8ec6
commit 54ec7c6b21

View File

@ -59,7 +59,8 @@ class Console implements AutoCloseable {
in.setHandleUserInterrupt(true);
in.setBellEnabled(true);
in.setCopyPasteDetection(true);
in.setHistory(new EditingHistory(in, Files.readAllLines(historyFile.toPath())) {
final Iterable<String> existingHistory = historyFile.exists() ? Files.readAllLines(historyFile.toPath()) : null;
in.setHistory(new EditingHistory(in, existingHistory) {
@Override protected boolean isComplete(CharSequence input) {
return completer.isComplete(input.toString());
}