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

JShell: Redeclared variable should be reset

    Details

    • Subcomponent:
    • Resolved In Build:
      b18
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Backports

        Description

        A DESCRIPTION OF THE PROBLEM :
        The result of line 13 of the test of the redeclared variable ‘a’ that previously contained a non-null value and compare against the results of lines 4 and 19.
         
        My current thinking is that lines 10 and 16 are both setting a to null, so the instanceof test on subsequent lines (13 and 19) should evaluate to false in both cases


        1. jshell> Integer a;
        2. a ==> null
        3.
        4. jshell> a instanceof Integer;
        5. $2 ==> false
        6.
        7. jshell> a = 1;
        8. a ==> 1
        9.
        10. jshell> Integer a;
        11. a ==> null
        12.
        13. jshell> a instanceof Integer;
        14. $5 ==> true
        15.
        16. jshell> a = null;
        17. a ==> null
        18.
        19. jshell> a instanceof Integer;
        20. $7 ==> false


        FREQUENCY : always


          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  rfield Robert Field
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: