Building and testing: the README's "Building and testing locally" section. Gradle runs on the Temurin 21 that
mise install provides, ./gradlew test is what CI runs, and ./gradlew formatDiff formats the files you changed.
-
Collections. Plain
java.utiltypes.List.of,List.copyOf,Map.ofandStream.toList()give unmodifiable collections, so new code does not need Guava'sImmutableListorImmutableMap; use them only where an existing API already hands one over. -
Nullability. One annotation,
javax.annotation.Nullable(jsr305), the one the code uses; do not add anotherNullable. -
Local variables.
varwherever the initializer gives the type unchanged, inforloops too. Not where it would box a primitive (for (var n : List<Integer>)), and not without an initializer that has a type of its own (a lambda,null). -
Immutability annotations. Do not add Error Prone's
@Immutableor@SuppressWarnings("Immutable"). -
License header. A new file starts with the Apache 2.0 header alone, without a copyright line:
/* * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
Files inherited from google-java-format and palantir-java-format keep their original headers.