Details
-
Bug
-
Resolution: Fixed
-
P3
-
9, 10, 11, 12
-
b18
-
generic
-
generic
-
Verified
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8254620 | 11.0.11-oracle | Robert Field | P3 | Resolved | Fixed | b01 |
JDK-8251146 | 11.0.9 | Robert Field | P3 | Resolved | Fixed | b03 |
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
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
- backported by
-
JDK-8251146 JShell: Redeclared variable should be reset
-
- Resolved
-
-
JDK-8254620 JShell: Redeclared variable should be reset
-
- Resolved
-