8182854: jshell tool: rerun multiline snippet from history corrupts history (jdk part)

Jdk sub-repo part of fix for parent issue 8182489, test in parent commit (langtools)

Reviewed-by: jlahoda
This commit is contained in:
Robert Field 2017-06-25 13:35:08 -07:00
parent 55ee56a972
commit e7275ffe56

View File

@ -380,7 +380,10 @@ public abstract class EditingHistory implements History {
}
public void fullHistoryReplace(String source) {
fullHistory.replace(source);
fullHistory.removeLast();
for (String line : source.split("\\R")) {
fullHistory.add(line);
}
}
private class NarrowingHistoryLine implements CharSequence {