Write extends @NonNull Object instead of extends Object.#17
Write extends @NonNull Object instead of extends Object.#17cpovirk wants to merge 1 commit intoeisop:masterfrom
extends @NonNull Object instead of extends Object.#17Conversation
The simpler formulation doesn't work in stub files, even in JDK stubs.
(This is typetools bug number 3030.)
I tested against a file with the call:
```
java.util.List.of("", null);
```
|
Thanks for making this suggestion! At first I was confused, b/c typetools 3030 sounds like using "T extends Object" in the annotated JDK works as expected. Then I remembered that nowadays this JDK is in the end loaded as stub files in the Checker Framework. I didn't see any documentation that issue 3030 is the intended behavior and I would like to avoid having to explicitly write the NonNull bounds - which is particularly confusing here, as the source and stub file behavior is different. So I tried fixing 3030 in eisop/checker-framework#247 I also tested the @cpovirk Please let me know in 247 if you see anything odd or if there is some documentation in the manual that should be updated. |
|
I've merged eisop/checker-framework#247. |
|
Thanks! I can't think of anything to document or anything else to do. I'll let you know if this finds anything fun when we upgrade to the June release :) |
|
Update: The combination of eisop/checker-framework#247 and #16 is definitely turning some things up :) |
|
@cpovirk "turning things up" in a good way or that we should re-open this PR? |
|
Oh, sorry :) In a good way -- catching declarations that would have permitted NPEs. |
The simpler formulation doesn't work in stub files, even in JDK stubs.
(This is typetools bug number 3030.)
I tested against a file with the call: