Bug 40839 - Deprecation is reported even if there is an empty member declaration prior to the field declaration
Summary: Deprecation is reported even if there is an empty member declaration prior to...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M3   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-28 11:42 EDT by Olivier Thomann CLA
Modified: 2008-06-02 07:39 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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;