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/MultiCommentLine.java
final IRegion region= trimLine(text, content);
						if (region.getOffset() != 0 || region.getLength() != text.length()) {
							range.move(region.getOffset());
							range.setLength(region.getLength());
							parent.setBorder(BORDER_UPPER);
							parent.setBorder(BORDER_LOWER);
						}
					}
				}
			}
		} else {
			offset= text.indexOf(content);
			if (offset >= 0) {
				offset += content.length();
				range.trimBegin(offset);
			}
		}
	}
	/*
	 * @see org.eclipse.jdt.internal.ui.text.comment.CommentLine#tokenizeLine(int)
	 */
	protected void tokenizeLine(int line) {
		int offset= 0;
		int index= offset;
		final CommentRegion parent= getParent();
		final CommentRange range= getFirst();
		final int begin= range.getOffset();
		final String content= parent.getText(begin, range.getLength());
		final int length= content.length();
		while (offset < length && Character.isWhitespace(content.charAt(offset)))