Community
Participate
Working Groups
I20080427-2000. The new comment formatter fails to format correctly following test case: public class X23c { /** * <table border="1" width="80%" cellpadding="5"> * <tr> * <td width="20%"><code>TypeDeclaration</code></td> * <td width="50%"><code>modifiers, isInterface, name, superclass, * superInterfaces<br> * RELATIVE_ORDER property</code></td> * </tr> * </table> */ void foo() { } }
Problem come from <table> tags which can have attributes (<tr> as well). The new comment format only handles simple tags definition as <name>....</name>.
Released for 3.4M7 in HEAD stream.
Using I20080429-0100, I'm seeing this as the result of formatting the testcase : class X23c { /** * <table border="1" width="80%" cellpadding="5"> * <tr> * <td width="20%"><code>TypeDeclaration</code></td> * <td width="50%"><code>modifiers, isInterface, name, superclass, * superInterfaces<br> * RELATIVE_ORDER property</code></td> * </tr> * </table> */ void foo() { } } There appears to be a tab missing at the start of the 2 indented lines.
I will still want consider this bug as fixed. The real test case was: public class X23c { /** * <table border="1" width="80%" cellpadding="5"> * <tr> * <td width="20%"><code>TypeDeclaration</code></td> * <td width="50%"><code>modifiers, isInterface, name, superclass, * superInterfaces<br> * RELATIVE_ORDER property</code></td> * </tr> * </table> */ void foo() { } } but I removed indentations to make it easier to read... If instead I had removed the text which did not fit the bugzilla short line length, then test case would have been: public class X23c { /** * <table border="1" width="80%" cellpadding="5"> * <tr> * <td width="20%"><code>TypeDeclaration</code></td> * <td width="50%"><code>modifiers, isInterface, name, * superInterfaces<br> * RELATIVE_ORDER property</code></td> * </tr> * </table> */ void foo() { } } Can you test that this test case is OK using I20080429-0100? If so, I would prefer you close this bug as verified and open a new bug for the remaining problem you see while testing the original test case: lines are not indented inside a immutable html tag (e.g.<code>...</code>) Thanks
I tried this case : class X23c { /** * <table border="1" width="80%" cellpadding="5"> * <tr> * <td width="20%"><code>TypeDeclaration</code></td> * <td width="50%"><code>modifiers, isInterface, name, * superInterfaces<br> * RELATIVE_ORDER property</code></td> * </tr> * </table> */ void foo() { } } and it produces this : class X23c { /** * <table border="1" width="80%" cellpadding="5"> * <tr> * <td width="20%"><code>TypeDeclaration</code></td> * <td width="50%"><code>modifiers, isInterface, name, * superInterfaces<br> * RELATIVE_ORDER property</code></td> * </tr> * </table> */ void foo() { } } which if your tabs are set to 4 instead of 8 characters doesn't look correct. I don't think this case is fixed. The 2 lines inside the multi-line <code> tags should have the same starting indentation as the other lines.
The actual comment didn't show up too well... I replaced each tab with TAB and left the spaces alone. TAB/** TAB * <table border="1" width="80%" cellpadding="5"> TAB * <tr> TAB * <td width="20%"><code>TypeDeclaration</code></td> TAB * <td width="50%"><code>modifiers, isInterface, name, * superInterfaces<br> * RELATIVE_ORDER property</code></td> TAB * </tr> TAB * </table> TAB */
Comment 5: The output is correct: <code>...</code> is considered as immutable, hence we do not touch even the space/tabs at the beginning of the javadoc line (i.e. after the '*'). Comment 6: This is the same issue than the original test case. The indentation before the beginning of the javadoc line is not well computed inside a <code>..</code> and will be fixed with the other bug... Still consider this bug fix: the new formatter now can handle correctly <table>, <tr> and <td> html tags. Just remove the immutable <code> tags from the example and you'll see it works well
I don't agree. I don't see how we can say this is fixed. Not a single case looks correct. Why don't you remove all leading '*' from the comment and format, then put them back in correctly.
(In reply to comment #8) > I don't agree. I don't see how we can say this is fixed. Not a single case > looks correct. > As I said the output you showed in comment 5 *is* correct. I will repeat myself, but we do not want to move the line inside the tag <code> as it's immutable Note that I didn't put a test case in my comment 7, but I guess I should do to show that the new formatter works properly now whith tables tags: public class X23d { /** * <table border="1" width="80%" cellpadding="5"> * <tr> * <td width="20%">first column</td> * <td width="50%">second column</td> * </tr> * </table> */ void foo() { } } which is correctly formatted as: public class X23d { /** * /** * <table border="1" width="80%" cellpadding="5"> * <tr> * <td width="20%">first column</td> * <td width="50%">second column</td> * </tr> * </table> */ void foo() { } } > > Why don't you remove all leading '*' from the comment and format, then put them > back in correctly. > That's what I plan to do... But it's an other separated issue: the new formatter does not indent correctly the start of the javadoc lines inside a tag <code> I'm not trying to reject the other issue, I just want to close this bug and work on the other as soon as you'll open it...
Sorry, wrong copy/paste on the formatted output (I'm not lucky with examples on this bug...). The correct formatted output is: public class X23 { /** * <table border="1" width="80%" cellpadding="5"> * <tr> * <td width="20%">first column</td> * <td width="50%">second column</td> * </tr> * </table> */ void foo() { } }
I've opened bug 229569 for the line indentation issue.
The confusion came from the fact that the original test case in comment 0 didn't reflect exactly the bug. This bug is not about the formatting of "<code>...</code>". It is about the formatting of "<table ...>". Thus the test case should have been: public class X23d { /** * <table border="1" width="80%" cellpadding="5"> * <tr> * <td width="20%">first column</td> * <td width="50%">second column</td> * </tr> * </table> */ void foo() { } } The formatting of "<code>...</code>" is still problematic and this is reflected in bug 229569. I verified that the formatting of the above test case is now correct with I20080429-0100.