Bug 46341 [formatting][implementation] comment line length not correctly applied
(1105 nightly build) when formatting the declaration below, with all default code formatter options (i.e. comment line length = 80), the last word '<code>String</code>' is not correctly moved to anotherline, leaving the last line longer than 80 characters (about 87 characters i think..) /** * Sets the set of identifiers to active activities. * * @param activeActivityIds * the set of identifiers to active activities. This set may be * empty, but it must not be <code>null</code>. If this set * is not empty, it must only contain instances of <code>String</code>. */ void setActiveActivityIds(Set activeActivityIds);
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/comment/CommentRegion.java
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.ILineTracker;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.TypedPosition;
import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.text.javadoc.IHtmlTagConstants;
/**
 * Comment region in a source code document.
 * 
 * @since 3.0
 */
public class CommentRegion extends TypedPosition implements IHtmlTagConstants, IBorderAttributes, ICommentAttributes {
	
	public static final int COMMENT_PREFIX_LENGTH= 3;
	
	protected static final String COMMENT_RANGE_DELIMITER= " "; 
	
	private int fBorders= 0;
	
	private final boolean fClear;
	
	private final String fDelimiter;
	
	private final IDocument fDocument;
	
	private final ITextMeasurement fTextMeasurement;
	
	private final LinkedList fLines= new LinkedList();