Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 195379

Summary: [formatter] format does not work on package-info javadoc
Product: [Eclipse Project] JDT Reporter: David Koski <david_koski>
Component: CoreAssignee: Eric Jodet <eric_jodet>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: frederic_fusier
Version: 3.3   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description David Koski CLA 2007-07-04 09:18:37 EDT
See also bug 195261

The java editor does not seem to understand the package-info.java format,
roughly:

/**
  * javadoc
  */

 package foo;

 import X;

Reformat does not reformat it as if it were javadoc, e.g. wrapping and
forcing leading *'s (in fact it seems to do nothing)
Comment 1 Olivier Thomann CLA 2007-07-24 10:13:09 EDT
What is your setting for formatting headers ?
Comment 2 David Koski CLA 2007-07-25 08:32:01 EDT
(In reply to comment #1)
> What is your setting for formatting headers ?
> 

They are:

Comments:

Enable Javadoc comment formatting
Enable block / line comment formatting

Javadoc:

Format html tags
Format java code snippets
Blank lines before javadoc
Indent javadoc tags


In a normal javadoc comment, if I type this:

/**
 * Super long line.
 *
 * <pre>
paste some code in here
 * </pre>
 */

and I reformat it, it will turn into:

/**
 * Super long
 * line.
 *
 * <pre>
 * paste some code in here
 * </pre>
 */
Comment 3 Eric Jodet CLA 2008-05-23 03:50:32 EDT
(In reply to comment #1)
> What is your setting for formatting headers ?
> 

This question might be of importance: on the comment formatter preference page, 
the "enable header comment formatting" option is disabled by default.
If you enable it, then the javadoc comments in a package-info file seems to be formatted as expected.

With this option enabled, I tried to format the javadoc comment I inserted in a package-info file:
				/**
 * 		@author                  ejd
 *  @since                      3.2
 * @version                          1.1
 */
package test;

This gave:
/**
 * @author ejd
 * @since 3.2
 * @version 1.1
 */
package test;

which sounds correct to me.

Would close as WORKSFORME.
Comment 4 Frederic Fusier CLA 2008-05-26 09:17:09 EDT

*** This bug has been marked as a duplicate of bug 113946 ***