Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add @NonNull annotations to @NullUnmarked APIs. #110

Merged
merged 3 commits into from
Dec 18, 2024
Merged

Add @NonNull annotations to @NullUnmarked APIs. #110

merged 3 commits into from
Dec 18, 2024

Conversation

cpovirk
Copy link
Collaborator

@cpovirk cpovirk commented Nov 22, 2024

While we're not sure about the attribute
values
,
we believe that everything else is non-null.

I hadn't thought of using @NonNull back then, but it occurred to me
after I put together #109.

While [we're not sure about the attribute
values](#10 (review)),
we believe that everything else is non-null.

I hadn't thought of using `@NonNull` back then, but it occurred to me
after I put together #109.
Copy link
Collaborator

@wmdietl wmdietl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When looking at the second signature, I nearly missed that the second type argument is the only type that is null-unmarked.
Adding the comments makes that more explicit, without a separate type-use annotation.
But it is also more verbose... I'm fine either way.

src/java.base/share/classes/java/nio/file/Files.java Outdated Show resolved Hide resolved
src/java.base/share/classes/java/nio/file/Files.java Outdated Show resolved Hide resolved
@wmdietl wmdietl assigned cpovirk and unassigned wmdietl Dec 18, 2024
@cpovirk
Copy link
Collaborator Author

cpovirk commented Dec 18, 2024

Thanks for all the reviews!

I got to wondering if it would be clearest to use a comment like /* unspecified */ to look maybe less like the existing declaration annotation, but I'm not sure that will be clearer overall, since it doesn't look as clearly like a "JSpecify thing." We can always update the comments if we arrive at something that we like more.

@cpovirk cpovirk merged commit 7cc2fbd into main Dec 18, 2024
19 checks passed
@cpovirk cpovirk deleted the partialmark branch December 18, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants