Community
Participate
Working Groups
Using latest, the following code generates a deprecated attribute for the field i. public class A { /** @deprecated */ ; // line comment static int i; } This should not be the case, because there is an empty member declaration before the field declaration. Such a test case is found in jacks test suite.
The comment pointer needs to be reset when an empty member declaration or an empty type declaration is read.
Fixed and released in HEAD. Regression test added.
JLS 3 gives no clue whether we are right or wrong in this instance (javac complains). However, note that the use of annotations will align our behavior to javac's since the following source yields a syntax error: @Deprecated ; int i; (no way to annotate an empty declaration).
Using JDK 7 javadoc upon the following source does not tag i as deprecated, which tends to prove us right (the javadoc should not be attached to i): /** * @deprecated **/ ; public int i;