8166744: JShell: java.lang.IndexOutOfBoundsException for legal history access
authorshinyafox
Thu, 29 Sep 2016 17:36:26 +0900
changeset 41213 129d3db3b466
parent 41212 54a8bb41b174
child 41214 855ac576eb77
8166744: JShell: java.lang.IndexOutOfBoundsException for legal history access Reviewed-by: rfield, jlahoda
jdk/src/jdk.internal.le/share/classes/jdk/internal/jline/extra/EditingHistory.java
--- 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));