Bug 267658 - [formatter] Javadoc comments may be still formatted as block comments
Summary: [formatter] Javadoc comments may be still formatted as block comments
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.5 M6   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-09 11:44 EDT by Frederic Fusier CLA
Modified: 2009-03-11 07:56 EDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (3.38 KB, patch)
2009-03-09 12:12 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2009-03-09 11:44:19 EDT
While verifying bug 265898, David highlight a problem with the initial test case when options are set as follow:
[ ] Enable Javadoc comment formatting
[X] Enable block comment formatting
[X] Enable line comment formatting
[X] Enable header comment formatting

The formatter output is:
/**
 * 
 * @hibernate.subclass discriminator-value="address"
 */
public class AddressAssetVersion extends AbstractAssetVersion {

}

Observe the new line added inside the javadoc comment... It seems that the Javadoc comment is formatted although the option is not set!
Comment 1 Frederic Fusier CLA 2009-03-09 11:54:56 EDT
Although it looks like, this is not a regression introduced by the fix for bug 254998 but was rather something wrong in the new comment formatter implemented in 3.4...

In fact the javadoc comment is formatted but as a block comment! The new line added is the normal formatter behavior when a tag is encountered at the beginning of a line in a block comment...

Fixing bug 254998 has just changed the formatter behavior as with 3.4.2.

E.g. using the following options:
[ ] Enable Javadoc comment formatting
[X] Enable block comment formatting
[ ] Enable line comment formatting
[ ] Enable header comment formatting

the following test case:
public class Test {
/**
 * @test bug
 */
int field;
}

was formatted in 3.4.2 as:
public class Test {
	/*
	 * *
	 * 
	 * @test bug
	 */
	int field;
}
Comment 2 Frederic Fusier CLA 2009-03-09 12:12:03 EDT
Created attachment 128049 [details]
Proposed patch
Comment 3 Frederic Fusier CLA 2009-03-10 04:55:39 EDT
Released for 3.5M6 in HEAD stream.
Comment 4 David Audel CLA 2009-03-11 07:56:11 EDT
Verified for 3.5M6 using I20090311-0100