Bug 108053 - [search] SearchMatch.isInDocComment useless for SearchEngine.searchDeclarationsOfReferencedTypes
Summary: [search] SearchMatch.isInDocComment useless for SearchEngine.searchDeclaratio...
Status: VERIFIED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-25 16:54 EDT by Adam Kiezun CLA
Modified: 2007-08-03 09:59 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 Adam Kiezun CLA 2005-08-25 16:54:29 EDT
3.1
you always get false for SearchMatch.isInDocComment in the requstor in
SearchEngine.searchDeclarationsOfReferencedTypes because the declaration of the
refefrenced type is of course not in javadoc.

However, how do I search for types referenced in the given element but *not* in
the javadoc of the given element. There seems to be no way.
Comment 1 Frederic Fusier CLA 2007-07-04 12:57:53 EDT
It's not possible to use this flag in this peculiar case. This is a limitation of this API which comes from the fact that only the first found reference is used to report the declaration.

So, in following example:
/**
 * @see Ref
 */
public class Test {
    public Ref ref;
}
class Ref {}

SearchEngine returns a match but cannot set the isInDocComment flag as there's another reference which is not in a javadoc comment...

But there's a way to do what you're expecting... Disable the javadoc comment support of the compiler before performing the search using the IJavaProject.setOption(String, String). The corresponding option is:
JavaCore.COMPILER_DOC_COMMENT_SUPPORT and the value to disable it is:
JavaCore.DISABLED.
Then SearchEngine will not look into the Javadoc comments and no type declaration will be reported if there's only references in Javadoc comment.

Close as WONTFIX
Comment 2 Frederic Fusier CLA 2007-08-03 09:59:00 EDT
Verified for 3.4M1 using build I20070802-0800.