Bug 106821 - [assist] Code assist: Deprecated elements not marked
Summary: [assist] Code assist: Deprecated elements not marked
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.5 M1   Edit
Assignee: David Audel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-12 04:24 EDT by Martin Aeschlimann CLA
Modified: 2008-08-06 12:15 EDT (History)
5 users (show)

See Also:


Attachments
Potential fix (7.27 KB, patch)
2008-04-30 04:51 EDT, David Audel CLA
no flags Details | Diff
Updated patch (13.23 KB, patch)
2008-07-23 09:22 EDT, David Audel CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Aeschlimann CLA 2005-08-12 04:24:34 EDT
3.1

In the following code example do a code assists and after 'foo' and after
'Thread.'. The elements on 'Foo' should all be shown as deprecated.

public class Foo {
	/**
	 * @deprecated
	 */
	void foo1() {
	}
	
	/**
	 * @deprecated
	 */
	void foo2() {
	}
	
	{
	foo
	Thread.
	}
}
Comment 1 Tom Hofmann CLA 2005-12-16 09:16:49 EST
The completion proposals do have the deprecation flag when the @Deprecated annotation is used, but not when only the javadoc tag is present. This is true for Java 1.4 source level as well.
Comment 2 Markus Keller CLA 2008-03-17 13:55:35 EDT
Works for me in I20080314-1059 for /** @deprecated */ elements, but only when they are defined in *another* compilation unit / class file.

Fails when doing content assist inside the declaring CU.
Comment 3 David Audel CLA 2008-04-30 04:51:09 EDT
Created attachment 98134 [details]
Potential fix

This fix should solve the problem with a very small performance loss.

For the completed compilation unit
- The scanner detects if a javadoc contains '@deprecated'
- The parser checks deprecation only if the javadoc contains '@deprecated'. The parse starts just before '@deprecated' and stop if a deprecated tag is found.
Comment 4 David Audel CLA 2008-04-30 04:52:08 EDT
Deferred to 3.5.
Comment 5 David Audel CLA 2008-07-23 09:22:57 EDT
Created attachment 108189 [details]
Updated patch
Comment 6 David Audel CLA 2008-07-23 09:25:52 EDT
Released for 3.5M1.

Test added
  CompletionTests_1_5#test0375()
Comment 7 Olivier Thomann CLA 2008-08-06 12:15:47 EDT
Verified for 3.5M1 using I20080805-1307