CheckerConfig#getConfigForTesting: Return Optional<Config>

The config is only available after load, and only if the checker ref
already exists. This means the returned config could have been null, but
the method was not annotated with @Nullable and callers were not
checking for null. To make this method safer to use and more consistent
with other methods in CheckerConfig return Optional<Config>.

Also rename the 'config' member variable to 'loadedConfig' to make the
naming consistent with the 'loadedChecker' member variable.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: I729931525fe789177f6a2548b121569d3e94e29c
3 files changed
tree: 5bc050dea1d6ea0b82578e152afa6f59e5f546a7
  1. java/
  2. javatests/
  3. src/
  4. BUILD
  5. LICENSE
  6. README.md
README.md

Gerrit Code Review Checks Plugin

This plugin provides a unified experience for checkers (CI systems, static analyzers, etc.) to integrate with Gerrit Code Review.