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
for (; line >= 0; line--) {
			IRegion region= document.getLineInformation(line);
			if (document.get(region.getOffset(), region.getLength()).trim().length() != 0)
				break;
		}
		int wsLine= Math.min(line + trailingEmptyLines, numberOfLines);
		IRegion region= document.getLineInformation(wsLine);
		return region.getOffset() + region.getLength();
	}
	/*
	 * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStarts(org.eclipse.jface.text.formatter.IFormattingContext)
	 */
	public void formatterStarts(IFormattingContext context) {
		super.formatterStarts(context);
		final FormattingContext current= (FormattingContext)context;
		fIndentations.addLast(current.getProperty(FormattingContextProperties.CONTEXT_INDENTATION));
		fPartitions.addLast(current.getProperty(FormattingContextProperties.CONTEXT_PARTITION));
		fPositions.addLast(current.getProperty(FormattingContextProperties.CONTEXT_POSITIONS));
	}
	/*
	 * @see org.eclipse.jface.text.formatter.ContextBasedFormattingStrategy#formatterStops()
	 */
	public void formatterStops() {
		super.formatterStops();
		fIndentations.clear();
		fPartitions.clear();
		fPositions.clear();
	}
}