Bug 45465 [formatting] New Formatter does not respect non javadoc @tags lines
For example, given a javadoc with tags that are not recognized, (i.e., xdoclet tags for instance): /** * @hibernate.set * lazy="true" * table="GUJArticleCategorization" * cascade="save-update" * @hibernate.collection-key * column="articleId" * @hibernate.collection-many-to-many * class="br.com.guj.model.Category" * column="categoryId" * * @return categorias deste artigo */ public Category getCategory() { return this.category; } After reformatting: /** * @hibernate.set lazy="true" table="GUJArticleCategorization" * cascade="save-update" @hibernate.collection-key column="articleId" * @hibernate.collection-many-to-many class="br.com.guj.model.Category" * column="categoryId" * * @return categorias deste artigo */ public Category getCategory() { return this.category; } Everything in a single line until it reachs the line size limit And there is NO option that can prevent this reformat. XDoclet will not recognize tags like this, if there is some text before them! Tested in M4. linux motif and winXP
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/comment/JavaDocRegion.java
* @inheritDoc
	 */
	protected final void wrapRegion(final int width) {
		
		if (!fSkipFormatting)
			super.wrapRegion(width);
	}
	
	/**
	 * @inheritDoc
	 */
	protected boolean canAppend(CommentLine line, CommentRange previous, CommentRange next, int index, int count) {
		
		if (next.hasAttribute(COMMENT_CODE | COMMENT_FIRST_TOKEN) && line.getSize() != 0)
			return false;
		return super.canAppend(line, previous, next, index, count);
	}
	/**
	 * Converts <code>formatted</code> into valid html code suitable to be
	 * put inside &lt;pre&gt;&lt;/pre&gt; tags by replacing any html symbols by
	 * the relevant entities.
	 * 
	 * @param formatted the formatted java code
	 * @return html version of the formatted code
	 */
	private String convertJava2Html(String formatted) {
		Java2HTMLEntityReader reader= new Java2HTMLEntityReader(new StringReader(formatted));
		char[] buf= new char[256];
		StringBuffer buffer= new StringBuffer();
		int l;