Bug 40839

Summary: Deprecation is reported even if there is an empty member declaration prior to the field declaration
Product: [Eclipse Project] JDT Reporter: Olivier Thomann <Olivier_Thomann>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.0   
Target Milestone: 3.0 M3   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Olivier Thomann CLA 2003-07-28 11:42:12 EDT
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.
Comment 1 Olivier Thomann CLA 2003-07-28 11:54:56 EDT
The comment pointer needs to be reset when an empty member declaration or an
empty type declaration is read.
Comment 2 Olivier Thomann CLA 2003-07-28 11:59:33 EDT
Fixed and released in HEAD.
Regression test added.
Comment 3 Maxime Daniel CLA 2008-06-02 07:36:28 EDT
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).
Comment 4 Maxime Daniel CLA 2008-06-02 07:39:40 EDT
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;