Community
Participate
Working Groups
If I want to add a literal XML snippet to a javadoc comment I can place the XML inside a <pre> tag. Eclipse escapes the '<' and' '>' correctly but insists on indenting the XML to the right each time I reformat the source code. For example, if I type: /** * <pre> * <foo/> * </pre> */ After formatting it becomes: /** * <pre> * <foo/> * </pre> */ However subsequent re-formatting of the source file indents the XML to the each time. So after 3 reformattings, the javadoc becomes: /** * <pre> * <foo/> * </pre> */ This is very anoying as the spaces are *inside* the pre tag so show up in the generated javadocs. Additionally if the build processes includes a step to clean the source code using the formatter each build intends the line! Note, my source formatter preferences have the following options enabled: * Format HTML tags * Format Java code snippets Can the javadoc formatter be made smart enough not to indent the text if it is XML? Note, if I disable the option "Format Java code snippet" the line is *not* indented (but neither is it escaped; and I really want to have Java code snippets formatted in addition to the ability to add XML examples, for example to show configuration examples or example XML output).
*** This bug has been marked as a duplicate of 99738 ***
Verified for 3.2.2 using build M20070112-1200.
Verified for 3.3 M5 using build I20070205-0009