Index: JavaDocTestCase.java =================================================================== RCS file: /home/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/formatter/comment/JavaDocTestCase.java,v --- JavaDocTestCase.java 20 Apr 2005 16:46:59 -0000 1.2 +++ JavaDocTestCase.java 13 Jun 2005 17:30:01 -0000 @@ -439,4 +439,31 @@ final String result = testFormat(input); assertEquals(expected, result); } + + /** + * [formatting] Javadoc formatting: extra newline with [pre] + * https://bugs.eclipse.org/bugs/show_bug.cgi?id=52921 + *

+ * This test only formats once. + *

+ */ + public void testNoExtraNewlineWithPre1() { + setUserOption(DefaultCodeFormatterConstants.FORMATTER_COMMENT_FORMAT_SOURCE, DefaultCodeFormatterConstants.TRUE); + String input= PREFIX + DELIMITER + INFIX + "
wrap here
" + DELIMITER + POSTFIX; //$NON-NLS-1$ + String expected= PREFIX + DELIMITER + INFIX + "
" + DELIMITER + INFIX + "wrap here" + DELIMITER + INFIX + "
" + DELIMITER + POSTFIX; //$NON-NLS-1$; //$NON-NLS-2$; //$NON-NLS-3$; + String result= testFormat(input); + assertEquals(expected, result); + + // now re-format several times + result= testFormat(result); + result= testFormat(result); + result= testFormat(result); + result= testFormat(result); + + // XXX: workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=99738 + String WORKAROUND_BUG_99738= " "; //$NON-NLS-1$ + expected= PREFIX + DELIMITER + INFIX + "
" + DELIMITER + INFIX + WORKAROUND_BUG_99738 + "wrap here" + DELIMITER + INFIX + "
" + DELIMITER + POSTFIX; //$NON-NLS-1$; //$NON-NLS-2$; //$NON-NLS-3$; + assertEquals(expected, result); + } + }