Community
Participate
Working Groups
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...
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...
Fixed. Test cases added in AnnotationTestMixed: - testBug45958 - testBug45958a - testBug45958b - testBug45958c
Verified.