Bug 43595 Javadoc formatter adds an extra line every time you format
20030924 Everytime you format a comment with a blank line another blank line is added. STEPS 1)Add a comment like this: /** * Get the progress monitor for a job. If it is a UIJob get the main * monitor from the status line. Otherwise get a background monitor. * * @return IProgressMonitor */ 2) Make a change in another method and format. It will look this this afterwards /** * Get the progress monitor for a job. If it is a UIJob get the main * monitor from the status line. Otherwise get a background monitor. * * * @return IProgressMonitor */
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/comment/JavaDocRegion.java
final Position[] positions= document.getPositions(CODE_POSITION_CATEGORY);
				if (positions.length > 0) {
					int begin= 0;
					int end= 0;
					final IFormattingContext context= new CommentFormattingContext();
					context.setProperty(FormattingContextProperties.CONTEXT_DOCUMENT, Boolean.valueOf(false));
					context.setProperty(FormattingContextProperties.CONTEXT_PREFERENCES, getStrategy().getPreferences());
					for (int position= 0; position < positions.length - 1; position++) {
						begin= positions[position++].getOffset();
						end= positions[position].getOffset();
						context.setProperty(FormattingContextProperties.CONTEXT_PARTITION, new TypedPosition(begin, end - begin, IDocument.DEFAULT_CONTENT_TYPE));
						formatter.format(document, context);
					}
				}
			} catch (BadPositionCategoryException exception) {
				
			}
		}
	}
	/*
	 * @see org.eclipse.jdt.internal.ui.text.comment.CommentRegion#canAppend(org.eclipse.jdt.internal.ui.text.comment.CommentLine, org.eclipse.jdt.internal.ui.text.comment.CommentRange, org.eclipse.jdt.internal.ui.text.comment.CommentRange, int, int)
	 */
	protected boolean canAppend(final CommentLine line, final CommentRange previous, final CommentRange next, final int offset, int length) {
		final boolean blank= next.hasAttribute(COMMENT_BLANKLINE);
		if (next.getLength() <= 2 && !blank && !isCommentWord(next))
			return true;
		if (fParameterNewLine && line.hasAttribute(JAVADOC_PARAMETER) && line.getSize() > 1)
			return false;
		if (previous != null) {
			if (offset != 0 && (blank || previous.hasAttribute(COMMENT_BLANKLINE) || next.hasAttribute(JAVADOC_PARAMETER) || next.hasAttribute(JAVADOC_ROOT) || next.hasAttribute(JAVADOC_SEPARATOR) || next.hasAttribute(COMMENT_NEWLINE) || previous.hasAttribute(COMMENT_BREAK) || previous.hasAttribute(JAVADOC_SEPARATOR)))