Bug 45958 - Compiler wrongly complains against valid @see constructor reference
Summary: Compiler wrongly complains against valid @see constructor reference
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: 3.0 M5   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-03 10:15 EST by Frederic Fusier CLA
Modified: 2003-11-21 07:49 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2003-11-03 10:15:38 EST
Let's have following example:
public class X {
	int x;
	public X(int i) {
		x = i;
	}
	/**
	 * @see #X(int)
	 */
	void foo() {
	}
}

The compiler complains against the @see reference in Javadoc comment:
----------
1. WARNING in D:\usr\OTI\workspaces\dvpt-ffr\_Bug\X.java (at line 7)
	* @see #X(int)
	        ^
Annotation: The method X(int) is undefined for the type X
----------
1 problem (1 warning)

This wrong as the reference is valid. It seems that the compiler does not see 
that the reference might be on constructor and looks only for a method 
reference in this case...
Comment 1 Frederic Fusier CLA 2003-11-05 12:05:05 EST
All @see references <type>#<identifier>(<arguments>) were scanned as reference 
to a method.

Need to distinguish case when <identifier> is identical to type name (or 
enclosing type name when no type was specified).

In this case, then create an specific AnnotationAllocationExpression instead of 
an AnnotationMessageSend. This allow to resolve correctly the binding to 
constructor.

If the binding fails for constructor, then also try to get a method in case a 
method with constrcutor name was declared in the specified type...
Comment 2 Frederic Fusier CLA 2003-11-17 05:20:48 EST
Fixed.

Test cases added in AnnotationTestMixed:
 - testBug45958
 - testBug45958a
 - testBug45958b
 - testBug45958c
Comment 3 David Audel CLA 2003-11-21 07:49:48 EST
Verified.