Bug 232285 - [formatter] New comment formatter wrongly formats javadoc header/footer with several contiguous stars
Summary: [formatter] New comment formatter wrongly formats javadoc header/footer with ...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 RC1   Edit
Assignee: Frederic Fusier CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-15 08:04 EDT by Frederic Fusier CLA
Modified: 2008-05-16 04:32 EDT (History)
4 users (show)

See Also:
jerome_lanneluc: review+


Attachments
Proposed patch (47.18 KB, patch)
2008-05-15 09:26 EDT, Frederic Fusier CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Frederic Fusier CLA 2008-05-15 08:04:15 EDT
Using build I20080513-2000.

When several contiguous stars are used for javadoc header or footer (e.g. /**** or ****/), the new comment formatter didn't change them in 3.4 M7 but try to format them in current build. Unfortunately the formatted output is really weird and we should at least retrieve the behavior initially implemented in 3.4M7

See bug 232138 comment 7 for more details and test cases illustrating this problem...
Comment 1 Frederic Fusier CLA 2008-05-15 09:26:27 EDT
Created attachment 100437 [details]
Proposed patch

In fact this regression since 3.4M7 was introduced by fix for bug 231060.

This simple patch avoid it and bring back the 3.4M7 behavior for javadoc header and footer and has absolutelty no impact on existing Eclipse and Ganymede workspaces tests results.

Jerome, any chance to put it into RC1?
Comment 2 Jerome Lanneluc CLA 2008-05-15 09:41:29 EDT
Frederic, can you please describe exactly the test cases that this patch is fixing? I.e. how is it different from bug 232138?
Comment 3 Frederic Fusier CLA 2008-05-15 10:06:21 EDT
(In reply to comment #2)
> Frederic, can you please describe exactly the test cases that this patch is
> fixing? I.e. how is it different from bug 232138?
> 
To make it short, this patch just bring back the formatted outputs of 3.4M7 described in bug 231138. It does not fix the difference with 3.3 comment formatter outputs...

So, with this patch:
 - bug 232138 comment 4 will be:
Test case:
=========
package test.lines;

public class X10 {

          /**
           **
           ** Returns true if the operator expects...
           **/
          void foo() {
          }
}

HEAD+patch formatting:
package test.lines;

public class X10 {

        /**
         ** 
         ** Returns true if the operator
         * expects...
         **/
        void foo() {
        }
}

 - bug 232128 comment 6 will be:

Test case 1):
============
public class X01 {

          /***
           *
           * Test header/footer.
           */
          void foo() {
          }
}

HEAD+patch formatting:
public class X01 {

        /***
         * 
         * Test header/footer.
         */
        void foo() {
        }
}

Test case 2):
============
public class X02 {

          /**
           *
           * Test header/footer.
           ***/
          void foo() {
          }
}

HEAD+patch formatting:
public class X02 {

        /**
         * 
         * Test header/footer.
         ***/
        void foo() {
        }
}

Test case 3):
============
public class X03 {

          /*****************************************
           *
           * Returns true
           * 
           *****************************************/
          void foo() {
          }
}

HEAD+patch formatting:
public class X03 {

        /*****************************************
         * 
         * Returns true
         * 
         *****************************************/
        void foo() {
        }
}
Comment 4 Jerome Lanneluc CLA 2008-05-15 11:06:53 EDT
OK for RC1
Comment 5 Jerome Lanneluc CLA 2008-05-15 11:27:09 EDT
Patch looks good: +1
Comment 6 Frederic Fusier CLA 2008-05-15 13:53:43 EDT
Released for 3.4RC1 in HEAD stream.
Comment 7 Eric Jodet CLA 2008-05-16 04:32:44 EDT
Verified for 3.4RC1 using build I20080515-2000