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 key
	 *                  The key of the attribute to set when an attributed comment
	 *                  range has been recognized
	 * @param html
	 *                  <code>true</code> iff html tags in this attributed comment
	 *                  range should be attributed too, <code>false</code> otherwise
	 * @return The new hierarchical depth of the attributed comment ranges
	 */
	protected final int markRange(final String token, final String tag, int level, final int key, final boolean html) {
		if (isOpeningTag(token, tag)) {
			if (level++ > 0)
				setAttribute(key);
		} else if (isClosingTag(token, tag)) {
			if (--level > 0)
				setAttribute(key);
		} else if (level > 0) {
			if (html || !hasAttribute(COMMENT_HTML))
				setAttribute(key);
		}
		return level;
	}
	/**
	 * Moves this comment range.
	 * 
	 * @param delta
	 *                  The delta to move the range
	 */
	public final void move(final int delta) {
		offset += delta;
	}