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

Bug 370307

Summary: [implementation] CompilationUnitDocumentProvider resets document without asking
Product: [Eclipse Project] JDT Reporter: M Dahlem <dahlem.marc>
Component: TextAssignee: JDT-Text-Inbox <jdt-text-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, remy.suen
Version: 3.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard: stalebug

Description M Dahlem CLA 2012-02-01 03:58:55 EST
Build Identifier: I20110613-1736

If a file is first opened and edited with an editor that doesn't use the CompilationUnitDocumentProvider and has unsaved changes, a call "open with" java editor (CompilationUnitDocumentProvider) resets the document without informing the opened editors.
After that the dirtystate is true, but nothing changed.

Reproducible: Always

Steps to Reproduce:
1. Open a file with the default editor (e.g. hello_world.txt)
2. Type in some characters (without saving)
3. Open the same file with an Editor that uses the ComilationUnitDocumentProvider (java editor)

4. You can see, that all (unsaved) typed characters from (2) disappear in both editors. The dirty state is true, but if you would save only the dirty state changes, but not the content of the document.
Comment 1 Dani Megert CLA 2012-02-01 06:37:29 EST
Broken since 3.2.

Only happens if one first uses the Text and then the Java editor. Also only happens if one uses the Java editor on non .java file.
Comment 2 Eclipse Genie CLA 2019-09-01 14:07:47 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.