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

Migrate to module-supported Nullable annotation package #2028

Closed
jhy opened this issue Nov 2, 2023 · 2 comments · Fixed by #2048
Closed

Migrate to module-supported Nullable annotation package #2028

jhy opened this issue Nov 2, 2023 · 2 comments · Fixed by #2048
Assignees
Labels
Milestone

Comments

@jhy
Copy link
Owner

jhy commented Nov 2, 2023

To mitigate errors/warnings in IntelliJ (but not present in the real Maven build), I'm temporarily adding requires static jsr305; to module-info.java, so that the nullable annotations are visible. But, we don't want to produce a published library with this as it's an automodule.

Need to select another Nullable package (#1992 jspecify?) before next release. Something that IDEs and Kotlin and other various tools will recognize.

@jhy jhy added this to the 1.17.1 milestone Nov 2, 2023
jhy added a commit that referenced this issue Nov 2, 2023
Need to remove before next release; tracked in #2028
@jhy
Copy link
Owner Author

jhy commented Nov 10, 2023

In testing this, to get warnings to show up in the current IntelliJ version for jspecify 0.3.0 (the latest release), I needed to explicitly add them to IntelliJ:

Settings -> Editor -> Inspections -> Probable bugs -> Nullability Problems -> @​NotNull/ @​Nullable problems:
Configure Annotations
Added org.jspecify.annotations.Nullable to the Nullable tab. And org.jspecify.annotations.NullMarked and org.jspecify.annotations.NonNull to the Not Null tab.

Pity that jspecify isn't directly supported currently in IntelliJ. This bug says it is implemented in EAP 233. Current production build is 232.

@jhy
Copy link
Owner Author

jhy commented Nov 10, 2023

Also doesn't support javax.annotation.WillClose;, but I'm not sure tooling does either?

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 self-assigned this Nov 10, 2023
@jhy jhy added the fixed label 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.

1 participant