-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Add nullability annotations and compile-time checks #4557
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
Merged
Merged
Changes from all commits
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
7468059
Create pre-compiled script plugin for NullAway and Error Prone
marcphilipp 5238fec
Set up OSGi verification to ignore missing JSpecify
marcphilipp 61b9978
Enable NullAway in junit-platform-commons
marcphilipp 37224bb
Fix `ModularUserGuideTests`
marcphilipp d8b4286
Annotate nullability in `org.junit.platform.commons.logging` package
marcphilipp 1bb8ab9
Annotate nullability in `org.junit.platform.commons.annotation` package
marcphilipp 9094796
Annotate nullability in `org.junit.platform.commons.function` package
marcphilipp efa8be1
Annotate nullability in `org.junit.platform.commons.support.scanning`
marcphilipp 116d904
Annotate nullability in `org.junit.platform.commons.support.conversion`
marcphilipp 71530d7
Annotate nullability in `org.junit.platform.commons` package
marcphilipp b4926e1
Add `Try.getNonNull{OrThrow}` method to ease null handling
marcphilipp 2202f3a
Annotate nullability in `org.junit.platform.commons.support` package
marcphilipp 92f4ee1
Annotate nullability in `org.junit.platform.commons.util` package
marcphilipp d917a2c
Enable NullAway in junit-platform-engine
marcphilipp ed8b8ef
Annotate nullability in `org.junit.platform.engine.support.config`
marcphilipp 383d577
Annotate nullability in `org.junit.platform.engine.support.descriptor`
marcphilipp 0b128e4
Annotate nullability in `org.junit.platform.engine.support.discovery`
marcphilipp ee11a6c
Annotate nullability in `org.junit.platform.engine.support.hierarchical`
marcphilipp 410793c
Annotate nullability in `org.junit.platform.engine.support.store`
marcphilipp ccbd996
Annotate nullability in `org.junit.platform.engine`
marcphilipp 56f5e2d
Annotate nullability in `org.junit.platform.engine.discovery`
marcphilipp dcf835f
Annotate nullability in `org.junit.platform.engine.reporting`
marcphilipp f494ee0
Enable and fail on all compile warnings in test fixtures
marcphilipp eb83ac4
Annotate nullability in `org.junit.platform.fakes`
marcphilipp 2dc7270
Treat root package and all subpackages as `@NullMarked`
marcphilipp 493cc94
Enable NullAway in junit-platform-suite-api
marcphilipp 9897085
Enable NullAway in junit-platform-suite-commons
marcphilipp fe2035f
Enable NullAway in junit-platform-suite-engine
marcphilipp 7802b36
Enable NullAway in junit-vintage-engine
marcphilipp f12b036
Let NullAway handle assertions in test code
marcphilipp 2cc1b8d
Enable NullAway in junit-platform-testkit
marcphilipp e5210e3
Use open-test-reporting snapshots
marcphilipp 9f43b05
Enable NullAway in junit-platform-reporting
marcphilipp 9257604
Enable NullAway in junit-platform-jfr
marcphilipp 66a38d5
Enable NullAway in junit-platform-console
marcphilipp c170e31
Add ArchUnit check for `@NullMarked` on all packages
marcphilipp f95e26d
Annotate packages to support downstream classpath compilation
marcphilipp 9ebd170
Move `@NullMarked` annotations to packages
marcphilipp c13a556
Enable NullAway in junit-platform-launcher
marcphilipp 2f880cf
Enable NullAway in junit-jupiter-api
marcphilipp c98f595
Annotate nullability in `org.junit.jupiter.api.condition`
marcphilipp 6949509
Annotate nullability in `org.junit.jupiter.api.extension.support`
marcphilipp 3cb766e
Annotate nullability in `org.junit.jupiter.api.extension`
marcphilipp b37450d
Annotate nullability in `org.junit.jupiter.api.function`
marcphilipp 1fb5c7f
Annotate nullability in `org.junit.jupiter.api.io`
marcphilipp 54b6522
Annotate nullability in `org.junit.jupiter.api.parallel`
marcphilipp b3ca703
Annotate nullability in `org.junit.jupiter.api`
marcphilipp 0b7b463
Check `org.junit.jupiter.api..`
marcphilipp 169e5d7
Enable NullAway in junit-jupiter-engine
marcphilipp 6b2a64a
Annotate nullability in `org.junit.jupiter.engine.config`
marcphilipp 179b3e9
Annotate nullability in `org.junit.jupiter.engine`
marcphilipp 63377d7
Annotate nullability in `org.junit.jupiter.engine.descriptor`
marcphilipp b6386c7
Check `org.junit.jupiter.engine..`
marcphilipp ddd17a9
Annotate nullability in remaining `org.junit.jupiter.engine..` packages
marcphilipp f38fb2d
Enable NullAway in junit-jupiter-migrationsupport
marcphilipp dc3ae6e
Enable NullAway in junit-jupiter-params
marcphilipp 5587851
Add JSpecify to all module descriptors
marcphilipp 2cccb29
Enable NullAway in tests
marcphilipp 62797b0
Enable NullAway in documentation
marcphilipp c0bb36a
Annotate nullability in `org.junit.platform.commons.test`
marcphilipp 5da1c40
Treat compiler warnings as errors for all source sets
marcphilipp aa121ee
Fix compilation of JMH benchmarks
marcphilipp 02c8d81
Move `@Nullable` to return type for methods
marcphilipp d80c226
Fix IDEA-detected nullability problems in main source sets
marcphilipp 6c11b2b
Add to release notes
marcphilipp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
documentation/src/test/java/example/callbacks/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
@NullMarked | ||
package example.callbacks; | ||
|
||
import org.jspecify.annotations.NullMarked; |
5 changes: 5 additions & 0 deletions
5
documentation/src/test/java/example/defaultmethods/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
@NullMarked | ||
package example.defaultmethods; | ||
|
||
import org.jspecify.annotations.NullMarked; |
5 changes: 5 additions & 0 deletions
5
documentation/src/test/java/example/exception/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
@NullMarked | ||
package example.exception; | ||
|
||
import org.jspecify.annotations.NullMarked; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
documentation/src/test/java/example/extensions/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
@NullMarked | ||
package example.extensions; | ||
|
||
import org.jspecify.annotations.NullMarked; |
5 changes: 5 additions & 0 deletions
5
documentation/src/test/java/example/interceptor/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
@NullMarked | ||
package example.interceptor; | ||
|
||
import org.jspecify.annotations.NullMarked; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
@NullMarked | ||
package example; | ||
|
||
import org.jspecify.annotations.NullMarked; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
documentation/src/test/java/example/registration/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
@NullMarked | ||
package example.registration; | ||
|
||
import org.jspecify.annotations.NullMarked; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
documentation/src/test/java/example/session/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
@NullMarked | ||
package example.session; | ||
|
||
import org.jspecify.annotations.NullMarked; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
documentation/src/test/java/example/sharedresources/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
@NullMarked | ||
package example.sharedresources; | ||
|
||
import org.jspecify.annotations.NullMarked; |
5 changes: 5 additions & 0 deletions
5
documentation/src/test/java/example/testinterface/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
@NullMarked | ||
package example.testinterface; | ||
|
||
import org.jspecify.annotations.NullMarked; |
5 changes: 5 additions & 0 deletions
5
documentation/src/test/java/example/testkit/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
@NullMarked | ||
package example.testkit; | ||
|
||
import org.jspecify.annotations.NullMarked; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
@NullMarked | ||
package example.timing; | ||
|
||
import org.jspecify.annotations.NullMarked; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
@NullMarked | ||
package extensions; | ||
|
||
import org.jspecify.annotations.NullMarked; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
@NullMarked | ||
package example; | ||
|
||
import org.jspecify.annotations.NullMarked; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcphilipp IIUC, this eventually didn't happen due to uber/NullAway#1083, and you instead went for annotating the packages, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thank you! Updated in df24efb