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

FR: Strict Nullability? #1992

Closed
stefanhaustein opened this issue Aug 24, 2023 · 1 comment · Fixed by #2048
Closed

FR: Strict Nullability? #1992

stefanhaustein opened this issue Aug 24, 2023 · 1 comment · Fixed by #2048
Labels
Milestone

Comments

@stefanhaustein
Copy link

Hi,

Unfortunately, the current nullability annotations don't work in all the places where they are needed for strict null-marking. For instance, we currently can't correctly mark the generic value type of the Attribute Map Entry as nullable with javax.annotations.Nullable:

public class Attribute implements Map.Entry<String, @Nullable String>, Cloneable  {

Would you mind if I'd create a PR to switch the project to strict nullability using Jspecify? This would also allow us to switch the two internal "NonNullByDefault" annotations over to @NullMarked.

Stefan

@jhy
Copy link
Owner

jhy commented Oct 18, 2023

Hi - sure I'd be happy to take a look at a PR and improve this. I'm not very familiar with jspecify so will I will need to dig into that. Impl needs to maintain API compatibility.

@jhy jhy added the feature label Oct 18, 2023
jhy added a commit that referenced this issue Nov 10, 2023
Away from jsr305

With the goal of having a nullability assertion annotation that supports Java modules, so we can release the next version of jsoup.

Annotation options appear limited and does not support @​WillClose, but rest appears OK.

Will fix #2028, #1992
@jhy jhy closed this as completed in #2048 Nov 10, 2023
jhy added a commit that referenced this issue Nov 10, 2023
Away from jsr305

With the goal of having a nullability assertion annotation that supports Java modules, so we can release the next version of jsoup.

Annotation options appear limited and does not support @​WillClose, but rest appears OK.

Fixes #2028
Fixes #1992
@jhy jhy added this to the 1.17.1 milestone Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants