-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[🚀 Feature]: JSpecify Nullness annotations for Java #14291
Comments
@mk868, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
This issue is looking for contributors. Please comment below or reach out to us through our IRC/Slack/Matrix channels if you are interested. |
I can contribute to add these annotations. |
@mk868, yes, please. Focus on small PRs so they can be quickly reviewed and merged. It does not matter if you send many PRs. A PR with 2-3 files changed will be merged rather quickly, but a PR with 20 files changed will take several days. |
[java] Add JSpecify annotations to WebElement and SearchContext (#14291)
Feature and motivation
I suggest adding JSpecify Nullness annotations to the Selenium framework code.
These annotations allow you to specify which parameters and return values can be null.
I'm aware that information about potential null values are already placed in the JavaDoc, but using annotations will be transparent to IDEs and static code analyzers.
This will give developers better exposure of potential problems with their code in order to avoid NullPointerExceptions.
Using annotations will also improve interoperability with Kotlin.
Links:
Usage example
The annotated method would look like this:
Then the IDE/static code analyzer will display a warning about unsafe code:
The text was updated successfully, but these errors were encountered: