File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
src/main/java/graphql/language Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 44import java .util .Collections ;
55import java .util .List ;
66
7+ import static graphql .Assert .assertNotNull ;
8+
79public 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}
Original file line number Diff line number Diff 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 */
You can’t perform that action at this time.
0 commit comments