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

jjs (the Nashorn JavaScript tool) prints erroneous line "null"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u31
    • Fix Version/s: 8u40
    • Component/s: core-libs
    • Labels:

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_31"
      Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.3.9600]

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      output of jjs -version: nashorn 1.8.0_31


      A DESCRIPTION OF THE PROBLEM :
      Running the example from http://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/api.html#sthref19 does not produce the expected result

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      on the command line, do:
      >jjs
      jjs> Java.type("java.lang.System").out.println(10)

      then you'll get:

      >jjs
      jjs> Java.type("java.lang.System").out.println(10)
      10
      null
      jjs>

      the problem is that an erroneous line with "null" is printed.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      >jjs
      jjs> Java.type("java.lang.System").out.println(10)
      10
      jjs>
      ACTUAL -
      >jjs
      jjs> Java.type("java.lang.System").out.println(10)
      10
      null
      jjs>

      REPRODUCIBILITY :
      This bug can be reproduced always.

        Attachments

          Activity

            People

            Assignee:
            hannesw Hannes Wallnoefer
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: