Skip to content

Commit 9b0a96f

Browse files
committed
graphql-java#325 PR fix ups - clearer javadoc and assertions
1 parent 52f1fff commit 9b0a96f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/graphql/language/AbstractNode.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import java.util.Collections;
55
import java.util.List;
66

7+
import static graphql.Assert.assertNotNull;
8+
79
public abstract class AbstractNode implements Node {
810

911
private SourceLocation sourceLocation;
@@ -24,6 +26,7 @@ public List<String> getComments() {
2426
}
2527

2628
public void setComments(List<String> comments) {
27-
this.comments = comments == null ? Collections.emptyList() : comments;
29+
assertNotNull(comments, "You must provide non null comments");
30+
this.comments = comments;
2831
}
2932
}

src/main/java/graphql/language/Node.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public interface Node {
1010
SourceLocation getSourceLocation();
1111

1212
/**
13-
* Nodes can have comments made on them
13+
* Nodes can have comments made on them, the following is one comment per line before a node.
1414
*
1515
* @return the list of comments or an empty list of there are none
1616
*/

0 commit comments

Comments
 (0)