ctolkmit / checker-framework

Automatically exported from code.google.com/p/checker-framework
0 stars 0 forks source link

NPE when checking lambda in field initializer #403

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Compile the attached Java class using `javac -processor 
org.checkerframework.checker.nullness.NullnessChecker -version -verbose 
-AprintErrorStack -AprintAllQualifiers StringWrapper.java`

What is the expected output? What do you see instead?
I expect the compilation to complete successfully. Instead, a 
NullPointerException is thrown. See the attached compiler output.

What version of the product are you using? On what operating system?
I built the "trunk" versions of jsr308-langtools, annotation-tools and 
checker-framework from source, as described in the manual, using jdk1.8.0_31. 
I'm running linux.

Please provide any additional information below.
Didn't try to debug the issue, but the problem seems to be with the `w -> 
w.value` subexpression. The NPE is not triggered when one introduces a 
`#getValue()` accessor method and replaces the `w -> w.value` subexpression 
with a `StringWrapper::getValue` method handle reference.

Original issue reported on code.google.com by stephan...@gmail.com on 28 Feb 2015 at 10:36

GoogleCodeExporter commented 9 years ago
I had to re-enter the CAPTCHA and apparently the attachments weren't retained. 
Doh! Attaching them to this comment.

Original comment by stephan...@gmail.com on 28 Feb 2015 at 10:38

Attachments:

GoogleCodeExporter commented 9 years ago
The log shows that I used version 1.8.9. Turns out this is because I used an 
old checkout of the code and performed only an `hg pull`, without an `hg 
update`. I just *properly* updated the working directory and re-ran the test 
using version 1.8.11. Can confirm the ticket is still valid.

Original comment by stephan...@gmail.com on 4 Mar 2015 at 9:51

GoogleCodeExporter commented 9 years ago
Thanks for the bug report! I reproduced and (hopefully) fixed the issue.

Original comment by wdi...@gmail.com on 17 Mar 2015 at 4:45

GoogleCodeExporter commented 9 years ago

Original comment by Jonathan...@gmail.com on 8 Apr 2015 at 10:48

GoogleCodeExporter commented 9 years ago

Original comment by jtha...@cs.washington.edu on 18 Apr 2015 at 6:42