Repository navigation
JSpecify big wave 2 #4184
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
JSpecify big wave 2 #4184
Changes from 1 commit
Commits
Show all changes
85 commits
Select commit
Hold shift + click to select a range
1b01d2b
Annotate GraphQLAppliedDirective
dondonz 8684b48
Add GraphQLSchema annotation
dondonz 0cdc8de
Remove exemption
dondonz 30d0abe
Annotate GraphQLType and GraphQLEnumType
dondonz 6ee01b8
Add Nullmarked to GraphQLEnumType
dondonz a45c613
Annotate GraphQLCodeRegistry
dondonz 70336d5
Annotate GraphQLList
dondonz 29f8363
Annotate PropertyDataFetcher
dondonz 083b2ab
Annotate GraphQLUnionType
dondonz b4761ef
Tidy up
dondonz 9a78fb3
Annotate GraphQLScalarType
dondonz 7bbfd9c
Annotate GraphQLNamedInputType
dondonz 7427f64
Add ErrorType
dondonz 120095c
Annotate Directives
dondonz 012f49c
Annotate ErrorClassification
dondonz afdd408
Annotate ExceptionWhileDataFetching
dondonz 803c924
Annotate ExecutionResult
dondonz a322ed0
Annotate GraphQLContext
dondonz 41320d4
Annotate AssertException and GraphQLError
dondonz 9765c21
Annotate GraphQLErrorBuilder
dondonz 0ee713c
Annotate GraphQLErrorException
dondonz e54fca2
Annotate ParseAndValidate
dondonz 603c00d
Annotate ParseAndValidateResult
dondonz 9fcaea1
Annotate Scalars
dondonz 88b02f3
Annotate SerializationError
dondonz e65217c
Update GraphQLError with a nullable location list
dondonz 19000a5
Annotate TypeMismatchError
dondonz 313bf4f
Annotate UnresolvedTypeError
dondonz 0846c55
Remove agent as no longer exists
dondonz d2d87cd
Add JSpecify prompt
dondonz f4b05bb
Fix NullAway issues with assertions
dondonz ab1ce8d
Remove null checks
dondonz 241b7a0
Annotate DefaultConnection
dondonz 7ffd1ba
Annotate Relay Connection
dondonz 003958f
Update URL
dondonz ba3de3e
Annotate DefaultConnectionCursor
dondonz 8de5a75
Annotate ConnectionCursor
dondonz 0bee1f8
Annotate DefaultEdge
dondonz a6e7382
Annotate DefaultPageInfo
dondonz e508453
Annotate Edge
dondonz ee76574
Annotate PageInfo
dondonz b7a7be6
Annotate SimpleListConnection
dondonz 81beb0d
Annotate Relay
dondonz 9c5e4c8
Annotate ValidationErrorClassification and ValidationErrorType
dondonz 6ec7d82
Annotate ValidationError
dondonz 98ff640
Annotate NamedNode
dondonz 3f58265
Annotate Argument
dondonz eb98025
Annotate GraphQLTypeUtil
dondonz 97b407d
Fix typo
dondonz 44253f7
Update prompt
dondonz e8b1670
Annotate Breadcrumb
dondonz f1b5529
Annotate FieldComplexityCalculator
dondonz 230b757
Annotate FieldComplexityEnvironment
dondonz ff81ff6
Annotate TypeResolutionEnvironment
dondonz ed2961f
Annotate MaxQueryComplexityInstrumentation
dondonz cf724bf
Annotate MaxQueryDepthInstrumentation
dondonz 8a47304
Make ValidationError description nullable as message is nullable
dondonz de6ad66
Add Nullmarked
dondonz fd3b4af
Revert to nullable description and type for ValidationError
dondonz 71ef680
Update test for Argument, and make nonnullable field clearer
dondonz 23afaea
Annotate Anonymizer
dondonz bd2bd8d
Merge branch 'master' into infer-nullity-3
dondonz 09a5236
Use string literal optimisation for assert
dondonz d1e2e54
Tidy up
dondonz 95e7dc9
Make path length not nullable
dondonz f8920d8
Use string literal for assert messages
dondonz c78124c
Change GraphQL error message to be non-nullable
dondonz 5b7104e
Improve prompt
dondonz de00e30
Add clarification on generics type arguments
dondonz e27bf54
Merge branch 'master' into infer-nullity-3
dondonz d5de341
Make TypeResolutionEnvironment value nullable
dondonz 0496a3d
Annotate TypeResolutionParameters
dondonz d2983da
Add Nullmarked to TypeResolutionParameters
dondonz 92b3ac1
Add prompt to reduce whitespace diff
dondonz 0bf48d3
Prompt updates
dondonz 2931540
Adjulst description of validation error to be nonnull
dondonz 66f3fa0
Adjust tests to be compliant with non-nullable description
dondonz cd232df
Update error message
dondonz b8b8a5a
Update tests given classiciation is not nullable
dondonz 91f0f5c
Correctly set local context and context to nullable
dondonz 4a05a72
Add mocks for i18n to accommodate non-nullable validation errors
dondonz b00dafe
Add another i18n mock
dondonz 85e9854
Merge branch 'master' into infer-nullity-3
dondonz 0a4d5d0
Add more nullable annotations
dondonz d83f175
Add assert
dondonz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Annotate ExecutionResult
- Loading branch information
commit 803c9244c6cafee634a1d6fb2c69b4d75bb25816
Some comments aren't visible on the classic Files Changed page.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,10 @@ | ||
| package graphql; | ||
|
|
||
|
|
||
| import org.jspecify.annotations.NullMarked; | ||
| import org.jspecify.annotations.NullUnmarked; | ||
| import org.jspecify.annotations.Nullable; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Map; | ||
| import java.util.function.Consumer; | ||
|
|
@@ -9,6 +13,7 @@ | |
| * This simple value class represents the result of performing a graphql query. | ||
| */ | ||
| @PublicApi | ||
| @NullMarked | ||
| @SuppressWarnings("TypeParameterUnusedInFormals") | ||
| public interface ExecutionResult { | ||
|
|
||
|
|
@@ -22,16 +27,16 @@ public interface ExecutionResult { | |
| * | ||
| * @return the data in the result or null if there is none | ||
| */ | ||
| <T> T getData(); | ||
| <T> @Nullable T getData(); | ||
|
|
||
| /** | ||
| * The graphql specification specifies: | ||
| * | ||
| * <p> | ||
| * "If an error was encountered before execution begins, the data entry should not be present in the result. | ||
| * If an error was encountered during the execution that prevented a valid response, the data entry in the response should be null." | ||
| * | ||
| * <p> | ||
| * This allows to distinguish between the cases where {@link #getData()} returns null. | ||
| * | ||
| * <p> | ||
| * See : <a href="https://graphql.github.io/graphql-spec/June2018/#sec-Data">https://graphql.github.io/graphql-spec/June2018/#sec-Data</a> | ||
| * | ||
| * @return <code>true</code> if the entry "data" should be present in the result | ||
|
|
@@ -42,14 +47,14 @@ public interface ExecutionResult { | |
| /** | ||
| * @return a map of extensions or null if there are none | ||
| */ | ||
| Map<Object, Object> getExtensions(); | ||
| @Nullable Map<Object, Object> getExtensions(); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inferred from javadoc (and also spec) |
||
|
|
||
|
|
||
| /** | ||
| * The graphql specification says that result of a call should be a map that follows certain rules on what items | ||
| * should be present. Certain JSON serializers may or may interpret {@link ExecutionResult} to spec, so this method | ||
| * is provided to produce a map that strictly follows the specification. | ||
| * | ||
| * <p> | ||
| * See : <a href="https://spec.graphql.org/October2021/#sec-Response-Format">https://spec.graphql.org/October2021/#sec-Response-Format</a> | ||
| * | ||
| * @return a map of the result that strictly follows the spec | ||
|
|
@@ -88,6 +93,7 @@ static Builder<?> newExecutionResult() { | |
| return ExecutionResultImpl.newExecutionResult(); | ||
| } | ||
|
|
||
| @NullUnmarked | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All builders are NullUnmarked |
||
| interface Builder<B extends Builder<B>> { | ||
|
|
||
| /** | ||
|
|
||
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
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.
Annotation inferred from the javadoc (and spec too)