Bug 153261 - [formatter] Format reports Error: Overlapping text edits
Summary: [formatter] Format reports Error: Overlapping text edits
Status: VERIFIED DUPLICATE of bug 111270
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M7   Edit
Assignee: Olivier Thomann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-09 06:05 EDT by Guenther Koegel CLA
Modified: 2008-10-27 13:06 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guenther Koegel CLA 2006-08-09 06:05:02 EDT
Please check product and component...

Trying to format the follwing Java code via Control+A and Control+Shift+F reports an error:
"Format" did not complete normally. Please see the log for mor information.
An exception stack trace is not available.

-------- example start ------
public class Main
{
    public static void main(String[] args)
    {
    }

    /**
     * <pre>
     * public String toString()
     * {
     *     return &quot;&quot;;
     * }
     * 
     */
}
------------ example end -------
It's caused by the missing pre end tag in the java doc comment.

Attention: The behaviour is different if Source->Format is triggered via mouse/Menu.

In the preferences I have checked "Format Java code snippets" under Java->Code Style->Formatter, tab Comments.
Comment 1 Dani Megert CLA 2006-08-09 06:37:12 EDT
Works for me using R3.2 and I20060809-0010, see also:
http://www.eclipse.org/eclipse/platform-text/development/bug-incomplete.htm
Comment 2 Guenther Koegel CLA 2006-08-09 09:53:52 EDT
Sorry, I should have tried it with a untainted Eclipse installation. Next time I will do that...

The error depends on the preference setting: "Clear blank lines in comments" being checked which is not the default in the plain vanilla Eclipse.

Start with the preference page Java->Code Style->Formatter

Create a new profile from "Eclipse [built-in]" and select "New..."
Enter a new profile name, e.g. test
On the Comments tab select "Clear blank lines in comments"
Press OK
Press OK to close preference window

Select the Java code via Control+A
Format the code with Control+Shift+F *several times*
(in case the first time succeeds)
Comment 3 Dani Megert CLA 2006-08-09 10:19:54 EDT
Can reproduce using I20060807-2000.
The edits are generated by JDT Core.
Comment 4 Olivier Thomann CLA 2006-08-13 19:49:45 EDT

*** This bug has been marked as a duplicate of 111270 ***
Comment 5 Frederic Fusier CLA 2008-10-27 13:06:43 EDT
Verified using 3.4.0 (I20080617-2000).