Bug 283413 - [content assist] Package-level javadoc requires fully-qualified refs for @see and @link tags
Summary: [content assist] Package-level javadoc requires fully-qualified refs for @see...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.6 M2   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-14 09:41 EDT by James Shaw CLA
Modified: 2009-09-16 09:59 EDT (History)
5 users (show)

See Also:


Attachments
Test case (2.08 KB, application/binary)
2009-07-23 07:35 EDT, James Shaw CLA
no flags Details
Proposed Patch (970 bytes, patch)
2009-08-10 04:43 EDT, Jay Arthanareeswaran CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Shaw CLA 2009-07-14 09:41:26 EDT
Currently, eclipse will auto-complete class names in the current package, but they are not fully qualified.  This produces warnings when running javadoc, and the hyperlinks are not generated.
Comment 1 Olivier Thomann CLA 2009-07-14 09:43:57 EDT
Jay, please investigate.
Comment 2 Jay Arthanareeswaran CLA 2009-07-23 02:36:35 EDT
This might be a problem if you are trying to run Javadoc for an individual file. Can you please try passing in the package names or a wildcard (*)? This is just to ensure that Javadoc is aware of the other classes/sources that are being referred to at the time of processing. I tried with both these options and the output is fine.

Let me know if this helps.
Comment 3 James Shaw CLA 2009-07-23 07:34:10 EDT
See the attached test case to reproduce the bug.  Autocompletion on the @see OtherClass tag must use the fully-qualified class name.

Warning when running is:
C:\workspace\javadoc-package-bug\src\foo\package-info.java:4: warning - Tag @see: reference not found: OtherClass
Comment 4 James Shaw CLA 2009-07-23 07:35:28 EDT
Created attachment 142368 [details]
Test case
Comment 5 Jay Arthanareeswaran CLA 2009-07-27 02:27:17 EDT
Just a behavior I observed: I see that Javadoc is not complaining when the references are made in any java file (in the same package) other than package-info.java. The generated HTML files have the proper links too. This could be a Javadoc bug. But I am yet to verify this. Will update the bug once I check on that.
Comment 6 James Shaw CLA 2009-07-27 02:57:21 EDT
This is not a javadoc bug, see http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javadoc.html#packagecomment

"If you add a @see tag in a package comment file, it must have a fully-qualified name."
Comment 7 Jay Arthanareeswaran CLA 2009-08-10 04:01:35 EDT
On investigation, I think this may have to be fixed in JDT/UI. Moving to JDT/UI for consideration.
Perhaps one possible place for the fix is -
org.eclipse.jdt.internal.ui.text.java.LazyJavaTypeCompletionProposal.computeReplacementString()
Comment 8 Jay Arthanareeswaran CLA 2009-08-10 04:43:53 EDT
Created attachment 143871 [details]
Proposed Patch

Attaching a fix for review by JDT/UI committers.
Comment 9 Dani Megert CLA 2009-08-17 08:42:12 EDT
Thanks Jay, the proposed patch is basically correct. I fixed it a little bit differently to have the correct code comments.
Comment 10 Markus Keller CLA 2009-09-10 08:56:45 EDT
FYI: The fix caused an NPE (bug 289028, fixed in HEAD).
Comment 11 Olivier Thomann CLA 2009-09-16 09:59:00 EDT
Verified for 3.6M2 using I20090915-0100.