changeset 41213:129d3db3b466

8166744: JShell: java.lang.IndexOutOfBoundsException for legal history access Reviewed-by: rfield, jlahoda
author shinyafox
date Thu, 29 Sep 2016 17:36:26 +0900
parents 54a8bb41b174
children 855ac576eb77
files jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/extra/EditingHistory.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/extra/EditingHistory.java	Wed Sep 28 22:13:14 2016 +0530
+++ b/jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/extra/EditingHistory.java	Thu Sep 29 17:36:26 2016 +0900
@@ -48,7 +48,9 @@
     private History currentDelegate;
 
     protected EditingHistory(ConsoleReader in, Iterable<? extends String> originalHistory) {
-        this.fullHistory = new MemoryHistory();
+        MemoryHistory fullHistory = new MemoryHistory();
+        fullHistory.setIgnoreDuplicates(false);
+        this.fullHistory = fullHistory;
         this.currentDelegate = fullHistory;
         bind(in, CTRL_UP,
              (Runnable) () -> moveHistoryToSnippet(in, ((EditingHistory) in.getHistory())::previousSnippet));