Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 107833

Summary: Pasting Java code changes indent incorrectly
Product: [Eclipse Project] JDT Reporter: Martijn van Steenbergen <mvsteenbergen>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: ---   
Hardware: Macintosh   
OS: All   
Whiteboard:

Description Martijn van Steenbergen CLA 2005-08-24 08:55:42 EDT
Eclipse SDK
Version: 3.1.0
Build id: I20050627-1435

public class Test {
    {
        String test = toString().toString().toString().toString().toString()
                .toString();
    }
}

1) Select the two lines comprising the assignment.
2) Cut.
3) Paste.

The second line of the assignment will incorrectly be aligned with the first line of the assignment, like 
so:

public class Test {
    {
        String test = toString().toString().toString().toString().toString()
        .toString();
    }
}

Invoking the formatter restores the correct indentation.
Comment 1 Olivier Thomann CLA 2005-08-24 08:57:36 EDT
Move to JDT/Text
Comment 2 Dani Megert CLA 2005-08-24 09:12:47 EDT

*** This bug has been marked as a duplicate of 65317 ***