Bug 44035 [formatting] Error in formatting parts of java code snippets in comment
This is for build I20030930. The Java code formatter options are set to Format java code snippets. Taking the following comment: /** * The following is a Java snipet. * * <pre> * while ((size = availableSize(stream, size)) > 0) { * System.out.println("available"); * } * </pre> */ public void test() { } And trying to format it here is what we got: /** * The following is a Java snipet. * * <pre> * while ((size = availableSize(stream, size)) > 0) { * System.out.println("available"); } * </pre> */ public void test() { }
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/comment/CommentRange.java
* @param token
	 *                  Token belonging to the comment range
	 * @param attribute
	 *                  Attribute to set if the html tag is present
	 * @param open
	 *                  <code>true</code> iff opening tags should be marked, <code>false</code>
	 *                  otherwise.
	 * @param close
	 *                  <code>true</code> iff closing tags should be marked, <code>false</code>
	 *                  otherwise.
	 */
	protected final void markHtmlTag(final String[] tags, final String token, final int attribute, final boolean open, final boolean close) {
		if (token.charAt(0) == HTML_TAG_PREFIX && token.charAt(token.length() - 1) == HTML_TAG_POSTFIX) {
			String tag= null;
			boolean isOpen= false;
			boolean isClose= false;
			for (int index= 0; index < tags.length; index++) {
				tag= tags[index];
				isOpen= isOpeningTag(token, tag);
				isClose= isClosingTag(token, tag);
				if ((open && isOpen) || (close && isClose)) {
					setAttribute(attribute);
					break;
				}
			}
		}
	}
	/**
	 * Marks the comment range as having a certain tag for line wrapping
	 *