Bug 336821 - Javadoc reference to constructor does not work without parameter list
Summary: Javadoc reference to constructor does not work without parameter list
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.7   Edit
Hardware: PC Windows 7
: P3 minor (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-10 09:07 EST by Markus Keller CLA
Modified: 2011-03-08 01:50 EST (History)
2 users (show)

See Also:
satyam.kandula: review+


Attachments
Proposed fix + regression test (5.96 KB, patch)
2011-02-10 10:18 EST, Olivier Thomann CLA
no flags Details | Diff
Proposed fix + regression test (5.65 KB, patch)
2011-02-11 03:31 EST, Satyam Kandula CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2011-02-10 09:07:00 EST
I20110208-0800

Javadoc reference to constructor does not work without parameter list.

In the example below, I get a wrong compiler warning for "#Try" and MemberRef#resolveBinding() returns null. Works fine for the method reference "#foo".


package xy;

/**
 * First ref should resolve to constructor
 * @see #Try
 * @see #Try(int, String)
 * @see #foo
 */
public class Try {
    public Try(int i, String message) {
        System.out.println(message + i);
    }
    
    public void foo(int i, String message) {
        System.out.println(message + i);
    }
}
Comment 1 Olivier Thomann CLA 2011-02-10 09:24:34 EST
I'll take a quick look.
Comment 2 Olivier Thomann CLA 2011-02-10 10:18:13 EST
Created attachment 188689 [details]
Proposed fix + regression test
Comment 3 Olivier Thomann CLA 2011-02-10 10:18:37 EST
Satyam, please review.
Comment 4 Satyam Kandula CLA 2011-02-11 03:31:46 EST
Created attachment 188749 [details]
Proposed fix + regression test

+1 for the patch in comment 2. 
However, I think a minor cleanup could be nice - The if's for the constructor check could be merged. Attached here is the patch with my proposed changes.
Please feel free to use whatever you feel appropriate.
Comment 5 Olivier Thomann CLA 2011-02-11 10:02:58 EST
Definitely +1 for your patch.
Thanks, Satyam.

Released for 3.7M6.
Comment 6 Satyam Kandula CLA 2011-03-08 01:50:16 EST
Verified for 3.7M6 using build I20110307-0800