Eclipse keeps giving me an error:
The value for annotation attribute Min.value must be a constant expression
But I definitely give the annotation constant.
private static final int MIN_YEAR = Calendar.getInstance().get(Calendar.YEAR) - 1; @Min(MIN_YEAR)
If I change it to
private static final int MIN_YEAR = 2013;
This is great, but I should not do it. Does anyone know why or how my constant MIN_YEAR is not considered a constant if it is declared with an evaluated expression instead of a prime number?
source share