Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8152296

langtools/test/jdk/jshell/ToolReloadTest.java failing if there is no persisted history

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • tools
    • None
    • b112
    • Verified

      The langtools/test/jdk/jshell/ToolReloadTest.java is failing when the persistent history is empty:

      test ToolReloadTest.testReloadRepeat(): failure
      java.lang.AssertionError: Repl tool died with exception
              at org.testng.Assert.fail(Assert.java:83)
              at ReplToolTesting.testRaw(ReplToolTesting.java:242)
              at ReplToolTesting.test(ReplToolTesting.java:203)
              at ReplToolTesting.test(ReplToolTesting.java:191)
              at ToolReloadTest.testReloadRepeat(ToolReloadTest.java:132)
      ...
      Caused by: java.util.NoSuchElementException
              at java.util.LinkedList.removeLast(LinkedList.java:287)
              at jdk.internal.jline.console.history.MemoryHistory.replace(MemoryHistory.java:138)
              at jdk.internal.jshell.tool.EditingHistory.fullHistoryReplace(EditingHistory.java:346)
              at jdk.internal.jshell.tool.ConsoleIOContext.replaceLastHistoryEntry(ConsoleIOContext.java:308)
              at jdk.internal.jshell.tool.JShellTool.rerunSnippet(JShellTool.java:1827)
              at jdk.internal.jshell.tool.JShellTool.cmdUseHistoryEntry(JShellTool.java:1806)
              at jdk.internal.jshell.tool.JShellTool.lambda$new$41(JShellTool.java:1068)
              at jdk.internal.jshell.tool.JShellTool.processCommand(JShellTool.java:689)
              at jdk.internal.jshell.tool.JShellTool.run(JShellTool.java:631)
              at jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:428)
              at jdk.internal.jshell.tool.JShellTool.start(JShellTool.java:401)
              at ReplToolTesting.testRaw(ReplToolTesting.java:240)

      Besides this, the tests shouldn't depend on the content of the global preferences.

            jlahoda Jan Lahoda
            jlahoda Jan Lahoda
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: