biddyweb / checker-framework

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

Nullness checker incorrectly thinks BlockingQueue.poll( long, TimeUnit ) returns @NonNull #374

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This method can return null. It should be treated as @Nullable but the Nullness 
checker thinks it's @NonNull

Thus I get the spurious error:

[ERROR] 
/home/david/apache/Blackhawk/javatestframework/util/src/main/java/com/trutest/ut
il/ProfiledBlockingQueue.java:[58,21] [override.return.invalid] @Nullable E 
extends @Initialized @Nullable Object poll(@Initialized @NonNull 
ProfiledBlockingQueue<E extends @Initialized @NonNull Object> this, 
@Initialized @NonNull long p0, @Initialized @NonNull TimeUnit p1) throws 
@Initialized @NonNull InterruptedException in 
com.trutest.util.ProfiledBlockingQueue cannot override E extends @Initialized 
@NonNull Object poll(@Initialized @NonNull BlockingQueue<E extends @Initialized 
@NonNull Object> this, @Initialized @NonNull long p0, @Initialized @NonNull 
TimeUnit p1) throws @Initialized @NonNull InterruptedException in 
java.util.concurrent.BlockingQueue; attempting to use an incompatible return 
type

using checker 1.8.6 on Java 8 on Linux.

Please provide any additional information below.

Original issue reported on code.google.com by DavidHod...@gmail.com on 16 Oct 2014 at 12:30

GoogleCodeExporter commented 9 years ago
You are correct.  The problem is that java.util.concurrent.BlockingQueue was 
not yet in the annotated JDK.  I will add it.

Original comment by michael.ernst@gmail.com on 16 Oct 2014 at 7:22

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 6a37e9b7db83.

Original comment by mer...@cs.washington.edu on 16 Oct 2014 at 8:02

GoogleCodeExporter commented 9 years ago

Original comment by wdi...@gmail.com on 16 Oct 2014 at 11:20

GoogleCodeExporter commented 9 years ago
Fixed in release 1.8.7

Original comment by Jonathan...@gmail.com on 30 Oct 2014 at 11:12