gerrit/gerrit-common
Dave Borowitz 16fefbf22b Extract an enum for label functions
A long time ago, these functions were each implementations of an
abstract class called CategoryFunction. This class was dissolved several
years ago in I6955594f, leading to the hard-coded strings that we have
today. That went a bit too far: hard-coded strings are error-prone.

Introduce an enum to avoid typos. For compatibility with the existing
GWT JSON interface, continue exposing a String from ProjectConfig; this
is simpler than implementing a custom gwtjsonrpc serializer for a
LabelFunction field.

The original motivation for removing the abstract class was that the set
of implementations was fixed, and even built-in functions should all be
implemented in the form of Prolog rules, so creating an extendable
abstract class sent the wrong message. This motivation still holds,
which is why this change only adds an enum, not a whole class.

Change-Id: I9fe1a865a828924fdeb2fc7c95154eaa79d4bd91
2018-02-21 08:27:32 -05:00
..
src Extract an enum for label functions 2018-02-21 08:27:32 -05:00
BUILD Bazel: Reformat build files 2016-12-07 11:33:07 +00:00