Bugs in JShellState#drop

andrei.eremeev andrei.eremeev at oracle.com
Fri May 8 14:07:21 UTC 2015


Hi REPL team,

Bugs (see DropTest()):
1. 'x' has outcome 'Added'. In this case 'x' should have id which is 
greater than id of 'y'. But 'x' does not.
-> int x
|  Added variable x of type int

-> /- x

-> int y
|  Added variable y of type int

-> int x
|  Added variable x of type int

-> /l

    9 : int x;
   10 : int y;

2. Commands /var, /classes, /methods and JShellState#vars(), 
JShellState#methods(), JShellState#classes return dropped keys.

3. Class with a broken (dropped) reference can be initiated and used.
-> int x
|  Added variable x of type int

-> class A { int f() { return x; } }
|  Added class A

-> /- x
|  Caused failure of dependent A --
|      cannot find symbol
|        symbol:   variable x
|      class A { int f() { return x; } }
|                                 ^

-> new A().f()
|  Expression value is: 0
|    assigned to temporary variable $1 of type int


BTW, are we going to implement forward references for classes?
Defining classes which refer to classes, methods or variables which have 
not defined.
E.g.
   class A extends B {}
   class B {}

Andrei Eremeev


More information about the kulla-dev mailing list