Skip to content

Navigation Menu

Sign in
Sign up

feat(api): add JSpecify nullability annotations - #1970

Open
Yury Semikhatsky (yury-s) wants to merge 2 commits into
microsoft:main from
yury-s:fix-473
Open

feat(api): add JSpecify nullability annotations #1970
Yury Semikhatsky (yury-s) wants to merge 2 commits into
microsoft:main from
yury-s:fix-473

Conversation

@yury-s

Copy link
Copy Markdown
Member

Summary

  • generate JSpecify nullability annotations for the public API
  • mark public API packages as null-marked
  • verify annotations with a Java NullAway consumer check

Fixes #473

Comment thread playwright/pom.xml
<artifactId>driver-bundle</artifactId>
</dependency>
</dependencies>
<profiles>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I assume this is a test-only null check setup? Otherwise, seems very involved for production pom.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes, this is for tests only:

<phase>test-compile</phase>
<goals>
 <goal>testCompile</goal>
 </goals>

Generate nullability annotations for the public API and verify them with a Java NullAway consumer check.
Fixes: microsoft#473 
- Single TypeRef.withNullability rule for params, setters and interface getters
- Drop unused isPrimitive guard and collapse optional field handling
- Let writeFile own the license header, package line and jspecify import
- Trim JSpecifyApiConsumer to statements NullAway actually checks
- Add license headers to package-info files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dgozman Dmitry Gozman (dgozman) dgozman approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[Feature] Add nullable reference annotations.

2 participants

AltStyle によって変換されたページ (->オリジナル) /