Project: JDT
Bug 17463 Replace with previous element from local history should ignore unparseable versions
Reported: 2002-05-23 15:47:29 | Status: verified fixed

Build F1 If the previous version of a file can't be parsed, then 'Replace with previous element from local history' replaces the element with the entire contents of the previous edition. I believe that this behaviour is incorrect. It should either continue searching in older versions until it finds a version with the element, or do nothing. Create the following Java file and save it: public class Hello { public Hello() { super(); System.out.println("Hello world"); } } Replace the contents with the following and save: dfjlkfdjklnbv dfbdfjhkfldbf f dbfdsjlgvbsdb fdsgkldfsg Replace the contents with the following and save: public class Hello { public Hello() { super(); System.out.println("Hello world"); } } Now select the constructor in the Outline view. Choose 'Replace with previous element from local history'. The resulting file is: public class Hello { dfjlkfdjklnbv dfbdfjhkfldbf f dbfdsjlgvbsdb fdsgkldfsg }

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaReplaceWithEditionAction.java