This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

crashing Kawa with a boolean field


Hi,

I accidentally crashed Kawa when trying to "inline" the access
of a javabean-like object using the code:

(define (dump empl :: <Employee>)
  (display* "first-name: " (slot-ref empl 'firstName))
  (display* "last-name:  " (slot-ref empl 'lastName))
  (display* "age:        " (slot-ref empl 'age))
  (display* "active:     " (slot-ref empl 'active)))


The class Employee is just a plain object with get/set methods
and the display* proc is quite obvious.

The problem is the field 'active', which is primitive boolean.
When I cut-n-paste the above, I get 

java.lang.NullPointerException
        at java.util.Hashtable.get(Hashtable.java:320)
        at gnu.bytecode.Type.lookupType(Type.java:51)
        at gnu.bytecode.Type.getType(Type.java:61)
        at gnu.bytecode.ClassType.make(ClassType.java:21)
        at gnu.bytecode.PrimType.emitCoerceToObject(PrimType.java:80)
        at gnu.expr.StackTarget.compileFromStack0(StackTarget.java:52)
        at gnu.expr.StackTarget.compileFromStack0(StackTarget.java:24)
        at gnu.expr.StackTarget.compileFromStack(StackTarget.java:68)
        at gnu.kawa.reflect.SlotGet.compile(SlotGet.java:272)
        at gnu.expr.ApplyExp.compile(ApplyExp.java:144)
        at gnu.expr.ApplyExp.compile(ApplyExp.java:107)
        at gnu.expr.ApplyExp.compile(ApplyExp.java:357)
        at gnu.expr.ApplyExp.compile(ApplyExp.java:107)
        at gnu.expr.Expression.compileNotePosition(Expression.java:98)
        at gnu.expr.Expression.compileWithPosition(Expression.java:69)
        at gnu.expr.BeginExp.compile(BeginExp.java:80)
        at gnu.expr.Expression.compileNotePosition(Expression.java:98)
        at gnu.expr.Expression.compileWithPosition(Expression.java:84)
        at gnu.expr.LambdaExp.compileBody(LambdaExp.java:1382)
        at gnu.expr.LambdaExp.compileAsMethod(LambdaExp.java:1356)
        at gnu.expr.LambdaExp.compileSetField(LambdaExp.java:547)
        at gnu.expr.SetExp.compile(SetExp.java:151)
        at gnu.expr.Expression.compileNotePosition(Expression.java:98)
        at gnu.expr.Expression.compileWithPosition(Expression.java:84)
        at gnu.expr.LambdaExp.compileBody(LambdaExp.java:1382)
        at gnu.expr.Compilation.addClass(Compilation.java:1507)
        at gnu.expr.Compilation.compile(Compilation.java:799)
        at gnu.expr.ModuleExp.evalToClass(ModuleExp.java:54)
        at gnu.expr.ModuleExp.evalModule(ModuleExp.java:166)
        at kawa.Shell.run(Shell.java:232)
        at kawa.Shell.run(Shell.java:180)
        at kawa.Shell.run(Shell.java:167)
        at kawa.Shell.run(Shell.java:154)
        at kawa.repl.main(repl.java:609)


and Kawa exits back to command prompt. If I don't declare the type
of the argument 'empl', everything is ok. If I don't acess the
field 'active', it's still ok. Looks like the boolean field and
argument type declaration is a fatal combination.


Wen-Chun


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]