ZhiqiangGao / beanshell2

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

unit test class3.bsh fails #8

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Run "test" ant build.  class3.bsh fails

     [java] Script: class3.bsh produced an eval Error: Sourced file: 
class3.bsh : Object constructor : at Line: 74 : in file: class3.bsh : new 
Bar33 ( )
     [java] Called from method: run : at Line: 60 : in 
file: /bsh/commands/run.bsh : run ( filename , null )
     [java] Target exception: java.lang.IllegalAccessError: tried to 
access method Foo33.<init>()V from class Bar33
     [java] Test: class3.bsh FAILED!

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

GoogleCodeExporter commented 9 years ago
I tested out some equivilent java to verify that the problem is real.

public class Test {

    /**
     * @param args
     */
    public static void main(String[] args) {
        new Test().foo();

    }

    class Foo33 
    {  
        Foo33() {} 
        void go() { System.out.println("go"); }
    }

    class Bar33 extends Foo33 { }

    void foo() {
        Foo33 foo = new Bar33();
        foo.go();
    }

}

This executes with no problem.   But in bsh this simple script fails :

class Foo33 
{  Foo33() {} };
class Bar33 extends Foo33 { }
x = new Bar33();

// Error: // Uncaught Exception: Object constructor : at Line: 1 : in file: 
<unknown 
file> : new Bar33 ( ) 

Target exception: java.lang.IllegalAccessError: tried to access method 
Foo33.<init>()
V from class Bar33

I also tried under JRE 1.4.2 and get the same failure.

Original comment by dlee.cal...@gmail.com on 6 May 2007 at 2:21

GoogleCodeExporter commented 9 years ago
I think this is a bug in ASM.  The version of ASM used is very old.  The right 
first
step for dealing with this would be to upgrade to the latest stable ASM.  This 
is a
big project, and it doesn't affect me, so I will pass for now.

Original comment by fschm...@gmail.com on 8 May 2007 at 6:15