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
* @param document the document
	 * @return the index such that if the document is cut up to the offset, it will have <code>leadingEmptyLines</code> empty lines upfront
	 * @throws BadLocationException
	 */
	private int getLeadingWSOffset(int leadingEmptyLines, IDocument document) throws BadLocationException {
		
		int nLines= document.getNumberOfLines();
		int line= 0;
		for (; line < nLines; line++) {
			IRegion region= document.getLineInformation(line);
			if (document.get(region.getOffset(), region.getLength()).trim().length() != 0)
				break;
		}
		int wsLine= Math.max(line - leadingEmptyLines, 0);
		return document.getLineOffset(wsLine);
	}
	/**
	 * Returns the offset of the end of the line in <code>document</code> that is the
	 * <code>trailingEmptyLine</code>th empty line after the last non-WS character in
	 * <code>document</code>.
	 * 
	 * @param trailingEmptyLine the number of empty lines to leave
	 * @param document the document
	 * @return the index such that if the document is cut from the offset, it will have <code>trailingEmptyLine</code> empty lines at the end
	 * @throws BadLocationException
	 */
	private int getTrailingWSOffset(int trailingEmptyLines, IDocument document) throws BadLocationException {
		
		int numberOfLines= document.getNumberOfLines();
		int line = numberOfLines - 1;