Bug 83285

Summary: [javadoc] Javadoc reference to constructor of secondary type has no binding / not found by search
Product: [Eclipse Project] JDT Reporter: Markus Keller <markus.kell.r>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: minor    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Markus Keller CLA 2005-01-20 05:23:47 EST
I20050118-1015

The javadoc reference to constructor C(String) of secondary type C has no
binding and is not found by search.

p/A.java:
package p;

enum A { }

class C {
    /**
     * Defined thru {@link #C(String)}. => wrong warning:
     * Javadoc: The method C(String) is undefined for the type C"  
     */
    private String fGerman;

    public C(String german) {
        fGerman = german;
    }
}
Comment 1 Frederic Fusier CLA 2005-03-01 16:07:01 EST
Not a specific 1.5 bug. Enum can be replaced by class A and it fails the same...
Comment 2 Frederic Fusier CLA 2005-03-07 09:21:01 EST
Fixed.

Javadoc parser used main type for implicit reference which was obviously wrong
in this case. That's explain this warning and the fact that Search engine didn't
find it.

Now Javadoc parser stores first type declaration found in parser ast stack and
starts from it to bind the reference. If reference is not found, try to resolve
in enclosing type or as a constructor call instead of a message send.

Also search engine now allows ConstructorLocator to accept message send
reference and verify while resolving if it can be bound to a constructor.

[jdt-core-internal]
Modifications done in SourceElementParser, ContructorLocator, MethodLocator,
JavadocAllocationExpression and JavadocMessageSend.
Test cases added in JavadocBugsTests and JavaSearchJavadocTests
Comment 3 Olivier Thomann CLA 2005-03-30 15:16:41 EST
Verified in I20050330-0500