88import graphql .util .TraversalControl ;
99import graphql .util .TraverserContext ;
1010import org .jspecify .annotations .NullMarked ;
11+ import org .jspecify .annotations .NullUnmarked ;
1112import org .jspecify .annotations .Nullable ;
1213
1314import java .util .LinkedHashMap ;
@@ -80,7 +81,8 @@ public boolean isEqualTo(@Nullable Node o) {
8081
8182 @ Override
8283 public ObjectValue deepCopy () {
83- return new ObjectValue (deepCopy (objectFields ), getSourceLocation (), getComments (), getIgnoredChars (), getAdditionalData ());
84+ List <ObjectField > copiedFields = deepCopy (objectFields );
85+ return new ObjectValue (copiedFields != null ? copiedFields : emptyList (), getSourceLocation (), getComments (), getIgnoredChars (), getAdditionalData ());
8486 }
8587
8688
@@ -107,8 +109,9 @@ public ObjectValue transform(Consumer<Builder> builderConsumer) {
107109 return builder .build ();
108110 }
109111
112+ @ NullUnmarked
110113 public static final class Builder implements NodeBuilder {
111- private @ Nullable SourceLocation sourceLocation ;
114+ private SourceLocation sourceLocation ;
112115 private ImmutableList <ObjectField > objectFields = emptyList ();
113116 private ImmutableList <Comment > comments = emptyList ();
114117 private IgnoredChars ignoredChars = IgnoredChars .EMPTY ;
@@ -124,7 +127,7 @@ private Builder(ObjectValue existing) {
124127 this .additionalData = new LinkedHashMap <>(existing .getAdditionalData ());
125128 }
126129
127- public Builder sourceLocation (@ Nullable SourceLocation sourceLocation ) {
130+ public Builder sourceLocation (SourceLocation sourceLocation ) {
128131 this .sourceLocation = sourceLocation ;
129132 return this ;
130133 }
0 commit comments