Community
Participate
Working Groups
Follow-up of bug 231263 review: org.eclipse.jdt.internal.formatter.Scribe.printJavadocHtmlTag(FormatJavadocText, FormatJavadocBlock, boolean) - shouldn't the 'Number of empty lines to preserve' be applied inside a <pre> tag (instead of applying the 'Remove blank lines' option) ?
The real problem is in fact for blank lines at the beginning of the code (e.g. after the <pre> tag and before the first character of the snippet) and at the end of the code (e.g. after the last character of the snippet and before the </pre> tag). The following example: interface X01 { /** * <pre> * * * public class Example {final int a= 1;final boolean b= true;} * * * </pre> */ int foo(); } is currently formatted as follow with Eclipse built-in: interface X01 { /** * <pre> * * * public class Example { * final int a = 1; * final boolean b = true; * } * * * </pre> */ int foo(); } (Note that Number of empty lines to preserve = 1 for Eclipse built-in settings) So, the formatted output should be instead: interface X01 { /** * <pre> * * public class Example { * final int a = 1; * final boolean b = true; * } * * </pre> */ int foo(); } Note that in 3.3 the output is: interface X01 { /** * <pre> * public class Example { * final int a = 1; * final boolean b = true; * } * * </pre> */ int foo(); }
On eclipse 4.5M6 I get the correct number of empty lines preserved inside <pre> tags. Do you still see this issue with a recent eclipse version?
This problem no longer occurs after the formatter redesign. *** This bug has been marked as a duplicate of bug 303519 ***