You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: coding-guidelines.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,16 +14,17 @@
14
14
15
15
## more specific topics
16
16
17
-
- Use @Public and @Internal to communicate what level of stability is supported.
17
+
- Use `@Public` and `@Internal` to communicate what level of stability is supported.
18
18
19
-
- Never make a class or method package protected or protected: make it public or private and use @Internal to communicate that the class can be changed without notice.
19
+
- Never make a class or method package private or protected:
20
+
make it public or private and use `@Internal` to communicate that the class can be changed without notice.
20
21
The user can decide itself about the risk when they use internal things.
21
22
22
23
### Optional vs null
23
24
We have a mix of Optional and allowing null values because GraphQL Java was originally written in Java 6.
24
25
We are not aiming to change the old code.
25
26
26
-
TBD: Every new code should use Optional or not?
27
+
**TBD: Every new code should use Optional or not?**
27
28
28
29
### Unit testing and dependencies
29
30
All tests are written in [Spock](http://spockframework.org).
@@ -56,7 +57,9 @@ Static methods imply that you never want to mock them.
56
57
57
58
Typical examples are util methods like `GraphQLTypeUtil.isNonNull()`
58
59
59
-
Don't mix static and non static methods (except factory methods): every class is either a general "Util" class with only static methods or a class with no static methods.
60
+
### "Util" class or not
61
+
Don't mix static and non static methods (except factory methods):
62
+
every class is either a general "Util" class with only static methods or a class with no static methods.
0 commit comments