Bug 336821

Summary: Javadoc reference to constructor does not work without parameter list
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Olivier Thomann <Olivier_Thomann>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P3 CC: Olivier_Thomann, satyam.kandula
Version: 3.7Flags: satyam.kandula: review+
Target Milestone: 3.7 M6   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Proposed fix + regression test
none
Proposed fix + regression test none

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