Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

With GEODE-8882 we have introduced a compile-time dependency (in the geode-core subproject only) on the JetBrains annotations package. This makes the JetBrains @NotNull and @Nullable annotations available in classes in that subproject. If you need those annotations in other subprojects, just add this to the pertinent build.gradle:

...

Here is the home page for the JetBrains annotations Maven project: https://github.com/JetBrains/java-annotations

In addition to those instructions you may want to tell IntelliJ inspections to "treat non-annotated members and parameters as @Nullable". This is the most conservative setting and should highlight the most bugs. Oddly, this setting is in the "Constant conditions & exceptions" panel under the Java "Probable bugs" inspection category:

Image Added

Example

Here's an example. When working on SocketMessageWriter.writeHandshakeMessage I wondered if the clientVersion parameter could ever be null. Here we're testing for null . Could this null-check be eliminated?

...