Bug 185576 - [javadoc][assist] Type parameters should not be proposed while completing in @link or @see reference
Summary: [javadoc][assist] Type parameters should not be proposed while completing in ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3 RC1   Edit
Assignee: Eric Jodet CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-05-04 12:14 EDT by Ed Merks CLA
Modified: 2007-06-06 13:43 EDT (History)
0 users

See Also:
frederic_fusier: review+


Attachments
[patch]: proposed fix + test cases (3.51 KB, patch)
2007-05-14 11:03 EDT, Eric Jodet CLA
no flags Details | Diff
[patch]: proposed fix + test cases (4.95 KB, patch)
2007-05-14 12:49 EDT, Eric Jodet CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Merks CLA 2007-05-04 12:14:25 EDT
If I have something like below, the IDE complains that {@link X} is bad, but I don't think it really is bad because the IDE suggests it when I type {@link and I hit ctrl-space.  Since EMF generates code that produces references like this, it would be awfully nice for it to be fixed.  If it actually is bad, I need to change the code generator not to produce it, so please let me know.

  /**
   * The return type {@link X} and that is all.
   * @param <X>
   * @param t
   * @return something.
   */
  public <X> X foooo(X t)
  {
    return null;
  }
Comment 1 Frederic Fusier CLA 2007-05-04 13:30:11 EDT
Javadoc warnings are set by the compiler.
Comment 2 Frederic Fusier CLA 2007-05-04 13:37:39 EDT
Eric, can you investigate?
Comment 3 Eric Jodet CLA 2007-05-14 05:09:26 EDT
(In reply to comment #2)
(sorry for the late answer - either I missed the bugzilla notification or did not receive it)
We currently behave as Javadoc which rejects the {@link X} syntax:
warning - Tag @link: reference not found: X

So, assuming this is a CA issue, where CA should not include X in the proposals list.
Trying to investigate CA.
Comment 4 Frederic Fusier CLA 2007-05-14 06:19:55 EDT
So, we can fix the CA behavior but it definitely sounds like EMF should not generate such invalid @link reference...
Comment 5 Frederic Fusier CLA 2007-05-14 07:55:28 EDT
Not that javadoc tool currently do not produce any no error for the following syntax: {@link <X>}. But it seems to be a side effect of bug http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6300302.

So, we need to verify the new javadoc tool behavior when this bug will be fixed and modify our if necessary...
Comment 6 Frederic Fusier CLA 2007-05-14 07:57:23 EDT
Modify summary according to the real JDT/Core issue.
Comment 7 Eric Jodet CLA 2007-05-14 11:03:04 EDT
Created attachment 67072 [details]
[patch]: proposed fix + test cases

Fix: filter type parameters when performing CA whithin a Javadoc
Added 2 test cases to JavadocBugsCompletionModelTest (testBug185576a and testBug185576b)
All JDT Tests completed OK
Frédéric: may you please review
Comment 8 Frederic Fusier CLA 2007-05-14 11:19:23 EDT
(In reply to comment #7)
> Created an attachment (id=67072) [details]
> [patch]: proposed fix + test cases
> 
> Fix: filter type parameters when performing CA whithin a Javadoc
> Added 2 test cases to JavadocBugsCompletionModelTest (testBug185576a and
> testBug185576b)
> All JDT Tests completed OK
> Frédéric: may you please review
> 
First test looks suspicious... I would expect to have at least one proposal: test class itself (first proposal in the second test).
Comment 9 Frederic Fusier CLA 2007-05-14 11:22:03 EDT
Second test is not correct, class X should not be public as it is a secondary type
Comment 10 Frederic Fusier CLA 2007-05-14 11:25:27 EDT
(In reply to comment #9)
> Second test is not correct, class X should not be public as it is a secondary
> type
> 
Forget this comment, I mixed parenthesis... It is correct
Comment 11 Eric Jodet CLA 2007-05-14 11:40:09 EDT
(In reply to comment #8)
> (In reply to comment #7)
> > Created an attachment (id=67072) [details] [details]
> > [patch]: proposed fix + test cases
> > 
> > Fix: filter type parameters when performing CA whithin a Javadoc
> > Added 2 test cases to JavadocBugsCompletionModelTest (testBug185576a and
> > testBug185576b)
> > All JDT Tests completed OK
> > Frédéric: may you please review
> > 
> First test looks suspicious... I would expect to have at least one proposal:
> test class itself (first proposal in the second test).
--> same for me, the reason I implemented the second one :-)

Comment 12 Eric Jodet CLA 2007-05-14 12:49:09 EDT
Created attachment 67098 [details]
[patch]: proposed fix + test cases

Following Frédéric review:
- fix is OK
- test case were modified to conform with expected behavior / result (Compiler Options 1.5, completion start position)
(All JDT UI tests also completed OK)
Comment 13 Frederic Fusier CLA 2007-05-14 12:59:53 EDT
Patch is OK, only 2 minor issues: the 2 tests still have the ONLY_ prefix and there's an unnecessary change in AbstractJavadocCompletionModelTest...

I'll fix these issues before releasing the patch.
Comment 14 Frederic Fusier CLA 2007-05-14 13:00:16 EDT
Patch released for 3.3 RC1 in HEAD stream
Comment 15 Eric Jodet CLA 2007-05-14 13:17:18 EDT
(In reply to comment #13)
sorry for the extra work - thanks for the review
Comment 16 Maxime Daniel CLA 2007-05-15 05:38:42 EDT
Verified for 3.3 RC1 using build I20070515-0010.