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
As additional convenience for IntelliJ users, we provide `.editorconfig`
40
+
As additional convenience for IntelliJ users, we provide an `.editorconfig`
41
41
file. IntelliJ will automatically use it to adjust its code formatting settings.
42
42
It does not support all required rules, so you still have to run
43
43
`spotlessApply` from time to time.
@@ -55,8 +55,8 @@ To run these checks locally:
55
55
56
56
## Static imports
57
57
58
-
We leverage static imports for many common types of operations. However, not all static methods or
59
-
constants are necessarily good candidates for a static import. The following list is a very
58
+
We use static imports for many common types of operations. However, not all static methods or
59
+
constants are necessarily good candidates for a static import. The following list is a
60
60
rough guideline of what are commonly accepted static imports:
61
61
62
62
- Test assertions (JUnit and AssertJ)
@@ -70,8 +70,8 @@ rough guideline of what are commonly accepted static imports:
70
70
71
71
Some of these are enforced by checkstyle rules:
72
72
73
-
-look for `RegexpSinglelineJava` in `checkstyle.xml`
74
-
-use`@SuppressWarnings("checkstyle:RegexpSinglelineJava")` to suppress the checkstyle warning
73
+
-Look for `RegexpSinglelineJava` in `checkstyle.xml`
74
+
-Use`@SuppressWarnings("checkstyle:RegexpSinglelineJava")` to suppress the checkstyle warning
75
75
76
76
## Ordering of class contents
77
77
@@ -84,7 +84,7 @@ The following order is preferred:
84
84
- Nested classes
85
85
86
86
If methods call each other, it's nice if the calling method is ordered (somewhere) above
87
-
the method that it calls. So, for one example, a private method would be ordered (somewhere) below
87
+
the method that it calls. For example, a private method would be ordered (somewhere) below
88
88
the non-private methods that use it.
89
89
90
90
In static utility classes (where all members are static), the private constructor
@@ -102,7 +102,7 @@ Method parameters and local variables should never be declared `final`.
102
102
103
103
## `@Nullable` annotation usage
104
104
105
-
[Note: this section is aspirational, as opposed to a reflection of the current codebase]
105
+
**Note: this section is aspirational, as opposed to a reflection of the current codebase**
106
106
107
107
All parameters and fields which can be `null` should be annotated with `@Nullable`
108
108
(specifically `javax.annotation.Nullable`, which is included by the
@@ -125,7 +125,7 @@ plugins {
125
125
## java.util.Optional usage
126
126
127
127
Following the reasoning from [Writing a Java library with better experience (slide 12)](https://speakerdeck.com/trustin/writing-a-java-library-with-better-experience?slide=12),
128
-
usage of `java.util.Optional` is kept at a minimum in this project.
128
+
usage of `java.util.Optional` is kept to a minimum in this project.
129
129
130
130
It is ok to use `Optional` in places where it does not leak into public API signatures.
131
131
@@ -137,9 +137,9 @@ itself uses it.
137
137
Avoid allocations whenever possible on the hot path (instrumentation code).
138
138
This includes `Iterator` allocations from collections; note that
139
139
`for(SomeType t : plainJavaArray)` does not allocate an iterator object.
140
-
Non-allocating stream api usage on the hot path is acceptable but may not
141
-
fit the surrounding code style; this is a judgement call. Note that
142
-
some stream apis make it much more difficult to allocate efficiently
140
+
Non-allocating stream API usage on the hot path is acceptable but may not
141
+
fit the surrounding code style; this is a judgment call. Note that
142
+
some stream APIs make it much more difficult to allocate efficiently
143
143
(e.g., `collect` with presized sink data structures involves
144
144
convoluted `Supplier` code, or lambdas passed to `forEach` might be
0 commit comments