Class B extends A, so when constructing B, first the constructor of A is called. But A constructor calls an abstract method prepared by B, which is not constructed yet. I guess this is the reason for the following code to throw exceptions in 2.0b4
(This makes it impossible to use java class A in BeanShell).
// This was in reality a java class, so we cannot modify its twisted constructor
abstract class A
abstract public int fun();
class B extends A
public int fun()
bsh.InterpreterError: Error in class initialization: java.lang.NullPointerException
at bsh.ClassGeneratorUtil.initInstance(Unknown Source)
at A.<init>(BeanShell Generated via ASM (www.objectweb.org))
at B.<init>(BeanShell Generated via ASM (www.objectweb.org))
Log in to post a comment.