[ nice-Bugs-982048 ] Internal NPE with contracts

"SourceForge.net" <[email protected]> Wed, 30 Jun 2004 02:51:37 -0700
Newsgroups gmane.comp.lang.nice.devel
Message-ID <[email protected]>
Bugs item #982048, was opened at 2004-06-29 18:33
Message generated for change (Comment added) made by bonniot
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=982048&group_id=12788

Category: None
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Bryn Keller (xoltar)
>Assigned to: Daniel Bonniot (bonniot)
Summary: Internal NPE with contracts

Initial Comment:
With latest CVS version:

class A { ?int foo; }

void bar(A a) 
  requires a.foo == null || a.foo.notNull >= 0
{}

C:\src\nice>nicec -a test test
nice.lang: parsing
test: parsing
test: typechecking
test: generating code
test: linking

An exception has occured in the compiler
Please fill-in a bug report at the following webpage:
http://sourceforge.net/tracker/?func=add&group_id=12788&atid=112788

Stack trace:
Exception in thread "main" java.lang.NullPointerException
        at
bossa.syntax.MethodImplementation.getRefExp(MethodImplementation.java
:173)
        at
bossa.syntax.MethodImplementation.compile(MethodImplementation.java:1
84)
        at bossa.syntax.AST.compile(AST.java:218)
        at
bossa.modules.Package.generateCode(Package.java:718)
        at bossa.modules.Package.compile(Package.java:268)
        at mlsub.compilation.fun.lambda21(make.nice:30)
        at mlsub.compilation.fun.apply1(fun.nice)
        at
gnu.expr.ModuleMethod.apply1(ModuleMethod.java:89)
        at nice.lang.fun.foreach(collections.nice:134)
        at nice.lang.dispatch.foreach(dispatch.nice)
        at
mlsub.compilation.fun.compileComponent(make.nice:30)
        at
mlsub.compilation.dispatch.compileComponent(dispatch.nice)
        at
mlsub.compilation.fun$make.lambda19(make.nice:45)
        at mlsub.compilation.fun$make.apply1(fun.nice)
        at
gnu.expr.ModuleMethod.apply1(ModuleMethod.java:89)
        at nice.lang.fun.foreach(collections.nice:134)
        at nice.lang.dispatch.foreach(dispatch.nice)
        at mlsub.compilation.fun.make(make.nice:44)
        at mlsub.compilation.dispatch.make(dispatch.nice)
        at
nice.tools.compiler.fun.compile(interface.nice:40)
        at
bossa.modules.Compilation.compile(Compilation.nice)
        at
nice.tools.compiler.console.fun.compile(main.nice:168)
        at
nice.tools.compiler.console.dispatch.compile(dispatch.nice)
        at
nice.tools.compiler.console.fun.main(main.nice:184)


----------------------------------------------------------------------

Comment By: Daniel Bonniot (bonniot)
Date: 2004-06-30 11:51

Message:
Logged In: YES 
user_id=88952

This bug has been fixed. The next release of the compiler will
include this correction. In the mean time, I encourage you try
the development version. It contains a version of the compiler
that fixes the bug. Please try it and reopen the bug-report if
you find any problem with it.

To know how to get an install the development version of the
compiler that fixes this bug, please read
http://nice.sourceforge.net/cgi-bin/twiki/view/Dev/DevelopmentVersion

Note that the bug has first been fixed in the CVS version, and it
might take one or two hours until the development version
includes the fix.

Thanks again for your help by submiting this bug report. 

Daniel Bonniot


----------------------------------------------------------------------

Comment By: Bryn Keller (xoltar)
Date: 2004-06-29 23:48

Message:
Logged In: YES 
user_id=2706

I mean I originally got the error

Exception in thread "main" java.lang.NullPointerException
 at gnu.expr.FindCapturedVars.capture(FindCapturedVars.java:179)

and after I had rebuilt the compiler, I instead got the error:

Exception in thread "main" java.lang.NullPointerException
at
bossa.syntax.MethodImplementation.getRefExp(MethodImplementation.java:173)



----------------------------------------------------------------------

Comment By: Daniel Bonniot (bonniot)
Date: 2004-06-29 23:36

Message:
Logged In: YES 
user_id=88952

By "this message" you mean the same as me?

----------------------------------------------------------------------

Comment By: Bryn Keller (xoltar)
Date: 2004-06-29 21:26

Message:
Logged In: YES 
user_id=2706

Yes, that's where I originally got the error too, both the
other day, and then again this morning. I did a CVS update
to make sure it still happened, and built with the dev jar,
but when I tried to compile the example again, I got this
error message instead. Weird.

----------------------------------------------------------------------

Comment By: Daniel Bonniot (bonniot)
Date: 2004-06-29 21:10

Message:
Logged In: YES 
user_id=88952

Hum, this looks like your previous problem. Didn't go away
after all (one shouldn't hope it would!). 

Strangely, we can reproduce it, although with a different error:

Exception in thread "main" java.lang.NullPointerException
 at gnu.expr.FindCapturedVars.capture(FindCapturedVars.java:179)

So I wonder what makes the difference, but in any case we
have something to fix, and then we will see. It's going to
delay 0.9.8 a bit, but oh well...


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=112788&aid=982048&group_id=12788


-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com