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

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 8u40
    • 8u31
    • core-libs

    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

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

            Dates

              Created:
              Updated:
              Resolved: