ZhiqiangGao / beanshell2

Automatically exported from code.google.com/p/beanshell2
0 stars 0 forks source link

class13 unit tests fail #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Run the unit test for class13.bsh

     [java] Running test: class13.bsh
     [java] Test FAILED: Line: 35 : assert ( isEvalError ( "new 
TestInner1.InstanceInner1().go()" ) )  : while evaluating file: class13.bsh

The comment for this failure indicats that while it is wrong, its "OK" 

// This should really not work... but it's actually ok unless we try to 
// access instance stuff

I actually cannot see why it is expecting to fail.

Original issue reported on code.google.com by dlee.cal...@gmail.com on 6 May 2007 at 2:06

GoogleCodeExporter commented 9 years ago
This bug is real because the super of a nonstatic inner class should be an 
instance
of the super class, not the super class itself.  Here is the relevant comment 
from
BSHAllocationExpression:

    // Change the parent (which was the class static) to the class instance
    // We really need to check if we're a static inner class here first...
    // but for some reason Java won't show the static modifier on our
    // fake inner classes...  could generate a flag field.

This isn't easy to fix, and it doesn't affect me, so I will pass for now.

Original comment by fschm...@gmail.com on 8 May 2007 at 5:58

GoogleCodeExporter commented 9 years ago
Isn't this a duplicate of issue 8 (or vice versa, but issue 8 has more infos).

Original comment by pejob...@gmail.com on 21 Feb 2011 at 12:04

GoogleCodeExporter commented 9 years ago
I don't think 7 and 8 are related.

Original comment by fschm...@gmail.com on 21 Feb 2011 at 3:58

GoogleCodeExporter commented 9 years ago
sorry, my fault. "class13.bsh" vs. "class3.bsh". Extracted unit test classes 
with issue number in name.

Original comment by pejob...@gmail.com on 24 Feb 2011 at 4:33