CodeOwnerResolver: Use ImmutableList.Builder<String> to collect messages

CodeOwnerResolver consists out of several steps to resolve code owner
emails to code owner accounts. For each step we collect debug messages
so that issues with resolving code owners can easily be investigated.

So far the internal methods returned OptionalResultWithMessages which is
the result of the method plus collected debug messages. Going forward we
want to refactor CodeOwnerResolver to process all emails at once rather
than each email one by one. For this most of the steps will be converted
into operations on a stream, e.g. the methods will filter the stream or
map entries in the stream. When we do this the methods can no longer
return messages as part of the result.

To enable the refactoring, this change changes the internal methods to
no longer return OptionalResultWithMessages, but instead return the
plain result and get an ImmutableList.Builder<String> passed in that is
used to collect messages. This also simplifies some of the code.

Signed-off-by: Edwin Kempin <ekempin@google.com>
Change-Id: Idf625ecf1784553dd6daa24a7d4862532e2524ac
2 files changed
tree: 9a6a3d5a7c45f228f3cb53f3d50a227605f03f90
  1. java/
  2. javatests/
  3. proto/
  4. resources/
  5. test/
  6. ui/
  7. .eslintrc.json
  8. .gitignore
  9. .gitreview
  10. bower.json
  11. BUILD
  12. LICENSE
  13. package-lock.json
  14. package.json
  15. README.md
README.md

Gerrit Code Review code-owners plugin

This plugin provides support for defining code owners for files in a repository.

If the code-owners plugin is enabled, changes can only be submitted if all touched files are covered by approvals from code owners.

Also see resources/Documentation/about.md.

IMPORTANT: Before installing/enabling the plugin follow the instructions from the setup guide, see resources/Documentation/setup-guide.md.