Bug 51451 [formatting] unstable comment formatting
- open TestCase - in the editor set the carret in a method declaration's name (e.g., ru|n()) - press CTRL-SHIFT-F multiple times -> the formatting changes in each `format'
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaFormattingStrategy.java
/**
 * Formatting strategy for java source code.
 * <p>
 * This strategy implements <code>IFormattingStrategyExtension</code>. It must be
 * registered with a content formatter implementing <code>IContentFormatterExtension2<code>
 * to take effect.
 * 
 * @since 3.0
 */
public class JavaFormattingStrategy extends ContextBasedFormattingStrategy {
	
	private final LinkedList fIndentations= new LinkedList();
	
	private final LinkedList fPartitions= new LinkedList();
	
	private final LinkedList fPositions= new LinkedList();
	/**
	 * Creates a new java formatting strategy.
	 * 
	 * @param viewer ISourceViewer to operate on
	 */
	public JavaFormattingStrategy(final ISourceViewer viewer) {
		super(viewer);
	}
	/*
	 * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#format()
	 */
	public void format() {
		super.format();
		Assert.isLegal(fIndentations.size() > 0);