Summary: | [javadoc] Incorrect usage of inner type not reported | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dani Megert <daniel_megert> | ||||||||
Component: | Core | Assignee: | Satyam Kandula <satyam.kandula> | ||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||
Severity: | normal | ||||||||||
Priority: | P3 | CC: | bokowski, frederic_fusier, jarthana, jerome_lanneluc, markus.kell.r, Olivier_Thomann | ||||||||
Version: | 3.4 | Flags: | jarthana:
review+
|
||||||||
Target Milestone: | 3.7 M6 | ||||||||||
Hardware: | All | ||||||||||
OS: | All | ||||||||||
Whiteboard: | |||||||||||
Attachments: |
|
Description
Dani Megert
2008-03-11 05:14:47 EDT
Actually it can be reproduced with the simple example: 1. setup your project to use 1.4 2. paste this into Package Explorer ---- %< ----- package pack2; import pack.Test; class X { /** * See also {@link Test.Inner}. */ void f() { } } package pack; public class Test { public interface Inner { } } ---- %< ----- 3. setup to warn about invalid refs in Javadoc ==> no warning Create Javadoc using 1.4 or 1.5 ==> warning is issued. See also bug 96237 which seems to have fixed this when the stuff is in the same package. sound similar (if not a real dup) to bug 221539 (In reply to comment #2) the test case in bug 221539 uses the same package, whereas the above test case uses 2 separate packages Thanks Dani - I was staring at the Javadoc warning for a bit but didn't understand what was going on. Why is the Javadoc there in the first place? > Why is the Javadoc there in the first place?
Where?
For example, in the case you came up with in comment 0. Why is {@link Test.Inner} wrong? Should it be {@link Inner}? If we have two imports: import pack.Test; import pack.Test.Inner; - would {@link Test.Inner} still be wrong? >For example, in the case you came up with in comment 0. Why is {@link >Test.Inner} wrong? Because for inner classes you either need to use full qualification or just the class itself, so yes {@link Inner} would work if there wasn't a bug in the 1.4 version of the javadoc tool :-( >If we have two imports: >import pack.Test; >import pack.Test.Inner; >- would {@link Test.Inner} still be wrong? Yep. Thanks. Now it all makes sense to me again. Just got another Eclipse build warning due to that (see bug 223083). Created attachment 100910 [details]
[proposed patch + test case] on top v865 - all jdt.core tests OK
Frederic, please review (In reply to comment #10) same patch fixes bug 221539 This is not a regression comparing to 3.3.2. Will fix in 3.5. Created attachment 101236 [details]
[proposed patch + test case] on top v_866
previous patch was the wrong one
bug 215193 describes the exact same issue, and attached patch fixes it. *** Bug 215193 has been marked as a duplicate of this bug. *** Not sure I'll have enough time to review the proposed patch for 3.5... See also bug 253750. Satyam, please investigate, thanks! Satyam, please investigate, thanks. (In reply to comment #20) > Satyam, please investigate, thanks. Ping! This happened again. (In reply to comment #21) I have the changes but unfortunately many tests needs to be updated -- Will fix those tests and create a patch. Created attachment 189260 [details]
Patch on HEAD
Cleaned up the previous patch.
Jay, Can you please review the patch? +1 for the patch. Thanks Jay for the Review. Released the patch on HEAD. Thanks! Verified in N20110228-2000. Just for reference: According to http://download.oracle.com/javase/6/docs/technotes/tools/windows/javadoc.html#specifyingname , "{@link Test.Inner}" would be legal, but sadly, javadoc.exe has this long-standing bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4464323 Furthermore, "{@link Inner}" is incorrect according to the spec, but again, the javadoc.exe implementation is broken. I've filed bug 338809 for a quick fix for this (since users shouldn't have to do all this investigation just to add workarounds that violate the spec). Verified for 3.7M6 using build I20110301-1537. |