Case expressions must be constant expressions for static final int?
Replace with So this will really be a constant as in “determined at compilation”. The specification precises that a “SwitchLabel” must be case followed by a constant expression case followed by the name of an enum value or default What is considered a valid constant expression is described here in the specification. It’s fairly limited.