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
try {
					
					if (fCodePositions.size() > 0) {
						
						int begin= 0;
						int end= 0;
						
						Position position= null;
						
						final IDocument document= getDocument();
						
						for (int index= fCodePositions.size() - 1; index >= 0;) {
							
							position= (Position)fCodePositions.get(index--);
							begin= position.getOffset();
							
							if (index >= 0) {
								position= (Position)fCodePositions.get(index--);
								end= position.getOffset();
							} else {
								/* 
								 * Handle missing closing tag
								 * see: https://bugs.eclipse.org/bugs/show_bug.cgi?id=57011
								 */
								position= null;
								end= getOffset() + getLength() - MultiCommentLine.MULTI_COMMENT_END_PREFIX.trim().length();
								while (end > begin && Character.isWhitespace(document.getChar(end - 1)))
									end--;
							}