Bug 80221 - [dom][javadoc] No Javadoc comment node when return type missing
Summary: [dom][javadoc] No Javadoc comment node when return type missing
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M6   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 82538 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-05 14:06 EST by Martin Aeschlimann CLA
Modified: 2005-03-30 15:13 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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