Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/main/java/graphql/execution/MergedField.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import java.util.function.Consumer;

import static graphql.Assert.assertNotEmpty;
import static graphql.Assert.assertNotNull;


/**
* This represents all Fields in a query which overlap and are merged into one.
Expand Down Expand Up @@ -428,7 +428,11 @@ public MergedField build() {
if (this.singleField != null && this.fields == null) {
return new MergedField(singleField, deferredExecutions);
}
ImmutableList<Field> fields = assertNotNull(this.fields, "You MUST add at least one field via the builder").build();
ImmutableList.Builder<Field> fieldsBuilder = this.fields;
if (fieldsBuilder == null) {
throw new AssertionError("You MUST add at least one field via the builder");
}
ImmutableList<Field> fields = fieldsBuilder.build();
assertNotEmpty(fields);
return new MultiMergedField(fields, deferredExecutions);
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/graphql/language/ArrayValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ public String toString() {

@Override
public ArrayValue deepCopy() {
List<Value> copiedValues = assertNotNull(deepCopy(values));
return new ArrayValue(copiedValues, getSourceLocation(), getComments(), getIgnoredChars(), getAdditionalData());
return new ArrayValue(assertNotNull(deepCopy(values)), getSourceLocation(), getComments(), getIgnoredChars(), getAdditionalData());
}

@Override
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/graphql/language/ObjectValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ public boolean isEqualTo(@Nullable Node o) {

@Override
public ObjectValue deepCopy() {
List<ObjectField> copiedFields = assertNotNull(deepCopy(objectFields));
return new ObjectValue(copiedFields, getSourceLocation(), getComments(), getIgnoredChars(), getAdditionalData());
return new ObjectValue(assertNotNull(deepCopy(objectFields)), getSourceLocation(), getComments(), getIgnoredChars(), getAdditionalData());
}


Expand Down
Loading