Project: JDT
Bug 133936 [misc] Compilation Unit Editor tramples file content
Reported: 2006-03-29 17:01:31 | Status: verified fixed

I20060329-0800 While trying to open a local revision from the History View, it became clear that the Compilation Unit Editor is determining the uniqueness of a file based solely on the file's path. Opening a local revision from the history view in a workspace that already contains the same file open will result in the workspace file's content being completely replaced by the local revision's contents. Repro Steps: 1. Open any java file in the workspace that is up to date with HEAD, make a change and save it. Now Replace With>Latest From HEAD to get your file back to its original state. 2. Select the file and select Team>Show History. (This will bring up the history view for that file) Make sure you're in the Local and Remote Revisions mode. 3. Open the original file from the Package Explorer. Note its content. 4. Now double click on the local revision in the History View. Notice how the original file's contents gets completely replaced with the new file contents and how the dirty bit gets set.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/javaeditor/CompilationUnitDocumentProvider.java