Bug 80221

Summary: [dom][javadoc] No Javadoc comment node when return type missing
Product: [Eclipse Project] JDT Reporter: Martin Aeschlimann <martinae>
Component: CoreAssignee: Frederic Fusier <frederic_fusier>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tobias_widmer
Version: 3.0   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Martin Aeschlimann CLA 2004-12-05 14:06:39 EST
20041205

Look at the AST in the following code with a missing return type:
	/**
	 * 
	 */
	private foo() {
		return 1;
	}

The AST does not contain a Javadoc node.
Comment 1 Tobias Widmer CLA 2005-01-11 06:45:46 EST
*** Bug 82538 has been marked as a duplicate of this bug. ***
Comment 2 Frederic Fusier CLA 2005-03-01 19:04:36 EST
Fixed.

As method return type is missing, compiler first creates a
ConstructorDeclaration. Recovery changes this ConstructorDeclaration to
MethodDeclaration but forgot to copy javadoc while doing this...

Now, invalid method as its javadoc correctly set

[jdt-core-internal]
Change done in Parser.convertToMethodDeclaration(...)
Test case added in ASTConverterJavadocTest
Comment 3 Olivier Thomann CLA 2005-03-30 15:13:07 EST
Verified in I20050330-0500