Bug 68593 [formatting] Code formatter formats header comments
Even though "format header comments" is turned off in the general settings block on the comments tab, Eclipse 3RC3 is formatting the header comments. This happened with both built-in and all newly generated format templates. regards martin
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/comment/CommentFormattingStrategy.java
import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jdt.internal.ui.JavaPlugin;
/**
 * Formatting strategy for general source code comments.
 * 
 * @since 3.0
 */
public class CommentFormattingStrategy extends ContextBasedFormattingStrategy {
	/**
	 * Returns the indentation of the line at the specified offset.
	 * 
	 * @param document	the document which owns the line
	 * @param region	the comment region which owns the line
	 * @param offset	the offset where to determine the indentation
	 * @param useTab		<code>true</code> iff the indentation should use tabs
	 *                   instead of spaces, <code>false</code> otherwise
	 * @return The indentation of the line
	 */
	public static String getLineIndentation(final IDocument document, final CommentRegion region, final int offset, final boolean useTab) {
		String result= ""; 
		try {
			final IRegion line= document.getLineInformationOfOffset(offset);
			final int begin= line.getOffset();
			final int end= Math.min(offset, line.getOffset() + line.getLength());
			result= region.stringToIndent(document.get(begin, end - begin), useTab);
		} catch (BadLocationException exception) {
			
		}
		return result;