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

Nashorn - finally clause executed twice

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 8u31, 8u40
    • core-libs
    • x86
    • windows_8
    • Verified

      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 :
      In Nashorn, the "finally" clause of a try-finally statement is sometimes executed twice (cf. steps to reproduce for an example).

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      At the command line, do:
      >jjs
      jjs> try { for(;;) { break; } } finally { print("X"); }

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      jjs> try { for(;;) { break; } } finally { print("X"); }
      X
      jjs>
      ACTUAL -
      jjs> try { for(;;) { break; } } finally { print("X"); }
      X
      X
      jjs>

      REPRODUCIBILITY :
      This bug can be reproduced always.

            pardesha Pardeep Sharma
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: