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

Bug 14362

Summary: Content assist insert code into read-only file
Product: [Eclipse Project] JDT Reporter: Felix Wong <fmhwong>
Component: UIAssignee: Kai-Uwe Maetzel <kai-uwe_maetzel>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: deboer, paulacox
Version: 2.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Felix Wong CLA 2002-04-22 17:53:14 EDT
Build 20020412

1. Create a java project JP1
2. Create a package jp1
3. Create Class A and B under jp1
4. Insert this "private A a;" under class B and class B should looks like

package jp1;

public class B {
	private A a;
}

5. Close B.java and mark it as read only.
6. Reopen B.java and you should not be able to insert any characters
7. Position the cursor to "private |A" (i.e. immediate before A)
   and hit CTRL-SPACE

8. It will insert B into it and it becomes

package jp1;

public class B {
	private BA a;
}
    and now the editor is dirty and you're unable to save
Comment 1 Erich Gamma CLA 2002-04-23 04:01:52 EDT
*** Bug 14287 has been marked as a duplicate of this bug. ***
Comment 2 Kai-Uwe Maetzel CLA 2002-04-30 09:56:35 EDT
Build 20020430.