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

Bug 20040

Summary: java editor: undo does not work correctly
Product: [Eclipse Project] JDT Reporter: Adam Kiezun <akiezun>
Component: UIAssignee: Kai-Uwe Maetzel <kai-uwe_maetzel>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P1    
Version: 2.0   
Target Milestone: 2.0 F4   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
preferences
none
Patch for CompilationUnitEditor none

Description Adam Kiezun CLA 2002-06-12 11:57:54 EDT
20020612
.create new class
.'override methods...' - add clone()
.undo
.redo
.undo

the plain text editor does not exhibit this mis-behavior

you're left with garbage like
(pressing undo/redo more times produces even more garbage):

public class Dfg  {
    
r.clone();  //<<GARBAGE
    }       //<<GARBAGE

}
Comment 1 Adam Kiezun CLA 2002-06-12 11:59:30 EDT
marked as major but i'm not sure
Comment 2 Dirk Baeumer CLA 2002-06-12 15:09:57 EDT
Couldn't reproduce problem using the following steps:

- creating class Test is default package
- adding method clone useing Override method
- using undo/redo/undo works as expected.

Adam can you provide a better test case.

Lowering priority since it is nor reproducable.
Comment 3 Adam Kiezun CLA 2002-06-13 08:07:20 EDT
seems to be some preference
i'm attaching my pref file
and increasing severity again :)
Comment 4 Adam Kiezun CLA 2002-06-13 08:09:50 EDT
Created attachment 1390 [details]
preferences
Comment 5 Erich Gamma CLA 2002-06-13 08:32:03 EDT
problem only shows up when: spacesForTabs=true
Comment 6 Erich Gamma CLA 2002-06-15 04:39:15 EDT
Problem if not fixed: inconsistent state after undo - user confusion and 
potential data loss. Need to investigate in a fix before we can assess the risk.
Comment 7 Kai-Uwe Maetzel CLA 2002-06-17 08:57:03 EDT
Created attachment 1449 [details]
Patch for CompilationUnitEditor
Comment 8 Kai-Uwe Maetzel CLA 2002-06-18 14:52:19 EDT
Reviewed by Daniel Megert & Dirk Baeumer.