77import graphql .schema .GraphQLSchemaElement ;
88import graphql .schema .GraphQLTypeUtil ;
99import graphql .schema .idl .SchemaGenerator ;
10+ import org .jspecify .annotations .NullMarked ;
11+ import org .jspecify .annotations .Nullable ;
1012
1113import java .io .Serializable ;
1214import java .util .Objects ;
1315
1416@ PublicApi
17+ @ NullMarked
1518public class SourceLocation implements Serializable {
1619
1720 public static final SourceLocation EMPTY = new SourceLocation (-1 , -1 );
1821
1922 private final int line ;
2023 private final int column ;
21- private final String sourceName ;
24+ private final @ Nullable String sourceName ;
2225
2326 public SourceLocation (int line , int column ) {
2427 this (line , column , null );
2528 }
2629
27- public SourceLocation (int line , int column , String sourceName ) {
30+ public SourceLocation (int line , int column , @ Nullable String sourceName ) {
2831 this .line = line ;
2932 this .column = column ;
3033 this .sourceName = sourceName ;
@@ -38,12 +41,12 @@ public int getColumn() {
3841 return column ;
3942 }
4043
41- public String getSourceName () {
44+ public @ Nullable String getSourceName () {
4245 return sourceName ;
4346 }
4447
4548 @ Override
46- public boolean equals (Object o ) {
49+ public boolean equals (@ Nullable Object o ) {
4750 if (this == o ) {
4851 return true ;
4952 }
@@ -91,7 +94,7 @@ public String toString() {
9194 *
9295 * @return the source location if available or null if it's not.
9396 */
94- public static SourceLocation getLocation (GraphQLSchemaElement schemaElement ) {
97+ public static @ Nullable SourceLocation getLocation (GraphQLSchemaElement schemaElement ) {
9598 if (schemaElement instanceof GraphQLModifiedType ) {
9699 schemaElement = GraphQLTypeUtil .unwrapAllAs ((GraphQLModifiedType ) schemaElement );
97100 }
0 commit comments