Community
Participate
Working Groups
Created attachment 274106 [details] Minimal example, whole project I get this error when trying to compile a file with an annotation that refers to a static final field made up of the concatenation of different Strings. It is an error because I am effectively using a compile-time constant (and javac does with it), and because, well, what is puzzling is that... changing other things such as a Javadoc, the annotated method name, etc. makes the error disappear Description Resource Path Location Type The value for annotation attribute Key.value must be a constant expression MyConfig.java /example/src/main/java line 10 Java Problem public interface MyConfig { /** * @see #configPrefix() * @see #assetDuration() */ // Change the reference to configPrefix from this Javadoc and the error disappears. Move this javadoc to another element and the error disappears too. static final String PROPS_PREFIX = "myproject"; static final String PROPS_PREFIX_PROP = PROPS_PREFIX + ".prefix"; @Key(PROPS_PREFIX_PROP) // Sometimes this line yields a compiler error... String configPrefix(); @Key(PROPS_PREFIX_PROP) // But this line works..., even if we also mention this method from the javadoc above String assetDuration(); // Change this method name to "myDuration" and the error disappears } @interface Key { String value(); }
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
Unable to reproduce this on master