Bug 230230 - [formatter] New comment formatter does not handle properly all scanner exceptions
Summary: [formatter] New comment formatter does not handle properly all scanner except...
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-05 11:41 EDT by Frederic Fusier CLA
Modified: 2008-05-13 06:49 EDT (History)
3 users (show)

See Also:
jerome_lanneluc: review+


Attachments
Proposed patch (81.48 KB, patch)
2008-05-05 12:05 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-05 11:41:49 EDT
Using build 3.4M7

The new comment formatter does not format properly the following simple test case:
public class X {

void foo() {
    // 1EX5I8Z - accessing outer fields within a constructor call
}
}

The output currently is:
public class X10 {

    void foo() {
        // EX5I8Z - accessing outer fields within a constructor call
    }
}

Note that the '1' at the comment beginning has been removed.
Comment 1 Frederic Fusier CLA 2008-05-05 11:47:01 EDT
This is due to the fact that the Scribe scan the line using the Scanner getNextToken() method for optimization reason. The scanner raises an exception on the first word which is not properly handled while printing the comment line.

Currently only string and character exceptions are properly handled, but they all should be.
Comment 2 Frederic Fusier CLA 2008-05-05 12:05:37 EDT
Created attachment 98655 [details]
Proposed patch

Note that this patch also fixes following bugs bundle:
 - bug 229682
 - bug 229683
 - bug 229932
 - bug 229954
 - bug 230184
Comment 3 Frederic Fusier CLA 2008-05-05 12:09:04 EDT
With this patch, we got 5 failures in Eclipse 3.0 full source workspace and 21 in Ganymede M6a one.
Jerome can you please review?
Comment 4 Frederic Fusier CLA 2008-05-06 04:49:07 EDT
Released for 3.4RC1 in HEAD stream.
Comment 5 Eric Jodet CLA 2008-05-13 06:49:13 EDT
Verified for 3.4RC1 using build I20080510-2000.