# HG changeset patch # User lana # Date 1476993691 0 # Node ID 34adecd02b101a3da8111fb4a9bc772058df301e # Parent 62c4aa12454a891b83474ea50f779cccef5bfca6# Parent 89347182c199653abf1c030e8c9dfab63de9248f Merge diff -r 62c4aa12454a -r 34adecd02b10 nashorn/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Console.java --- a/nashorn/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Console.java Thu Oct 20 18:38:11 2016 +0000 +++ b/nashorn/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Console.java Thu Oct 20 20:01:31 2016 +0000 @@ -42,6 +42,8 @@ import jdk.internal.jline.console.ConsoleReader; import jdk.internal.jline.console.KeyMap; import jdk.internal.jline.extra.EditingHistory; +import jdk.internal.misc.Signal; +import jdk.internal.misc.Signal.Handler; class Console implements AutoCloseable { private static final String DOCUMENTATION_SHORTCUT = "\033\133\132"; //Shift-TAB @@ -68,6 +70,21 @@ in.addCompleter(completer); Runtime.getRuntime().addShutdownHook(new Thread((Runnable)this::saveHistory)); bind(DOCUMENTATION_SHORTCUT, (ActionListener)evt -> showDocumentation(docHelper)); + try { + Signal.handle(new Signal("CONT"), new Handler() { + @Override public void handle(Signal sig) { + try { + in.getTerminal().reset(); + in.redrawLine(); + in.flush(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + }); + } catch (IllegalArgumentException ignored) { + //the CONT signal does not exist on this platform + } } String readLine(final String prompt) throws IOException { diff -r 62c4aa12454a -r 34adecd02b10 nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java --- a/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java Thu Oct 20 18:38:11 2016 +0000 +++ b/nashorn/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java Thu Oct 20 20:01:31 2016 +0000 @@ -129,10 +129,11 @@ @Override public String getProgram(final String... statements) { + Objects.requireNonNull(statements); final StringBuilder sb = new StringBuilder(); for (final String statement : statements) { - sb.append(statement).append(';'); + sb.append(Objects.requireNonNull(statement)).append(';'); } return sb.toString();