Community
Participate
Working Groups
Given the code public class Test { /** {@value} */ public static final String FOO = "foo"; /** {@value} */ public static final String BAR = bar(); private static String bar() { return "bar"; } } the first Javadoc renders correctly as "foo" and the second renders as expected as just "{@value}" (because the value assigned to BAR is not a constant expression in the sense of JLS §15.28[1]). The feature request: It would be nice if Eclipse issues a (optional) warning if a Javadoc @value tag does not (explicitly or implicitly) reference a constant variable (in the sense of JLS §4.12.4[2]). The result would always render as "{@value}", which is probably not intended most of the time. [1] https://docs.oracle.com/javase/specs/jls/se10/html/jls-15.html#jls-15.28 [2] https://docs.oracle.com/javase/specs/jls/se10/html/jls-4.html#jls-4.12.4